commit 175a92f633d0217d25b697c83d9be65ca9130c10 Author: Milan Hanajik Date: Mon Jul 28 09:54:35 2014 +0200 Initial commit almost identical to SVN-repo rev.340 diff --git a/TestBenchFramework.sln b/TestBenchFramework.sln new file mode 100644 index 000000000..71d82d668 --- /dev/null +++ b/TestBenchFramework.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TestBenchFramework\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "TBFSetup", "TBFSetup\TBFSetup.vdproj", "{4890DE5C-9F68-40D7-B075-92C8EAB79833}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Debug|x86.ActiveCfg = Debug|x86 + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Debug|x86.Build.0 = Debug|x86 + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|Any CPU.Build.0 = Release|Any CPU + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.ActiveCfg = Release|x86 + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.Build.0 = Release|x86 + {4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|Any CPU.ActiveCfg = Debug + {4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|x86.ActiveCfg = Debug + {4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Any CPU.ActiveCfg = Release + {4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Any CPU.Build.0 = Release + {4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|x86.ActiveCfg = Release + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestBenchFramework/AboutDlg.Designer.cs b/TestBenchFramework/AboutDlg.Designer.cs new file mode 100644 index 000000000..376976216 --- /dev/null +++ b/TestBenchFramework/AboutDlg.Designer.cs @@ -0,0 +1,117 @@ +namespace TestBenchFramework +{ + partial class AboutDlg + { + /// + /// 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 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.copyrightLabel = new System.Windows.Forms.Label(); + this.versionLabel = new System.Windows.Forms.Label(); + this.buildDateLabel = new System.Windows.Forms.Label(); + this.closeButton = new System.Windows.Forms.Button(); + this.logoPictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); + this.SuspendLayout(); + // + // copyrightLabel + // + this.copyrightLabel.AutoSize = true; + this.copyrightLabel.Location = new System.Drawing.Point(145, 19); + this.copyrightLabel.Name = "copyrightLabel"; + this.copyrightLabel.Size = new System.Drawing.Size(90, 13); + this.copyrightLabel.TabIndex = 4; + this.copyrightLabel.Text = "Copyright 2013"; + // + // versionLabel + // + this.versionLabel.AutoSize = true; + this.versionLabel.Location = new System.Drawing.Point(145, 41); + this.versionLabel.Name = "versionLabel"; + this.versionLabel.Size = new System.Drawing.Size(105, 13); + this.versionLabel.TabIndex = 5; + this.versionLabel.Text = "Version _VERSION_"; + // + // buildDateLabel + // + this.buildDateLabel.AutoSize = true; + this.buildDateLabel.Location = new System.Drawing.Point(145, 64); + this.buildDateLabel.Name = "buildDateLabel"; + this.buildDateLabel.Size = new System.Drawing.Size(136, 13); + this.buildDateLabel.TabIndex = 6; + this.buildDateLabel.Text = "Build date _BUILD_DATE_"; + // + // closeButton + // + this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.closeButton.Location = new System.Drawing.Point(341, 36); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(105, 28); + this.closeButton.TabIndex = 11; + this.closeButton.Text = "&Close"; + this.closeButton.UseVisualStyleBackColor = true; + // + // logoPictureBox + // + this.logoPictureBox.BackgroundImage = global::TestBenchFramework.Properties.Resources.sensus_logo; + this.logoPictureBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.logoPictureBox.InitialImage = null; + this.logoPictureBox.Location = new System.Drawing.Point(12, 34); + this.logoPictureBox.Name = "logoPictureBox"; + this.logoPictureBox.Size = new System.Drawing.Size(103, 30); + this.logoPictureBox.TabIndex = 12; + this.logoPictureBox.TabStop = false; + // + // AboutDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(458, 99); + this.Controls.Add(this.logoPictureBox); + this.Controls.Add(this.closeButton); + this.Controls.Add(this.buildDateLabel); + this.Controls.Add(this.versionLabel); + this.Controls.Add(this.copyrightLabel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "AboutDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "About Test Bench Framework"; + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label copyrightLabel; + private System.Windows.Forms.Label versionLabel; + private System.Windows.Forms.Label buildDateLabel; + private System.Windows.Forms.Button closeButton; + private System.Windows.Forms.PictureBox logoPictureBox; + } +} \ No newline at end of file diff --git a/TestBenchFramework/AboutDlg.cs b/TestBenchFramework/AboutDlg.cs new file mode 100644 index 000000000..9400162a8 --- /dev/null +++ b/TestBenchFramework/AboutDlg.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace TestBenchFramework +{ + /// + /// About dialog + /// + public partial class AboutDlg : Form + { + /// + /// Contsructor + /// + /// Language neutral version string + /// Regionally formated build date string + public AboutDlg(string version, string buildDate) + { + InitializeComponent(); + versionLabel.Text = versionLabel.Text.Replace("_VERSION_", version); + buildDateLabel.Text = buildDateLabel.Text.Replace("_BUILD_DATE_", buildDate); + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/AboutDlg.resx b/TestBenchFramework/AboutDlg.resx new file mode 100644 index 000000000..62664e0db --- /dev/null +++ b/TestBenchFramework/AboutDlg.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 + + + True + + \ No newline at end of file diff --git a/TestBenchFramework/AttachedTextBoxes.cs b/TestBenchFramework/AttachedTextBoxes.cs new file mode 100644 index 000000000..54f206dc8 --- /dev/null +++ b/TestBenchFramework/AttachedTextBoxes.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace TBF +{ + /// + /// Data types and orientation of the table layout panel attached data. + /// + public enum Arrangement + { + RowOfIntegers, + RowOfDoubles, + RowOfStrings, + ColumnOfIntegers, + ColumnOfDoubles, + ColumnOfStrings, + } + + /// + /// This class represents TextBox controls and data modified by them + /// that are attached to (=displayed inside) a TableLayoutPanel control. + /// + public class AttachedTextBoxes + { + /// + /// Private fields + /// + int count; /// Number of attached TextBoxes / cells + Arrangement arngmnt; /// Type of attachemnt (see above) + bool isRow; /// true if it is a row + TextBox[] textBoxes; /// TextBox controls to be aded to TableLayoutPanel + int[] intData; /// integer data | + double[] doubleData; /// double data |-> one of these three arrays is used + string[] stringData; /// string data | + + /// + /// Constructor, which creates TextBox controls and adds them to the table layout panel. + /// + public AttachedTextBoxes(TableLayoutPanel tblLtPnl, Arrangement arngmnt, int firstColumn, int firstRow, int size) + { + this.count = size; + this.arngmnt = arngmnt; + isRow = (arngmnt == Arrangement.RowOfIntegers || arngmnt == Arrangement.RowOfDoubles || arngmnt == Arrangement.RowOfStrings); + + textBoxes = new TextBox[count]; + intData = new int[count]; + doubleData = new double[count]; + stringData = new string[count]; + + for (int i = 0; i < count; i++) + { + textBoxes[i] = new TextBox(); /// Crete a new TextBox control + + if (isRow) + { + tblLtPnl.Controls.Add(textBoxes[i], firstColumn + i, firstRow); + } + else + { + tblLtPnl.Controls.Add(textBoxes[i], firstColumn, firstRow + i); + } + } + } + + /// + /// Attached data array size + /// + public int Count { get { return count; } } + + /// + /// Indexer returning a TextBox + /// + /// Index + /// TextBox object reference + public TextBox this[int index] + { + get + { + if (index < 0 || index >= count) + { + return null; + } + else + { + return textBoxes[index]; + } + } + } + + /// + /// Retrieves data from the controls or detects a format error. + /// Wrong format in a cell interrupts data retrieving, so when the first control + /// contains data with wrong format, no data are retrieved at all. + /// + /// true if all data have correct format + public bool ValidateData() + { + switch (arngmnt) + { + case Arrangement.RowOfIntegers: + case Arrangement.ColumnOfIntegers: + for (int i = 0; i < count; i++) + { + if (!Int32.TryParse(textBoxes[i].Text, out intData[i])) return false; + } + return true; + + case Arrangement.RowOfDoubles: + case Arrangement.ColumnOfDoubles: + for (int i = 0; i < count; i++) + { + if (!Double.TryParse(textBoxes[i].Text, out doubleData[i])) return false; + } + return true; + + case Arrangement.RowOfStrings: + case Arrangement.ColumnOfStrings: + default: + return true; + } + } + + /// + /// The following three methods provide initialization of controls with original data. + /// + + public void SetData(int index, int value) + { + if (index < 0 || index >= count) return; + intData[index] = value; + textBoxes[index].Text = value.ToString(); + } + + public void SetData(int index, double value) + { + if (index < 0 || index >= count) return; + doubleData[index] = value; + textBoxes[index].Text = value.ToString(); + } + + public void SetData(int index, string value) + { + if (index < 0 || index >= count) return; + stringData[index] = value; + textBoxes[index].Text = value; + } + + /// + /// The following three methods provide retrieving data from controls. + /// ValidateData() must be called first. The return value must be true. + /// + + public int GetIntData(int index) + { + if (index < 0 || index >= count) return 0; + return intData[index]; + } + + public double GetDoubleData(int index) + { + if (index < 0 || index >= count) return 0; + return doubleData[index]; + } + + public string GetStringData(int index) + { + if (index < 0 || index >= count) return null; + return textBoxes[index].Text; + } + } +} diff --git a/TestBenchFramework/BarGraph.cs b/TestBenchFramework/BarGraph.cs new file mode 100644 index 000000000..197e199f7 --- /dev/null +++ b/TestBenchFramework/BarGraph.cs @@ -0,0 +1,72 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace TBF +{ + public class BarGraph + { + int originX; /// Left coordinate of the bar + int originY; /// Top coordinate of the bar + int barWidth; /// Bar width, the bar is actualy 1 pixel wider + int barHeight; /// Bar height the bat is actualy 1 pixel higher + Color barColor; /// Bar color + Color backColor; /// Background color (above the bar) + /// Bar border is always black, 1 pixel wide + int barValue; /// The actual bar size (the bar is drawn from bottom) + + System.Windows.Forms.Control control; + Rectangle rect; + + + /// Use this setter to update the bar size + public float FValue + { + get { return (float)barValue/(float)barHeight; } + set + { + Value = (int)(value * (float)barHeight); + control.Invalidate(); + } + } + + /// Use this setter to update the bar size + public int Value + { + get { return barValue; } + set + { + if (value < 0) barValue = 0; + else if (value >= barHeight) barValue = barHeight; + else barValue = value; + control.Invalidate(); + } + } + + /// + /// Constructor + /// + public BarGraph(System.Windows.Forms.Control control, int originX, int originY, int barWidth, int barHeight, Color barColor, Color backColor) + { + this.control = control; + this.originX = originX; + this.originY = originY; + this.barWidth = barWidth; + this.barHeight = barHeight; + this.barColor = barColor; + this.backColor = backColor; + rect = new Rectangle(originX, originY, barWidth + 1, barHeight + 1); + barValue = 0; + } + + /// + /// Call this function in Form1_Paint(..), pass the arguments without any modifications + /// + public void Paint(Graphics g) + { + g.FillRectangle(new SolidBrush(backColor), originX + 1, originY + 1, barWidth, barHeight - barValue); + g.FillRectangle(new SolidBrush(barColor), originX + 1, originY + barHeight + 1 - barValue, barWidth, barValue); + g.DrawRectangle(new Pen(Color.Black, 2.0F), originX, originY, barWidth + 1, barHeight + 1); + } + } +} diff --git a/TestBenchFramework/BenchControl/BenchId/Component.cs b/TestBenchFramework/BenchControl/BenchId/Component.cs new file mode 100644 index 000000000..6bb7a8c92 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/Component.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.BenchId +{ + /// + /// Holds information identifying the test bench. + /// + public class Component : ComponentBase, Generic.IComponent + { + readonly ComponentCfg benchIdCfg; + + public static void ResetStaticProperties() { } + + public int TestBenchNr { get { return benchIdCfg.TestBenchNr; } } + + public Component(ComponentCfg cfg) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.benchIdCfg = cfg; + } + } +} diff --git a/TestBenchFramework/BenchControl/BenchId/ComponentCfg.cs b/TestBenchFramework/BenchControl/BenchId/ComponentCfg.cs new file mode 100644 index 000000000..039c80393 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/ComponentCfg.cs @@ -0,0 +1,55 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.BenchId +{ + /// + /// Holds information identifying the test bench - serializable configuration. + /// + public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg + { + public int TestBenchNr; + + /// Parameterless constructor + public ComponentCfg() + { + } + + public ComponentCfg(IComponentFactory factory, string name, int testBenchNr) + : base(factory, name) + { + TestBenchNr = testBenchNr; + } + + public IComponentCfg Clone() + { + return new ComponentCfg(Factory, Name, TestBenchNr); + } + + public string ToString(int i) + { + return string.Format("TestBenchNr = {0}", TestBenchNr); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + ComponentCfg config = (ComponentCfg)(new XmlSerializer(typeof(ComponentCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.cs b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.cs new file mode 100644 index 000000000..bc8d040a1 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.cs @@ -0,0 +1,63 @@ +using System; +using System.Windows.Forms; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.BenchId +{ + public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl + { + ComponentCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as ComponentCfg; + Redraw(); + } + } + + public ComponentCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + nameLabel.Text = Strings.Name; + numberLabel.Text = Strings.Test_bench_number; + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + numberTextBox.Text = config.TestBenchNr.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + numberTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + + try { config.TestBenchNr = int.Parse(numberTextBox.Text); } + catch { config.TestBenchNr = 1; } + } + } +} diff --git a/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.designer.cs new file mode 100644 index 000000000..69cbd9119 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.designer.cs @@ -0,0 +1,106 @@ +namespace TBF.BenchControl.BenchId +{ + partial class ComponentCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.numberLabel = new System.Windows.Forms.Label(); + this.numberTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(135, 55); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(25, 58); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(132, 31); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(60, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ClassName"; + // + // numberLabel + // + this.numberLabel.AutoSize = true; + this.numberLabel.Location = new System.Drawing.Point(25, 86); + this.numberLabel.Name = "numberLabel"; + this.numberLabel.Size = new System.Drawing.Size(44, 13); + this.numberLabel.TabIndex = 6; + this.numberLabel.Text = "Number"; + // + // numberTextBox + // + this.numberTextBox.Enabled = false; + this.numberTextBox.Location = new System.Drawing.Point(135, 83); + this.numberTextBox.Name = "numberTextBox"; + this.numberTextBox.Size = new System.Drawing.Size(57, 20); + this.numberTextBox.TabIndex = 7; + // + // ComponentCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.numberTextBox); + this.Controls.Add(this.numberLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "ComponentCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label numberLabel; + private System.Windows.Forms.TextBox numberTextBox; + } +} diff --git a/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.resx b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/ComponentCfgCtrl.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/TestBenchFramework/BenchControl/BenchId/ComponentFactory.cs b/TestBenchFramework/BenchControl/BenchId/ComponentFactory.cs new file mode 100644 index 000000000..2a3a1839f --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchId/ComponentFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.BenchId +{ + public class ComponentFactory : IComponentFactory + { + public string ClassName { get { return "Bench-ID"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return int.MaxValue; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new ComponentCfg(this, "Bench-ID", 1); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new ComponentCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Component((ComponentCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return ComponentCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Component.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/BenchPath.cs b/TestBenchFramework/BenchControl/BenchPath.cs new file mode 100644 index 000000000..4bbe79ca6 --- /dev/null +++ b/TestBenchFramework/BenchControl/BenchPath.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl +{ + public class BenchPath + { + public int ItemNr; + public string Name; + public float Qfrom; + public float Qto; + public ITempMeter TempIn; + public ITempMeter TempOut; + public IPressureMeter PressIn; + public IPressureMeter PressOut; + public IList ValvesOpen; + public IList ValvesClose; + + /// Constructor from name, the rest is empty + public BenchPath(string name, int itemNr) + { + ItemNr = itemNr; + Name = name; + ValvesOpen = new List(); + ValvesClose = new List(); + } + + /// Constructor from data entity + public BenchPath(Entities.BenchPath entity, IList components) + : this(entity.Name, entity.ItemNr) + { + Qfrom = entity.Qfrom; + Qto = entity.Qto; + TempIn = (ITempMeter)TbfComponents.FindComponent(entity.TempIn, components); + TempOut = (ITempMeter)TbfComponents.FindComponent(entity.TempOut, components); + PressIn = (IPressureMeter)TbfComponents.FindComponent(entity.PressIn, components); + PressOut = (IPressureMeter)TbfComponents.FindComponent(entity.PressOut, components); + + string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' }); + ValvesOpen = new List(); + foreach (var vName in vOpen) ValvesOpen.Add((IValve)TbfComponents.FindComponent(vName, components)); + + string[] vClose = entity.ValvesClose.Split(new char[] { ';' }); + ValvesClose = new List(); + foreach (var vName in vClose) ValvesClose.Add((IValve)TbfComponents.FindComponent(vName, components)); + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoi.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoi.cs new file mode 100644 index 000000000..bdd06397e --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoi.cs @@ -0,0 +1,108 @@ +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Threading; +using TBF.BenchControl; +using TBF.BenchControl.Generic; +using log4net; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + /// + /// IdcCamera object represents all IDC cameras. + /// Camera ID is an argument of most methods. + /// + public class CameraRoi : ComponentBase, IComponent, GenericDevices.ICameraRoi, GenericDevices.IRegisterReader + { + private static readonly ILog log = LogManager.GetLogger(typeof(CameraRoi)); + public override string ToString() { return string.Format("{0}, roi{1}, parent={2}", + cameraRoiCfg.Name, cameraRoiCfg.RoiNr, Cfg.ParentName); } + + public static void ResetStaticProperties() + { + } + + readonly CameraRoiCfg cameraRoiCfg; + + readonly GenericDevices.ICamera camera; + public GenericDevices.ICamera Camera { get { return camera; } } + + public float PulsesPerLtr + { + get { return (ProcedureParams as RoiProcedureParams).GradPerLtr; } + } + + public CameraRoi(CameraRoiCfg cfg, IList components) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.cameraRoiCfg = cfg; + if (cfg.DebugLevel != Entities.DebugMode.Off) + { + camera = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.ICamera; + if (camera == null) throw new Exception("Cannot find " + Name + " parent"); + } + } + + /// + /// Events: Event.ReadRegisterDone, Event.Error + /// + /// Reference to a variable for the water meter pulses + /// ReadWaterMeter instance reference casted to IOperaton + public IOperation ReadRegisterOp(ref IntBox pulses) + { + return new ReadRegisterOp(this, ref pulses); + } + + /// + /// Events: Event.ReadRegisterDone, Event.Error + /// + /// Reference to a variable for the water meter pulses + /// Reference to a variable for the related reference flow meter pulses + /// ReadWaterMeter instance reference casted to IOperaton + public IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses) + { + return new ReadRegisterOp(this, ref pulses, ref refPulses); + } + + /// + /// Events: ReadReferenceDone, Error + /// + /// Reference to a variable for the water meter pulses + /// ReadWaterMeter instance reference casted to IOperaton + public IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses) + { + return null; /// not implemented + } + + /// + /// Watermeter wheel/arrow detection process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + public IOperation DetectOp() + { + RoiProcedureParams pp = ProcedureParams as RoiProcedureParams; + return camera.DetectOp(cameraRoiCfg.RoiNr, + new Cameras.IdcCamera.Command.Detect(cameraRoiCfg.RoiNr, 0, pp.IRoiX, pp.IRoiY, pp.IRoiW, pp.IRoiH, + pp.CX, pp.CY, pp.ORoiW, pp.ORoiH, pp.R1, pp.R2, pp.R3, + pp.Ang1, pp.Ang2, pp.AngStep, pp.CCW, (pp.CCW ? -30 : 30), + pp.SequenceLen, pp.SequenceTiming, pp.BackgroundCorr, + pp.BrightnessRoi * camera.Brightness)); + } + + /// + /// Watermeter wheel/arrow angle measurement process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + public IOperation MeasureOp() + { + RoiProcedureParams pp = ProcedureParams as RoiProcedureParams; + return camera.MeasureOp(cameraRoiCfg.RoiNr, + new Cameras.IdcCamera.Command.Measure(cameraRoiCfg.RoiNr, true, 0, pp.IRoiX, pp.IRoiY, pp.IRoiW, pp.IRoiH, + pp.CX, pp.CY, pp.ORoiW, pp.ORoiH, pp.MinMvmt, pp.MaxMvmt, + pp.BrightnessRoi * camera.Brightness)); + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfg.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfg.cs new file mode 100644 index 000000000..b07307fc0 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfg.cs @@ -0,0 +1,54 @@ +using System.IO; +using System.IO.Ports; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg + { + public int RoiNr; /// ROI number 1..4 + + /// Parameterless constructor + public CameraRoiCfg() + { + } + + /// Constructor + public CameraRoiCfg(IComponentFactory factory, string name, string parentName, int roiNr) + : base(factory, name, parentName) + { + this.RoiNr = roiNr; + } + + public IComponentCfg Clone() + { + return new CameraRoiCfg(Factory, Name, ParentName, RoiNr); + } + + public string ToString(int i) + { + return string.Format("roi{0}, parent={1}", RoiNr, ParentName); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, + DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + CameraRoiCfg config = (CameraRoiCfg)(new XmlSerializer(typeof(CameraRoiCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.cs new file mode 100644 index 000000000..be098693f --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.cs @@ -0,0 +1,94 @@ +using System; +using System.Windows.Forms; +using System.IO.Ports; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + public partial class CameraRoiCfgCtrl : UserControl, IComponentCfgCtrl + { + ComponentParametersDlg parent; + + CameraRoiCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as CameraRoiCfg; + Redraw(); + } + } + + public CameraRoiCfgCtrl() + { + InitializeComponent(); + } + + private void IdcCameraCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + parentNameComboBox.Items.Add("---"); + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is BenchControl.Cameras.IdcCamera.IdcCameraFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + roiTextBox.Text = config.RoiNr.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + roiTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + + int dummy; + if (!int.TryParse(roiTextBox.Text, out dummy) || dummy < 1 || dummy > 4) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Region of Interest' is not valid"; + } + + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.RoiNr = int.Parse(roiTextBox.Text); + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.designer.cs new file mode 100644 index 000000000..74d10a5e7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.designer.cs @@ -0,0 +1,130 @@ +namespace TBF.BenchControl.Cameras.CameraRoi +{ + partial class CameraRoiCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.roiTextBox = new System.Windows.Forms.TextBox(); + this.roiLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(138, 72); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(28, 75); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(135, 46); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(89, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComponentName"; + // + // roiTextBox + // + this.roiTextBox.Enabled = false; + this.roiTextBox.Location = new System.Drawing.Point(138, 121); + this.roiTextBox.Name = "roiTextBox"; + this.roiTextBox.Size = new System.Drawing.Size(80, 20); + this.roiTextBox.TabIndex = 4; + // + // roiLabel + // + this.roiLabel.AutoSize = true; + this.roiLabel.Location = new System.Drawing.Point(28, 124); + this.roiLabel.Name = "roiLabel"; + this.roiLabel.Size = new System.Drawing.Size(94, 13); + this.roiLabel.TabIndex = 3; + this.roiLabel.Text = "Region of Interest:"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(138, 96); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 6; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(28, 99); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 5; + this.parentNameLabel.Text = "Parent Name"; + // + // CameraRoiCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.roiTextBox); + this.Controls.Add(this.roiLabel); + this.Name = "CameraRoiCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.Load += new System.EventHandler(this.IdcCameraCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.TextBox roiTextBox; + private System.Windows.Forms.Label roiLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + private System.Windows.Forms.Label parentNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.resx b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiCfgCtrl.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/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiFactory.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiFactory.cs new file mode 100644 index 000000000..58b7802bf --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/CameraRoiFactory.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + public class CameraRoiFactory : IComponentFactory + { + public string ClassName { get { return "CameraROI"; } } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 20; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new CameraRoiCfg(this, "ROI", "", 1); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new CameraRoiCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new CameraRoi((CameraRoiCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return CameraRoiCfg.CreateFromDbEntity(component, this); + } + + public bool HasProcedureParams { get { return true; } } + // + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) + { + return RoiProcedureParams.GetProcedureParams(procedureParams); + } + + public bool HasTestParams { get { return false; } } + // + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + + public void ResetStaticProperties() { CameraRoi.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/ReadRegisterOp.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/ReadRegisterOp.cs new file mode 100644 index 000000000..f43ef4bab --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/ReadRegisterOp.cs @@ -0,0 +1,74 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + public class ReadRegisterOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadRegisterOp)); + public override string ToString() { return string.Format("ReadRegisterOp({0})", cameraRoi.Cfg.Name); } + + /// Set by the constructor + readonly GenericDevices.ICameraRoi cameraRoi; + readonly BenchControl.Cameras.IdcCamera.IdcCamera camera; + IntBox pulses; + IntBox refPulses; + + /// + /// Events: Event.ReadRegisterDone or Event.Error + /// + /// Register reader reference + /// Reference to a field with the water meter pulses + public ReadRegisterOp(GenericDevices.ICameraRoi cameraRoi, ref IntBox pulses) + { + this.cameraRoi = cameraRoi; + if (cameraRoi == null) throw new ArgumentNullException("reader is null or it is not IdcCamera"); + + camera = cameraRoi.Camera as BenchControl.Cameras.IdcCamera.IdcCamera; + + this.pulses = pulses; + log.Debug(this.ToString()); + } + + /// + /// Events: Event.ReadRegisterDone or Event.Error + /// + /// Register reader reference + /// Reference to a Box with the water meter pulses + /// Reference to a Box with the reference flow meter pulses synchronized with the water meter + public ReadRegisterOp(GenericDevices.ICameraRoi cameraRoi, ref IntBox pulses, ref IntBox refPulses) + : this(cameraRoi, ref pulses) + { + this.refPulses = refPulses; + log.Debug(this.ToString()); + } + + private void ReadPulses() + { + pulses.N = camera.Idc100.Pulses; + if (refPulses != null) + { + refPulses.N = 0; + } + } + + /// Start this operation + public void Start() + { + ReadPulses(); + } + + /// Run this operation + /// eventDone + public Event Run() + { + ReadPulses(); + return Event.ReadRegisterDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/CameraRoi/RoiProcedureParams.cs b/TestBenchFramework/BenchControl/Cameras/CameraRoi/RoiProcedureParams.cs new file mode 100644 index 000000000..7c1db8ca6 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/CameraRoi/RoiProcedureParams.cs @@ -0,0 +1,313 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.Cameras.CameraRoi +{ + public class RoiProcedureParams : IParamsProvider, IProcedureParams + { + public int IRoiX; + public int IRoiY; + public int IRoiW; + public int IRoiH; + + public float GradPerLtr; + public bool CCW; /// Clockwise = false, Counter clockwise = true + public float ORoiW; + public float ORoiH; + public float CX; + public float CY; + + public float R1; + public float R2; + public float R3; + public float Ang1; + public float Ang2; + public float AngStep; + public int MinMvmt; + public int MaxMvmt; + + public int SequenceLen; + public int SequenceTiming; + public int BackgroundCorr; + public float BrightnessRoi; + + string[] paramNames = new string[] + { + "IRoiX", + "IRoiY", + "IRoiW", + "IRoiH", + + "Grad per liter", + "CW/CCW", + "ORoiW", + "ORoiH", + "CX", + "CY", + + "R1", + "R2", + "R3", + "Ang1", + "Ang2", + "AngStep", + "Min.Mvmt.", + "Max.Mvmt.", + + "Det.Seq.Len", + "Det.Seq.Timing", + "Background", + "Brightness", + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return IRoiX.ToString(); + case 1: return IRoiY.ToString(); + case 2: return IRoiW.ToString(); + case 3: return IRoiH.ToString(); + + case 4: return GradPerLtr.ToString(); + case 5: return (CCW ? "ccw" : "cw"); + case 6: return ORoiW.ToString(); + case 7: return ORoiH.ToString(); + case 8: return CX.ToString(); + case 9: return CY.ToString(); + + case 10: return R1.ToString(); + case 11: return R2.ToString(); + case 12: return R3.ToString(); + case 13: return Ang1.ToString(); + case 14: return Ang2.ToString(); + case 15: return AngStep.ToString(); + case 16: return MinMvmt.ToString(); + case 17: return MaxMvmt.ToString(); + + case 18: return SequenceLen.ToString(); + case 19: return SequenceTiming.ToString(); + case 20: return BackgroundCorr.ToString(); + case 21: return ((int)(100.0f * BrightnessRoi)).ToString(); + + default: return string.Empty; + } + } + + /// + /// Parameterless constructor - sets default values of parameters. + /// + public RoiProcedureParams() + { + IRoiX = 60; + IRoiY = 1; + IRoiW = 520; + IRoiH = 478; + + GradPerLtr = 40; + CCW = true; + ORoiW = 64.0f; + ORoiH = 64.0f; + CX = 31.0f; + CY = 31.0f; + + R1 = 21.0f; + R2 = 31.0f; + R3 = 0; + Ang1 = 0; + Ang2 = 400.0f; + AngStep = 40.0f; + MinMvmt = 0; + MaxMvmt = 0; + + SequenceLen = 8; + SequenceTiming = 1; + BackgroundCorr = 0; + BrightnessRoi = 1.0f; + } + + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: IRoiX = int.Parse(strValue); return; + case 1: IRoiY = int.Parse(strValue); return; + case 2: IRoiW = int.Parse(strValue); return; + case 3: IRoiH = int.Parse(strValue); return; + + case 4: GradPerLtr = Utils.ParseUFloat(strValue); return; + case 5: CCW = strValue.ToLower().Equals("ccw"); return; + case 6: ORoiW = Utils.ParseUFloat(strValue); return; + case 7: ORoiH = Utils.ParseUFloat(strValue); return; + case 8: CX = Utils.ParseUFloat(strValue); return; + case 9: CY = Utils.ParseUFloat(strValue); return; + + case 10: R1 = Utils.ParseUFloat(strValue); return; + case 11: R2 = Utils.ParseUFloat(strValue); return; + case 12: R3 = Utils.ParseSFloat(strValue); return; + case 13: Ang1 = Utils.ParseSFloat(strValue); return; + case 14: Ang2 = Utils.ParseSFloat(strValue); return; + case 15: AngStep = Utils.ParseUFloat(strValue); return; + case 16: MinMvmt = int.Parse(strValue); return; + case 17: MaxMvmt = int.Parse(strValue); return; + + case 18: SequenceLen = int.Parse(strValue); return; + case 19: SequenceTiming = int.Parse(strValue); return; + case 20: BackgroundCorr = int.Parse(strValue); return; + case 21: BrightnessRoi = ((float)int.Parse(strValue) / 100.0f); return; + default: return; + } + } + + /// + /// Parses the text in the control to verify whether it represents a valid parameter. + /// + /// Parameter nr. + /// String to be verified + /// Message to be shown when verification fails + /// 'true' if parameter string is valid, 'false' otherwise + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + int iDummy; + float dummy; + switch (i) + { + case 0: + case 1: + case 2: + case 3: + case 16: + case 17: + case 18: + case 19: + case 20: + if (int.TryParse(strValue, out iDummy)) return true; + break; + + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 15: + case 21: + if (Utils.TryParseUFloat(strValue, out dummy)) return true; + break; + + case 12: + case 13: + case 14: + if (Utils.TryParseSFloat(strValue, out dummy)) return true; + break; + + case 5: + if (strValue.ToLower().Equals("cw") || strValue.ToLower().Equals("ccw")) return true; + break; + + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentProcedure ProcedureParamsEntity { get { return procedureParamsEntity; } } + Entities.ComponentProcedure procedureParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Procedure Procedure { get { return procedure; } } + Entities.Procedure procedure; + + public RoiProcedureParams(Entities.ComponentProcedure procedureParamsEntity, string componentName, Entities.Procedure procedure) + : this() + { + this.procedureParamsEntity = procedureParamsEntity; + this.componentName = componentName; + this.procedure = procedure; + } + + public TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentProcedure entity + TBF.Entities.ComponentProcedure entity = new TBF.Entities.ComponentProcedure(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Procedure = procedure; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + procedureParamsEntity.Parameters = writer.ToString(); + procedureParamsEntity.CmpntName = componentName; + procedureParamsEntity.Procedure = procedure; + + } + } + + public static IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParamsEntity) + { + if (procedureParamsEntity == null) return new RoiProcedureParams(); + + RoiProcedureParams procedureParams; + try + { + procedureParams = (RoiProcedureParams)(new XmlSerializer(typeof(RoiProcedureParams))) + .Deserialize(new StringReader(procedureParamsEntity.Parameters)); + } + catch + { + procedureParams = new RoiProcedureParams(); + } + procedureParams.procedureParamsEntity = procedureParamsEntity; + procedureParams.componentName = procedureParamsEntity.CmpntName; + procedureParams.procedure = procedureParamsEntity.Procedure; + return procedureParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Connect.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Connect.cs new file mode 100644 index 000000000..e9fbbb987 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Connect.cs @@ -0,0 +1,15 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Connect : IWorkerCmd + { + public string CmdName { get { return "Connect"; } } + public int TimeoutMs; + + public Connect(int timeoutMs) + { + this.TimeoutMs = timeoutMs; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Detect.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Detect.cs new file mode 100644 index 000000000..a358be799 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Detect.cs @@ -0,0 +1,60 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Detect : IWorkerCmd + { + public string CmdName { get { return "Detect"; } } + public int RoiNr; + public int WMeterType; + public int IRoiX; + public int IRoiY; + public int IRoiW; + public int IRoiH; + public float CX; + public float CY; + public float ORoiW; + public float ORoiH; + public float R1; + public float R2; + public float R3; + public float Ang1; + public float Ang2; + public float AngStep; + public bool CCW; /// Clockwise = false, Counter clockwise = true + public float NomSpeed; + public int SequenceLen; + public int SequenceTiming; + public int BackgroundCorr; + public float Brightness; /// Overal brightness 0.0 .. 1.0 obtained as a product of the camera and the ROI brightness + + public Detect(int roiNr, int wMeterType, int iRoiX, int iRoiY, int iRoiW, int iRoiH, + float cx, float cy, float oRoiW, float oRoiH, + float r1, float r2, float r3, float ang1, float ang2, float angStep, bool ccw, + float nomSpeed, int sequenceLen, int sequenceTiming, int backgroundCorr, float brightness) + { + this.RoiNr = roiNr; + this.WMeterType = wMeterType; + this.IRoiX = iRoiX; + this.IRoiY = iRoiY; + this.IRoiW = iRoiW; + this.IRoiH = iRoiH; + this.CX = cx; + this.CY = cy; + this.ORoiW = oRoiW; + this.ORoiH = oRoiH; + this.R1 = r1; + this.R2 = r2; + this.R3 = r3; + this.Ang1 = ang1; + this.Ang2 = ang2; + this.AngStep = angStep; + this.CCW = ccw; + this.NomSpeed = nomSpeed; + this.SequenceLen = sequenceLen; + this.SequenceTiming = sequenceTiming; + this.BackgroundCorr = backgroundCorr; + this.Brightness = brightness; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Disconnect.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Disconnect.cs new file mode 100644 index 000000000..72b94adcf --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Disconnect.cs @@ -0,0 +1,13 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Disconnect : IWorkerCmd + { + public string CmdName { get { return "Disconnect"; } } + + public Disconnect() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Grab.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Grab.cs new file mode 100644 index 000000000..faf155674 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Grab.cs @@ -0,0 +1,31 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Grab : IWorkerCmd + { + public string CmdName { get { return "Grab"; } } + public int X; + public int Y; + public int W; + public int H; + public int Scale; + public string FileName; + public FileFormat Format; + public float Brightness; /// Camera brightness 0.0 .. 1.0 + bool WaitCompleted; + + public Grab(string fileName, FileFormat format, float brihtness, bool waitCompleted) + { + X = 0; + Y = 0; + W = 640; + H = 480; + Scale = 1; + this.FileName = fileName; + this.Format = format; + this.Brightness = brihtness; + this.WaitCompleted = waitCompleted; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Measure.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Measure.cs new file mode 100644 index 000000000..50dd8adfc --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Measure.cs @@ -0,0 +1,44 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Measure : IWorkerCmd + { + public string CmdName { get { return "Measure"; } } + public int RoiNr; /// 1 or 2 + public bool Triggered; + public int WMeterType; + public int IRoiX; + public int IRoiY; + public int IRoiW; + public int IRoiH; + public float CX; + public float CY; + public float ORoiW; + public float ORoiH; + public int MinMvmt; + public int MaxMvmt; + public float Brightness; /// Overal brightness 0.0 .. 1.0 obtained as a product of the camera and the ROI brightness + + public Measure(int roiNr, bool triggered, int wMeterType, + int iRoiX, int iRoiY, int iRoiW, int iRoiH, + float cx, float cy, float oRoiW, float oRoiH, + int minMvmt, int maxMvmt, float brightness) + { + this.RoiNr = roiNr; + this.Triggered = triggered; + this.WMeterType = wMeterType; + this.IRoiX = iRoiX; + this.IRoiY = iRoiY; + this.IRoiW = iRoiW; + this.IRoiH = iRoiH; + this.CX = cx; + this.CY = cy; + this.ORoiW = oRoiW; + this.ORoiH = oRoiH; + this.MinMvmt = minMvmt; + this.MaxMvmt = maxMvmt; + this.Brightness = brightness; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Other.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Other.cs new file mode 100644 index 000000000..b508a18f7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Other.cs @@ -0,0 +1,15 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Other : IWorkerCmd + { + public string CmdName { get { return "Other"; } } + public string Command; + + public Other(string command) + { + this.Command = command; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Save.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Save.cs new file mode 100644 index 000000000..bcc5b37eb --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Save.cs @@ -0,0 +1,21 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + class Save : IWorkerCmd + { + public string CmdName { get { return "Save"; } } + public string VariableName; + public string FileName; + public FileFormat Format; + public bool WaitCompleted; + + public Save(string variableName, string fileName, FileFormat format, bool waitCompleted) + { + this.VariableName = variableName; + this.FileName = fileName; + this.Format = format; + this.WaitCompleted = waitCompleted; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/SetBrightness.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/SetBrightness.cs new file mode 100644 index 000000000..d03d80bd0 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/SetBrightness.cs @@ -0,0 +1,15 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class SetBrightness : IWorkerCmd + { + public string CmdName { get { return "SetBrightness"; } } + public float Brightness; /// 0.0f .. 1.0f + + public SetBrightness(float brightness) + { + this.Brightness = brightness; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StartNew.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StartNew.cs new file mode 100644 index 000000000..ba530e1c3 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StartNew.cs @@ -0,0 +1,13 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class StartNew : IWorkerCmd + { + public string CmdName { get { return "StartNew"; } } + + public StartNew() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopOp.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopOp.cs new file mode 100644 index 000000000..89aa90ff5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopOp.cs @@ -0,0 +1,13 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class StopOp : IWorkerCmd + { + public string CmdName { get { return "StopOp"; } } + + public StopOp() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopStream.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopStream.cs new file mode 100644 index 000000000..f977e0ed6 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/StopStream.cs @@ -0,0 +1,13 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class StopStream : IWorkerCmd + { + public string CmdName { get { return "StopStream"; } } + + public StopStream() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Stream.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Stream.cs new file mode 100644 index 000000000..a509ac22c --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Command/Stream.cs @@ -0,0 +1,19 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera.Command +{ + public class Stream : IWorkerCmd + { + public string CmdName { get { return "Stream"; } } + public StreamType Type; + public FileFormat Format; + public float Brightness; /// Camera brightness 0.0 .. 1.0 + + public Stream(StreamType type, FileFormat format, float brightness) + { + this.Type = type; + this.Format = format; + this.Brightness = brightness; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IWorkerCmd.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IWorkerCmd.cs new file mode 100644 index 000000000..aa3f62c58 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IWorkerCmd.cs @@ -0,0 +1,8 @@ + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public interface IWorkerCmd + { + string CmdName { get; } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/Idc100.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Idc100.cs new file mode 100644 index 000000000..9d16555f5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/Idc100.cs @@ -0,0 +1,1441 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using log4net; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public class Idc100 + { + private static readonly ILog log = LogManager.GetLogger(typeof(Idc100)); + + /// + /// Constants + /// + const string IdcHomeDir = Program.HomeDir; /// Contains subdirectory Images/... + const int MesurementPeriod_Frames = 6; + const int ParamsSize = 14; + const int MaxMeasurementsCount = 160000; /// Enough for +/- 3,5h measurement + + /// + /// Data marks identifying events + /// + enum MARK + { + FALLING = 2000000000, /// Marks measurement start + RISING = 2000000001, /// marks measurement end + BEGIN = 2000000002, /// not used + END = 2000000003, /// not used + DUMMY = 2000000004 + } + + /// Version string + public string Version { get { return cameraVersionStr; } } + string cameraVersionStr; /// IDC100 version, valid after 'Connect' + + /// + /// Private fields + /// + int cameraNr; /// 0-based camera number + int comPortNr; /// COM port number + int baudRate; + float brightness; /// Relative brightness 0 .. 1.0f + string imagesPath; + Tools.IniUtil commonIni; + + SerialLayer serial; /// Communications + Thread workerThread; + + struct Measurement + { + public uint timeStamp; + public int angle; + public Measurement(uint timeStamp, int angle) + { + this.timeStamp = timeStamp; + this.angle = angle; + } + } + + IList measurements; /// Raw angle measurements obtained by the camera + + int wm_nrBegin; /// Measuremnt start mark + uint wm_timestampBegin; + + int wm_nrEnd; /// Measurement end mark + uint wm_timestampEnd; + + /// + /// The angle difference since the start of the measurement operation (the start mark) + /// + public int Pulses + { + get + { + if (measurements.Count < 1 || wm_nrBegin >= measurements.Count) return 0; + return measurements[measurements.Count - 1].angle - measurements[wm_nrBegin].angle; + } + } + + /// + /// The angle difference between the end and the start of the measurement operation + /// + public int TotalPulses + { + get + { + if (wm_nrBegin >= measurements.Count || wm_nrEnd > measurements.Count || wm_nrBegin > wm_nrEnd) return 0; + return measurements[wm_nrEnd - 1].angle - measurements[wm_nrBegin].angle; + } + } + + int m_initSpeed; + + + IdcState _idcState; + /// + IdcState idcState + { + get { return _idcState; } + set + { + if (value != _idcState) + { + _idcState = value; + TBF.UiBridge.Bridge.OnCameraStateChanged(this, + new TBF.UiBridge.CameraStateChangedEventArgs(cameraNr, value)); + } + } + } + /// + public IdcState IdcState { get { return _idcState; } } + + + string m_errorStr; /// last camera error string + RetVal m_lastError; /// last error (either host or camera) + + /// On program exit the control sets these events to avoid deadlocks + AutoResetEvent workerCommandEvent; + AutoResetEvent workerEvent; + + IWorkerCmd workerCmd; + RetVal workerResponse; + + + /// + /// Constructor + /// + /// Camera name = 'Images' subdirectory name) + /// Com port number 1..999 + /// Baud rate 57600 or 115200 + /// Relative brightness 0..1.0f + public Idc100(string name, int cameraNr, int comPortNr, int baudRate, float brightness) + { + this.comPortNr = comPortNr; + this.baudRate = baudRate; + this.brightness = brightness; + this.cameraNr = cameraNr; + m_initSpeed = 0; + + /// Read the rest of parameters from INI-files + this.commonIni = new Tools.IniUtil(IdcHomeDir + "config\\common.ini"); + + /// Create SerialLayer instance + imagesPath = string.Format("{0}Images\\{1}\\", IdcHomeDir, name); + Directory.CreateDirectory(imagesPath); + serial = new SerialLayer(cameraNr, comPortNr, baudRate, 2000, imagesPath); + + /// Initialize the rest + measurements = new List(); + + wm_nrBegin = 0; + wm_nrEnd = 0; + wm_timestampBegin = 0; + wm_timestampEnd = 0; + + m_lastError = RetVal.OK; + + idcState = IdcState.NotConnected; + workerCmd = null; + workerResponse = 0; + workerCommandEvent = new AutoResetEvent(false); + workerEvent = new AutoResetEvent(false); + + //ExecuteIdcIniFile(); + } + + + public RetVal StartOp(IWorkerCmd workerCmd) + { + IdcState[] iniStates; + IdcTransition[] sTransTbl; + + ///------------------------------------ Connection state ------------------------------------ + if (workerCmd is Command.Connect) + { + m_lastError = Connect((workerCmd as Command.Connect).TimeoutMs); + return m_lastError; + } + else if (workerCmd is Command.Disconnect) + { + iniStates = new IdcState[] { IdcState.Idle, IdcState.Busy, IdcState.OpCompleted, IdcState.OpFailed }; + sTransTbl = new IdcTransition[] { new IdcTransition(RetVal.SequenceError, IdcState.Unchanged), + new IdcTransition(RetVal.FatalError, IdcState.Unchanged), + new IdcTransition(RetVal.OK, IdcState.NotConnected), }; + serial.m_disconnecting = true; + serial.UnlockLastRead(); /// Quit infinite fifo.Get() waiting for a character in read FIFO + RetVal retv = IssueThreadCmd(workerCmd, iniStates, sTransTbl); + + if (retv == RetVal.SequenceError) + return m_lastError = RetVal.OK; /// Camera was not connected - OK + else + return m_lastError = retv; + } + else if (idcState == IdcState.NotConnected) + { + /// connection must be established for all remaining operations + return (m_lastError = RetVal.CameraNotConnected); + } + + ///------------------------------------ Other operations ------------------------------------ + + if (workerCmd is Command.Detect || workerCmd is Command.Measure || workerCmd is Command.Stream) + { + /// + /// Long lasting (start/stop) operations state transition table + /// + iniStates = new IdcState[] { IdcState.Idle }; + sTransTbl = new IdcTransition[] { new IdcTransition(RetVal.Busy, IdcState.Busy), + new IdcTransition(RetVal.OpFailed, IdcState.OpFailed), + new IdcTransition(RetVal.OK, IdcState.Busy), }; + } + else + { + /// + /// Immediate operations state transition table + /// + iniStates = new IdcState[] { IdcState.Idle }; + sTransTbl = new IdcTransition[] { new IdcTransition(RetVal.Busy, IdcState.Busy), + new IdcTransition(RetVal.OK, IdcState.Idle), }; + } + + m_lastError = IssueThreadCmd(workerCmd, iniStates, sTransTbl); + return m_lastError; + } + + + public RetVal StopOp() + { + IdcState[] iniStates = new IdcState[] { IdcState.Busy, + IdcState.OpCompleted, + IdcState.OpFailed }; + + IdcTransition[] sTransTbl = new IdcTransition[] { new IdcTransition(RetVal.SequenceError, IdcState.Unchanged), + new IdcTransition(RetVal.OK, IdcState.Idle) + }; + + return m_lastError = IssueThreadCmd(new Command.StopOp(), iniStates, sTransTbl); + } + + + //--------------------------------------------------------------------- + // Connect + // Starts the worker thread, opens the COM-port and establishes + // communication with the camera. + // Returns: + // 0 = OK + // RetVal.SEQUENCE_ERROR ....... camera was already connected, etc + // RetVal.INVALID_COMPORT_NR ... invalid COM-port number + // RetVal.CANNOT_INIT_CAMERA ... when worker thread cannot be started + // RetVal.CANNOT_OPEN_COMPORT ... cannot open COM-port + // RetVal.CANNOT_SET_COMPORT_PARAMETERS ... cannot set comm. parameters + // RetVal.COMM_TIMEOUT ... comm. timeout when establishing a connection + // RetVal.UNKNNOWN_COMM_ERROR ... other less common comm. error + //--------------------------------------------------------------------- + RetVal Connect(int timeoutMs) + { + lock (serial) + { + if (idcState != IdcState.NotConnected) return RetVal.SequenceError; /// Command sequence error + if (comPortNr == 0) return RetVal.InvalidComPortNr; + + /// Start the worker thread + workerThread = new Thread(new ThreadStart(Worker)); + workerThread.Start(); + + if (workerEvent.WaitOne(timeoutMs)) + { + if (workerResponse == RetVal.OK) + { + idcState = IdcState.Idle; + return RetVal.OK; /// Intro part completed OK in time, thread is running OK + } + else + { + return workerResponse; /// Return the code from the thread + } + } + + return RetVal.CommTimeout; /// Timeout + } + } + + ///------------------------------------------------------------------------------ + /// Used to issue command to the worker thread + /// Arguments: + /// threadCmd ... thread command (definend in enum in Common.h) + /// expectedStates ... = NULL ... do not check current state + /// = {state1, state2, ..., 0} ... check if current + /// state is one of states in the zero terminated arary + /// stateTransitionTable= {{resp1,state1},{resp2,state2}, ... ,{RetVal.OK,defaultState}} + /// (!!! last item must be {RetVal.OK,defaultState}) + /// Returns: + /// workerResponse (error code in case of an error) + ///------------------------------------------------------------------------------ + RetVal IssueThreadCmd(IWorkerCmd workerCmd, IdcState[] expectedStates, IdcTransition[] stateTransitionTable) + { + lock (serial) + { + /// Check the initial state + if (idcState == IdcState.NotConnected || expectedStates == null) + { + return RetVal.SequenceError; /// Camera is not connected or expexted states missing + } + /// + bool isInExpectedState = false; + foreach (var expextedState in expectedStates) + { + if (idcState == expextedState) isInExpectedState = true; + } + if (!isInExpectedState) + { + return RetVal.SequenceError; /// Camera is not in any of the expected states + } + + /// Issue thread comand and wait for a response + workerResponse = 0; + this.workerCmd = workerCmd; + workerCommandEvent.Set(); + workerEvent.WaitOne(); + + /// Change the state depending on the response + if (stateTransitionTable != null) + { + foreach (var item in stateTransitionTable) + { + if (item.RetVal == workerResponse) + { + if (item.NewState != IdcState.Unchanged) idcState = item.NewState; + break; + } + } + } + + return workerResponse; + } + } + + /// + /// Shut down Idc100 operation, stop the worker thread. + /// + public void ShutDown() + { + if (workerThread != null) workerThread.Join(); + } + + void Worker() + { + //------------------------------------------------------------------- + // Introductory part: 'Connect' operation waits until it is completed + //------------------------------------------------------------------- + + /// Open the COM-port and set communication parameters + workerResponse = serial.OpenPort(); + + /// Verify connection and get version + if (RetVal.OK == workerResponse && RetVal.OK != serial.GetVer(out cameraVersionStr)) + { + serial.ClosePort(); + workerResponse = RetVal.CannotCommWithCamera; + } + + /// Signal intro is finished, return on error + workerEvent.Set(); + + if (workerResponse != RetVal.OK) return; /// Thread halted on error + + //-------------------------------------------------- + // Worker thread loop + //-------------------------------------------------- + string cmd; + RetVal retv; + int iretv; + + while (true) + { + workerCommandEvent.WaitOne(); + + //------------------------------------------------------------------------------------------- + if (workerCmd is Command.Disconnect) + { + // Disconnect camera: close the com-port and exit worker thread + serial.ClosePort(); + workerResponse = RetVal.OK; + workerEvent.Set(); + return; + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.StopOp) + { + // StopOp() when camera is idle -> do nothing + workerResponse = RetVal.OK; + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.StartNew) + { + // Format: + // startnew + // Issues command(s): + // startnew + // settime + byte znak; + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + serial.WriteString("startnew\r\n"); + + workerResponse = RetVal.Busy; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + // Returns: + // WAIT_OBJECT_0 ... WorkerCommand.STOP_OP received + // WAIT_TIMEOUT .... time expired, no WorkerCommand.STOP_OP received + + while (true) + { + if (workerCommandEvent.WaitOne(6000)) + { + /// Signal received + if (workerCmd is Command.StopOp) + { + workerResponse = RetVal.OpInterrupted; + break; + } + } + else + { + /// Timeout + workerResponse = RetVal.OK; + break; + } + } + + if (workerResponse == RetVal.OK) + { + do { + retv = serial.ReadByte(out znak); + } + while (znak != '$'); // read all characters in the buffer + + serial.WriteString("connect\r\n"); + + if (RetVal.OK != serial.ReadByte(out znak) || znak != 'V') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '\r') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '\n') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '$') workerResponse = RetVal.OpFailed; + else workerResponse = RetVal.OK; + } + + if (workerResponse == RetVal.OK) + { + /// settime + DateTime now = DateTime.Now; + string settimeStr = String.Format("settime {0} {1} {2} {3} {4} {5} {6}\r\n", + now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond); + serial.WriteString(settimeStr); + + if (RetVal.OK != serial.ReadByte(out znak) || znak != '>') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != ' ') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '0') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != ' ') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != 'O') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != 'K') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '\r') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '\n') workerResponse = RetVal.OpFailed; + else if (RetVal.OK != serial.ReadByte(out znak) || znak != '$') workerResponse = RetVal.OpFailed; + else workerResponse = RetVal.OK; + } + + /// Verify connection and get version + if (RetVal.OK == workerResponse && RetVal.OK != serial.GetVer(out cameraVersionStr)) + { + serial.ClosePort(); + workerResponse = RetVal.CannotCommWithCamera; + workerEvent.Set(); + continue; + } + + WT_SSOp_Complete(workerResponse); + + workerResponse = RetVal.OK; + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.SetBrightness) + { + Command.SetBrightness args = workerCmd as Command.SetBrightness; + + /// Set image brightness + /// Format: setbright 0..100 + /// Example: setbright 50 + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt(string.Format("setbright {0}\r\n", Math.Max(0, Math.Min((int)(100.0f * args.Brightness), 100))), + out received, 1, out m_errorStr); + + workerResponse = (iretv <= 0 || received[0] < 0) ? RetVal.OpFailed : RetVal.OK; + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Grab) + { + Command.Grab args = workerCmd as Command.Grab; + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt(string.Format("setbright {0}\r\n", Math.Max(0, Math.Min((int)(100.0f * args.Brightness), 100))), + out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + + iretv = serial.CommandInt(String.Format("new matbyte snap({0},{1}) vecint iroi(5)\r\n", args.W, args.H), + out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + + iretv = serial.CommandInt(String.Format("set iroi {0} {1} {2} {3} {4}\r\n", + args.X, args.Y, args.W, args.H, args.Scale), + out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + // grab + iretv = serial.CommandInt(String.Format("grab snap iroi\r\n"), + out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + // save + string fmtStr = (args.Format == FileFormat.Bmp) ? "bmp" : ( (args.Format == FileFormat.Jpeg) ? "jpg" : "idc"); + cmd = string.Format("save {0} snap {1}\r\n", fmtStr, args.FileName); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + workerResponse = (iretv <= 0 || received[0] < 0) ? RetVal.OpFailed : RetVal.OK; + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Save) + { + Command.Save args = workerCmd as Command.Save; + + string fmtStr = (args.Format == FileFormat.Bmp) ? "bmp" : ( (args.Format == FileFormat.Jpeg) ? "jpg" : "idc"); + cmd = string.Format("save {0} {1} {2}\r\n", fmtStr, args.VariableName, args.FileName); + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + + if (iretv <= 0 || received[0] < 0) + { + // NOK + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + else if (!args.WaitCompleted) + { + // OK and does not wait for completition + workerResponse = RetVal.OK; + workerEvent.Set(); + continue; + } + else + { + // OK, but waits for completition + workerResponse = RetVal.Busy; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + while (true) + { + Thread.Sleep(200); + + iretv = serial.CommandInt("fiostate\r\n", out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] <= 0) + { + //m_pWnd->PostMessage(WM_USER, EVENT_OP_COMPLETED+m_cameraNr, 0); <------- TODO + idcState = IdcState.OpCompleted; + break; + } + } + + WT_SSOp_Wait4StopOp(Timeout.Infinite); + + // OK & completed + workerResponse = RetVal.OK; + workerEvent.Set(); + } + } + //------------------------------------------------------------------------------------------- +/* + ///--------------------------------------- + /// Releases IDC100 memory allocated by created images and variables + /// and deletes oroi1 ... oroi9 (complete detection result) + /// Format: clear + ///--------------------------------------- + case WorkerCommand.NEW_WM: + { + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt("delete -all\r\n", out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + workerEvent.Set(); + break; + } + + iretv = serial.CommandInt("new int nrarrows\r\n", out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + workerEvent.Set(); + break; + } + + iretv = serial.CommandInt(String.Format("set nrarrows {0}\r\n", arrows.GetLength(0) - 1), out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + workerEvent.Set(); + break; + } + + workerResponse = RetVal.OK; /// Eventually overwritten in the for loop + //------ + for (int arwIx = 1; arwIx <= arrows.GetLength(0) - 1; arwIx++) + { + cmd = String.Format("new vecfloat params{0}({1}) vecint oroi{0}(5) matshort bkgnd{0}({2},{3}) matbyte detected{0}({4},{5})\r\n", + arwIx, ParamsSize, (int)(Math.Round(arrows[arwIx].oroi_w)), (int)(Math.Round(arrows[arwIx].oroi_h)), + arrows[arwIx].iroi_w, arrows[arwIx].iroi_h); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + break; + } + + cmd = String.Format("set params{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}\r\n", + arwIx, ParamsSize, + arrows[arwIx].wmType, + arrows[arwIx].cx.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].cy.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].oroi_w.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].oroi_h.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].r1.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].r2.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].r3.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].a1.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].a2.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].step_a.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].nom_speed.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + arrows[arwIx].background_corr); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + break; + } + + cmd = String.Format("set oroi{0} 0 0 {1} {2} 1\r\n", + arwIx, (int)(Math.Round(arrows[arwIx].oroi_w)), (int)(Math.Round(arrows[arwIx].oroi_h))); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv==0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + break; + } + } //for + + workerEvent.Set(); + break; + } +*/ + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Detect) + { + Command.Detect args = workerCmd as Command.Detect; + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt(string.Format("setbright {0}\r\n", Math.Max(0, Math.Min((int)(100.0f * args.Brightness), 100))), + out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + workerResponse = RetVal.Busy; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + /// Common commands: + cmd = "delete -ex oroi1 oroi2 bkgnd1 bkgnd2 detected1 detected2\r\n"; + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + if (RetVal.OK == (retv = WT_SSOp_FastCmd("loadflash\r\n"))) + { + cmd = String.Format("new vecfloat params{0}({1}) vecint oroi{0}(5) matshort bkgnd{0}({2},{3}) matbyte detected{0}({4},{5})\r\n", + args.RoiNr, + ParamsSize, + (int)Math.Round(args.ORoiW), + (int)Math.Round(args.ORoiH), + args.IRoiW, + args.IRoiH); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + cmd = String.Format("set params{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}\r\n", + args.RoiNr, + ParamsSize, + args.WMeterType, + args.CX.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.CY.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.ORoiW.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.ORoiH.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.R1.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.R2.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.R3.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.Ang1.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.Ang2.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.AngStep.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.NomSpeed.ToString("F2", System.Globalization.CultureInfo.InvariantCulture), + args.BackgroundCorr); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + cmd = String.Format("set oroi{0} 0 0 {1} {2} 1\r\n", + args.RoiNr, (int)Math.Round(args.ORoiW), (int)Math.Round(args.ORoiH)); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + if (args.WMeterType == 0) + { + /// + /// wmType==0 commands: + /// + cmd = String.Format("new vecint iroi{0}(5) periods timestamps cubbyte seq\r\n", args.RoiNr); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + cmd = String.Format("set iroi{0} {1} {2} {3} {4} 1\r\n", + args.RoiNr, args.IRoiX, args.IRoiY, args.IRoiW, args.IRoiH); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + StringBuilder sb = new StringBuilder(40); + for (int i = 0; i < args.SequenceLen; i++) + { + sb.Append(" "); + sb.Append((i % 2 == 0) ? "1" : args.SequenceTiming.ToString()); + } + if (RetVal.OK == (retv = WT_SSOp_FastCmd(String.Format("set periods{0}\r\n", sb.ToString())))) + { + cmd = String.Format("grab seq iroi{0} {1} periods timestamps\r\n", + args.RoiNr, args.SequenceLen); + if (RetVal.OK == (retv = WT_SSOp_LongCmd(cmd))) + { + switch (args.RoiNr) + { + default: retv = 0; break; + case 2: retv = WT_SSOp_LongCmd_NoTmOut("mask seq iroi2 oroi1\r\n"); break; + case 3: retv = WT_SSOp_LongCmd_NoTmOut("mask seq iroi3 oroi1 oroi2\r\n"); break; + case 4: retv = WT_SSOp_LongCmd_NoTmOut("mask seq iroi4 oroi1 oroi2 oroi3\r\n"); break; + } + if (RetVal.OK == retv) + { + retv = WT_SSOp_LongCmd(String.Format("detect {0} seq periods detected{0}\r\n", + args.RoiNr)); + + if (retv == RetVal.OK) + { + // save + cmd = string.Format("save jpg detected{0} detected{0}\r\n", args.RoiNr); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + + RetVal retv2 = (iretv <= 0 || received[0] < 0) ? RetVal.OpFailed : RetVal.OK; + if (retv2 == RetVal.OpInterrupted) retv = RetVal.OpInterrupted; + } + } + } + } + } + } + } + else if (args.WMeterType >= 1) + { // + // wmType==1,2 commands: + // + cmd = String.Format("new matfloat homo vecint iroi{0}(5) cubbyte seq cubshort c1 matshort strip lsdbkg digits0\r\n", args.RoiNr); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + cmd = String.Format("set iroi{0} {1} {2} {3} {4} 1\r\n", args.RoiNr, args.IRoiX, args.IRoiY, args.IRoiW, args.IRoiH); + if (RetVal.OK == (retv = WT_SSOp_FastCmd(cmd))) + { + if (RetVal.OK == (retv = WT_SSOp_LongCmd(String.Format("grab seq iroi{0} 20 11\r\n", args.RoiNr)))) + { + if (RetVal.OK == (retv = WT_SSOp_LongCmd(String.Format("detect {0} seq 1 detected{0} homo\r\n", args.RoiNr)))) + { + // time 95s +/- 1.5 turns + if (RetVal.OK == (retv = WT_SSOp_LongCmd(String.Format("grab c1 oroi{0} 300 7\r\n", args.RoiNr)))) + { + if (RetVal.OK == (retv = WT_SSOp_LongCmd_NoTmOut(String.Format("mount c1 oroi{0} homo strip lsdbkg 0\r\n", args.RoiNr)))) + { + retv = WT_SSOp_LongCmd("getdigits strip digits0\r\n"); + } + } + } + } + } + } + } + } + } + } + } + } + WT_SSOp_Complete(retv); + workerResponse = RetVal.OK; + workerEvent.Set(); + } +/* + case WorkerCommand.VERIFY: + { + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt("verify\r\n", out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OP_FAILED; + workerEvent.Set(); + break; + } + + workerResponse = RetVal.BUSY; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + workerResponse = RetVal.OK; + workerEvent.Set(); + break; + } + */ + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Measure) + { + Command.Measure args = workerCmd as Command.Measure; + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt(string.Format("setbright {0}\r\n", Math.Max(0, Math.Min((int)(100.0f * args.Brightness), 100))), + out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + int logLen = 400000 / (int)Math.Round(args.ORoiW) / (int)Math.Round(args.ORoiH); + if (logLen < 2) logLen = 2; + + if (args.WMeterType == 0) + { + cmd = String.Format("new vecint iroi{0}(5) snaptimes(10) cubshort snaps({1},{2},10) log({1},{2},{3}) int shift\r\n", + args.RoiNr, (int)Math.Round(args.ORoiW), (int)Math.Round(args.ORoiH), logLen); + } + else + { + cmd = String.Format("new vecint iroi{0}(5) snaptimes(10) cubshort snaps({1},{2},10) lsdlog int shift\r\n", + args.RoiNr, (int)Math.Round(args.CX), (int)Math.Round(args.CY)); // snaps(cx,cy,10) ... dimensions + } + + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv<=0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + cmd = String.Format("set iroi{0} {1} {2} {3} {4} 1\r\n", + args.RoiNr, args.IRoiX, args.IRoiY, args.IRoiW, args.IRoiH); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + /* + cmd = String.Format("getshift seq iroi{0} shift {1}\r\n", args.RoiNr, 30); + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + */ + + if (args.WMeterType == 0 && args.MaxMvmt == 0 && args.MinMvmt == 0) + { + /// + /// Std: Uses 'initSpeed' + /// + cmd = String.Format("task 1 oroi{0} 1 {1} {2} shift snaps snaptimes log {3} params{0} bkgnd{0}\r\n", + args.RoiNr, + MesurementPeriod_Frames, + (args.Triggered ? "1" : "0"), + logLen); + serial.FifoFlush(); + serial.WriteString(cmd); // send command + } + else if (args.WMeterType == 0) + { + // + // Introduced in ver.7.6.7: + // Uses 'maxMvmt' and 'minMvmt', allows faster movement measurement + // + cmd = String.Format("task 1 oroi{0} 1 {1} {2} shift snaps snaptimes log {3} params{0} bkgnd{0} {4} {5}\r\n", + args.RoiNr, + MesurementPeriod_Frames, + (args.Triggered ? "1" : "0"), + logLen, + args.MaxMvmt, + args.MinMvmt); + serial.FifoFlush(); + serial.WriteString(cmd); // send command + } + else if (args.WMeterType >= 1) + { + // + // Digital counters (Dubai) + // + cmd = String.Format("task {0} oroi{1} 1 {2} {3} shift snaps snaptimes 0 0 homo digits0 params{1} lsdbkg 36 lsdlog\r\n", + args.WMeterType + 1, + args.RoiNr, + MesurementPeriod_Frames, + (args.Triggered ? "1" : "0")); + serial.FifoFlush(); + serial.WriteString(cmd); // send command + } + else + { + // ... + } + + // clear measurement data + measurements.Clear(); + wm_nrBegin = 0; + wm_nrEnd = 0; + wm_timestampBegin = 0; + wm_timestampEnd = 0; + + workerResponse = RetVal.Busy; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + // start reading data + byte znak; + bool stopOpReceived = false; + int angle; + uint time; + while (true) + { + // wait for '>' character, check for WorkerCommand.STOP_OP + do { + if (!stopOpReceived && WorkerCommand.StopOp == WT_SSOp_Wait4StopOp(5)) + { + stopOpReceived = true; + serial.WriteByte((byte)'Q'); + } + if (RetVal.OK != (retv = serial.ReadByte(out znak))) /// if ReadByte_C fails => quit the loop ... + { /// ... and return negative error code + break; + } + } + while (znak != '>'); + + if (retv != RetVal.OK) break; /// communication failed + + /// Read the rest of line + StringBuilder restOfLine = new StringBuilder(); + while (RetVal.OK == (retv = serial.ReadByte(out znak)) && + (znak != (byte)'\r') && (znak != (byte)'\n')) + { + restOfLine.Append((char)znak); + } + if (retv != RetVal.OK) break; + + log.InfoFormat("Received: >{0}", restOfLine); + + /// Parse the line, save and send the result + string[] results = restOfLine.ToString().Split(new char[] { ' ' }); + if ((results.Length >= 3) && results[1].Equals("0") && results[2].Equals("OK")) + { + retv = RetVal.OK; /// Op. successfully completed + break; + } + else if (results.Length < 3 || !UInt32.TryParse(results[1], out time) || !Int32.TryParse(results[2], out angle)) + { + retv = RetVal.OpFailed; /// Op. failed + log.ErrorFormat("RetVal.OpFailed", restOfLine); + break; + } + + if (!stopOpReceived) + { + if ((time > 0) && (measurements.Count < MaxMeasurementsCount)) + { + if (angle == (int)MARK.DUMMY) + { + // do nothing + } + else if (angle == (int)MARK.FALLING) + { + wm_nrBegin = measurements.Count; + wm_timestampBegin = time; + //m_pWnd->PostMessage(WM_USER, EVENT_DATA_READY+m_cameraNr, ID_BEGIN); <------- TODO + } + else if (angle == (int)MARK.RISING) + { + wm_nrEnd = measurements.Count; + wm_timestampEnd = time; + //m_pWnd->PostMessage(WM_USER, EVENT_DATA_READY+m_cameraNr, ID_END); <------- TODO + } + else + { + measurements.Add(new Measurement(time, angle)); + //m_pWnd->PostMessage(WM_USER, EVENT_DATA_READY+m_cameraNr, wm_nrmeasurements); <------- TODO + } + } + } + else if (retv == RetVal.OK && time == 0) + { + /// Wait until '$' + do { + if (RetVal.OK != (retv = serial.ReadByte(out znak))) /// if ReadByte_C fails => quit ... + break; //return -retv; /// ... the loop and return negative ... + } /// ... error code + while (znak != '$'); + break; + } + } + + if (retv != RetVal.OK && !stopOpReceived) + { + //m_pWnd->PostMessage(WM_USER, EVENT_OP_FAILED+m_cameraNr, 0); <------- TODO + idcState = IdcState.OpFailed; + WT_SSOp_Wait4StopOp(Timeout.Infinite); + } + + workerResponse = RetVal.OK; + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Other) + { + Command.Other args = workerCmd as Command.Other; + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + iretv = serial.CommandInt(args.Command + "\r\n", out received, 1, out m_errorStr); + if (iretv < 0) workerResponse = (RetVal)(-iretv); + else if (iretv==0) workerResponse = RetVal.OpFailed; + else if (received[0] < 0) workerResponse = (RetVal)(-received[0]); + else workerResponse = RetVal.OK; + + workerEvent.Set(); + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.Stream) + { + Command.Stream args = workerCmd as Command.Stream; + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + /// Check the camera file I/O state + while (true) + { + iretv = serial.CommandInt("fiostate\r\n", out received, 1, out m_errorStr); + if (iretv <= 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + else if (received[0] == 0) + { + break; /// Continue - start a stream operation + } + } + + iretv = serial.CommandInt(string.Format("setbright {0}\r\n", Math.Max(0, Math.Min((int)(100.0f * args.Brightness), 100))), + out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + + /// Grab one image + if (args.Type != StreamType.Full) + { + iretv = serial.CommandInt("acqimage\r\n", out received, 1, out m_errorStr); + if (iretv <= 0 || received[0] < 0) + { + workerResponse = RetVal.OpFailed; + workerEvent.Set(); + continue; + } + } + + /// Prepare the camera command string + if (args.Format == FileFormat.Bmp) + { + if (args.Type == StreamType.SubSampled) cmd = "streamssdbmp\r\n"; + else if (args.Type == StreamType.Focus) cmd = "streamroibmp\r\n"; + else cmd = "streambmp\r\n"; + } + else if (args.Format == FileFormat.Jpeg) + { + if (args.Type == StreamType.SubSampled) cmd = "streamssdjpg\r\n"; + else if (args.Type == StreamType.Focus) cmd = "streamroijpg\r\n"; + else cmd = "streamjpg\r\n"; + } + else + { + workerResponse = RetVal.OK; + workerEvent.Set(); + continue; + } + + /// Start streaming + iretv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + + if (iretv >= 1 && received[0] == 0) + { + workerResponse = RetVal.Busy; // state -> State.CAMERA_BUSY + workerEvent.Set(); + + WorkerCommand wrkCmd = WT_SSOp_Wait4StopOp(Timeout.Infinite); + + /// Stop streaming + iretv = serial.CommandInt("stopstream\r\n", out received, 1, out m_errorStr); + if (iretv >= 1 && received[0] == 0) + { + workerResponse = RetVal.OK; // state -> State.CAMERA_IDLE + workerEvent.Set(); + } + if (wrkCmd != WorkerCommand.StopOp) + { + WT_SSOp_Wait4StopOp(Timeout.Infinite); + workerResponse = RetVal.OK; // state: State.CAMERA_OP_COMPLETED -> State.CAMERA_IDLE or + workerEvent.Set(); + } + } + else + { + /// Streaming was not started, return error and wait for StopOp + workerResponse = RetVal.OpFailed; // state -> State.CAMERA_OP_FAILED + workerEvent.Set(); + + WT_SSOp_Wait4StopOp(Timeout.Infinite); + + workerResponse = RetVal.OK; // state -> State.CAMERA_IDLE + workerEvent.Set(); + } + } + //------------------------------------------------------------------------------------------- + else if (workerCmd is Command.StopStream) + { + Command.StopStream args = workerCmd as Command.StopStream; + } + } // end while (true) + } + + //--------------------------------------------------------------------- + // Sends command and waits for a response. + // + // Arguments: + // cmd ........ command + // Returns: + // long ... 0 = command completed OK, error code=0 + // 1...999 = command completed with an error code + // RetVal.OP_INTERRUPTED = StopOp was received by the OCX component + // 1000... = camera error (communication timeout ?) + //--------------------------------------------------------------------- + RetVal WT_SSOp_FastCmd(string cmd) + { + if (WorkerCommand.StopOp == WT_SSOp_Wait4StopOp(1)) + { + return RetVal.OpInterrupted; /// This error code has the priority to avoid deadlocks + } + + int[] received = new int[1]; + received[0] = 0; /// OK in debug mode + + /// Send a command that cannot be interrupted via 'Q' + int readByteRetv = serial.CommandInt(cmd, out received, 1, out m_errorStr); + + if (readByteRetv<0) return (RetVal)(-readByteRetv); /// possibly a camera timeout + + return (RetVal)(-received[0]); /// <--- normal return from the operation + } + + //--------------------------------------------------------------------- + // Sends command and waits for "> 'received' 'string'" or sends 'Q' + // after CMD_STOP_OP. Then waits for a prompt '$'. + // Waits until '>' is received. + // + // Arguments: + // cmd ........ command + // Returns: + // long ... 0 = command completed OK, error code=0 + // 1...999 = command completed with an error code + // RetVal.OP_INTERRUPTED = StopOp was received by the OCX component + // 1000... = camera error (communication timeout ?) + //--------------------------------------------------------------------- + RetVal WT_SSOp_LongCmd(string cmd) + { + /// Send the command + serial.FifoFlush(); + serial.WriteString(cmd); + + RetVal readByteRetv; + byte znak; + + /// When WorkerCommand.STOP_OP arrives, 'Q' character is sent to abort the operation. + /// Then the loop still waits until '>' is received. + bool stopOpReceived = false; + do { + if (!stopOpReceived && WorkerCommand.StopOp == WT_SSOp_Wait4StopOp(5)) + { + /// send 'Q' if CMD_STOP_OP worker thread command is received + stopOpReceived = true; + serial.WriteByte((byte)'Q'); + } + + if (RetVal.OK != (readByteRetv = serial.ReadByte(out znak))) break; + /// if ReadByte_C fails quit the loop and return negative error code + } + while (znak != (byte)'>'); + + if (stopOpReceived) return RetVal.OpInterrupted; /// StopOp: This error code has the priority to avoid deadlocks + if (readByteRetv != RetVal.OK) return readByteRetv; /// Possibly a camera communication timeout + + /// Read a line of text from IDC terminated by '\r' (and '\n') + StringBuilder tmp = new StringBuilder(); + do + { + if (RetVal.OK != (readByteRetv = serial.ReadByte(out znak))) break; + if (znak == (byte)'\r') break; + tmp.Append((char)znak); + } + while (true); + + log.InfoFormat("{0}: Received: >{1}", cameraNr, tmp); + + if (readByteRetv != RetVal.OK) return readByteRetv; /// Return on error + + /// Parse the line after '>'. + /// Read two fields: Return code and the rest of the line. + const int maxArrayLen = 3; + string[] strArray = tmp.ToString().Split(new char[] {' '}, maxArrayLen); + /// + if (strArray.Length < 3) return RetVal.CommError; /// Unexpected format, there should be at least 2 strings + /// + int negativeIdcReturnCode; + if (!Int32.TryParse(strArray[1], out negativeIdcReturnCode)) + { + return RetVal.CommError; + } + else if (negativeIdcReturnCode < 0) + { + m_errorStr = strArray[2]; + } + + /// Read characters until '$' received + do { + if (0 != (readByteRetv = serial.ReadByte(out znak))) break; + } + while (znak != '$'); + + if (readByteRetv != RetVal.OK) return readByteRetv; /// Possibly a camera communication timeout + + return (RetVal)(-negativeIdcReturnCode); /// Normal return from the operation + } + + //---------------------------------------------------------------------------- + // Sends command and waits for "> 'received' 'string'" or sends 'Q' + // after CMD_STOP_OP. Then waits for a prompt '$'. + // + // Arguments: + // cmd ........ command + // Returns: + // long ... 0 = command completed OK, error code=0 + // 1...999 = command completed with an error code + // RetVal.OP_INTERRUPTED = StopOp was received by the OCX component + // 1000... = camera error (communication timeout ?) + //---------------------------------------------------------------------------- + RetVal WT_SSOp_LongCmd_NoTmOut(string cmd) + { + /// Send the command + serial.FifoFlush(); + serial.WriteString(cmd); + + RetVal readByteRetv; + byte znak; + + /// When WorkerCommand.STOP_OP arrives, 'Q' character is sent to abort the operation. + /// Then the loop still waits until '>' is received. + bool stopOpReceived = false; + do { + if (!stopOpReceived && WorkerCommand.StopOp == WT_SSOp_Wait4StopOp(5)) + { + // send 'Q' if CMD_STOP_OP worker thread command is received + stopOpReceived = true; + serial.WriteByte((byte)'Q'); + } + readByteRetv = serial.ReadByte(out znak); /// Do not quit the loop on timeout (???) + } + while (znak != '>'); + + if (stopOpReceived) return RetVal.OpInterrupted; /// StopOp: This error code has the priority to avoid deadlocks + if (readByteRetv != RetVal.OK) return readByteRetv; /// Possibly a camera communication timeout + + /// Read a line of text from IDC terminated by '\r' (and '\n') + StringBuilder tmp = new StringBuilder(); + do + { + if (RetVal.OK != (readByteRetv = serial.ReadByte(out znak))) break; + if (znak == (byte)'\r') break; + tmp.Append((char)znak); + } + while (true); + + if (readByteRetv != RetVal.OK) return readByteRetv; /// Return on error + + /// Parse the line after '>'. + /// Read two fields: Return code and the rest of the line. + const int maxArrayLen = 2; + string[] strArray = tmp.ToString().Split(new char[] { ' ' }, maxArrayLen); + /// + if (strArray.Length < 2) return RetVal.OpFailed; /// Unexpected format, there should be at least 2 strings + /// + int negativeIdcReturnCode; + Int32.TryParse(strArray[0], out negativeIdcReturnCode); + if (negativeIdcReturnCode < 0) m_errorStr = strArray[1]; + + /// Read characters until '$' received + do + { + if (0 != (readByteRetv = serial.ReadByte(out znak))) break; + } + while (znak != '$'); + + if (readByteRetv != RetVal.OK) return readByteRetv; /// Possibly a camera communication timeout + + return (RetVal)(-negativeIdcReturnCode); /// Normal return from the operation + } + + //--------------------------------------------------------------------- + // Sends OP_COPMPETED / OP_FAILED message and waits for StopOp. + // + // Arguments: + // errorCode ... RetVal.OP_INTERRUPTED, !!!do not issue any message anymore + // < 1000 command line response (number after >), or + // >=1000 error code (camera timeout, etc.) + // Returns: + // long ........ 0 = OK ... 'received' is valid + // RetVal.COMM_TIEMOUT + //--------------------------------------------------------------------- + void WT_SSOp_Complete(RetVal errorCode) + { + if (errorCode == RetVal.OpInterrupted) return; + + // Send an appropriate message to the control + if (errorCode == RetVal.OK) + { + //m_pWnd->PostMessage(WM_USER, EVENT_OP_COMPLETED+m_cameraNr, 0); <------- TODO + idcState = IdcState.OpCompleted; + } + else + { + //m_pWnd->PostMessage(WM_USER, EVENT_OP_FAILED+m_cameraNr, -errorCode); <------- TODO + idcState = IdcState.OpFailed; + } + + // Wait for StopOp + WT_SSOp_Wait4StopOp(Timeout.Infinite); + } + + /** ------------------------------------------------------------------------------ + * Waits for CMD_STOP_OP command. Other commands are ignoerd. + * + * Arguments: + * ms .............. timeout in ms or INFINITE (default) + * Returns: + * WorkerCommand.STOP_OP ... STOP_OP received + * WorkerCommand.Timeout ... time expired, no STOP_OP received + * ------------------------------------------------------------------------------- */ + WorkerCommand WT_SSOp_Wait4StopOp(int timeoutMs) + { + while (true) + { + if (workerCommandEvent.WaitOne(timeoutMs)) + { + if (workerCmd is Command.StopOp) return WorkerCommand.StopOp; + } + else + { + return WorkerCommand.Timeout; + } + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCamera.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCamera.cs new file mode 100644 index 000000000..9eec77e40 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCamera.cs @@ -0,0 +1,297 @@ +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Threading; +using TBF.BenchControl; +using TBF.BenchControl.Generic; +using log4net; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + /// + /// IdcCamera object represents all IDC cameras. + /// Camera ID is an argument of most methods. + /// + public class IdcCamera : ComponentBase, IDevice, IOperation, GenericDevices.ICamera + { + private static readonly ILog log = LogManager.GetLogger(typeof(IdcCamera)); + public override string ToString() { return string.Format("{0}, com{1}, {2}, roi{3}", + idcCameraCfg.Name, idcCameraCfg.ComPortNr, + currentOp, currentRoiId); } + + const int MaxRoisCount = 4; + + /// + /// Enumeration of cameras via static fields and methods + /// + static int nextCameraNr = 0; + public static void ResetStaticProperties() + { + nextCameraNr = 0; + } + + int cameraNr; + public int CameraNr { get { return cameraNr; } } + + public float Brightness { get { return idcCameraCfg.BrightnessCam; } } + + private readonly IdcCameraCfg idcCameraCfg; + + /// + /// Currently running camera operation. + /// ReadRegisterOp-s are not included in this list, they are independent. + /// + public enum CurrentOp + { + None, + StartNew, + SetBrightness, + Grab, + Live, + Focus, + Detect, + Measure, + } + + /// Private fields + public Idc100 Idc100; /// Idc100 camera low level implementation + CurrentOp currentOp; + int currentRoiId; + IWorkerCmd detectCmd; + IWorkerCmd measureCmd; + + public IdcCamera(IdcCameraCfg cfg, IList components) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.idcCameraCfg = cfg; + + cameraNr = nextCameraNr++; + } + + public void Initialize() + { + if (idcCameraCfg.DebugLevel == Entities.DebugMode.Simulate) + { + log.WarnFormat("{0}: in simulation mode", Name); + return; + } + + /// Initialize the camera + Idc100 = new Idc100(Name, cameraNr, idcCameraCfg.ComPortNr, idcCameraCfg.BaudRate, idcCameraCfg.BrightnessCam); + RetVal rVal = Idc100.StartOp(new Command.Connect(3000)); /// timeout in ms + + + if (idcCameraCfg.DebugLevel == Entities.DebugMode.AutoDetect) + { + if (rVal == RetVal.OK) + idcCameraCfg.DebugLevel = Entities.DebugMode.DetectedOn; + else + idcCameraCfg.DebugLevel = Entities.DebugMode.DetectedOff; + } + else if (rVal != RetVal.OK) + { + throw (new Exception(string.Format("Cannot make a connection to {0} on COM{1}", Name, idcCameraCfg.ComPortNr))); + } + + if (idcCameraCfg.DebugLevel != Entities.DebugMode.DetectedOff) + { + log.WarnFormat("Detected: {0} on COM{1} ver. {2}", Name, idcCameraCfg.ComPortNr, Idc100.Version); + } + } + + public void RunDeviceBefore() + { + } + + public void RunDeviceAfter() + { + } + + public void StopDevice() + { + if (Idc100 != null) + { + RetVal rVal = Idc100.StartOp(new Command.Disconnect()); + Idc100.ShutDown(); + } + } + + /// + /// Restart the camera with a new firmware. + /// + /// Reference to operation object instance + public IOperation StartNewOp() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.StartNew; + return this; + } + + /// + /// Set camera image brightness (camera aperture). + /// + /// Reference to operation object instance + public IOperation SetBrightnessOp() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.SetBrightness; + return this; + } + + /// + /// Grab an image. + /// + /// Reference to operation object instance + public IOperation GrabOp() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.Grab; + return this; + } + + /// + /// Display live image. + /// + /// Reference to operation object instance + public IOperation LiveOp() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.Live; + return this; + } + + /// + /// Display live detail to focus the camera. + /// + /// Reference to operation object instance + public IOperation FocusOp() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.Focus; + return this; + } + + /// + /// Watermeter wheel/arrow detection process. + /// + /// Region of interest (1..MaxRoisCount) + /// Reference to operation object instance + public IOperation DetectOp(int roiId, IWorkerCmd detectCmd) + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + if (roiId < 1 || roiId > MaxRoisCount) throw new ArgumentOutOfRangeException("roiId"); + currentOp = CurrentOp.Detect; + this.currentRoiId = roiId; + this.detectCmd = detectCmd; + return this; + } + + /// + /// Watermeter wheel/arrow angle measurement process. + /// + /// Region of interest (1..MaxRoisCount) + /// Reference to operation object instance + public IOperation MeasureOp(int roiId, IWorkerCmd measureCmd) + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + if (roiId < 1 || roiId > MaxRoisCount) throw new ArgumentOutOfRangeException("roiId"); + currentOp = CurrentOp.Measure; + this.currentRoiId = roiId; + this.measureCmd = measureCmd; + return this; + } + + /// Start the operation + public void Start() + { + if (Cfg.DebugLevel == Entities.DebugMode.Normal || Cfg.DebugLevel == Entities.DebugMode.DetectedOn) + { + switch (currentOp) + { + case CurrentOp.StartNew: + Idc100.StartOp(new Command.StartNew()); + return; + case CurrentOp.Grab: + Idc100.StartOp(new Command.Grab("snap1", FileFormat.Jpeg, Brightness, false)); + return; + case CurrentOp.Live: + Idc100.StartOp(new Command.Stream(StreamType.SubSampled, FileFormat.Jpeg, Brightness)); + return; + case CurrentOp.Focus: + Idc100.StartOp(new Command.Stream(StreamType.Focus, FileFormat.Bmp, Brightness)); + return; + case CurrentOp.Detect: + Idc100.StartOp(this.detectCmd); + return; + case CurrentOp.Measure: + Idc100.StartOp(this.measureCmd); + return; + } + } + } + + /// + /// Check the cameraDev state (OP_COMPLETED or OP_FAILED) + /// + /// + public Event Run() + { + if (Cfg.DebugLevel == Entities.DebugMode.Normal || Cfg.DebugLevel == Entities.DebugMode.DetectedOn) + { + switch (currentOp) + { + case CurrentOp.Grab: + if (Idc100.IdcState == IdcState.Idle) return Event.None; + else return Event.Error; + + case CurrentOp.StartNew: + case CurrentOp.Live: + case CurrentOp.Focus: + case CurrentOp.Measure: + case CurrentOp.Detect: + if (Idc100.IdcState == IdcState.Busy) + { + return Event.CameraBusy; + } + else if (Idc100.IdcState == IdcState.OpCompleted) + { + log.InfoFormat("{0}: {1} - OpCompleted", cameraNr, currentOp); + return Event.CameraOpCompleted; + } + else if (Idc100.IdcState == IdcState.OpFailed) + { + log.WarnFormat("{0}: {1} - OpFailed", cameraNr, currentOp); + return Event.CameraOpFailed; + } + else return Event.Error; + + default: + return Event.Error; + } + } + else + { + if (currentOp == CurrentOp.Grab) + { + return Event.None; + } + else + { + return Event.CameraOpCompleted; + } + } + } + + /// Stop the operation + public void Stop() + { + if ((Cfg.DebugLevel == Entities.DebugMode.Normal || Cfg.DebugLevel == Entities.DebugMode.DetectedOn) + && (Idc100.IdcState != IdcState.Idle)) + { + Idc100.StopOp(); + } + currentOp = CurrentOp.None; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfg.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfg.cs new file mode 100644 index 000000000..87e74f5dd --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfg.cs @@ -0,0 +1,57 @@ +using System.IO; +using System.IO.Ports; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public class IdcCameraCfg : ComponentCfgBase, Generic.IComponentCfg + { + public int ComPortNr; /// Com port number 1..999 + public int BaudRate; /// Baud rate 57600 or 115200 + public float BrightnessCam; /// Relative brightness 0 .. 1.0f + + /// Parameterless constructor + public IdcCameraCfg() + { + } + + /// Constructor + public IdcCameraCfg(IComponentFactory factory, string name, int comPortNr, int baudRate, float brightnessCam) + : base(factory, name) + { + this.ComPortNr = comPortNr; + this.BaudRate = baudRate; + this.BrightnessCam = brightnessCam; + } + + public IComponentCfg Clone() + { + return new IdcCameraCfg(Factory, Name, ComPortNr, BaudRate, BrightnessCam); + } + + public string ToString(int i) + { + return string.Format("COM{0}, {1}Bd, brightness={2}%", ComPortNr, BaudRate, (int)(100.0f * BrightnessCam)); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + IdcCameraCfg config = (IdcCameraCfg)(new XmlSerializer(typeof(IdcCameraCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.cs new file mode 100644 index 000000000..f15593e63 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.cs @@ -0,0 +1,88 @@ +using System; +using System.Windows.Forms; +using System.IO.Ports; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public partial class IdcCameraCfgCtrl : UserControl, IComponentCfgCtrl + { + IdcCameraCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as IdcCameraCfg; + Redraw(); + } + } + + public IdcCameraCfgCtrl() + { + InitializeComponent(); + } + + private void IdcCameraCfgCtrl_Load(object sender, EventArgs e) + { + baudRateComboBox.Items.Add("57600"); + baudRateComboBox.Items.Add("115200"); + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + comPortNrTextBox.Text = config.ComPortNr.ToString(); + baudRateComboBox.Text = config.BaudRate.ToString(); + brightnessTextBox.Text = (100.0f * config.BrightnessCam).ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + comPortNrTextBox.Enabled = true; + baudRateComboBox.Enabled = true; + brightnessTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!int.TryParse(comPortNrTextBox.Text, out dummy) || dummy < 1 || dummy > 999) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Serial Port Number' is not valid"; + } + if (!int.TryParse(baudRateComboBox.Text, out dummy) || ((dummy != 57600) && (dummy != 115200))) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Baud Rate' should be 57600 or 115200 Bd"; + } + if (!int.TryParse(brightnessTextBox.Text, out dummy) || dummy < 0 || dummy > 100) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Brightness' should be between 0 and 100 %"; + } + + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ComPortNr = int.Parse(comPortNrTextBox.Text); + config.BaudRate = int.Parse(baudRateComboBox.Text); + config.BrightnessCam = ((float)int.Parse(brightnessTextBox.Text) / 100.0f); + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.designer.cs new file mode 100644 index 000000000..5e40a189e --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.designer.cs @@ -0,0 +1,176 @@ +namespace TBF.BenchControl.Cameras.IdcCamera +{ + partial class IdcCameraCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.baudRateLabel = new System.Windows.Forms.Label(); + this.comPortNrTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.brightnessTextBox = new System.Windows.Forms.TextBox(); + this.brightnessLabel = new System.Windows.Forms.Label(); + this.baudRateComboBox = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(139, 47); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(29, 50); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(136, 21); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // baudRateLabel + // + this.baudRateLabel.AutoSize = true; + this.baudRateLabel.Location = new System.Drawing.Point(28, 102); + this.baudRateLabel.Name = "baudRateLabel"; + this.baudRateLabel.Size = new System.Drawing.Size(58, 13); + this.baudRateLabel.TabIndex = 5; + this.baudRateLabel.Text = "Baud Rate"; + // + // comPortNrTextBox + // + this.comPortNrTextBox.Enabled = false; + this.comPortNrTextBox.Location = new System.Drawing.Point(139, 73); + this.comPortNrTextBox.Name = "comPortNrTextBox"; + this.comPortNrTextBox.Size = new System.Drawing.Size(80, 20); + this.comPortNrTextBox.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(28, 76); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Serial Port Number:"; + // + // brightnessTextBox + // + this.brightnessTextBox.Enabled = false; + this.brightnessTextBox.Location = new System.Drawing.Point(140, 126); + this.brightnessTextBox.Name = "brightnessTextBox"; + this.brightnessTextBox.Size = new System.Drawing.Size(79, 20); + this.brightnessTextBox.TabIndex = 8; + // + // brightnessLabel + // + this.brightnessLabel.AutoSize = true; + this.brightnessLabel.Location = new System.Drawing.Point(28, 129); + this.brightnessLabel.Name = "brightnessLabel"; + this.brightnessLabel.Size = new System.Drawing.Size(56, 13); + this.brightnessLabel.TabIndex = 7; + this.brightnessLabel.Text = "Brightness"; + // + // baudRateComboBox + // + this.baudRateComboBox.FormattingEnabled = true; + this.baudRateComboBox.Location = new System.Drawing.Point(139, 99); + this.baudRateComboBox.Name = "baudRateComboBox"; + this.baudRateComboBox.Size = new System.Drawing.Size(80, 21); + this.baudRateComboBox.TabIndex = 6; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(226, 129); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(15, 13); + this.label2.TabIndex = 9; + this.label2.Text = "%"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(226, 102); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(20, 13); + this.label3.TabIndex = 10; + this.label3.Text = "Bd"; + // + // IdcCameraCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.baudRateComboBox); + this.Controls.Add(this.brightnessTextBox); + this.Controls.Add(this.brightnessLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.baudRateLabel); + this.Controls.Add(this.comPortNrTextBox); + this.Controls.Add(this.label1); + this.Name = "IdcCameraCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.Load += new System.EventHandler(this.IdcCameraCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label baudRateLabel; + private System.Windows.Forms.TextBox comPortNrTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox brightnessTextBox; + private System.Windows.Forms.Label brightnessLabel; + private System.Windows.Forms.ComboBox baudRateComboBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.resx b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraCfgCtrl.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/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraFactory.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraFactory.cs new file mode 100644 index 000000000..6c54cc6a9 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcCameraFactory.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public class IdcCameraFactory : IComponentFactory + { + public string ClassName { get { return "IdcCamera"; } } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 20; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new IdcCameraCfg(this, "Idc", 20, 57600, 0.5f); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new IdcCameraCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new IdcCamera((IdcCameraCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return IdcCameraCfg.CreateFromDbEntity(component, this); + } + + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + // + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + + public void ResetStaticProperties() { IdcCamera.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcEnums.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcEnums.cs new file mode 100644 index 000000000..01623d8b8 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/IdcEnums.cs @@ -0,0 +1,65 @@ +using System; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + /// IDC camera states + public enum IdcState + { + Unchanged = -1, /// not a state - used in state transition tables + NotConnected = 0, /// 'gray' + Idle, /// 'green' + Busy, /// 'yellow' or 'orange' + OpCompleted, /// 'green' + OpFailed, /// 'red' + Halted, /// 'red' + } + + public enum RetVal + { + OK = 0, + HOST_START = 1000, /// Start of error codes from HOST part of the software + Busy, /// OK - camera operation in progress + OpInterrupted, /// OK - camera operation interrupted + OpFailed, /// RetVal - Camera operation failed + CameraNotConnected, /// RetVal - Camera is not connected + SequenceError, /// RetVal - Invalid sequence of calls + InvalidComPortNr, /// RetVal - Invalid COM-port number + CannotOpenComPort, /// RetVal - Cannot open COM-port + CannotCommWithCamera, /// RetVal - Cannot communicate with the camera + CommTimeout, /// RetVal - Communication timeout + CommError, /// RetVal - Unknown error during communication + ShutdownInProgress, /// RetVal - System is shutting down + FatalError, /// RetVal - Fatal error + } + + public struct IdcTransition + { + public RetVal RetVal; + public IdcState NewState; + + public IdcTransition(RetVal retVal, IdcState newState) + { + this.RetVal = retVal; + this.NewState = newState; + } + } + + public enum FileFormat + { + Bmp, + Jpeg, + } + + public enum StreamType + { + Full, + SubSampled, + Focus, + } + + enum WorkerCommand + { + StopOp, /// Stop the current operation + Timeout, /// The expected WorkerCommand(s) have not arrived in time + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialFileIO.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialFileIO.cs new file mode 100644 index 000000000..de19c33b8 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialFileIO.cs @@ -0,0 +1,227 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using log4net; +using TBF.UiBridge; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + /// + /// File I/O implementation + /// + public class SerialFileIO + { + static readonly ILog log = LogManager.GetLogger(typeof(SerialFileIO)); + + static TBF.Tools.ByteFormatter byteFormatter = new TBF.Tools.ByteFormatter(); + + const int BUFSIZE = 1024; + const int MAXFNAMESIZE = 62; + + int cameraIdx; + string imagesPath; + + StringBuilder fioFilenameBuilder; + string fioFullPathname; + int packetSize; + byte[] fioBuffer; + BinaryWriter fioWriter; + + enum FioState + { + Command, /// 'o', 'c' or 'w' + Open, /// 'p' + Open2, /// 'e' + Open3, /// 'n' + Open4, /// 1 + Filename, + Close, /// 'l' + Close2, /// 'o' + Close3, /// 's' + Close4, /// 'e' + Close5, /// 1 + Write, /// 'r' + Write2, /// 'i' + Write3, /// 't' + Write4, /// 'e' + Write5, /// 1 + PktSize1, + PktSize2, + PktSize3, + Data, + } + + FioState state; + + public string TransferredFile + { + get { return fioFullPathname; } + } + + public SerialFileIO(int cameraIdx, string imagesPath) + { + this.cameraIdx = cameraIdx; + this.imagesPath = imagesPath; + state = FioState.Command; + fioFullPathname = string.Empty; + fioFilenameBuilder = new StringBuilder(16); + fioBuffer = new byte[BUFSIZE]; + } + + public void ProcessByte(byte b) + { + /// + /// Reaching break in any case of the following switch is an error + /// + if (state == FioState.Data) + { + if (packetSize > 0) + { + if (fioWriter != null) + { + fioWriter.Write(b); + } + if (--packetSize == 0) + { + state = FioState.Command; + } + return; + } + + log.ErrorFormat("{0}: FIO error 17", cameraIdx); + } + else + { + switch (state) + { + case FioState.Command: + if ((char)b == 'o') { state = FioState.Open; return; } + if ((char)b == 'c') { state = FioState.Close; return; } + if ((char)b == 'w') { state = FioState.Write; return; } + log.ErrorFormat("{0}: FIO error 1, fullPathName={1}", cameraIdx, fioFullPathname); + break; + case FioState.Open: + if ((char)b == 'p') { state = FioState.Open2; return; } + log.ErrorFormat("{0}: FIO error 2", cameraIdx); + break; + case FioState.Open2: + if ((char)b == 'e') { state = FioState.Open3; return; } + log.ErrorFormat("{0}: FIO error 3", cameraIdx); + break; + case FioState.Open3: + if ((char)b == 'n') { state = FioState.Open4; return; } + log.ErrorFormat("{0}: FIO error 4", cameraIdx); + break; + case FioState.Open4: + if (b == 1) + { + fioFilenameBuilder.Clear(); + state = FioState.Filename; + return; + } + log.ErrorFormat("{0}: FIO error 5", cameraIdx); + break; + case FioState.Filename: + if (b == 0) + { + if (fioWriter != null) + { + fioWriter.Close(); + fioWriter.Dispose(); + } + + try + { + fioFullPathname = imagesPath + fioFilenameBuilder.ToString(); + fioWriter = new BinaryWriter(File.Open(fioFullPathname, FileMode.Create)); + log.DebugFormat("{0}: Open(\"{1}\")", cameraIdx, fioFullPathname); + } + catch + { + fioWriter = null; + log.WarnFormat("{0}: Failed to open(\"{1}\")", cameraIdx, fioFullPathname); + } + state = FioState.Command; + return; + } + else if (fioFilenameBuilder.Length < MAXFNAMESIZE) + { + fioFilenameBuilder.Append((char)b); + return; + } + log.ErrorFormat("{0}: FIO error 6", cameraIdx); + break; + case FioState.Close: + if ((char)b == 'l') { state = FioState.Close2; return; } + log.ErrorFormat("{0}: FIO error 7", cameraIdx); + break; + case FioState.Close2: + if ((char)b == 'o') { state = FioState.Close3; return; } + log.ErrorFormat("{0}: FIO error 8", cameraIdx); + break; + case FioState.Close3: + if ((char)b == 's') { state = FioState.Close4; return; } + log.ErrorFormat("{0}: FIO error 9", cameraIdx); + break; + case FioState.Close4: + if ((char)b == 'e') { state = FioState.Close5; return; } + log.ErrorFormat("{0}: FIO error 10", cameraIdx); + break; + case FioState.Close5: + if ((char)b == '1' && fioWriter != null) + { + log.DebugFormat("{0}: Close()", cameraIdx); + fioWriter.Close(); + fioWriter.Dispose(); + fioWriter = null; + Bridge.OnImageUpdated(this, new ImageUpdatedEventArgs(cameraIdx, fioFullPathname)); + fioFullPathname = String.Empty; + state = FioState.Command; + return; + } + log.ErrorFormat("{0}: FIO error 11", cameraIdx); + break; + case FioState.Write: + if ((char)b == 'r') { state = FioState.Write2; return; } + log.ErrorFormat("{0}: FIO error 12", cameraIdx); + break; + case FioState.Write2: + if ((char)b == 'i') { state = FioState.Write3; return; } + log.ErrorFormat("{0}: FIO error 13", cameraIdx); + break; + case FioState.Write3: + if ((char)b == 't') { state = FioState.Write4; return; } + log.ErrorFormat("{0}: FIO error 14", cameraIdx); + break; + case FioState.Write4: + if ((char)b == 'e') { state = FioState.Write5; return; } + log.ErrorFormat("{0}: FIO error 15", cameraIdx); + break; + case FioState.Write5: + if ((char)b == '1') { state = FioState.PktSize1; return; } + log.ErrorFormat("{0}: FIO error 16", cameraIdx); + break; + case FioState.PktSize1: + packetSize = (int)b; + state = FioState.PktSize2; + return; + case FioState.PktSize2: + packetSize = (256 * packetSize) + (int)b; + state = FioState.PktSize3; + return; + case FioState.PktSize3: + packetSize = (256 * packetSize) + (int)b; + log.DebugFormat("{0}: write(len={1})", cameraIdx, packetSize); + state = FioState.Data; + return; + default: + log.ErrorFormat("{0}: FIO error 18", cameraIdx); + break; + } + } + + state = FioState.Command; + } + } +} diff --git a/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialLayer.cs b/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialLayer.cs new file mode 100644 index 000000000..88f53b5d2 --- /dev/null +++ b/TestBenchFramework/BenchControl/Cameras/IdcCamera/SerialLayer.cs @@ -0,0 +1,619 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.IO.Ports; +using System.Text; +using System.Threading; +using log4net; + +namespace TBF.BenchControl.Cameras.IdcCamera +{ + public class SerialLayer + { + static readonly ILog log = LogManager.GetLogger(typeof(SerialLayer)); + + /// + /// Set to true when shut-down is in progress + /// + public static bool g_shutDown = false; + public bool m_disconnecting; + + int cameraNr; + int comPortNr; + int baudRate; + int readTimeout; + string imagesPath; + + Queue readQueue; + ManualResetEvent queueNotEmptyEvent; + + SerialFileIO serialFileIO; + + SerialPort serialPort; + + byte[] singleCharWrBuff; /// predefined serial write buffer for 1 byte + byte[] twoCharsWrBuff; /// predefined serial write buffer for 2 bytes + + #region Content switching, multiplexing + + const byte CTRLZ = 26; + const byte CTRLQ = 17; + const byte XON = 17; + const byte CTRLS = 19; + const byte XOFF = 19; + + /// + /// Multiplexed channel content ID (destination ID) + /// + enum Mux + { + Console, /// Command console, identified by CTRLZ + 'C' byte sequence + File, /// File download (ICD camera -> file), identified by CTRLZ = 'F' byte sequence + } + + Mux lastWriteContentId; + Mux currentReadContentId; + bool lastReadCtrlZ; + + #endregion + + /// + /// Create a SerialLayer instance. + /// + /// 0-based camera number + /// COM port number 1..999 + /// Baud rate 57600 or 115200 + /// Read timeout in ms + /// Path to a folder where received files are stored + public SerialLayer(int cameraNr, int comPortNr, int baudRate, int readTimeout, string imagesPath) + { + log.InfoFormat("new SerialLayer(ix={0}, com{1}, {2}Bd, tmout={3}ms, ipath={4})", cameraNr, comPortNr, baudRate, readTimeout, imagesPath); + + this.cameraNr = cameraNr; + this.comPortNr = comPortNr; + this.baudRate = baudRate; + this.readTimeout = readTimeout; + this.imagesPath = imagesPath; + + singleCharWrBuff = new byte[1]; + twoCharsWrBuff = new byte[2]; + twoCharsWrBuff[0] = CTRLZ; + + m_disconnecting = false; + readQueue = new Queue(); + queueNotEmptyEvent = new ManualResetEvent(false); + + serialPort = new SerialPort(); + serialPort.DataReceived += serialPort_DataReceived; + } + + /// + /// Open the serial port. + /// + /// RetVal.OK or RetVal.CANNOT_OPEN_COMPORT + public RetVal OpenPort() + { + log.Info("OpenPort()"); + + if (serialPort.IsOpen) return RetVal.OK; + + if (comPortNr<1 || comPortNr>999) return RetVal.CannotOpenComPort; + + m_disconnecting = false; + + /// Initialize FIFO, content switching, multiplexing + readQueue.Clear(); + lastWriteContentId = Mux.Console; + currentReadContentId = Mux.Console; + lastReadCtrlZ = false; + + serialFileIO = new SerialFileIO(cameraNr, imagesPath); + + /// Finally open the serial port + try + { + serialPort.PortName = "COM" + comPortNr.ToString(); + serialPort.BaudRate = baudRate; + serialPort.Parity = Parity.None; + serialPort.DataBits = 8; + serialPort.StopBits = StopBits.One; + serialPort.Handshake = Handshake.None; + serialPort.RtsEnable = true; + serialPort.DtrEnable = true; + + serialPort.ReadTimeout = 1000000; /// Sufficiently large, read timeout is applied to FIFO read + serialPort.WriteTimeout = SerialPort.InfiniteTimeout; + + serialPort.Open(); + } + catch (Exception e) + { + log.Error("Cannot open serial port COM" + comPortNr.ToString(), e); + return RetVal.CannotOpenComPort; + } + + return RetVal.OK; + } + + /// + /// Close the serial port. + /// + public void ClosePort() + { + log.InfoFormat("{0}: ClosePort()", cameraNr); + if (!serialPort.IsOpen) return; + m_disconnecting = true; /// Complete any pending I/O operations + serialPort.Close(); + } + + + public void FifoFlush() + { + lock (readQueue) { readQueue.Clear(); } + } + + public void UnlockLastRead() + { + lock (readQueue) { readQueue.Enqueue((byte)' '); } /// quit infinite fifo.Get() waiting + + } + + /// + /// Serial port data received event handler method + /// + /// SerialPort + /// + void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + byte[] data = new byte[serialPort.BytesToRead]; + serialPort.Read(data, 0, data.Length); + + foreach (byte dat in data) + { + byte b = dat; + + if (lastReadCtrlZ) + { + lastReadCtrlZ = false; + + if (dat == (byte)'C') + { + currentReadContentId = Mux.Console; /// Ctrl-Z + 'C' sequence detected: Mux.Console + continue; + } + if (dat == (byte)'F') + { + currentReadContentId = Mux.File; /// Ctrl-Z + 'F' sequence detected: Mux.File + continue; + } + + if (dat == (byte)'1') b = (byte)XON; /// Ctrl-Z + '1' sequence detected: XON + if (dat == (byte)'2') b = (byte)XOFF; /// Ctrl-Z + '2' sequence detected: XOFF + } + else if (dat == CTRLZ) + { + lastReadCtrlZ = true; + continue; + } + + /// + /// Process demultiplexed data byte b appropriately + /// + if (currentReadContentId == Mux.Console) + { + lock (readQueue) + { + readQueue.Enqueue(b); + queueNotEmptyEvent.Set(); + } + } + else + { + serialFileIO.ProcessByte(b); + } + } + } + + + #region Read from readQueue + + /// + /// Read one byte from the console content FIFO. + /// + /// Received byte + /// RetVal.OK, RetVal.COMM_TIMEOUT or RetVal.SHUTDOWN + public RetVal ReadByte(out byte response) + { + if (g_shutDown || m_disconnecting) + { + response = 0; + log.DebugFormat("{0}: ReadByte() returns RetVal.SHUTDOWN", cameraNr); + return RetVal.ShutdownInProgress; + } + + lock (readQueue) + { + if (readQueue.Count > 0) + { + response = readQueue.Dequeue(); + return RetVal.OK; + } + else + { + queueNotEmptyEvent.Reset(); + } + } + + if (queueNotEmptyEvent.WaitOne(readTimeout)) + { + lock (readQueue) + { + response = readQueue.Dequeue(); + return RetVal.OK; + } + } + else + { + response = 0; + log.ErrorFormat("{0}: ReadByte() returns RetVal.COMM_TIMEOUT", cameraNr); + return RetVal.CommTimeout; + } + } + + /// + /// Read bytes and form the output string until a delimiter character is received. + /// Output string excludes the delimiter. + /// + /// Delimiter character + /// Output string + /// RetVal.OK, RetVal.COMM_TIMEOUT or RetVal.SHUTDOWN + RetVal ReadUntil(char delimiter, out string output) + { + StringBuilder buffer = new StringBuilder(); + + while (true) + { + RetVal retv; + byte znak; + + if (RetVal.OK != (retv = ReadByte(out znak))) + { + output = buffer.ToString(); /// Copy data received so far to the output + log.Error("ReadUntil('" + delimiter.ToString() + "', out \"" + output + "\") returns " + retv.ToString()); + return retv; /// Communication error + } + char c = (char)znak; + if (c == delimiter) break; + buffer.Append(c); + } + + output = buffer.ToString(); + return RetVal.OK; + } + + /// + /// Read bytes and form the output string until "\r\n" is received. + /// Output string excludes "\r\n". + /// + /// Output string + /// RetVal.OK, RetVal.COMM_TIMEOUT, RetVal.COMM_ERROR or RetVal.SHUTDOWN + RetVal ReadLine(out string output) + { + RetVal retv = ReadUntil('\r', out output); + if (retv != RetVal.OK) return retv; + + /// Read the expected '\n' + byte znak; + if (RetVal.OK != (retv = ReadByte(out znak))) return retv; + if (znak != (byte)'\n') + { + log.Error("ReadLine(out \"" + output + "\") returns " + retv.ToString()); + return RetVal.CommError; + } + + return RetVal.OK; + } + + #endregion + + + #region Write to serial port + + /// + /// Write one byte (console content) to the serial port. + /// + /// Byte to send + public void WriteByte(byte b) + { + WriteByte_Mux(b, Mux.Console); + } + + /// + /// Write one byte from any source (either console or file) to the serial port. + /// Perform multiplexing - expansion to escape sequences using CTRLZ. + /// + /// Byte to send + /// Mux.Console or Mux.File + void WriteByte_Mux(byte b, Mux contentId) + { + if (contentId != lastWriteContentId) + { + /// Switching contentId when writing to a camera is not supported yet, + /// therefore this code within { } wont be invoked right now. + + /// Send the content switch command CTRLZ + contentId + twoCharsWrBuff[1] = (contentId == Mux.Console) ? (byte)'C' : (byte)'F'; + serialPort.Write(twoCharsWrBuff, 0, 2); + lastWriteContentId = contentId; + return; + } + + if (b == CTRLZ) + { + /// If 'b'=CTRLZ send CTRLZ + CTRLZ + twoCharsWrBuff[1] = CTRLZ; + serialPort.Write(twoCharsWrBuff, 0, 2); + return; + } + else if (b == XON) + { + /// If 'b'=XON send CTRLZ + '1' + twoCharsWrBuff[1] = (byte)'1'; + serialPort.Write(twoCharsWrBuff, 0, 2); + return; + } + else if (b == XOFF) + { + /// If 'b'=XON send CTRLZ + '2' + twoCharsWrBuff[1] = (byte)'2'; + serialPort.Write(twoCharsWrBuff, 0, 2); + return; + } + else + { + /// Send a single regular byte 'b' + singleCharWrBuff[0] = b; + serialPort.Write(singleCharWrBuff, 0, 1); + return; + } + } + + /// + /// Write a string (console content) to the serial port. + /// + /// String to send + public void WriteString(string str) + { + if (str == null) return; /// There is nothing to send - return + + if (str.EndsWith("\r\n")) + { + log.InfoFormat("{0}: WriteString(\"{1}\\r\\n\")", cameraNr, str.Substring(0, str.Length - 2)); + } + else + { + log.InfoFormat("{0}: WriteString(\"{1}\")", cameraNr, str); + } + + for (int i = 0; i < str.Length; i++) WriteByte((byte)str[i]); + } + + #endregion + + +//------------------------------------------------------------------------------- +///////////////////////// Higher level console commands /////////////////////// +//------------------------------------------------------------------------------- + + //--------------------------------------------------------------------------- + // Sends the specified command and waits for the following response. + // strings separated by spaces and terminated by + // Stores response into an array of CStrings pointed by pStrArray. + // + // Returns: + // positive numbers and 0 + // The number of fields in the response. Returned number may be + // greater then arrayLen. Only the first arrayLen strings are saved. + // negative numbers + // negative error code returned by lower level functions: + // -RetVal.COMM_TIMEOUT = timeout occurred + // -RetVal.COMM_ERROR = all other errors + //--------------------------------------------------------------------------- + public int CommandStr(string cmd, out string[] strArray, int nrFields, out string remaining) + { + StringBuilder tmp = new StringBuilder(); + StringBuilder logStr = new StringBuilder(); + StringBuilder rem = new StringBuilder(); + + lock (readQueue) { readQueue.Clear(); } + WriteString(cmd); /// send + + strArray = null; + remaining = String.Empty; + + string beforeGT; + RetVal retv = ReadUntil('>', out beforeGT); + if (retv != RetVal.OK) return -(int)retv; /// If Read... fails quit the loop ... + /// ... and return negative error code + /// Read the expected ' ' + byte znak; + if (RetVal.OK != (retv = ReadByte(out znak))) return -(int)retv; + if (znak != (byte)' ') return -(int)RetVal.CommError; + + /// Read fields after '>', parse the first field (the return code) + string received; + retv = ReadLine(out received); + if (retv != RetVal.OK) return -(int)retv; + strArray = received.Split(new char[] { ' ' }, nrFields + 1); + + log.InfoFormat("{0}: Received: > {1}", cameraNr, received); + + /// Skip until '$' received + retv = ReadUntil('$', out received); + if (retv != RetVal.OK) return -(int)retv; + + /// Parse the return code (the 1st field) + int returnCode; + if (!int.TryParse(strArray[0], out returnCode) || returnCode < 0) return returnCode; + + if (strArray.GetLength(0) == nrFields + 1) remaining = strArray[nrFields]; + + return Math.Min(strArray.GetLength(0), nrFields); + } + + //--------------------------------------------------------------------------- + // Sends the specified command and waits for the following response. + // integers separated by spaces and terminated by + // Stores response into an integer array pointed by pIntArray; + // + // Returns: + // positive numbers and 0 + // The number of fields in the response. Returned number may be + // greater then arrayLen. Only the first arrayLen strings are saved. + // negative numbers + // negative error code returned by lower level functions + //--------------------------------------------------------------------------- + public int CommandInt(string cmd, out int[] intArray, int nrFields, out string remaining) + { + string[] strArray; + int retv = CommandStr(cmd, out strArray, nrFields, out remaining); + + if (retv <= 0) + { + intArray = null; + return retv; + } + + intArray = new int[retv]; + for (int i = 0; i < retv; i++) + { + int.TryParse(strArray[i], out intArray[i]); + } + + return retv; + } + + //--------------------------------------------------------------------------- + // Sends the specified command and waits for the following response. + // real numbers separated by spaces and terminated by + // Stores response into a double array pointed by pDblArray; + // + // Returns: + // positive numbers and 0 + // The number of fields in the response. Returned number may be + // greater then arrayLen. Only the first arrayLen strings are saved. + // negative numbers + // negative error code returned by lower level functions + //--------------------------------------------------------------------------- + public int CommandDbl(string cmd, out double[] dblArray, int arrayLen, out string remaining) + { + string[] strArray; + int retv = CommandStr(cmd, out strArray, arrayLen, out remaining); + + if (retv <= 0) + { + dblArray = null; + return retv; + } + + dblArray = new double[retv]; + for (int i = 0; i < retv; i++) + { + double.TryParse(strArray[i], out dblArray[i]); + } + + return retv; + } + + /// + /// Get camera version string + /// + /// Version string + /// RetVal.OK, RetVal.COMM_TIMEOUT, RetVal.COMM_ERROR, RetVal.SHUTDOWN or a camera ret.code (1..999) + public RetVal GetVer(out string versionStr) + { + log.DebugFormat("{0}: GetVer()", cameraNr); + + versionStr = String.Empty; + StringBuilder tmp = new StringBuilder(); + const int arrayLen = 1; + string[] strArray = new string[arrayLen]; + + lock (readQueue) { readQueue.Clear(); } + + WriteString("info\r\n"); /// Send + + /// Read info message until '>' + string infoMessage; + RetVal retv = ReadUntil('>', out infoMessage); + if (retv != RetVal.OK) return retv; + log.DebugFormat("{0}: InfoMessage: {1}", cameraNr, infoMessage); + + /// Read the expected ' ' + byte znak; + if (RetVal.OK != (retv = ReadByte(out znak))) return retv; + if (znak != (byte)' ') return RetVal.CommError; + + /// Read fields after '>', parse the first field (the return code) + string tempStr; + retv = ReadLine(out tempStr); + if (retv != RetVal.OK) return retv; + string[] fields = tempStr.Split(new char[] { ' ' }, 2); + int returnCode; + if (!int.TryParse(fields[0], out returnCode) || returnCode < 0) return (RetVal)(-returnCode); + + /// Skip until '$' received + retv = ReadUntil('$', out tempStr); + if (retv != RetVal.OK) return retv; + + /// Parse the infoMessage + int pos1 = infoMessage.IndexOf("version = "); + if (pos1 != -1) + { + pos1 += "version = ".Length; + int pos2 = infoMessage.IndexOf("\r\n", pos1); + versionStr = infoMessage.Substring(pos1, pos2 - pos1); + + log.InfoFormat("{0}: GetVer(out \"" + versionStr + "\")", cameraNr); + return RetVal.OK; + } + + log.ErrorFormat("{0}: GetVer(...) returns RetVal.OP_FAILED", cameraNr); + return RetVal.CommError; /// Cannot read the version string + } + + //---------------------------------------------------------------------------- + // Check if livestream of serial characters is coming. + // + // Returns: + // RetVal.OK ..... not (OK), + // RetVal.BUSY ... yes (camera needs to be restarted) + //---------------------------------------------------------------------------- + RetVal CheckLiveStream() + { + byte znak; + + // 500 characters without timeout = stream + // copyright message is +/-350 characters long + + for (int i=0; i<500; i++) + { + if (RetVal.CommTimeout == ReadByte(out znak)) return RetVal.OK; /// timeout ... no stream (OK) + } + +#if true + // try to stop the stream + lock (readQueue) { readQueue.Clear(); } + + WriteString("\r\nstopstream\r\n"); + while (RetVal.CommTimeout != ReadByte(out znak)) { }; + return RetVal.OK; +#else + // just report a running stream (RetVal.Busy) + return RetVal.Busy; +#endif + } + + } +} diff --git a/TestBenchFramework/BenchControl/ComponentBase.cs b/TestBenchFramework/BenchControl/ComponentBase.cs new file mode 100644 index 000000000..8777eee58 --- /dev/null +++ b/TestBenchFramework/BenchControl/ComponentBase.cs @@ -0,0 +1,46 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl +{ + public class ComponentBase : IComponent + { + Generic.IComponentCfg cfg; + public Generic.IComponentCfg Cfg { get { return cfg; } } + + /// Constructor + public ComponentBase(Generic.IComponentCfg cfg) + { + this.cfg = cfg; + } + + + public string Name { get { return Cfg.Name; } } + + + /// + /// Reference to an object with procedure parameters + /// + public IParamsProvider ProcedureParams; + /// + public void GetProcedureParams(TBF.Entities.Procedure procedure) + { + if (Cfg.Factory.HasProcedureParams) + { + ProcedureParams = TbfComponents.GetProcedureParams(this, procedure); + } + } + + /// + /// Reference to an object with test parameters + /// + public IParamsProvider TestParams; + /// + public void GetTestParams(TBF.Entities.Test test) + { + if (Cfg.Factory.HasTestParams) + { + TestParams = TbfComponents.GetTestParams(this, test); + } + } + } +} diff --git a/TestBenchFramework/BenchControl/ComponentCfgBase.cs b/TestBenchFramework/BenchControl/ComponentCfgBase.cs new file mode 100644 index 000000000..faa901196 --- /dev/null +++ b/TestBenchFramework/BenchControl/ComponentCfgBase.cs @@ -0,0 +1,87 @@ +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace TBF.BenchControl +{ + public class ComponentCfgBase + { + [XmlIgnore] + public string Name + { + get { return name; } + set { name = value; } + } + string name; + + [XmlIgnore] + public Generic.IComponentFactory Factory + { + get { return factory; } + set { factory = value; } + } + Generic.IComponentFactory factory; + + [XmlIgnore] + public string ParentName + { + get { return parentName; } + set { parentName = value; } + } + string parentName; + + [XmlIgnore] + public int ItemNr + { + get { return itemNr; } + set { itemNr = value; } + } + int itemNr; + + [XmlIgnore] + public Entities.DebugMode DebugLevel + { + get { return debugLevel; } + set { debugLevel = value; } + } + Entities.DebugMode debugLevel; + + [XmlIgnore] + public Entities.LogLevel LogLevel { get { return logLevel; } } + Entities.LogLevel logLevel; + + [XmlIgnore] + public IList Corrections { get { return corrections; } } + IList corrections; + + protected ComponentCfgBase() + { + itemNr = 0; + debugLevel = Entities.DebugMode.Normal; + logLevel = Entities.LogLevel.Off; + } + + protected ComponentCfgBase(Generic.IComponentFactory factory, string name) + : this() + { + this.factory = factory; + this.name = name; + } + + protected ComponentCfgBase(Generic.IComponentFactory factory, string name, string parentName) + : this(factory, name) + { + this.parentName = parentName; + } + + protected void InitCfgBaseFromEntity(Entities.Component cmpntEntity, Generic.IComponentFactory factory) + { + name = cmpntEntity.Name; + parentName = cmpntEntity.ParentName; + itemNr = cmpntEntity.ItemNr; + debugLevel = cmpntEntity.Mode; + logLevel = cmpntEntity.Logging; + corrections = cmpntEntity.Corrections; + this.factory = factory; + } + } +} diff --git a/TestBenchFramework/BenchControl/Constants.cs b/TestBenchFramework/BenchControl/Constants.cs new file mode 100644 index 000000000..5e865ecce --- /dev/null +++ b/TestBenchFramework/BenchControl/Constants.cs @@ -0,0 +1,12 @@ + +namespace TBF.BenchControl +{ + public static class Constants + { + /// + /// A fraction of the tank volume that is considered to be safe. + /// When the estimated test end tank volume exceeds this fraction, tank emptying is forced. + /// + public const float TankFullFactor = 0.9f; + } +} diff --git a/TestBenchFramework/BenchControl/Current.cs b/TestBenchFramework/BenchControl/Current.cs new file mode 100644 index 000000000..c298d3852 --- /dev/null +++ b/TestBenchFramework/BenchControl/Current.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TBF.Entities; + +namespace TBF.BenchControl +{ + /// + /// This class keeps the current values used or measured by the test bench. + /// + public class Current + { + /// + /// Procedure, Tests and TestResults data + /// + public static Procedure Procedure; + + public static Test Test; + public static int TestId = 0; + + public static TestResult TestResult; + public static int TestResultId = 0; + + /// + /// Measured data + /// + public static double StartMass; + public static double StopMass; + + static Current() + { + } + + /// Constructor + public Current() + { + /// There should always be some raw data + } + + /// + /// Processes current 'tick' data during measurement. + /// + public static void ProcessTickData() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.Designer.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.Designer.cs new file mode 100644 index 000000000..4f767145b --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.Designer.cs @@ -0,0 +1,193 @@ +namespace TBF.BenchControl.DataEntry.Munich +{ + partial class CycleBeginningForm + { + /// + /// 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 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.okButton = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.mainStateTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.mainSnTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.auxStateTextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.auxSnTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // okButton + // + this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.okButton.ForeColor = System.Drawing.Color.Black; + this.okButton.Location = new System.Drawing.Point(439, 27); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(98, 63); + this.okButton.TabIndex = 0; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.mainStateTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.mainSnTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox1.ForeColor = System.Drawing.Color.Black; + this.groupBox1.Location = new System.Drawing.Point(28, 18); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(376, 92); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Hauptzähler"; + // + // mainStateTextBox + // + this.mainStateTextBox.Location = new System.Drawing.Point(183, 56); + this.mainStateTextBox.Name = "mainStateTextBox"; + this.mainStateTextBox.Size = new System.Drawing.Size(163, 31); + this.mainStateTextBox.TabIndex = 3; + this.mainStateTextBox.Visible = false; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(18, 59); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 23); + this.label2.TabIndex = 2; + this.label2.Text = "Stand:"; + this.label2.Visible = false; + // + // mainSnTextBox + // + this.mainSnTextBox.Location = new System.Drawing.Point(183, 37); + this.mainSnTextBox.Name = "mainSnTextBox"; + this.mainSnTextBox.Size = new System.Drawing.Size(163, 31); + this.mainSnTextBox.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(18, 40); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(159, 23); + this.label1.TabIndex = 0; + this.label1.Text = "Seriennummer:"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.auxStateTextBox); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.auxSnTextBox); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox2.ForeColor = System.Drawing.Color.Black; + this.groupBox2.Location = new System.Drawing.Point(28, 135); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(376, 92); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Nebenzähler"; + // + // auxStateTextBox + // + this.auxStateTextBox.Location = new System.Drawing.Point(183, 54); + this.auxStateTextBox.Name = "auxStateTextBox"; + this.auxStateTextBox.Size = new System.Drawing.Size(163, 31); + this.auxStateTextBox.TabIndex = 3; + this.auxStateTextBox.Visible = false; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(18, 57); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(74, 23); + this.label3.TabIndex = 2; + this.label3.Text = "Stand:"; + this.label3.Visible = false; + // + // auxSnTextBox + // + this.auxSnTextBox.Location = new System.Drawing.Point(183, 37); + this.auxSnTextBox.Name = "auxSnTextBox"; + this.auxSnTextBox.Size = new System.Drawing.Size(163, 31); + this.auxSnTextBox.TabIndex = 1; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(18, 40); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(159, 23); + this.label4.TabIndex = 0; + this.label4.Text = "Seriennummer:"; + // + // CycleBeginningForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.Color.DarkGoldenrod; + this.ClientSize = new System.Drawing.Size(569, 255); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.okButton); + this.ForeColor = System.Drawing.Color.Black; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "CycleBeginningForm"; + this.Text = "Daten"; + this.TopMost = true; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox mainStateTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox mainSnTextBox; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox auxStateTextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox auxSnTextBox; + private System.Windows.Forms.Label label4; + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.cs new file mode 100644 index 000000000..0e95d5c51 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.cs @@ -0,0 +1,36 @@ +using System; +using System.Windows.Forms; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted + { + // To be retrieved after the form closes + public string MainSNText; + public string AuxSNText; + public string MainStateText; + public string AuxStateText; + + // Set to 'true' when the form closes + public bool Completed { get { return completed; } } + bool completed; + + public CycleBeginningForm() + { + InitializeComponent(); + completed = false; + // TODO: localize strings + } + + private void okButton_Click(object sender, EventArgs e) + { + MainSNText = mainSnTextBox.Text; + AuxSNText = auxSnTextBox.Text; + MainStateText = mainStateTextBox.Text; + AuxStateText = auxStateTextBox.Text; + + completed = true; + Close(); + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.resx b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleBeginningForm.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/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.Designer.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.Designer.cs new file mode 100644 index 000000000..31157a9d4 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.Designer.cs @@ -0,0 +1,264 @@ +namespace TBF.BenchControl.DataEntry.Munich +{ + partial class CycleEndForm + { + /// + /// 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 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.groupBox2 = new System.Windows.Forms.GroupBox(); + this.auxStateTextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.mainStateTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); + this.qFallTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.qRiseTextBox = new System.Windows.Forms.TextBox(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.auxStateTextBox); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox2.ForeColor = System.Drawing.Color.Black; + this.groupBox2.Location = new System.Drawing.Point(25, 123); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(362, 81); + this.groupBox2.TabIndex = 4; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Nebenzähler"; + // + // auxStateTextBox + // + this.auxStateTextBox.Location = new System.Drawing.Point(183, 31); + this.auxStateTextBox.Name = "auxStateTextBox"; + this.auxStateTextBox.Size = new System.Drawing.Size(163, 31); + this.auxStateTextBox.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(18, 34); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(74, 23); + this.label3.TabIndex = 2; + this.label3.Text = "Stand:"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.mainStateTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox1.ForeColor = System.Drawing.Color.Black; + this.groupBox1.Location = new System.Drawing.Point(25, 23); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(362, 81); + this.groupBox1.TabIndex = 3; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Hauptzähler"; + // + // mainStateTextBox + // + this.mainStateTextBox.Location = new System.Drawing.Point(183, 31); + this.mainStateTextBox.Name = "mainStateTextBox"; + this.mainStateTextBox.Size = new System.Drawing.Size(163, 31); + this.mainStateTextBox.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(18, 34); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 23); + this.label2.TabIndex = 2; + this.label2.Text = "Stand:"; + // + // okButton + // + this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.okButton.ForeColor = System.Drawing.Color.Black; + this.okButton.Location = new System.Drawing.Point(425, 33); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(98, 63); + this.okButton.TabIndex = 5; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.radioButton3); + this.groupBox3.Controls.Add(this.radioButton2); + this.groupBox3.Controls.Add(this.radioButton1); + this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox3.Location = new System.Drawing.Point(25, 223); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(362, 142); + this.groupBox3.TabIndex = 6; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Protokoll"; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Location = new System.Drawing.Point(34, 100); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(152, 27); + this.radioButton3.TabIndex = 2; + this.radioButton3.TabStop = true; + this.radioButton3.Text = "radioButton3"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(34, 67); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(152, 27); + this.radioButton2.TabIndex = 1; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "radioButton2"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(34, 34); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(152, 27); + this.radioButton1.TabIndex = 0; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "radioButton1"; + this.radioButton1.UseVisualStyleBackColor = true; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.label4); + this.groupBox4.Controls.Add(this.qFallTextBox); + this.groupBox4.Controls.Add(this.label1); + this.groupBox4.Controls.Add(this.qRiseTextBox); + this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox4.Location = new System.Drawing.Point(25, 383); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(361, 125); + this.groupBox4.TabIndex = 7; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Umschaltpunkte"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(18, 79); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(64, 23); + this.label4.TabIndex = 7; + this.label4.Text = "Qfall:"; + // + // qFallTextBox + // + this.qFallTextBox.Location = new System.Drawing.Point(183, 77); + this.qFallTextBox.Name = "qFallTextBox"; + this.qFallTextBox.Size = new System.Drawing.Size(163, 31); + this.qFallTextBox.TabIndex = 6; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(18, 37); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(80, 23); + this.label1.TabIndex = 5; + this.label1.Text = "Qsteig:"; + // + // qRiseTextBox + // + this.qRiseTextBox.Location = new System.Drawing.Point(183, 34); + this.qRiseTextBox.Name = "qRiseTextBox"; + this.qRiseTextBox.Size = new System.Drawing.Size(163, 31); + this.qRiseTextBox.TabIndex = 4; + // + // CycleEndForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.DarkGoldenrod; + this.ClientSize = new System.Drawing.Size(559, 530); + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.okButton); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "CycleEndForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Daten"; + this.TopMost = true; + this.Load += new System.EventHandler(this.CycleEndForm_Load); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox auxStateTextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox mainStateTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox qFallTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox qRiseTextBox; + + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.cs new file mode 100644 index 000000000..2e9c0801f --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.cs @@ -0,0 +1,55 @@ +using System; +using System.Windows.Forms; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public partial class CycleEndForm : Form, GenericDevices.IHasCompleted + { + // To be set before the form opens + public string ProtocolName1; + public string ProtocolName2; + public string ProtocolName3; + + // To be retrieved after the form closes + public string MainStateText; + public string AuxStateText; + public string ProtocolTitle; + + // Set to 'true' when the form closes + public bool Completed { get { return completed; } } + bool completed; + + public CycleEndForm() + { + InitializeComponent(); + completed = false; + // TODO: localize strings + } + + private void CycleEndForm_Load(object sender, EventArgs e) + { + radioButton1.Text = ProtocolName1; + radioButton2.Text = ProtocolName2; + radioButton3.Text = ProtocolName3; + qRiseTextBox.Text = Sequences.SequenceBase.Qrise.ToString("F3"); + qFallTextBox.Text = Sequences.SequenceBase.Qfall.ToString("F3"); + } + + private void okButton_Click(object sender, EventArgs e) + { + MainStateText = mainStateTextBox.Text; + AuxStateText = auxStateTextBox.Text; + + float umsch; + if (Utils.TryParseUFloat(qRiseTextBox.Text, out umsch)) Sequences.SequenceBase.Qrise = umsch; + if (Utils.TryParseUFloat(qFallTextBox.Text, out umsch)) Sequences.SequenceBase.Qfall = umsch; + + if (radioButton1.Checked) ProtocolTitle = ProtocolName1; + else if (radioButton2.Checked) ProtocolTitle = ProtocolName2; + else if (radioButton3.Checked) ProtocolTitle = ProtocolName3; + + completed = true; + Close(); + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.resx b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/CycleEndForm.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/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs new file mode 100644 index 000000000..264d4913c --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public class EntryForm : Generic.IComponent, IOperation, GenericDevices.IDataEntry, GenericDevices.IHasProtocolTitle + { + readonly EntryFormCfg entryFormCfg; + public Generic.IComponentCfg Cfg { get { return entryFormCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return entryFormCfg.Name; } } + + /// + /// Properties set by the Begin and the End form + /// + public string MainBeginStateText { get { return mainBeginStateText; } } + string mainBeginStateText; + + public string AuxBegintateText { get { return auxBeginStateText; } } + string auxBeginStateText; + + public string ProtocolTitle { get { return protocolTitle; } } + string protocolTitle; + + + System.Windows.Forms.Form modelessDlg; + + IList waterMeters; + + public enum CurrentOp + { + None, + ShowFormAtCycleBeginning, + ShowFormAtCycleEnd, + } + + CurrentOp currentOp; + + public EntryForm(EntryFormCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.entryFormCfg = cfg; + currentOp = CurrentOp.None; + } + + /// Reference to the operation + public IOperation ShowFormAtCycleBeginningOp(IList waterMeters) + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.ShowFormAtCycleBeginning; + this.waterMeters = waterMeters; + return this; + } + + /// Reference to the operation + public IOperation ShowFormAtCycleEndOp(IList waterMeters) + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.ShowFormAtCycleEnd; + this.waterMeters = waterMeters; + return this; + } + + delegate void EntryFormDlgt(EntryForm myRef); + /// + void OpenBeginningDlg(EntryForm myRef) + { + myRef.modelessDlg = new CycleBeginningForm(); + modelessDlg.Show(); + } + /// + void OpenEndDlg(EntryForm myRef) + { + CycleEndForm endForm = new CycleEndForm(); + endForm.ProtocolName1 = entryFormCfg.ProtocolTitle1; + endForm.ProtocolName2 = entryFormCfg.ProtocolTitle2; + endForm.ProtocolName3 = entryFormCfg.ProtocolTitle3; + myRef.modelessDlg = endForm; + modelessDlg.Show(); + } + + /// Start this operation + public void Start() + { + switch (currentOp) + { + case CurrentOp.ShowFormAtCycleBeginning: + Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + break; + case CurrentOp.ShowFormAtCycleEnd: + Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this); + break; + } + } + + /// Run this operation + /// Event.ResultsPrinted + public Event Run() + { + if (!(modelessDlg as GenericDevices.IHasCompleted).Completed) return Event.None; + + if (modelessDlg is CycleBeginningForm) + { + if (waterMeters.Count >= 1 && waterMeters[0] != null) + { + mainBeginStateText = (modelessDlg as CycleBeginningForm).MainStateText; + waterMeters[0].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText; + } + if (waterMeters.Count >= 2 && waterMeters[1] != null) + { + auxBeginStateText = (modelessDlg as CycleBeginningForm).AuxStateText; + waterMeters[1].SerialNr = (modelessDlg as CycleBeginningForm).AuxSNText; + } + } + else + { + if (waterMeters.Count >= 1 && waterMeters[0] != null) + { + waterMeters[0].State = (modelessDlg as CycleEndForm).MainStateText; + } + if (waterMeters.Count >= 2 && waterMeters[1] != null) + { + waterMeters[1].State = (modelessDlg as CycleEndForm).AuxStateText; + } + protocolTitle = (modelessDlg as CycleEndForm).ProtocolTitle; + } + return Event.Done; + } + + /// Stop this operation + public void Stop() + { + modelessDlg = null; + currentOp = CurrentOp.None; + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfg.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfg.cs new file mode 100644 index 000000000..888918a2f --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfg.cs @@ -0,0 +1,62 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg + { + public string ProtocolTitle1; + public string ProtocolTitle2; + public string ProtocolTitle3; + + /// Parameterless constructor + public EntryFormCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public EntryFormCfg(IComponentFactory factory, string name, + string protocolTitle1, string protocolTitle2, string protocolTitle3) + : base(factory, name) + { + this.ProtocolTitle1 = protocolTitle1; + this.ProtocolTitle2 = protocolTitle2; + this.ProtocolTitle3 = protocolTitle3; + } + + public IComponentCfg Clone() + { + return new EntryFormCfg(Factory, Name, ProtocolTitle1, ProtocolTitle2, ProtocolTitle3); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + EntryFormCfg config = (EntryFormCfg)(new XmlSerializer(typeof(EntryFormCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.cs new file mode 100644 index 000000000..abf86915a --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.cs @@ -0,0 +1,67 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl)); + + EntryFormCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as EntryFormCfg; + Redraw(); + } + } + + public EntryFormCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + protocolTitle1TextBox.Text = config.ProtocolTitle1; + protocolTitle2TextBox.Text = config.ProtocolTitle2; + protocolTitle3TextBox.Text = config.ProtocolTitle3; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + protocolTitle1TextBox.Enabled = true; + protocolTitle2TextBox.Enabled = true; + protocolTitle3TextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + config.ProtocolTitle1 = protocolTitle1TextBox.Text; + config.ProtocolTitle2 = protocolTitle2TextBox.Text; + config.ProtocolTitle3 = protocolTitle3TextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.designer.cs new file mode 100644 index 000000000..8f0992300 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.designer.cs @@ -0,0 +1,152 @@ +namespace TBF.BenchControl.DataEntry.Munich +{ + partial class EntryFormCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.protocolTitle1TextBox = new System.Windows.Forms.TextBox(); + this.protocolTitle2TextBox = new System.Windows.Forms.TextBox(); + this.protocolTitle3TextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 86); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(74, 13); + this.label1.TabIndex = 6; + this.label1.Text = "Protocol title 1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(27, 112); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 13); + this.label2.TabIndex = 7; + this.label2.Text = "Protocol title 2"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(27, 138); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(74, 13); + this.label3.TabIndex = 8; + this.label3.Text = "Protocol title 3"; + // + // protocolTitle1TextBox + // + this.protocolTitle1TextBox.Enabled = false; + this.protocolTitle1TextBox.Location = new System.Drawing.Point(137, 83); + this.protocolTitle1TextBox.Name = "protocolTitle1TextBox"; + this.protocolTitle1TextBox.Size = new System.Drawing.Size(130, 20); + this.protocolTitle1TextBox.TabIndex = 9; + // + // protocolTitle2TextBox + // + this.protocolTitle2TextBox.Enabled = false; + this.protocolTitle2TextBox.Location = new System.Drawing.Point(137, 109); + this.protocolTitle2TextBox.Name = "protocolTitle2TextBox"; + this.protocolTitle2TextBox.Size = new System.Drawing.Size(130, 20); + this.protocolTitle2TextBox.TabIndex = 10; + // + // protocolTitle3TextBox + // + this.protocolTitle3TextBox.Enabled = false; + this.protocolTitle3TextBox.Location = new System.Drawing.Point(137, 135); + this.protocolTitle3TextBox.Name = "protocolTitle3TextBox"; + this.protocolTitle3TextBox.Size = new System.Drawing.Size(130, 20); + this.protocolTitle3TextBox.TabIndex = 11; + // + // EntryFormCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.protocolTitle3TextBox); + this.Controls.Add(this.protocolTitle2TextBox); + this.Controls.Add(this.protocolTitle1TextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "EntryFormCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox protocolTitle1TextBox; + private System.Windows.Forms.TextBox protocolTitle2TextBox; + private System.Windows.Forms.TextBox protocolTitle3TextBox; + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.resx b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormCfgCtrl.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/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormFactory.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormFactory.cs new file mode 100644 index 000000000..010483299 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryFormFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.DataEntry.Munich +{ + public class EntryFormFactory : IComponentFactory + { + public string ClassName { get { return "DataEntryForm-Munich"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new EntryFormCfg(this, "DataEntryForm-Munich", "Protokoll Werkprüfung", "Protokoll 2", "Protokoll 3"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new EntryFormCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new EntryForm((EntryFormCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return EntryFormCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Common.cs b/TestBenchFramework/BenchControl/Elde/Common.cs new file mode 100644 index 000000000..899b38bc4 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Common.cs @@ -0,0 +1,71 @@ +using System; + +namespace TBF.BenchControl.Elde +{ + public enum Command + { + None = 0, /// Do nothing, just transfer data (route, etc.) + Start = 1, /// Start the measurement + Stop = 2, /// Stop the measurement + } + + public enum StatusP : ulong + { + RefFlowMeterMask = 0x7, + TestInProgress = 0x8, + TestCompleted = 0x10, + DiverterError = 0x20, + MsrmntWithDivrtr = 0x80, + RefPulsesMsrmnt = 0x100, + SynchroMethod = 0x800, + WaterMeterCalib = 0x1000, + EmgcyStopActive = 0x2000, + MsrmntGateActive = 0x4000, + TimeMeasurement = 0x8000, + FrequencyMeasured = 0x80000, + ADCError = 0x80000000, + TimeoutOccured = 0x100000000, + MeretAddresses = 0x200000000, + SampleBuferFull = 0x400000000, + ErrorTempMeter = 0x10000000000, + ErrorPressMeter1 = 0x1000000000000, + ErrorPressMeter2 = 0x2000000000000, + ErrorPressMeter3 = 0x4000000000000, + ErrorPressMeter4 = 0x8000000000000, + } + + public enum StopDevs + { + None = 0, + Reference = 0x01, + Diverter = 0x02, + GatePulse = 0x08, + TimeMeasurement = 0x10, + BypassDevCoupled2Div = 0x20, + RegValveRegulation = 0x80, + All = 0xFF, + } + + public enum TestMethods + { + Diverter = 0x01, /// 0x01 = Mass method (diverters are used), 0 = Volume method + FixedStart = 0x02, + Synchro = 0x04, /// 0x02 = Synchro method, 0 = Pulse counting + } + + public enum RegulValveMode : byte + { + None = 0, + PulseWidth = 1, /// Pulse width 0.05 .. 2 sec. + TargetPosition = 2, /// Low and high position (=DAC value) limits (0..100%) are specified + TargetFrequency = 3, /// Low and high frequency limits (0..2000Hz,0..2200Hz) are specified + Stop = 4, /// Stop regulation + } + + public enum RegulValveState + { + Idle = 0, + PwOrFreqRegul = 2, + DacValueRegul = 3, + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardCfg.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardCfg.cs new file mode 100644 index 000000000..69e8f9842 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardCfg.cs @@ -0,0 +1,52 @@ +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde +{ + public class ControlBoardCfg : ComponentCfgBase, IComponentCfg + { + public int ComPortNr; + + /// Parameterless constructor + public ControlBoardCfg() + { + } + /// Constructor + public ControlBoardCfg(IComponentFactory factory, string name, int comPortNr) + : base(factory, name) + { + this.ComPortNr = comPortNr; + } + + public IComponentCfg Clone() + { + return new ControlBoardCfg(Factory, Name, ComPortNr); + } + + public string ToString(int i) + { + return string.Format("COM{0}", ComPortNr); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component tbfComponent, IComponentFactory factory) + { + using (var reader = new StringReader(tbfComponent.Parameters)) + { + ControlBoardCfg config = (ControlBoardCfg)(new XmlSerializer(typeof(ControlBoardCfg))).Deserialize(reader); + config.Name = tbfComponent.Name; + config.InitCfgBaseFromEntity(tbfComponent, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.Designer.cs new file mode 100644 index 000000000..93f45b4ba --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.Designer.cs @@ -0,0 +1,106 @@ +namespace TBF.BenchControl.Elde +{ + partial class ControlBoardCfgCtrl + { + /// + /// 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() + { + this.label1 = new System.Windows.Forms.Label(); + this.comPortNrTextBox = new System.Windows.Forms.TextBox(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.nameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(44, 113); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Serial Port Number:"; + // + // comPortNrTextBox + // + this.comPortNrTextBox.Enabled = false; + this.comPortNrTextBox.Location = new System.Drawing.Point(154, 110); + this.comPortNrTextBox.Name = "comPortNrTextBox"; + this.comPortNrTextBox.Size = new System.Drawing.Size(105, 20); + this.comPortNrTextBox.TabIndex = 1; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(151, 45); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 2; + this.classNameLabel.Text = "ComonentName"; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(44, 79); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 3; + this.nameLabel.Text = "Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(154, 76); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(105, 20); + this.nameTextBox.TabIndex = 4; + // + // ControlBoardCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.comPortNrTextBox); + this.Controls.Add(this.label1); + this.Name = "ControlBoardCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.ControlBoardCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox comPortNrTextBox; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.TextBox nameTextBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.cs new file mode 100644 index 000000000..31100cbbc --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.cs @@ -0,0 +1,75 @@ +using System; +using System.Windows.Forms; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde +{ + public partial class ControlBoardCfgCtrl : UserControl, IComponentCfgCtrl + { + ControlBoardCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as ControlBoardCfg; + Redraw(); + } + } + + public ControlBoardCfgCtrl() + { + InitializeComponent(); + } + + private void ControlBoardCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + comPortNrTextBox.Text = config.ComPortNr.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + comPortNrTextBox.Enabled = true; + } + + /// + /// Verify current user controls for validity. + /// Called when user wants to close/save the configuration. + /// + /// See VerifyFlags + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!int.TryParse(comPortNrTextBox.Text, out dummy) || dummy <= 0 || dummy > 999) + { + message += "Control board serial port number is invalid"; + flags |= CfgVerifyFlags.Error; + } + + return flags; + } + + /// + /// Save settings to the configuration class. + /// + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + /// + this.Name = nameTextBox.Text; + this.config.ComPortNr = int.Parse(comPortNrTextBox.Text); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardCfgCtrl.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/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs new file mode 100644 index 000000000..42bdecdf1 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs @@ -0,0 +1,334 @@ +using System; +using System.Text; +using System.IO.Ports; +using System.Collections.Generic; +using TBF.BenchControl.Generic; +using TBF.BenchControl.GenericDevices; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class ControlBoardDev : IComponent, IDevice, IValveControl + { + /// + /// Info: + /// Warn: + /// Error: + /// + private static readonly ILog log = LogManager.GetLogger(typeof(ControlBoardDev)); + public override string ToString() { return string.Format("ControlBoardDev on com{0}", controlBoardCfg.ComPortNr); } + + public static void ResetStaticProperties() { } + + ControlBoardCfg controlBoardCfg; + public Generic.IComponentCfg Cfg { get { return controlBoardCfg; } } + + public string Name { get { return controlBoardCfg.Name; } } + + + /// + /// Reference to the control board component + /// + IControlCom controlCom; + + /// + /// Emergency stop signal state updated by RunDevice(). + /// 'modelessDlg' is notified about the changes and uses this information to change its visibility. + /// + //UiBridge.EmergencyStopEventArgs.State emergencyStopState; + + + /// + /// Public read only wrappers for Elde software component fields + /// + /// rvNr1 = 1 .. nrRegulValves (one based) + /// wmNr0 = 0 .. nrWaterMeters-1 (zero based) + /// tmpNr0 = 0 .. nrTempMeters-1 (zero based) + /// prsNr0 = 0 .. nrPressureMeters-1 (zero based) + /// + public StatusP StatusP { get { return controlCom.StatusP; } } + public float ReferenceFreq { get { return controlCom.ReferenceFreq; } } /// In [Hz] 0..2500, nom.=2000 + public int EtPulses(int wmNr0) { return controlCom.EtPulses(wmNr0); } + public int WMeterPulses(int wmNr0) { return controlCom.WMeterPulses(wmNr0); } + public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); } + public uint RegulValveDAC { get { return controlCom.RegulValveDAC; } } + public float Pressure(int prsNr0) { return controlCom.Pressure(prsNr0); } + public float Temperature(int tmpNr0) { return controlCom.Temperature(tmpNr0); } + public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)controlCom.RegulValveState(rvNr1); } + public ulong RRoute { get { return controlCom.RRoute; } } + public uint DivTime { get { return controlCom.DivTime; } } + public float TTime { get { return controlCom.TTime; } } + public uint FmState { get { return controlCom.FmState; } } + public uint BeginState(int wmNr0) { return controlCom.BeginState(wmNr0); } + public float ReferenceFlow { get { return controlCom.ReferenceFlow; } } + public float RValvePosition(int rvNr1) { return controlCom.RValvePosition(rvNr1); } + public float DivSamples(int ms) { return controlCom.DivSamples(ms); } + public int ScopeSamples(int i, int j, int k) { return controlCom.ScopeSamples(i, j, k); } + public uint DigitalInputs { get { return controlCom.DigitalInputs; } } + public float AnalogInput(int adcNr0) { return controlCom.AnalogInput(adcNr0); } + public uint AnalogInputRaw(int adcNr0, int bank) { return controlCom.AnalogInputRaw(adcNr0, bank); } /// bank0=RV, bank1=Temp + public float ReferenceVolume { get { return controlCom.ReferenceVolume; } } + public float VyslExt(int wmNr0, int what) { return controlCom.VyslExt(wmNr0, what); } + + /// Extracted from the StatusP + public bool EmgcyStopActive { get { return (controlCom.StatusP & StatusP.EmgcyStopActive) != 0; } } + + /// State of valves sent out - buffered by the last SendCommand() + public ulong Route { get { return route; } } + + /// + /// Initialization data updated by constructors of children components + /// and sent to 'controlCom2panel' by SendCalibData() method. + /// + public uint[,] RegValveCalib = new uint[8, 2]; + public byte[] MeretRS485Address = new byte[4]; + public float[,] TempCalibData = new float[8, 5]; + + // Array length is the reference flowmeters count plus one +#if DN100 + public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 }; +#elif MUNICH + public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 }; +#elif FUZHOU150 + public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 }; +#endif + public uint[] DiverterEdge = new uint[2] { 50, 50 }; + public uint[] BalanceRange = new uint[2]; + + /// + /// Private values sent by the last SendCommand() + /// + bool sendCommandFlag; + Command cmd; + int refNr; + ulong route; + int refPulses; + TestMethods testMethods; + float filterConstant; + float[] FMFreq; + int regConst; + int shortImp; + StopDevs stopDevs; + + public void SetFMFreq(int index, float power) + { + if (index == 0) FMFreq = new float[2] { power, 0 }; + else if (index == 1) FMFreq = new float[2] { 0, power }; + else FMFreq = new float[2] { 0, 0 }; + } + + public void UpdateWeights() + { + for (int i = 0; i < MettlerToledo.BalanceDev.BalancesCount; i++) + { + controlCom.SetWeight(i, MettlerToledo.BalanceDev.Masses[i]); + } + } + + + /// + /// Constructor + /// + public ControlBoardDev(ControlBoardCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.controlBoardCfg = cfg; + FMFreq = new float[2] { 0, 0 }; + } + + /// + /// Specific pre-initialization for control board only + /// + /// + public void InitializeComponent( +#if DN100 + ControlCom2VB.ControlCom2panel ctrlBrdComponent, +#elif MUNICH + ControlComponent3Munich.UserControl1 ctrlBrdComponent, +#elif FUZHOU150 + ControlComponent3Munich.UserControl1 ctrlBrdComponent, +#endif + float[] tankCapacities) + { + if (controlBoardCfg.DebugLevel == Entities.DebugMode.Simulate) + { + controlCom = new ControlComSim(); + } + else + { + int cnt = Math.Min(BalanceRange.Length, tankCapacities.Length); + for (int i = 0; i < cnt; i++) BalanceRange[i] = (uint)tankCapacities[i]; + controlCom = new ControlComWrap(ctrlBrdComponent); + } + } + + /// Initialize this device + public void Initialize() + { + controlCom.SendCalibData(RegValveCalib, + MeretRS485Address, + controlBoardCfg.ComPortNr, + TempCalibData, + EtCalib, + DiverterEdge, + BalanceRange); + } + + /// Run this device + public void RunDeviceBefore() + { + controlCom.RunDeviceBefore(); + + if (EmgcyStopActive) + { + /// SendCommand() arguments to clear the emergency stop state + sendCommandFlag = true; + this.cmd = Command.Stop; + this.stopDevs = StopDevs.All; + } + else + { + /// Reset all SendCommand() arguments + sendCommandFlag = false; + this.cmd = Command.None; + this.stopDevs = 0; + } + this.refNr = 0; + this.refPulses = 0; + this.testMethods = 0; + this.filterConstant = 0; + this.regConst = 0; + this.shortImp = 0; + } + + /// Run this device + public void RunDeviceAfter() + { + if (sendCommandFlag) + { + controlCom.SendCommand(cmd, refNr, route, refPulses, testMethods, + filterConstant, FMFreq, regConst, shortImp, stopDevs); + } + + controlCom.RunDeviceAfter(); + } + + /// Stop this device + public void StopDevice() + { + } + + /// + /// Sends a command to the control board. + /// + /// See ControlBoard.Command enum + /// Number of the etalon/reference (1..5) + /// Route: 64-bit installation specific number + /// kolko impulzov ma trvat skuska + /// See ControlBoard.TestMethods enum + /// 0 = No filtering (0..255) + /// Coefficient used to control reg. valves (1..100) + /// 0 = default value, 1 = spec. processing of very short pulses + /// What to stop + public void SendCommand(Command cmd, int refFlowmtrNr, ulong route, int totalRefPulses, TestMethods testMethods, + float filterConstant, int regConst, int shortImp, StopDevs stopDevs) + { + this.cmd = cmd; + this.refNr = refFlowmtrNr; + this.route = route; + this.refPulses = totalRefPulses; + this.testMethods = testMethods; + this.filterConstant = filterConstant; + this.regConst = regConst; + this.shortImp = shortImp; + this.stopDevs = stopDevs; + + sendCommandFlag = true; + } + + public void SetValves(ulong valvesToOpen, ulong valvesToClose) + { + route = (route | valvesToOpen) & (~valvesToClose); + sendCommandFlag = true; + } + + /// + /// Regulation valves control. + /// + /// Regulation valve nr. (1..5) + /// Valve regulation mode, see the enum + /// Target position or target frequency or pulse duration + public void ValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue) + { + controlCom.ValveMove(valveNo, valveMode, valveValue); + } + + + /// + /// Open one valve and/or close one valve. + /// Events: ValvesSet + /// + /// Valve to be opened + /// Valve to be closed + /// Created operation + public IOperation SetValvesOp(IValve valveOpen, IValve valveClose) + { + return new Valve.SetValvesOp(this, valveOpen, valveClose); + } + + /// + /// Open and/or close multiple valves. + /// Events: ValvesSet + /// + /// A list of valves to be opened + /// A list of valves to be closed + /// Created operation + public IOperation SetValvesOp(IList valvesOpen, IList valvesClose) + { + return new Valve.SetValvesOp(this, valvesOpen, valvesClose); + } + + /// + /// Starts the measurement. + /// Events: MeasurementStarted + /// + /// Flow meter + /// An array of register readers + /// Number of reference pulses to complete the test + /// Created operation + public IOperation StartMeasurementOp(IFlowMeter flowMeter, int refPulses, TestMethods method) + { + return new StartMeasurementOp(this, flowMeter, refPulses, method); + } + + /// + /// Queries th econtrol board whether the measurement was completed. + /// Events: MeasurementCompleted or None + /// + /// Created operation + public IOperation QueryMeasurementEndOp() + { + return new QueryMeasurementEndOp(this); + } + + /// + /// Stop the previous control board operation (diverter, gate, etc.) + /// Events: PreviousStopped + /// + /// Created operation + public IOperation StopPreviousOp() + { + return new StopPreviousOp(this); + } + + /// + /// Updates the tank drawing and weight value in Elde software component. + /// + /// Current mass in [kg] or approx. volume in [l] + /// Created operation + public IOperation UpdateTankWeightOp() + { + return new UpdateTankWeightOp(this); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardFactory.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardFactory.cs new file mode 100644 index 000000000..a329e4e39 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardFactory.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde +{ + public class ControlBoardFactory : IComponentFactory + { + public string ClassName { get { return "ControlBoard"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new ControlBoardCfg(this, "CB", 1); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new ControlBoardCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new ControlBoardDev((ControlBoardCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return Elde.ControlBoardCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { ControlBoardDev.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlComSim.cs b/TestBenchFramework/BenchControl/Elde/ControlComSim.cs new file mode 100644 index 000000000..49b070b1a --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlComSim.cs @@ -0,0 +1,293 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class ControlComSim : TestBenchSim, IControlCom + { + private static readonly ILog log = LogManager.GetLogger(typeof(ControlComSim)); + public override string ToString() { return string.Format("ControlComSim"); } + + + StatusP statusP; + public StatusP StatusP { get { return statusP; } } + + float referenceFreq = 650.0f; + public float ReferenceFreq { get { return referenceFreq; } } + + int[] etPulses = new int[Program.WMsCount + 1]; + public int EtPulses(int wmNr1and0) + { + return etPulses[wmNr1and0]; + } + + float[] errFactor = new float[Program.WMsCount + 1]; /// Internal + float[] wMeterPulsesF = new float[Program.WMsCount + 1]; /// Internal + + int[] wMeterPulses = new int[Program.WMsCount + 1]; /// Rounded from wMeterPulsesF + public int WMeterPulses(int wmNr1) + { + return wMeterPulses[wmNr1]; + } + + int[] wMeterReference = new int[Program.WMsCount + 1]; + public int WMeterReference(int wmNr1) + { + return wMeterReference[wmNr1]; + } + + public uint RegulValveDAC { get { return 0; } } + + public float Pressure(int prsNr0) { return 0; } + public float Temperature(int tmpNr0) { return (float)(20 + tmpNr0); } + public RegulValveState RegulValveState(int rvNr1) { return 0; } + + public ulong RRoute { get { return route; } } + + public uint DivTime { get { return 0; } } + + float tTime = 0; + public float TTime { get { return tTime; } } + + public uint FmState { get { return 0; } } + public uint BeginState(int wmNr0) { return 0; } + + float referenceFlow; + public float ReferenceFlow { get { return referenceFlow; } } + + public float RValvePosition(int rvNr1) { return 0; } + public float DivSamples(int ms) { return 0; } + public int ScopeSamples(int i, int j, int k) { return 0; } + public uint DigitalInputs { get { return 0; } } + public float AnalogInput(int adcNr0) { return 0; } + public uint AnalogInputRaw(int adcNr0, int bank) { return 0; } /// bank0=RV, bank1=Temp + public float ReferenceVolume { get { return 0; } } + public float VyslExt(int wmNr0, int what) { return 0; } + public void SetWeight(int pos, float mass) { return; } /// not available in sim. mode + + /// + /// Private initialization data updated by contructors of children components + /// and sent to 'controlCom2panel' by SendCalibData() method. + /// + uint[,] regValveCalib; + byte[] meretRS485Address; + float[,] tempCalibData; + float[] etCalib; + uint[] diverterEdge; + uint[] balanceRange; + + /// + /// Private values set by SendCommand() + /// + Command cmd; + int refFlowmtrNr; + ulong route; + public ulong Route { get { return route; } } + int totalRefPulses; + TestMethods testMethods; + float filterConstant; + float[] FMFreq; + int regConst; + int shortImp; + StopDevs stopDevs; + + /// + /// Private values set by ValveMove() + /// + int regulValveNo; + RegulValveMode regulValveMode; + float[] regulValveValue; + + Random rand; + + /// + /// Constructor + /// + public ControlComSim() + { + rand = new Random(); + } + + /// + /// Sends calibration and configuration data to the control board. + /// + /// Regulating valves calib.coefs, ix1 = valve nr. (1..5), ix2 = coef.nr. (0..1), values typ. c0 = 0, c1 = 0.2 + /// Meret address, index = 0..1, value typ. 99 and 100 + /// COM port number of the control board (typ. 1) + /// Temp.calc.coefs, ix1 = temp.sens.nr. (0..7 ???), ix2 = coef.nr + /// Etalon nominal values + /// Percentages for switching of diverters, ix = diverter nr.(0,1), typ.value 50 (%) + public void SendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, float[] etCalib, uint[] divEdge, uint[] balanceRange) + { + this.regValveCalib = rvCalib; + this.meretRS485Address = meretA; + this.tempCalibData = tempCalib; + this.etCalib = etCalib; + this.diverterEdge = divEdge; + this.balanceRange = balanceRange; + } + + /// + /// Sends a command to the control board. + /// + /// See ControlBoard.Command enum + /// Number of the etalon/reference (1..5) + /// Route: 64-bit installation specific number + /// kolko impulzov ma trvat skuska + /// See ControlBoard.TestMethods enum + /// 0 = No filtering (0..255) + /// Freq.inverter control (not applicable in DT100, Munich) + /// Coefficient used to control reg. valves (1..100) + /// 0 = default value, 1 = spec. processing of very short pulses + /// What to stop + public void SendCommand(Command cmd, int refFlowmtrNr, ulong route, int totalRefPulses, TestMethods testMethods, + float filterConstant, float[] FMFreq, int regConst, int shortImp, StopDevs stopDevs) + { + Command lastCmd = this.cmd; + this.cmd = cmd; + this.refFlowmtrNr = refFlowmtrNr; + this.route = route; + RouteSim = route; + this.totalRefPulses = totalRefPulses; + this.testMethods = testMethods; + this.filterConstant = filterConstant; + this.FMFreq = FMFreq; + this.regConst = regConst; + this.shortImp = shortImp; + this.stopDevs = stopDevs; + + statusP = (StatusP)(((ulong)statusP & 0xFFFFFFFFFFFFFFF8L) | (ulong)refFlowmtrNr); + + if (cmd == Command.Start && lastCmd != Command.Start ) + { + statusP |= StatusP.TestInProgress; + /// + /// Clear all counters + /// + if (etPulses != null) { for (int i = 0; i < etPulses.Length; i++) etPulses[i] = 0; } + if (wMeterPulses != null) { for (int i = 0; i < wMeterPulses.Length; i++) wMeterPulses[i] = 0; } + if (wMeterPulsesF != null) { for (int i = 0; i < wMeterPulsesF.Length; i++) wMeterPulsesF[i] = 0; } + if (wMeterReference != null) { for (int i = 0; i < wMeterReference.Length; i++) wMeterReference[i] = 0; } + if (errFactor != null) + { + for (int i = 0; i < errFactor.Length; i++) errFactor[i] = ((float)rand.Next(100) + 950.0f) / 1000.0f; + } + tTime = 0; + } + else if (cmd == Command.Stop) + { + statusP = 0; + //statusP &= ~StatusP.Running; + } + } + + /// + /// Control of regulating valves. + /// + /// Regulating valve nr. (1..5) + /// ??? + /// ??? + public void ValveMove(int regulValveNo, RegulValveMode regulValveMode, float[] regulValveValue) + { + this.regulValveNo = regulValveNo; + this.regulValveMode = regulValveMode; + this.regulValveValue = regulValveValue; + } + + public void RunDeviceBefore() + { + base.RunDevice(regulValveNo, refFlowmtrNr, statusP); + + log.DebugFormat("refFreq=", referenceFreq); + + tTime += 1.0f; + + float Qnom = (regulValveNo > 0) ? etCalib[regulValveNo] : 0; + + switch (cmd) + { + case Command.None: + break; + + case Command.Start: + if ((testMethods & TestMethods.Diverter) == TestMethods.Diverter) + { + SetSimDiverter(true); + } + break; + + case Command.Stop: + if ((testMethods & TestMethods.Diverter) == TestMethods.Diverter) + { + SetSimDiverter(false); + } + break; + } + + switch (regulValveMode) + { + case RegulValveMode.TargetFrequency: + float targetFlow = ((regulValveValue[0] + regulValveValue[1]) / 2.0f) * (Qnom / 2000.0f); + UpdateSimFlow(targetFlow); + + //if (referenceFreq < valveValue[0]) referenceFreq += ((float)rand.Next(20) + 10.0f) / 2.0f; + //else if (referenceFreq > valveValue[1]) referenceFreq -= ((float)rand.Next(20) + 10.0f) / 2.0f; + //else referenceFreq += ((float)rand.Next(10) - 5.0f) / 2.0f; + referenceFreq = GetSimFlow() * 2000.0f / Qnom; + if (referenceFreq < 0) referenceFreq = 0; + if (referenceFreq > 2500) referenceFreq = 2500; + break; + + default: + break; + } + + referenceFlow = referenceFreq / 2000; + + bool stopTest = false; + if (cmd == Command.Start) + { + float pwFactor = 1.0f; + + /// Increment reference flow meters + for (int i = 0; i < Program.WMsCount; i++) + { + etPulses[i] += (int)referenceFreq; + if (etPulses[i] > totalRefPulses) + { + pwFactor = 1.0f - (float)(etPulses[i] - totalRefPulses) / referenceFreq; + etPulses[i] = totalRefPulses; + stopTest = true; + } + } + + /// Increment water meters + for (int i = 1; i < Program.WMsCount; i++) + { + const float wmPulsesPerLiter = 10.0f; + wMeterPulsesF[i] += errFactor[i] * pwFactor * ((float)rand.Next(100) + 450.0f) * wmPulsesPerLiter * GetSimFlow() / 1800.0f; + wMeterPulses[i] = (int)wMeterPulsesF[i]; + } + + if (etPulses[0] > totalRefPulses) + { + statusP |= StatusP.TestCompleted; + statusP &= ~StatusP.TestInProgress; + } + } + + if (stopTest) + { + SetSimDiverter(false); + statusP = (statusP | StatusP.TestCompleted); + statusP = (statusP & ~StatusP.TestInProgress); + } + } + + public void RunDeviceAfter() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/ControlComWrap.cs b/TestBenchFramework/BenchControl/Elde/ControlComWrap.cs new file mode 100644 index 000000000..3c70f6602 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/ControlComWrap.cs @@ -0,0 +1,265 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class ControlComWrap : IControlCom + { + private static readonly ILog log = LogManager.GetLogger(typeof(ControlComWrap)); + + /// + /// Properties + /// + public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } } + public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000 + public int EtPulses(int wmNr0) + { + return (int)ctrlBrdComponent.etPulses[wmNr0]; + } + public int WMeterPulses(int wmNr0) + { + return (int)ctrlBrdComponent.wMeterPuls[wmNr0]; + } + public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; } + public uint RegulValveDAC { get { return ctrlBrdComponent.StavDA; } } + public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; } + public float Temperature(int tmpNr0) { return ctrlBrdComponent.temperature[tmpNr0]; } + public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; } + public ulong RRoute { get { return ctrlBrdComponent.rRoute; } } + public uint DivTime { get { return ctrlBrdComponent.divTime; } } + public float TTime { get { return ctrlBrdComponent.Ttime; } } + public uint FmState { get { return ctrlBrdComponent.fMState; } } + public uint BeginState(int wmNr0) { return ctrlBrdComponent.beginSt[wmNr0]; } + public float ReferenceFlow { get { return ctrlBrdComponent.referenceFlow; } } + public float RValvePosition(int rvNr1) + { + //return ctrlBrdComponent.RValvePosition[rvNr1 - 1]; + return ctrlBrdComponent.Analogy[rvNr1 - 1]; /// Fixes bug: RValvePosition returns 0 all the time + } + public float DivSamples(int ms) { return ctrlBrdComponent.DIVSamples[ms, 0]; } + public int ScopeSamples(int i, int j, int k) { return ctrlBrdComponent.ScopeSamples[i, j, k]; } + public uint DigitalInputs { get { return ctrlBrdComponent.Vstupy; } } + public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; } + public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp + public float ReferenceVolume { get { return ctrlBrdComponent.ReferenceVolume; } } + public float VyslExt(int wmNr0, int what) { return ctrlBrdComponent.VyslExt[wmNr0, what]; } + public void SetWeight(int pos, float mass) { ctrlBrdComponent.Weight[pos] = mass; } + + + /// + /// Reference to the control board component + /// +#if DN100 + private ControlCom2VB.ControlCom2panel ctrlBrdComponent; +#elif MUNICH + private ControlComponent3Munich.UserControl1 ctrlBrdComponent; +#elif FUZHOU150 + private ControlComponent3Munich.UserControl1 ctrlBrdComponent; +#endif + + /// + /// Constructor that initializes the control board component reference + /// + /// +#if DN100 + public ControlComWrap(ControlCom2VB.ControlCom2panel ctrlBrdComponent) +#elif MUNICH + public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent) +#elif FUZHOU150 + public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent) +#endif + { + this.ctrlBrdComponent = ctrlBrdComponent; + } + + + /// + /// Sends calibration and configuration data to the control board. + /// + /// Regulating valves calib.coefs, ix1 = valve nr. (1..5), ix2 = coef.nr. (0..1), values typ. c0 = 0, c1 = 0.2 + /// Meret address, index = 0..1, value typ. 99 and 100 + /// COM port number of the control board (typ. 1) + /// Temp.calc.coefs, ix1 = temp.sens.nr. (0..7 ???), ix2 = coef.nr + /// Etalon nominal values + /// Percentages for switching of diverters, ix = diverter nr.(0,1), typ.value 50 (%) + /// Balance range = volume of the tanks on the balaces (ix=0,1) + public void SendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, + float[] etCalib, uint[] divEdge, uint[] balanceRange) + { + if (Program.MainWnd.InvokeRequired) + { + /// When SendCalibData(...) called from the worker thread + object[] args = new object[] { rvCalib, meretA, usedCom, tempCalib, etCalib, divEdge, balanceRange }; + Program.MainWnd.Invoke((SendCalibDataDlgt)DoSendCalibData, args); /// Invoke required as component was created in UI thread + } + else + { + /// When SendCalibData(...) called from the UI thread + DoSendCalibData(rvCalib, meretA, usedCom, tempCalib, etCalib, divEdge, balanceRange); + } + } + /// + delegate void SendCalibDataDlgt(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, + float[] etCalib, uint[] divEdge, uint[] balanceRange); + /// + private void DoSendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, + float[] etCalib, uint[] divEdge, uint[] balanceRange) + { + //TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} SendCalibData(COM{1}) rvCalib[0,0]={2} rvCalib[0,1]={3} rvCalib[1,0]={4} rvCalib[1,1]={5}\r\n", + // DateTime.Now.ToLongTimeString(), usedCom, + // rvCalib[0,0], rvCalib[0,1], rvCalib[1,0], rvCalib[1,1])); + log.InfoFormat("SendCalibData(COM{0}) rvCalib[0,0]={1} rvCalib[0,1]={2} rvCalib[1,0]={3} rvCalib[1,1]={4}\r\n", + usedCom, rvCalib[0,0], rvCalib[0,1], rvCalib[1,0], rvCalib[1,1]); +#if (DN100) + ctrlBrdComponent.ExternalCom = true; +#endif + ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange); + } + + + /// + /// Control of regulating valves. + /// + /// Regulating valve nr. (1..5) + /// Valve regulation mode, see the enum + /// Target position or target frequency or pulse duration + public void ValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue) + { + if (Program.MainWnd.InvokeRequired) + { + /// When ValveMove(...) called from the worker thread + object[] args = new object[] { valveNo, valveMode, valveValue }; + Program.MainWnd.Invoke((ValveMoveDlgt)DoValveMove, args); /// When ValveMove called from a worker thread + } + else + { + /// When ValveMove(...) called from the UI thread + DoValveMove(valveNo, valveMode, valveValue); /// When ValveMove called from the UI thread + } + } + /// + delegate void ValveMoveDlgt(int valveNo, RegulValveMode valveMode, float[] valveValue); + /// + private void DoValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue) + { + //TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} ValveMove({1}, {2}, [{3}, {4}])\r\n", + // DateTime.Now.ToLongTimeString(), + // valveNo, + // valveMode, + // valveValue[0], + // valveValue[1])); + log.InfoFormat("ValveMove({0}, {1}, [{2}, {3}])\r\n", valveNo, valveMode, valveValue[0], valveValue[1]); + + ctrlBrdComponent.ValveMove((byte)valveNo, (byte)valveMode, valveValue); + } + + + /// + /// Sends a command to the control board. + /// + /// See ControlBoard.Command enum + /// Reference flow meter number (1..5) + /// Route: 64-bit installation specific number + /// Test duration as a number of reference flow meter pulses + /// See ControlBoard.TestMethods enum + /// 0 = No filtering (0..255) + /// Freq.inverter control (not applicable in DT100, Munich) + /// Coefficient used to control the regulation valve (1..100) + /// 0 = default value, 1 = spec. processing of very short pulses + /// What to stop + public void SendCommand(Command cmd, int refFlowMeterNr, ulong route, int totalRefPulses, TestMethods testMethods, + float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) + { + if (Program.MainWnd.InvokeRequired) + { + /// When SendCommand(...) called from the worker thread + object[] args = new object[] { cmd, refFlowMeterNr, route, totalRefPulses, testMethods, + filterConstant, fmFreq, regConst, shortImp, stopDevs }; + Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, args); /// Component was created in UI thread - use Invoke() + } + else + { + /// When SendCommand(...) called from the UI thread + DoSendCommand(cmd, refFlowMeterNr, route, totalRefPulses, testMethods, + filterConstant, fmFreq, regConst, shortImp, stopDevs); + } + } + /// + delegate void SendCommandDlgt(Command cmd, int refFlowmtrNr, ulong route, int totalRefPulses, TestMethods testMethods, + float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); + /// + private void DoSendCommand(Command cmd, int refFlowMeterNr, ulong route, int totalRefPulses, TestMethods testMethods, + float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs) + { + //TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} SendCommand({1}, {2}, {3}, {4}, {5}, {6}, [{7},{8}], {9}, {10}, {11})\r\n", + // DateTime.Now.ToLongTimeString(), + // cmd, + // refFlowMeterNr, + // route.ToString("X"), + // totalRefPulses, + // testMethods, + // filterConstant, + // fmFreq[0], + // fmFreq[1], + // regConst, + // shortImp, + // stopDevs)); + log.InfoFormat("SendCommand({0}, {1}, {2}, {3}, {4}, {5}, [{6},{7}], {8}, {9}, {10})\r\n", + cmd, + refFlowMeterNr, + route.ToString("X"), + totalRefPulses, + testMethods, + filterConstant, + fmFreq[0], + fmFreq[1], + regConst, + shortImp, + stopDevs); +#if DN100 + ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods, + filterConstant, fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs); +#else + ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)refPulses, (uint)testMethods, + filterConstant, FMFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs); +#endif + } + + + enum CommType + { + Rx, /// Receive data only + TxRx, /// Transmit and receive data + } + + public void RunDeviceBefore() + { + object[] args = new object[] { CommType.Rx }; + MakeCommDlgt dlgt = MakeComm; + Program.MainWnd.Invoke(dlgt, args); /// Invoke MakeExtComm(.) in the UI thread + } + + public void RunDeviceAfter() + { + object[] args = new object[] { CommType.TxRx }; + MakeCommDlgt dlgt = MakeComm; + Program.MainWnd.Invoke(dlgt, args); /// Invoke MakeExtComm(.) in the UI thread + } + + /// + /// A delegate to execute the SendCommand() in the UI thread + /// + delegate void MakeCommDlgt(CommType extComm); + + /// + /// Executes the SendCommand(...) and MakeExtCom() in the UI thread + /// + void MakeComm(CommType commType) + { + if (ctrlBrdComponent.ExternalCom) + { + ctrlBrdComponent.MakeExtCom((commType == CommType.Rx) ? false : true); + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Diverter/Diverter.cs b/TestBenchFramework/BenchControl/Elde/Diverter/Diverter.cs new file mode 100644 index 000000000..d190fa317 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/Diverter.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.BenchControl.Elde.Diverter +{ + public class Diverter : Generic.IComponent, GenericDevices.IDiverter + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(Diverter)); + public override string ToString() + { + return string.Format("Diverter({0},{1})", Name, diverterCfg.BitPosition); + } + + public static void ResetStaticProperties() { } + + private readonly DiverterCfg diverterCfg; + public Generic.IComponentCfg Cfg { get { return diverterCfg; } } + + public string Name { get { return diverterCfg.Name; } } + + readonly ControlBoardDev controlBoard; + + public readonly ulong Mask; /// derived from bitPosition in the constructor + + + public Diverter(DiverterCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.diverterCfg = cfg; + + controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + if (cfg.BitPosition < 0 || cfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position"); + this.Mask = (((ulong)1) << cfg.BitPosition); + + log.Debug(this.ToString()); + } + + public bool State + { + get { return (controlBoard.Route & Mask) != 0; } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfg.cs b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfg.cs new file mode 100644 index 000000000..b92f02192 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfg.cs @@ -0,0 +1,51 @@ +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Diverter +{ + public class DiverterCfg : ComponentCfgBase, IChildComponentCfg + { + public int BitPosition; + + /// Parameterless constructor + public DiverterCfg() + { + } + /// Constructor + public DiverterCfg(IComponentFactory factory, string name, string parentName, int bitPosition) + : base(factory, name, parentName) + { + this.BitPosition = bitPosition; + } + + public IComponentCfg Clone() + { + return new DiverterCfg(Factory, Name, ParentName, BitPosition); + } + + public string ToString(int i) + { + return string.Format("bit={0}", BitPosition); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + DiverterCfg config = (DiverterCfg)(new XmlSerializer(typeof(DiverterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.Designer.cs new file mode 100644 index 000000000..93e7abf90 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.Designer.cs @@ -0,0 +1,130 @@ +namespace TBF.BenchControl.Elde.Diverter +{ + partial class DiverterCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.bitPositionLabel = new System.Windows.Forms.Label(); + this.bitPositionTextBox = new System.Windows.Forms.TextBox(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 41); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 44); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 17); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(27, 70); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // bitPositionLabel + // + this.bitPositionLabel.AutoSize = true; + this.bitPositionLabel.Location = new System.Drawing.Point(27, 96); + this.bitPositionLabel.Name = "bitPositionLabel"; + this.bitPositionLabel.Size = new System.Drawing.Size(59, 13); + this.bitPositionLabel.TabIndex = 5; + this.bitPositionLabel.Text = "Bit Position"; + // + // bitPositionTextBox + // + this.bitPositionTextBox.Enabled = false; + this.bitPositionTextBox.Location = new System.Drawing.Point(137, 93); + this.bitPositionTextBox.Name = "bitPositionTextBox"; + this.bitPositionTextBox.Size = new System.Drawing.Size(46, 20); + this.bitPositionTextBox.TabIndex = 6; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(137, 67); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // DiverterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.bitPositionTextBox); + this.Controls.Add(this.bitPositionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "DiverterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.DiverterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.Label bitPositionLabel; + private System.Windows.Forms.TextBox bitPositionTextBox; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.cs new file mode 100644 index 000000000..b21753414 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.cs @@ -0,0 +1,89 @@ +using System; +using System.Windows.Forms; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Diverter +{ + public partial class DiverterCfgCtrl : UserControl, IComponentCfgCtrl + { + ComponentParametersDlg parent; + DiverterCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as DiverterCfg; + Redraw(); + } + } + + public DiverterCfgCtrl() + { + InitializeComponent(); + } + + private void DiverterCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + nameTextBox.Text = config.Name; + bitPositionTextBox.Text = config.BitPosition.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + bitPositionTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Bit Position' should be between 0 and 63"; + } + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.BitPosition = int.Parse(bitPositionTextBox.Text); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfgCtrl.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/TestBenchFramework/BenchControl/Elde/Diverter/DiverterFactory.cs b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterFactory.cs new file mode 100644 index 000000000..728ab536f --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Diverter/DiverterFactory.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Diverter +{ + public class DiverterFactory : IComponentFactory + { + public string ClassName { get { return "Diverter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new DiverterCfg(this, "Diverter", "CB", 0); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new DiverterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Diverter((DiverterCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return DiverterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Diverter.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs new file mode 100644 index 000000000..a5ed94360 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.BenchControl.Elde.FlowMeter +{ + public class FlowMeter : Generic.IComponent, GenericDevices.IFlowMeter + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter)); + public override string ToString() + { + return string.Format("FlowMeter({0},{1})", Name, Position); + } + + public static void ResetStaticProperties() { } + + FlowMeterCfg flowMeterCfg; + public Generic.IComponentCfg Cfg { get { return flowMeterCfg; } } + + public string Name { get { return flowMeterCfg.Name; } } + public IList Corrections { get { return flowMeterCfg.Corrections; } } + + public readonly ControlBoardDev ControlBoard; + + public readonly int Position; /// 1..4 + + readonly float nominalFlow; + public float NominalFlow { get { return nominalFlow; } } + + public FlowMeter(FlowMeterCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.flowMeterCfg = cfg; + + ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + Position = cfg.Position; + + nominalFlow = cfg.NominalFlow; + ControlBoard.EtCalib[Position] = NominalFlow; + + /// Prepare data for SendCalibData() control board component method + + log.Debug(this.ToString()); + } + + /// + /// Events: FlowDone, Error + /// + /// Reference to a variable for the flow in Bar + /// ReadFlowOp instance reference casted to IOperaton + public IOperation ReadFlowOp(ref FloatBox flow) + { + return new ReadFlowOp(this, ref flow); + } + + /// + /// Events: flowDone, Error + /// + /// Reference to a variable for the flow in Bar + /// Event returned when measurement done + /// ReadFlowOp instance reference casted to IOperaton + public IOperation ReadFlowOp(ref FloatBox flow, Event flowDone) + { + return new ReadFlowOp(this, ref flow, flowDone); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs new file mode 100644 index 000000000..58519eb3e --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs @@ -0,0 +1,61 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.FlowMeter +{ + public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg + { + public int Position; /// 1..5 + + public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz + + /// Parameterless constructor + public FlowMeterCfg() + { + } + + /// + /// Flow meter configuration parameters + /// + /// Flow meter name + /// Position on the control board 1..5 + public FlowMeterCfg(IComponentFactory factory, string name, string parentName, int position, float nominalFlow) + : base(factory, name, parentName) + { + if (position < 1 || position > 5) throw new ArgumentOutOfRangeException("position"); + this.Position = position; + this.NominalFlow = nominalFlow; + } + + public IComponentCfg Clone() + { + return new FlowMeterCfg(Factory, Name, ParentName, Position, NominalFlow); + } + + public string ToString(int i) + { + return string.Format("position={0}, nominalFlow={1}", Position, NominalFlow); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + FlowMeterCfg config = (FlowMeterCfg)(new XmlSerializer(typeof(FlowMeterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.Designer.cs new file mode 100644 index 000000000..a5061f73d --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.Designer.cs @@ -0,0 +1,153 @@ +namespace TBF.BenchControl.Elde.FlowMeter +{ + partial class FlowMeterCfgCtrl + { + /// + /// 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() + { + this.positionTextBox = new System.Windows.Forms.TextBox(); + this.positionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.nominalFlowTextBox = new System.Windows.Forms.TextBox(); + this.nominalFlowLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // positionTextBox + // + this.positionTextBox.Enabled = false; + this.positionTextBox.Location = new System.Drawing.Point(224, 113); + this.positionTextBox.Name = "positionTextBox"; + this.positionTextBox.Size = new System.Drawing.Size(46, 20); + this.positionTextBox.TabIndex = 6; + // + // positionLabel + // + this.positionLabel.AutoSize = true; + this.positionLabel.Location = new System.Drawing.Point(30, 116); + this.positionLabel.Name = "positionLabel"; + this.positionLabel.Size = new System.Drawing.Size(44, 13); + this.positionLabel.TabIndex = 5; + this.positionLabel.Text = "Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(30, 90); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(140, 61); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(30, 64); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(137, 37); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // nominalFlowTextBox + // + this.nominalFlowTextBox.Enabled = false; + this.nominalFlowTextBox.Location = new System.Drawing.Point(224, 138); + this.nominalFlowTextBox.Name = "nominalFlowTextBox"; + this.nominalFlowTextBox.Size = new System.Drawing.Size(46, 20); + this.nominalFlowTextBox.TabIndex = 8; + // + // nominalFlowLabel + // + this.nominalFlowLabel.AutoSize = true; + this.nominalFlowLabel.Location = new System.Drawing.Point(30, 141); + this.nominalFlowLabel.Name = "nominalFlowLabel"; + this.nominalFlowLabel.Size = new System.Drawing.Size(140, 13); + this.nominalFlowLabel.TabIndex = 7; + this.nominalFlowLabel.Text = "Nominal flow [m3/h @2kHz]"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(140, 87); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // FlowMeterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.nominalFlowTextBox); + this.Controls.Add(this.nominalFlowLabel); + this.Controls.Add(this.positionTextBox); + this.Controls.Add(this.positionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "FlowMeterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.FlowMeterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox positionTextBox; + private System.Windows.Forms.Label positionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.TextBox nominalFlowTextBox; + private System.Windows.Forms.Label nominalFlowLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs new file mode 100644 index 000000000..c45142bc3 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs @@ -0,0 +1,102 @@ +using System; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.FlowMeter +{ + public partial class FlowMeterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(FlowMeterCfgCtrl)); + + ComponentParametersDlg parent; + FlowMeterCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as FlowMeterCfg; + Redraw(); + } + } + + public FlowMeterCfgCtrl() + { + InitializeComponent(); + } + + private void FlowMeterCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + positionTextBox.Text = config.Position.ToString(); + nominalFlowTextBox.Text = config.NominalFlow.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + positionTextBox.Enabled = true; + nominalFlowTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 1 || dummy > 5) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Position' should be between 1 and 5"; + } + float fdummy; + if (!Utils.TryParseUFloat(nominalFlowTextBox.Text, out fdummy) || fdummy < 0.2 || fdummy > 1000) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Nominal flow' should be between 0.2 and 1000"; + } + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.Position = int.Parse(positionTextBox.Text); + Utils.TryParseUFloat(nominalFlowTextBox.Text, out config.NominalFlow); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.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/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterFactory.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterFactory.cs new file mode 100644 index 000000000..33b572de7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterFactory.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.FlowMeter +{ + public class FlowMeterFactory : IComponentFactory + { + public string ClassName { get { return "FlowMeter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new FlowMeterCfg(this, "FlowMeter", "CB", 1, 1); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new FlowMeterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new FlowMeter((FlowMeterCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return FlowMeterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { FlowMeter.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs new file mode 100644 index 000000000..297e46277 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs @@ -0,0 +1,65 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde.FlowMeter +{ + public class ReadFlowOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadFlowOp)); + public override string ToString() { return string.Format("ReadFlowOp(.,{0},{1},.)", eventDone, flowMeterNr); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly int flowMeterNr; + readonly Event eventDone; + FloatBox flow; + + /// + /// Events: FlowInDone, FlowOutDone or Error + /// + /// Flow meter reference + /// Reference to the measured flow variable, value is in bar + /// Event to be returned by Run() when completed OK + public ReadFlowOp(FlowMeter flowMeter, ref FloatBox flow, Event eventDone) + { + if (flowMeter == null) throw new ArgumentNullException("flowMeter"); + this.controlBoard = flowMeter.ControlBoard; + this.flowMeterNr = flowMeter.Position; + this.eventDone = eventDone; + this.flow = flow; + + log.Debug(this.ToString()); + } + public ReadFlowOp(FlowMeter flowMeter, ref FloatBox flow) + : this(flowMeter, ref flow, Event.FlowMeasurementDone) + { + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + if (flowMeterNr == (int)(controlBoard.StatusP & StatusP.RefFlowMeterMask)) + { + flow.F = controlBoard.ReferenceFlow; + return eventDone; + } + else + { + return Event.Error; + } + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/IControlCom.cs b/TestBenchFramework/BenchControl/Elde/IControlCom.cs new file mode 100644 index 000000000..5615ef8e9 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/IControlCom.cs @@ -0,0 +1,69 @@ + +namespace TBF.BenchControl.Elde +{ + interface IControlCom + { + StatusP StatusP { get; } + float ReferenceFreq { get; } + int EtPulses(int wmNr0); + int WMeterPulses(int wmNr0); + int WMeterReference(int wmNr0); + uint RegulValveDAC { get; } + float Pressure(int prsNr0); + float Temperature(int tmpNr0); + RegulValveState RegulValveState(int rvNr1); + ulong RRoute { get; } + uint DivTime { get; } + float TTime { get; } + uint FmState { get; } + uint BeginState(int wmNr0); + float ReferenceFlow { get; } + float RValvePosition(int rvNr1); + float DivSamples(int ms); + int ScopeSamples(int i, int j, int k); + uint DigitalInputs { get; } + float AnalogInput(int adcNr0); + uint AnalogInputRaw(int adcNr0, int bank); + float ReferenceVolume { get; } + float VyslExt(int wmNr0, int what); + void SetWeight(int pos, float mass); + + /// + /// Sends calibration and configuration data to the control board. + /// + /// Regulating valves calib.coefs, ix1 = valve nr. (1..5), ix2 = coef.nr. (0..1), values typ. c0 = 0, c1 = 0.2 + /// Meret address, index = 0..1, value typ. 99 and 100 + /// COM port number of the control board (typ. 1) + /// Temp.calc.coefs, ix1 = temp.sens.nr. (0..7 ???), ix2 = coef.nr + /// Etalon nominal values + /// Percentages for switching of diverters, ix = diverter nr.(0,1), typ.value 50 (%) + void SendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, float[] etCalib, uint[] divEdge, uint[] balanceRange); + + /// + /// Updates a command that is regularly sent to the control board by SendCommand. + /// + /// See ControlBoard.Command enum + /// Number of the etalon/reference (1..5) + /// Route: 64-bit installation specific number + /// kolko impulzov ma trvat skuska + /// See ControlBoard.TestMethods enum + /// 0 = No filtering (0..255) + /// Freq.inverter control (not applicable in DT100, Munich) + /// Coefficient used to control reg. valves (1..100) + /// 0 = default value, 1 = spec. processing of very short pulses + /// What to stop + void SendCommand(Command cmd, int refNr, ulong route, int refPulses, TestMethods testMethods, + float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs); + + /// + /// Control of regulating valves. + /// + /// Regulating valve nr. (1..5) + /// ??? + /// ??? + void ValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue); + + void RunDeviceBefore(); + void RunDeviceAfter(); + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs new file mode 100644 index 000000000..d0dffc877 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PressureMeter +{ + public class PressureMeter : IComponent, GenericDevices.IPressureMeter + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter)); + public override string ToString() + { + return string.Format("PressureMeter({0},{1})", Name, Index); + } + + public static void ResetStaticProperties() { } + + readonly PressureMeterCfg pressureMeterCfg; + public Generic.IComponentCfg Cfg { get { return pressureMeterCfg; } } + + public string Name { get { return pressureMeterCfg.Name; } } + public IList Corrections { get { return pressureMeterCfg.Corrections; } } + + public readonly ControlBoardDev ControlBoard; + + public readonly int Index; /// 0..3 + public readonly byte RS485Address; /// 0..255 + + public PressureMeter(PressureMeterCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.pressureMeterCfg = cfg; + + ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + Index = cfg.Position; + RS485Address = cfg.RS485Address; + + /// Prepare data for SendCalibData() control board component method + ControlBoard.MeretRS485Address[Index] = RS485Address; + + log.Debug(this.ToString()); + } + + /// + /// Events: PressureDone, Error + /// + /// Reference to a variable for the pressure in Bar + /// ReadPressureOp instance reference casted to IOperaton + public IOperation ReadPressureOp(ref FloatBox pressure) + { + return new ReadPressureOp(this, ref pressure); + } + + /// + /// Events: pressureDone, Error + /// + /// Reference to a variable for the pressure in Bar + /// Event returned when measurement done + /// ReadPressureOp instance reference casted to IOperaton + public IOperation ReadPressureOp(ref FloatBox pressure, Event pressureDone) + { + return new ReadPressureOp(this, ref pressure, pressureDone); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs new file mode 100644 index 000000000..61ee4e6ea --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs @@ -0,0 +1,63 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PressureMeter +{ + public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg + { + public int Position; /// 0..7 + public byte RS485Address; /// 0..255 + + /// Parameterless constructor + public PressureMeterCfg() + { + } + /// + /// Regulation valve configuration parameters + /// + /// Regulation valve name + /// Position on the control board 1..5 + /// 0..1023 + /// 0..1023 + public PressureMeterCfg(IComponentFactory factory, string name, string parentName, int index, byte rs485Address) + : base(factory, name, parentName) + { + if (index < 0 || index > 7) throw new ArgumentOutOfRangeException("Position"); + this.Position = index; + + if (rs485Address < 0 || rs485Address > 255) throw new ArgumentOutOfRangeException("RS485Address"); + this.RS485Address = rs485Address; + } + + public IComponentCfg Clone() + { + return new PressureMeterCfg(Factory, Name, ParentName, Position, RS485Address); + } + + public string ToString(int i) + { + return string.Format("index={0}, RS485 address={1}", Position, RS485Address); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + PressureMeterCfg config = (PressureMeterCfg)(new XmlSerializer(typeof(PressureMeterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.Designer.cs new file mode 100644 index 000000000..f96f3df12 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.Designer.cs @@ -0,0 +1,153 @@ +namespace TBF.BenchControl.Elde.PressureMeter +{ + partial class PressureMeterCfgCtrl + { + /// + /// 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() + { + this.positionTextBox = new System.Windows.Forms.TextBox(); + this.positionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.componentNameLabel = new System.Windows.Forms.Label(); + this.rs485AddressLabel = new System.Windows.Forms.Label(); + this.rs485AddressTextBox = new System.Windows.Forms.TextBox(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // positionTextBox + // + this.positionTextBox.Enabled = false; + this.positionTextBox.Location = new System.Drawing.Point(138, 104); + this.positionTextBox.Name = "positionTextBox"; + this.positionTextBox.Size = new System.Drawing.Size(46, 20); + this.positionTextBox.TabIndex = 6; + // + // positionLabel + // + this.positionLabel.AutoSize = true; + this.positionLabel.Location = new System.Drawing.Point(28, 107); + this.positionLabel.Name = "positionLabel"; + this.positionLabel.Size = new System.Drawing.Size(44, 13); + this.positionLabel.TabIndex = 5; + this.positionLabel.Text = "Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(28, 81); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(138, 52); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(28, 55); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // componentNameLabel + // + this.componentNameLabel.AutoSize = true; + this.componentNameLabel.Location = new System.Drawing.Point(135, 28); + this.componentNameLabel.Name = "componentNameLabel"; + this.componentNameLabel.Size = new System.Drawing.Size(83, 13); + this.componentNameLabel.TabIndex = 0; + this.componentNameLabel.Text = "ComonentName"; + // + // rs485AddressLabel + // + this.rs485AddressLabel.AutoSize = true; + this.rs485AddressLabel.Location = new System.Drawing.Point(28, 133); + this.rs485AddressLabel.Name = "rs485AddressLabel"; + this.rs485AddressLabel.Size = new System.Drawing.Size(81, 13); + this.rs485AddressLabel.TabIndex = 7; + this.rs485AddressLabel.Text = "RS485 Address"; + // + // rs485AddressTextBox + // + this.rs485AddressTextBox.Enabled = false; + this.rs485AddressTextBox.Location = new System.Drawing.Point(138, 130); + this.rs485AddressTextBox.Name = "rs485AddressTextBox"; + this.rs485AddressTextBox.Size = new System.Drawing.Size(46, 20); + this.rs485AddressTextBox.TabIndex = 8; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(138, 78); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // PressureMeterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.rs485AddressTextBox); + this.Controls.Add(this.rs485AddressLabel); + this.Controls.Add(this.positionTextBox); + this.Controls.Add(this.positionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.componentNameLabel); + this.Name = "PressureMeterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.PressureMeterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox positionTextBox; + private System.Windows.Forms.Label positionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label componentNameLabel; + private System.Windows.Forms.Label rs485AddressLabel; + private System.Windows.Forms.TextBox rs485AddressTextBox; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs new file mode 100644 index 000000000..0bf078eee --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs @@ -0,0 +1,100 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PressureMeter +{ + public partial class PressureMeterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(PressureMeterCfgCtrl)); + + ComponentParametersDlg parent; + PressureMeterCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as PressureMeterCfg; + Redraw(); + } + } + + public PressureMeterCfgCtrl() + { + InitializeComponent(); + } + + private void PressureMeterCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + componentNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + positionTextBox.Text = config.Position.ToString(); + rs485AddressTextBox.Text = config.RS485Address.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + positionTextBox.Enabled = true; + rs485AddressTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 0 || dummy > 7) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Position' should be between 0 and 7"; + } + if (!int.TryParse(rs485AddressTextBox.Text, out dummy) || dummy < 0 || dummy > 255) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'RS485 Address' should be between 0 and 255"; + } + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.Position = int.Parse(positionTextBox.Text); + config.RS485Address = (byte)int.Parse(rs485AddressTextBox.Text); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.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/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterFactory.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterFactory.cs new file mode 100644 index 000000000..6745a3ce5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterFactory.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PressureMeter +{ + public class PressureMeterFactory : IComponentFactory + { + public string ClassName { get { return "PressureMeter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new PressureMeterCfg(this, "PressureMeter", "CB", 1, 99); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new PressureMeterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new PressureMeter((PressureMeterCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return PressureMeterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { PressureMeter.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs new file mode 100644 index 000000000..5213a1f01 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs @@ -0,0 +1,58 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde.PressureMeter +{ + public class ReadPressureOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadPressureOp)); + public override string ToString() { return string.Format("ReadPressureOp(.,{0},{1},.)", eventDone, pressureMeterNr); } + + /// Set by the constructor + readonly ControlBoardDev controlBoardDev; + readonly int pressureMeterNr; + readonly Event eventDone; + FloatBox pressure; + + /// + /// Events: PressureInDone, PressureOutDone or Error + /// + /// Pressure meter reference + /// Reference to the measured pressure variable, value is in bar + /// Event to be returned by Run() when completed OK + public ReadPressureOp(PressureMeter pressureMeter, ref FloatBox pressure, Event eventDone) + { + if (pressureMeter == null) throw new ArgumentNullException("pressureMeter"); + this.controlBoardDev = pressureMeter.ControlBoard; + this.pressureMeterNr = pressureMeter.Index; + this.eventDone = eventDone; + this.pressure = pressure; + + log.Debug(this.ToString()); + } + public ReadPressureOp(PressureMeter pressureMeter, ref FloatBox pressure) + : this(pressureMeter, ref pressure, Event.PressureDone) + { + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.PressureInDone or Event.PressureOutDone + /// + public Event Run() + { + pressure.F = controlBoardDev.Pressure(pressureMeterNr); + return eventDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Pump/Pump.cs b/TestBenchFramework/BenchControl/Elde/Pump/Pump.cs new file mode 100644 index 000000000..87f8caa32 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/Pump.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.BenchControl.Elde.Pump +{ + public class Pump : Generic.IComponent, GenericDevices.IPump, GenericDevices.IValve + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(Pump)); + public override string ToString() + { + return string.Format("Pump(name={0}, bit={1})", Name, bitPosition); + } + + public static void ResetStaticProperties() { } + + private readonly PumpCfg pumpCfg; + public Generic.IComponentCfg Cfg { get { return pumpCfg; } } + + public string Name { get { return pumpCfg.Name; } } + + public GenericDevices.IValve CoupledTo { get { return null; } } + public bool Invert { get { return false; } } + public int LagOpening { get { return 0; } } + public int LagClosing { get { return 0; } } + + readonly ControlBoardDev controlBoard; + readonly int bitPosition; /// 0 .. 63 + + public readonly ulong Mask; /// derived from bitPosition in the constructor + + + public Pump(PumpCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.pumpCfg = cfg; + + controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + this.bitPosition = cfg.BitPosition; + this.Mask = (((ulong)1) << bitPosition); + + log.Debug(this.ToString()); + } + + public bool State + { + get { return (controlBoard.Route & Mask) != 0; } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Pump/PumpCfg.cs b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfg.cs new file mode 100644 index 000000000..6e3d95714 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfg.cs @@ -0,0 +1,52 @@ +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Pump +{ + public class PumpCfg : ComponentCfgBase, IChildComponentCfg + { + public int BitPosition; + + /// Parameterless constructor + public PumpCfg() + { + } + + /// Constructor + public PumpCfg(IComponentFactory factory, string name, string parentName, int bitPosition) + : base(factory, name, parentName) + { + this.BitPosition = bitPosition; + } + + public IComponentCfg Clone() + { + return new PumpCfg(Factory, Name, ParentName, BitPosition); + } + + public string ToString(int i) + { + return string.Format("bit={0}", BitPosition); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + PumpCfg config = (PumpCfg)(new XmlSerializer(typeof(PumpCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.Designer.cs new file mode 100644 index 000000000..1a21a54de --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.Designer.cs @@ -0,0 +1,130 @@ +namespace TBF.BenchControl.Elde.Pump +{ + partial class PumpCfgCtrl + { + /// + /// 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() + { + this.bitPositionTextBox = new System.Windows.Forms.TextBox(); + this.bitPositionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // bitPositionTextBox + // + this.bitPositionTextBox.Enabled = false; + this.bitPositionTextBox.Location = new System.Drawing.Point(122, 99); + this.bitPositionTextBox.Name = "bitPositionTextBox"; + this.bitPositionTextBox.Size = new System.Drawing.Size(46, 20); + this.bitPositionTextBox.TabIndex = 6; + // + // bitPositionLabel + // + this.bitPositionLabel.AutoSize = true; + this.bitPositionLabel.Location = new System.Drawing.Point(36, 102); + this.bitPositionLabel.Name = "bitPositionLabel"; + this.bitPositionLabel.Size = new System.Drawing.Size(59, 13); + this.bitPositionLabel.TabIndex = 5; + this.bitPositionLabel.Text = "Bit Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(36, 76); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(122, 47); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(36, 50); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(119, 21); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(122, 73); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // PumpCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.bitPositionTextBox); + this.Controls.Add(this.bitPositionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "PumpCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.PumpCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox bitPositionTextBox; + private System.Windows.Forms.Label bitPositionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.cs new file mode 100644 index 000000000..b5b868e93 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.cs @@ -0,0 +1,92 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Pump +{ + public partial class PumpCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(PumpCfgCtrl)); + + ComponentParametersDlg parent; + PumpCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as PumpCfg; + Redraw(); + } + } + + public PumpCfgCtrl() + { + InitializeComponent(); + } + + private void PumpCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + bitPositionTextBox.Text = config.BitPosition.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + bitPositionTextBox.Enabled = true; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.BitPosition = int.Parse(bitPositionTextBox.Text); + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Bit Position' should be between 0 and 63"; + } + return flags; + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/PumpCfgCtrl.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/TestBenchFramework/BenchControl/Elde/Pump/PumpFactory.cs b/TestBenchFramework/BenchControl/Elde/Pump/PumpFactory.cs new file mode 100644 index 000000000..e5e92bd55 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Pump/PumpFactory.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Pump +{ + public class PumpFactory : IComponentFactory + { + public string ClassName { get { return "Pump"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return int.MaxValue; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new PumpCfg(this, "Pump", "CB", 0); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new PumpCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Pump((PumpCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return PumpCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Pump.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/FMPumpTestParams.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/FMPumpTestParams.cs new file mode 100644 index 000000000..04d3356a1 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/FMPumpTestParams.cs @@ -0,0 +1,151 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.Elde.PumpWithFM +{ + public class FMPumpTestParams : IParamsProvider, ITestParams + { + public float Power; /// Target=terminal flow durning detection when increasing or decreasing the flow + + string[] paramNames = new string[] + { + Strings.PowerPct, + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return Power.ToString("F1"); + default: return string.Empty; + } + } + + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: Power = Utils.ParseUFloat(strValue); return; + default: return; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + float dummy; + switch (i) + { + case 0: + if (Utils.TryParseUFloat(strValue, out dummy)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentTest TestParamsEntity { get { return testParamsEntity; } } + Entities.ComponentTest testParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Test Test { get { return test; } } + Entities.Test test; + + /// Parameterless constructor + public FMPumpTestParams() + { + Power = 50.0f; + } + + public FMPumpTestParams(Entities.ComponentTest testParamsEntity, string componentName, Entities.Test test) + : this() + { + this.testParamsEntity = testParamsEntity; + this.componentName = componentName; + this.test = test; + } + + public TBF.Entities.ComponentTest ToDbEntity(IComponent component, Entities.Test test) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentTest entity + TBF.Entities.ComponentTest entity = new TBF.Entities.ComponentTest(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Test = test; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + testParamsEntity.Parameters = writer.ToString(); + testParamsEntity.CmpntName = componentName; + testParamsEntity.Test = test; + + } + } + + public static IParamsProvider GetTestParams(Entities.ComponentTest testParamsEntity) + { + if (testParamsEntity == null) return new FMPumpTestParams(); + + FMPumpTestParams testParams; + try + { + testParams = (FMPumpTestParams)(new XmlSerializer(typeof(FMPumpTestParams))) + .Deserialize(new StringReader(testParamsEntity.Parameters)); + } + catch + { + testParams = new FMPumpTestParams(); + } + testParams.testParamsEntity = testParamsEntity; + testParams.componentName = testParamsEntity.CmpntName; + testParams.test = testParamsEntity.Test; + return testParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs new file mode 100644 index 000000000..48f2eab18 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.BenchControl.Elde.PumpWithFM +{ + public class Pump : Generic.IComponent, GenericDevices.IPumpFM, GenericDevices.IValve, IOperation + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(Pump)); + public override string ToString() + { + return string.Format("Pump(name={0}, bit={1}, idx={2})", Name, bitPosition, FMIndex); + } + + public static void ResetStaticProperties() { } + + private readonly PumpCfg pumpCfg; + public Generic.IComponentCfg Cfg { get { return pumpCfg; } } + + public string Name { get { return pumpCfg.Name; } } + + public GenericDevices.IValve CoupledTo { get { return null; } } + public bool Invert { get { return false; } } + public int LagOpening { get { return 0; } } + public int LagClosing { get { return 0; } } + + readonly ControlBoardDev controlBoard; + readonly int bitPosition; /// 0 .. 63 + int FMIndex; /// 0 .. FMPumpsCount-1 + + public readonly ulong Mask; /// derived from bitPosition in the constructor + + public bool State + { + get { return (controlBoard.Route & Mask) != 0; } + } + + + public Pump(PumpCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.pumpCfg = cfg; + + controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + this.bitPosition = cfg.BitPosition; + this.Mask = (((ulong)1) << bitPosition); + this.FMIndex = cfg.FMIndex; + + log.Debug(this.ToString()); + } + + /// + /// The currently running operation. + /// + public enum CurrentOp + { + None, + TurnOn, + TurnOff, + } + /// + CurrentOp currentOp; + + /// + /// Turn the pump frequency inverter on. + /// + public IOperation TurnOn() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.TurnOn; + return this; + } + + /// + /// Turn the pump frequency inverter on. + /// + public IOperation TurnOff() + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.TurnOff; + return this; + } + + /// Start the operation + public void Start() + { + switch (currentOp) + { + case CurrentOp.TurnOn: + controlBoard.SetFMFreq(FMIndex, 50.0f); + return; + case CurrentOp.TurnOff: + default: + controlBoard.SetFMFreq(FMIndex, 0.0f); + return; + } + } + + /// Run the operation + public Event Run() + { + return Event.TurnPumpOnOffDone; + } + + /// Stop the operation + public void Stop() + { + currentOp = CurrentOp.None; + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfg.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfg.cs new file mode 100644 index 000000000..4c52a8f63 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfg.cs @@ -0,0 +1,53 @@ +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PumpWithFM +{ + public class PumpCfg : ComponentCfgBase, IChildComponentCfg + { + public int BitPosition; + public int FMIndex; + + /// Parameterless constructor + public PumpCfg() + { + } + /// Constructor + public PumpCfg(IComponentFactory factory, string name, string parentName, int bitPosition, int fmIndex) + : base(factory, name, parentName) + { + this.BitPosition = bitPosition; + this.FMIndex = fmIndex; + } + + public IComponentCfg Clone() + { + return new PumpCfg(Factory, Name, ParentName, BitPosition, FMIndex); + } + + public string ToString(int i) + { + return string.Format("bit={0}, fmIdx={1}", BitPosition, FMIndex); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + PumpCfg config = (PumpCfg)(new XmlSerializer(typeof(PumpCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.Designer.cs new file mode 100644 index 000000000..a8b21c99a --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.Designer.cs @@ -0,0 +1,153 @@ +namespace TBF.BenchControl.Elde.PumpWithFM +{ + partial class PumpCfgCtrl + { + /// + /// 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() + { + this.bitPositionTextBox = new System.Windows.Forms.TextBox(); + this.bitPositionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.fmIndexTextBox = new System.Windows.Forms.TextBox(); + this.fmIndexLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // bitPositionTextBox + // + this.bitPositionTextBox.Enabled = false; + this.bitPositionTextBox.Location = new System.Drawing.Point(122, 99); + this.bitPositionTextBox.Name = "bitPositionTextBox"; + this.bitPositionTextBox.Size = new System.Drawing.Size(46, 20); + this.bitPositionTextBox.TabIndex = 6; + // + // bitPositionLabel + // + this.bitPositionLabel.AutoSize = true; + this.bitPositionLabel.Location = new System.Drawing.Point(36, 102); + this.bitPositionLabel.Name = "bitPositionLabel"; + this.bitPositionLabel.Size = new System.Drawing.Size(59, 13); + this.bitPositionLabel.TabIndex = 5; + this.bitPositionLabel.Text = "Bit Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(36, 76); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(122, 47); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(36, 50); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(119, 21); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(122, 73); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // fmIndexTextBox + // + this.fmIndexTextBox.Enabled = false; + this.fmIndexTextBox.Location = new System.Drawing.Point(122, 124); + this.fmIndexTextBox.Name = "fmIndexTextBox"; + this.fmIndexTextBox.Size = new System.Drawing.Size(46, 20); + this.fmIndexTextBox.TabIndex = 8; + // + // fmIndexLabel + // + this.fmIndexLabel.AutoSize = true; + this.fmIndexLabel.Location = new System.Drawing.Point(36, 127); + this.fmIndexLabel.Name = "fmIndexLabel"; + this.fmIndexLabel.Size = new System.Drawing.Size(51, 13); + this.fmIndexLabel.TabIndex = 7; + this.fmIndexLabel.Text = "FM Index"; + // + // PumpCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.fmIndexTextBox); + this.Controls.Add(this.fmIndexLabel); + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.bitPositionTextBox); + this.Controls.Add(this.bitPositionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "PumpCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.PumpCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox bitPositionTextBox; + private System.Windows.Forms.Label bitPositionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + private System.Windows.Forms.TextBox fmIndexTextBox; + private System.Windows.Forms.Label fmIndexLabel; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.cs new file mode 100644 index 000000000..41141e3fd --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.cs @@ -0,0 +1,100 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PumpWithFM +{ + public partial class PumpCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(PumpCfgCtrl)); + + ComponentParametersDlg parent; + PumpCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as PumpCfg; + Redraw(); + } + } + + public PumpCfgCtrl() + { + InitializeComponent(); + } + + private void PumpCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + bitPositionTextBox.Text = config.BitPosition.ToString(); + fmIndexTextBox.Text = config.FMIndex.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + bitPositionTextBox.Enabled = true; + fmIndexTextBox.Enabled = true; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.BitPosition = int.Parse(bitPositionTextBox.Text); + config.FMIndex = int.Parse(fmIndexTextBox.Text); + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Bit Position' should be between 0 and 63"; + } + if (!int.TryParse(fmIndexTextBox.Text, out dummy) || dummy < 0) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'FM Index' should be between 0 and FMPumpsCount - 1"; + } + return flags; + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfgCtrl.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/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpFactory.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpFactory.cs new file mode 100644 index 000000000..f9d60cd82 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpFactory.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.PumpWithFM +{ + public class PumpFactory : IComponentFactory + { + public string ClassName { get { return "PumpWithFM"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return true; } } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) + { + return FMPumpTestParams.GetTestParams(testParams); + } + + /// Max. number of components of this class in the system + public int MaxCount { get { return int.MaxValue; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new PumpCfg(this, "Pump", "CB", 0, 0); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new PumpCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Pump((PumpCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return PumpCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Pump.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/QueryMeasurementEndOp.cs b/TestBenchFramework/BenchControl/Elde/QueryMeasurementEndOp.cs new file mode 100644 index 000000000..c341a6c75 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/QueryMeasurementEndOp.cs @@ -0,0 +1,59 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class QueryMeasurementEndOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(QueryMeasurementEndOp)); + public override string ToString() { return string.Format("QueryMeasurementEndOp(.,{0})", eventDone); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly Event eventDone; + + bool done = false; + + /// + /// Events: MeasurementCompleted + /// + /// Event to be returned by Run() when completed OK + public QueryMeasurementEndOp(ControlBoardDev controlBoardDev, Event eventDone) + { + if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev"); + this.controlBoard = controlBoardDev; + this.eventDone = eventDone; + + log.Debug(this.ToString()); + } + public QueryMeasurementEndOp(ControlBoardDev controlBoardDev) + : this(controlBoardDev, Event.MeasurementCompleted) + { + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + if (done) return eventDone; + if (0 != (controlBoard.StatusP & StatusP.TestCompleted)) + { + done = true; + return eventDone; + } + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RRProcedureParams.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RRProcedureParams.cs new file mode 100644 index 000000000..30a90f4c0 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RRProcedureParams.cs @@ -0,0 +1,155 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class RRProcedureParams : IParamsProvider, IProcedureParams + { + public float PulsesPerLtr; /// Target low limit of the flow increase or decrease + + string[] paramNames = new string[] + { + Strings.PulsesPerLtr, + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return PulsesPerLtr.ToString(); + default: return string.Empty; + } + } + + /// + /// Parameterless constructor - sets default values of parameters. + /// + public RRProcedureParams() + { + PulsesPerLtr = 1.0f; + } + + /// Retrieves parameters from UI controls + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: PulsesPerLtr = Utils.ParseUFloat(strValue); return; + default: return; + } + } + + /// Verifies whether strings in UI controls represent valid parameters + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + float dummy; + switch (i) + { + case 0: + if (Utils.TryParseUFloat(strValue, out dummy)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentProcedure ProcedureParamsEntity { get { return procedureParamsEntity; } } + Entities.ComponentProcedure procedureParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Procedure Procedure { get { return procedure; } } + Entities.Procedure procedure; + + public RRProcedureParams(Entities.ComponentProcedure procedureParamsEntity, string componentName, Entities.Procedure procedure) + : this() + { + this.procedureParamsEntity = procedureParamsEntity; + this.componentName = componentName; + this.procedure = procedure; + } + + public TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentProcedure entity + TBF.Entities.ComponentProcedure entity = new TBF.Entities.ComponentProcedure(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Procedure = procedure; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + procedureParamsEntity.Parameters = writer.ToString(); + procedureParamsEntity.CmpntName = componentName; + procedureParamsEntity.Procedure = procedure; + + } + } + + public static IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParamsEntity) + { + if (procedureParamsEntity == null) return new RRProcedureParams(); + + RRProcedureParams procedureParams; + try + { + procedureParams = (RRProcedureParams)(new XmlSerializer(typeof(RRProcedureParams))) + .Deserialize(new StringReader(procedureParamsEntity.Parameters)); + } + catch + { + procedureParams = new RRProcedureParams(); + } + procedureParams.procedureParamsEntity = procedureParamsEntity; + procedureParams.componentName = procedureParamsEntity.CmpntName; + procedureParams.procedure = procedureParamsEntity.Procedure; + return procedureParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadReferenceForRegisterOp.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadReferenceForRegisterOp.cs new file mode 100644 index 000000000..43ee94aa7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadReferenceForRegisterOp.cs @@ -0,0 +1,58 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class ReadReferenceForRegisterOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadReferenceForRegisterOp)); + public override string ToString() { return string.Format("ReadWaterMeterOp(.,{0},{1},.)", eventDone, registerNr); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly int registerNr; /// 0 .. nr.watermeters-1 + readonly Event eventDone; + IntBox pulses; + + /// + /// Events: or Error + /// + /// Flow meter reference + /// Reference to the measured flow variable, value is in bar + /// Event to be returned by Run() when completed OK + public ReadReferenceForRegisterOp(Elde.RegisterReader.RegisterReader register, ref IntBox pulses, Event eventDone) + { + if (register == null) throw new ArgumentNullException("register"); + this.controlBoard = register.ControlBoard; + this.registerNr = register.Position; + this.eventDone = eventDone; + this.pulses = pulses; + + log.Debug(this.ToString()); + } + public ReadReferenceForRegisterOp(Elde.RegisterReader.RegisterReader register, ref IntBox pulses) + : this(register, ref pulses, Event.ReadReferenceDone) + { + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + pulses.N = (int)controlBoard.EtPulses(registerNr); + return eventDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadRegisterOp.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadRegisterOp.cs new file mode 100644 index 000000000..4d9e01d5b --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/ReadRegisterOp.cs @@ -0,0 +1,71 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class ReadRegisterOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadRegisterOp)); + public override string ToString() { return string.Format("ReadRegisterOp({0})", reader.Name); } + + /// Set by the constructor + readonly RegisterReader reader; + IntBox pulses; + IntBox refPulses; + + /// + /// Events: Event.ReadRegisterDone or Event.Error + /// + /// Register reader reference + /// Reference to a field with the water meter pulses + public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses) + { + this.reader = reader as RegisterReader; + if (reader == null) throw new ArgumentNullException("reader is null or it is not Elde"); + + this.pulses = pulses; + log.Debug(this.ToString()); + } + + /// + /// Events: Event.ReadRegisterDone or Event.Error + /// + /// Register reader reference + /// Reference to a Box with the water meter pulses + /// Reference to a Box with the reference flow meter pulses synchronized with the water meter + public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses, ref IntBox refPulses) + : this(reader, ref pulses) + { + this.refPulses = refPulses; + log.Debug(this.ToString()); + } + + private void ReadPulses() + { + pulses.N = (int)reader.ControlBoard.WMeterPulses(reader.Position); + if (refPulses != null) + { + refPulses.N = (int)reader.ControlBoard.EtPulses(reader.Position); + } + } + + /// Start this operation + public void Start() + { + ReadPulses(); + } + + /// Run this operation + /// eventDone + public Event Run() + { + ReadPulses(); + return Event.ReadRegisterDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs new file mode 100644 index 000000000..88dd05637 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class RegisterReader : ComponentBase, GenericDevices.IRegisterReader + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(RegisterReader)); + public override string ToString() + { + return string.Format("Register({0},{1})", Name, Position); + } + + public static void ResetStaticProperties() { } + + RegisterReaderCfg registerReaderCfg; + + public float PulsesPerLtr + { + get + { + return (ProcedureParams is RRProcedureParams) ? (ProcedureParams as RRProcedureParams).PulsesPerLtr : 0; + } + } + + public readonly ControlBoardDev ControlBoard; + + public readonly int Position; /// 1 .. inf + + public RegisterReader(RegisterReaderCfg cfg, IList components) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.registerReaderCfg = cfg; + + ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + Position = cfg.Position; + + /// Prepare data for SendCalibData() control board component method + + log.Debug(this.ToString()); + } + + /// + /// Events: Event.ReadRegisterDone, Event.Error + /// + /// Reference to a variable for the water meter pulses + /// ReadWaterMeter instance reference casted to IOperaton + public IOperation ReadRegisterOp(ref IntBox pulses) + { + return new ReadRegisterOp(this, ref pulses); + } + + /// + /// Events: Event.ReadRegisterDone, Event.Error + /// + /// Reference to a variable for the water meter pulses + /// Reference to a variable for the related reference flowmeter pulses + /// Reference to operation object instance + public IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses) + { + return new ReadRegisterOp(this, ref pulses, ref refPulses); + } + + /// + /// Events: ReadReferenceDone, Error + /// + /// Reference to a variable for the water meter pulses + /// Reference to operation object instance + public IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses) + { + return new ReadReferenceForRegisterOp(this, ref pulses); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfg.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfg.cs new file mode 100644 index 000000000..584eab6b4 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfg.cs @@ -0,0 +1,60 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg + { + public int Position; /// 1..nrWaterMeters + + /// Parameterless constructor + public RegisterReaderCfg() + { + } + /// + /// Regulation valve configuration parameters + /// + /// Regulation valve name + /// Position on the control board 1 .. nrWaterMeters + public RegisterReaderCfg(IComponentFactory factory, string name, string parentName, int position) + : base(factory, name, parentName) + { + if (position < 1 || position >= 2 * Program.WMsCount) + { + throw new ArgumentOutOfRangeException("position"); + } + this.Position = position; + } + + public IComponentCfg Clone() + { + return new RegisterReaderCfg(Factory, Name, ParentName, Position); + } + + public string ToString(int i) + { + return string.Format("position={0}", Position); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + RegisterReaderCfg config = (RegisterReaderCfg)(new XmlSerializer(typeof(RegisterReaderCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.Designer.cs new file mode 100644 index 000000000..d73b92337 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.Designer.cs @@ -0,0 +1,130 @@ +namespace TBF.BenchControl.Elde.RegisterReader +{ + partial class RegisterReaderCfgCtrl + { + /// + /// 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() + { + this.positionTextBox = new System.Windows.Forms.TextBox(); + this.positionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.componentNameLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // positionTextBox + // + this.positionTextBox.Enabled = false; + this.positionTextBox.Location = new System.Drawing.Point(136, 119); + this.positionTextBox.Name = "positionTextBox"; + this.positionTextBox.Size = new System.Drawing.Size(46, 20); + this.positionTextBox.TabIndex = 6; + // + // positionLabel + // + this.positionLabel.AutoSize = true; + this.positionLabel.Location = new System.Drawing.Point(26, 122); + this.positionLabel.Name = "positionLabel"; + this.positionLabel.Size = new System.Drawing.Size(44, 13); + this.positionLabel.TabIndex = 5; + this.positionLabel.Text = "Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(26, 96); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(136, 67); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(26, 70); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // componentNameLabel + // + this.componentNameLabel.AutoSize = true; + this.componentNameLabel.Location = new System.Drawing.Point(133, 43); + this.componentNameLabel.Name = "componentNameLabel"; + this.componentNameLabel.Size = new System.Drawing.Size(83, 13); + this.componentNameLabel.TabIndex = 0; + this.componentNameLabel.Text = "ComonentName"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(136, 93); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // RegisterReaderCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.positionTextBox); + this.Controls.Add(this.positionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.componentNameLabel); + this.Name = "RegisterReaderCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.RegisterReaderCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox positionTextBox; + private System.Windows.Forms.Label positionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label componentNameLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.cs new file mode 100644 index 000000000..79709154f --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.cs @@ -0,0 +1,92 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public partial class RegisterReaderCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(RegisterReaderCfgCtrl)); + + ComponentParametersDlg parent; + RegisterReaderCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as RegisterReaderCfg; + Redraw(); + } + } + + public RegisterReaderCfgCtrl() + { + InitializeComponent(); + } + + private void RegisterReaderCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + componentNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + positionTextBox.Text = config.Position.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + positionTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(positionTextBox.Text, out dummy) || (dummy < 1) || (dummy > 2 * Program.WMsCount)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Position' should be >= 1"; + } + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.Position = int.Parse(positionTextBox.Text); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderCfgCtrl.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/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderFactory.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderFactory.cs new file mode 100644 index 000000000..a2a97f5e9 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReaderFactory.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegisterReader +{ + public class RegisterReaderFactory : IComponentFactory + { + public string ClassName { get { return "RegisterReader"; } } + + /// Max. number of components of this class in the system + public int MaxCount { get { return Program.WMsCount; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new RegisterReaderCfg(this, "Sick", "CB", 1); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new RegisterReaderCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new RegisterReader((RegisterReaderCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return RegisterReaderCfg.CreateFromDbEntity(component, this); + } + + public bool HasProcedureParams { get { return true; } } + /// + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) + { + return RRProcedureParams.GetProcedureParams(procedureParams); + } + + public bool HasTestParams { get { return false; } } + /// + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + + public void ResetStaticProperties() { RegisterReader.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs new file mode 100644 index 000000000..3c1adf65b --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class ChangeRegulValvePositionOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ChangeRegulValvePositionOp)); + public override string ToString() + { + return string.Format("ChangeRegulValvePositionOp({0},{1}s)", regulValve.Name, timePulseSec.ToString("F2")); + } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly RegulValve regulValve; + readonly int regulValveNr; + readonly float timePulseSec; + + /// Process values + bool firstRun; + + /// + /// Set required water flow. + /// Events: FlowSet, FlowTimeOut + /// + /// Control board device + /// Regulation valve component + /// Lower limit of the position to be achieved + /// Upper limit of the position to be achieved + /// Timeout in sec. for setting the flow + /// Only Elde.Valve flow are used, other flow on the lists are ignored + public ChangeRegulValvePositionOp(ControlBoardDev controlBoard, RegulValve regulValve, float timePulseSec) + { + if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); + this.controlBoard = controlBoard; + + this.regulValve = regulValve as RegulValve; + if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); + this.regulValveNr = this.regulValve.Position; + + this.timePulseSec = timePulseSec; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + firstRun = true; + float positionPct = controlBoard.RValvePosition(regulValveNr); + log.WarnFormat("RV#={0}, actPos={1}%", regulValveNr, positionPct.ToString("F1")); + + controlBoard.ValveMove(regulValveNr, + RegulValveMode.PulseWidth, + new float[2] { timePulseSec, timePulseSec }); + } + + /// Run this operation + /// + /// Event.SetFlowDone + /// + public Event Run() + { + float positionPct = controlBoard.RValvePosition(regulValveNr); + log.WarnFormat("RV#={0}, actPos={1}%", regulValveNr, positionPct.ToString("F1")); + + return Event.PositionReached; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs new file mode 100644 index 000000000..62a6c51e4 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class RegulValve : IComponent, GenericDevices.IRegulValve + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve)); + public override string ToString() + { + return string.Format("RegulationValve({0},{1})", Name, Position); + } + + public static void ResetStaticProperties() { } + + public RegulValveCfg RegulValveCfg; + public Generic.IComponentCfg Cfg { get { return RegulValveCfg; } } + + public string Name { get { return Cfg.Name; } } + + IDictionary dict; + public IDictionary Dict { get { return dict; } } + + readonly ControlBoardDev controlBoard; + + public readonly int Position; /// 0..7 + public readonly int DacValueClosed; /// 0..1023 + public readonly int DacValueOpen; /// 0..1023 + + public RegulValve(RegulValveCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.RegulValveCfg = cfg; + + controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + this.Position = cfg.Position; + this.DacValueClosed = cfg.DacValueClosed; + this.DacValueOpen = cfg.DacValueOpen; + this.dict = new Dictionary(); + + this.controlBoard.RegValveCalib[Position - 1, 0] = (uint)DacValueClosed; + this.controlBoard.RegValveCalib[Position - 1, 1] = (uint)DacValueOpen; + + log.Debug(this.ToString()); + } + + /// + /// Operation to set the water flow within tolerances + /// Events: Event.None, Event.FlowReached, Event.FlowTimeOut + /// + /// Flowmeter component + /// Lower limit of the required flow [m3/h] + /// Higher limit of the required flow [m3/h] + /// Measured flow [m3/h] + /// Timeout in [s] + /// SetFlowOp instance + public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout) + { + return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout); + } + + /// + /// Operation to set the water flow within tolerances. Leave the measurement running. + /// Events: Event.None, Event.FlowReached, Event.FlowTimeOut + /// + /// Flowmeter component + /// Lower limit of the required flow [m3/h] + /// Higher limit of the required flow [m3/h] + /// Measured flow [m3/h] + /// Timeout in [s] + /// SetFlowOp instance + public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout) + { + return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, true); + } + + /// + /// Operation to set the regulation valve to a required position + /// Events: Event.None + /// + /// Lower limit of the required valve position in [%] + /// Higher limit of the required valve position in [%] + /// SetPositionOp instance + public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + { + return new SetRegulValvePositionOp(controlBoard, this, pctLo, pctHi, timeoutMs); + } + + public IOperation ChangeRegulValvePositionOp(float timePulseSec) + { + return new ChangeRegulValvePositionOp(controlBoard, this, timePulseSec); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs new file mode 100644 index 000000000..debb2f32b --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs @@ -0,0 +1,73 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class RegulValveCfg : ComponentCfgBase, IChildComponentCfg + { + public int Position; /// 0..7 + public int DacValueClosed; /// 0..1023 + public int DacValueOpen; /// 0..1023 + public int PidCoef; /// 1..100 + public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions + + /// Parameterless constructor + public RegulValveCfg() + { + } + /// + /// Regulation valve configuration parameters + /// + /// Regulation valve name + /// Position on the control board 0..7 + /// 0..1023 + /// 0..1023 + /// 1..100 + public RegulValveCfg(IComponentFactory factory, string name, string parentName, int position, int dacValueClosed, int dacValueOpen, int pidCoef, bool storedPositionReuse) + : base(factory, name, parentName) + { + if (position < 0 || position > 7) throw new ArgumentOutOfRangeException("position"); + if (dacValueClosed < 0 || dacValueClosed > 1023) throw new ArgumentOutOfRangeException("dacValueOpen"); + if (dacValueOpen < 0 || dacValueOpen > 1023) throw new ArgumentOutOfRangeException("dacValueOpen"); + if (pidCoef < 1 || pidCoef > 100) throw new ArgumentOutOfRangeException("pidCoef"); + + this.Position = position; + this.DacValueClosed = dacValueClosed; + this.DacValueOpen = dacValueOpen; + this.PidCoef = pidCoef; + this.StoredPositionReuse = storedPositionReuse; + } + + public IComponentCfg Clone() + { + return new RegulValveCfg(Factory, Name, ParentName, Position, DacValueClosed, DacValueOpen, PidCoef, StoredPositionReuse); + } + + public string ToString(int i) + { + return string.Format("position={0}, DAC-closed={1}, DAC-open={2}, PID={3}, posReuse={4}", + Position, DacValueClosed, DacValueOpen, PidCoef, StoredPositionReuse); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + RegulValveCfg config = (RegulValveCfg)(new XmlSerializer(typeof(RegulValveCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.Designer.cs new file mode 100644 index 000000000..20eaac9b5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.Designer.cs @@ -0,0 +1,213 @@ +namespace TBF.BenchControl.Elde.RegulValve +{ + partial class RegulValveCfgCtrl + { + /// + /// 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() + { + this.positionTextBox = new System.Windows.Forms.TextBox(); + this.positionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.dacClosedLabel = new System.Windows.Forms.Label(); + this.dacClosedTextBox = new System.Windows.Forms.TextBox(); + this.dacOpenTextBox = new System.Windows.Forms.TextBox(); + this.dacOpenLabel = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.pidCoefLabel = new System.Windows.Forms.Label(); + this.pidCoefTextBox = new System.Windows.Forms.TextBox(); + this.storedPosReuseCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // positionTextBox + // + this.positionTextBox.Enabled = false; + this.positionTextBox.Location = new System.Drawing.Point(138, 78); + this.positionTextBox.Name = "positionTextBox"; + this.positionTextBox.Size = new System.Drawing.Size(46, 20); + this.positionTextBox.TabIndex = 6; + // + // positionLabel + // + this.positionLabel.AutoSize = true; + this.positionLabel.Location = new System.Drawing.Point(28, 81); + this.positionLabel.Name = "positionLabel"; + this.positionLabel.Size = new System.Drawing.Size(18, 13); + this.positionLabel.TabIndex = 5; + this.positionLabel.Text = "ID"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(28, 57); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(138, 30); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(28, 33); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(135, 9); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(89, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComponentName"; + // + // dacClosedLabel + // + this.dacClosedLabel.AutoSize = true; + this.dacClosedLabel.Location = new System.Drawing.Point(28, 104); + this.dacClosedLabel.Name = "dacClosedLabel"; + this.dacClosedLabel.Size = new System.Drawing.Size(93, 13); + this.dacClosedLabel.TabIndex = 7; + this.dacClosedLabel.Text = "DAC when Closed"; + // + // dacClosedTextBox + // + this.dacClosedTextBox.Enabled = false; + this.dacClosedTextBox.Location = new System.Drawing.Point(138, 101); + this.dacClosedTextBox.Name = "dacClosedTextBox"; + this.dacClosedTextBox.Size = new System.Drawing.Size(46, 20); + this.dacClosedTextBox.TabIndex = 8; + // + // dacOpenTextBox + // + this.dacOpenTextBox.Enabled = false; + this.dacOpenTextBox.Location = new System.Drawing.Point(138, 124); + this.dacOpenTextBox.Name = "dacOpenTextBox"; + this.dacOpenTextBox.Size = new System.Drawing.Size(46, 20); + this.dacOpenTextBox.TabIndex = 10; + // + // dacOpenLabel + // + this.dacOpenLabel.AutoSize = true; + this.dacOpenLabel.Location = new System.Drawing.Point(28, 127); + this.dacOpenLabel.Name = "dacOpenLabel"; + this.dacOpenLabel.Size = new System.Drawing.Size(87, 13); + this.dacOpenLabel.TabIndex = 9; + this.dacOpenLabel.Text = "DAC when Open"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(138, 54); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // pidCoefLabel + // + this.pidCoefLabel.AutoSize = true; + this.pidCoefLabel.Location = new System.Drawing.Point(28, 150); + this.pidCoefLabel.Name = "pidCoefLabel"; + this.pidCoefLabel.Size = new System.Drawing.Size(78, 13); + this.pidCoefLabel.TabIndex = 11; + this.pidCoefLabel.Text = "PID Coefficient"; + // + // pidCoefTextBox + // + this.pidCoefTextBox.Enabled = false; + this.pidCoefTextBox.Location = new System.Drawing.Point(138, 147); + this.pidCoefTextBox.Name = "pidCoefTextBox"; + this.pidCoefTextBox.Size = new System.Drawing.Size(46, 20); + this.pidCoefTextBox.TabIndex = 12; + // + // storedPosReuseCheckBox + // + this.storedPosReuseCheckBox.AutoSize = true; + this.storedPosReuseCheckBox.Enabled = false; + this.storedPosReuseCheckBox.Location = new System.Drawing.Point(31, 174); + this.storedPosReuseCheckBox.Name = "storedPosReuseCheckBox"; + this.storedPosReuseCheckBox.Size = new System.Drawing.Size(162, 17); + this.storedPosReuseCheckBox.TabIndex = 13; + this.storedPosReuseCheckBox.Text = "Enable stored position re-use"; + this.storedPosReuseCheckBox.UseVisualStyleBackColor = true; + // + // RegulValveCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.storedPosReuseCheckBox); + this.Controls.Add(this.pidCoefTextBox); + this.Controls.Add(this.pidCoefLabel); + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.dacOpenTextBox); + this.Controls.Add(this.dacOpenLabel); + this.Controls.Add(this.dacClosedTextBox); + this.Controls.Add(this.dacClosedLabel); + this.Controls.Add(this.positionTextBox); + this.Controls.Add(this.positionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "RegulValveCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.RegulationValveCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox positionTextBox; + private System.Windows.Forms.Label positionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label dacClosedLabel; + private System.Windows.Forms.TextBox dacClosedTextBox; + private System.Windows.Forms.TextBox dacOpenTextBox; + private System.Windows.Forms.Label dacOpenLabel; + private System.Windows.Forms.ComboBox parentNameComboBox; + private System.Windows.Forms.Label pidCoefLabel; + private System.Windows.Forms.TextBox pidCoefTextBox; + private System.Windows.Forms.CheckBox storedPosReuseCheckBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs new file mode 100644 index 000000000..ad870b19f --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs @@ -0,0 +1,120 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public partial class RegulValveCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(RegulValveCfgCtrl)); + + ComponentParametersDlg parent; + RegulValveCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as RegulValveCfg; + Redraw(); + } + } + + public RegulValveCfgCtrl() + { + InitializeComponent(); + } + + private void RegulationValveCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + positionTextBox.Text = config.Position.ToString(); + dacClosedTextBox.Text = config.DacValueClosed.ToString(); + dacOpenTextBox.Text = config.DacValueOpen.ToString(); + pidCoefTextBox.Text = config.PidCoef.ToString(); + storedPosReuseCheckBox.Checked = config.StoredPositionReuse; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + positionTextBox.Enabled = true; + dacClosedTextBox.Enabled = true; + dacOpenTextBox.Enabled = true; + pidCoefTextBox.Enabled = true; + storedPosReuseCheckBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 1 || dummy > 5) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Position' should be between 1 and 5"; + } + if (!int.TryParse(dacClosedTextBox.Text, out dummy) || dummy < 0 || dummy > 1023) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'DAC when Closed' should be between 0 and 1023"; + } + if (!int.TryParse(dacOpenTextBox.Text, out dummy) || dummy < 0 || dummy > 1023) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'DAC when Open' should be between 0 and 1023"; + } + if (!int.TryParse(pidCoefTextBox.Text, out dummy) || dummy < 0 || dummy > 100) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'PID Coefficient' should be between 0 and 100"; + } + + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.Position = int.Parse(positionTextBox.Text); + config.DacValueClosed = int.Parse(dacClosedTextBox.Text); + config.DacValueOpen = int.Parse(dacOpenTextBox.Text); + config.PidCoef = int.Parse(pidCoefTextBox.Text); + config.StoredPositionReuse = storedPosReuseCheckBox.Checked; + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.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/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveFactory.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveFactory.cs new file mode 100644 index 000000000..041e71e0e --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveFactory.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class RegulValveFactory : IComponentFactory + { + public string ClassName { get { return "RegulationValve"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new RegulValveCfg(this, "RegulationValve", "CB", 1, 100, 500, 20, false); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new RegulValveCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new RegulValve((RegulValveCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return RegulValveCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { RegulValve.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs new file mode 100644 index 000000000..0ae4845c1 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -0,0 +1,269 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class SetFlowOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(SetFlowOp)); + public override string ToString() + { + return string.Format("SetFlowOp({0},{1},{2})", regulValve.Name, reqFlowLo, reqFlowHi); + } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly Elde.FlowMeter.FlowMeter flowMeter; + readonly Elde.RegulValve.RegulValve regulValve; + readonly int regulValveNr; + readonly int flowMeterNr; + readonly float reqFlowLo; + readonly float reqFlowHi; + readonly float reqFlowAve; + readonly int timeout; + readonly bool leaveMeasurementRunning; + + /// Process values + enum OpState + { + Idle = 0, + ValveMoveToPosition, + SettingPosition, + ValveMoveToFlow, + SettingFlow, + FlowReached, + } + OpState opState; + + float targetPositionLo; + float targetPositionHi; + + int expireTime; + FloatBox measuredFlow; + + + /// + /// Set required water flow. Conditionally leave the measurement running. + /// Events: FlowSet, FlowTimeOut + /// + /// Control board device + /// Regulation valve component + /// Flowmeter component + /// Lower limit of the flow to be achieved in [m3/h] + /// Upper limit of the flow to be achieved in [m3/h] + /// Timeout for the flow setting in [s] + /// true = Leave the measurement running after op. stop + /// Only Elde.Valve flow are used, other flow on the lists are ignored + public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regulValve, IFlowMeter flowMeter, + float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout, bool leaveMeasurementRunning) + { + if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); + this.controlBoard = controlBoard; + + this.regulValve = regulValve as Elde.RegulValve.RegulValve; + if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); + this.regulValveNr = this.regulValve.Position; + + this.flowMeter = flowMeter as Elde.FlowMeter.FlowMeter; + if (flowMeter == null) throw new ArgumentNullException("flowMeter in null or not Elde"); + this.flowMeterNr = this.flowMeter.Position; + + this.reqFlowLo = requiredFlowLo; + this.reqFlowHi = requiredFlowHi; + this.reqFlowAve = (reqFlowLo + reqFlowHi) / 2.0f; + this.measuredFlow = measuredFlow; + + this.timeout = timeout; + + this.leaveMeasurementRunning = leaveMeasurementRunning; + + log.Debug(this.ToString()); + } + + /// + /// Set required water flow - Do not leave the measurement running. + /// Events: FlowSet + /// + public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, + float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout) + : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, false) + { + } + + /// + /// Set required water flow - No timeout. + /// Events: FlowSet + /// + public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, + float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow) + : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, int.MaxValue, false) + { + } + + /// + /// Fetch target position limits from the dictionary or return false + /// + /// Average of the flow targer range (input) + /// Target valve position low limit (output) + /// Target valve position high limit (output) + /// true when positions for the target flow are stored in the memory, otherwise return false + bool FetchTargetPosition(float avgReqFlow, out float positionLo, out float positionHi) + { + float targetPosition; + if (regulValve.Dict.TryGetValue(avgReqFlow, out targetPosition)) + { + positionLo = Math.Max(targetPosition * 0.95f, 0.0f); + positionHi = Math.Min(targetPosition * 1.05f, 100.0f); + return true; + } + else + { + positionLo = 0.0f; + positionHi = 0.0f; + return false; + } + } + + void StoreTargetPosition(float avgReqFlow, float actPosition) + { + if (!regulValve.Dict.ContainsKey(reqFlowAve)) + { + regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); + } + return; + } + + /// Start this operation + public void Start() + { + if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi)) + { + log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}", + regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi, targetPositionLo, targetPositionHi); + + opState = OpState.ValveMoveToPosition; + } + else + { + log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}", + regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi); + + opState = OpState.ValveMoveToFlow; + } + + expireTime = StateMachine.CurrentTime + timeout; + if (expireTime < 0) expireTime = int.MaxValue; + + TestMethods tm = 0; + StopDevs sd = 0; + controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route, int.MaxValue, tm, + 0.0f, regulValve.RegulValveCfg.PidCoef, 0, sd); + } + + /// Run this operation + /// + /// Event.None, Event.FlowReached, Event.RegulValveTimeOut, Event.Error + /// + public Event Run() + { + float rvPosition = controlBoard.RValvePosition(regulValveNr); + float flowMtrFreq = controlBoard.ReferenceFreq; + float flow = flowMtrFreq * flowMeter.NominalFlow / 2000.0f; + + if (measuredFlow != null) measuredFlow.F = flow; + + log.InfoFormat("Run(): rv#={0} pos={1}% freq={2} flow={3} opState={4}", + regulValveNr, rvPosition.ToString("F1"), flowMtrFreq, flow, opState); + + if (opState == OpState.ValveMoveToPosition) + { + controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, + new float[2] { targetPositionLo, targetPositionHi }); + + opState = OpState.SettingPosition; + return Event.None; + } + else if (opState == OpState.SettingPosition) + { + if ((targetPositionLo <= rvPosition) && (rvPosition <= targetPositionHi)) + { + opState = OpState.ValveMoveToFlow; + } + return Event.None; + } + else if (opState == OpState.ValveMoveToFlow) + { + if (reqFlowLo >= reqFlowHi || reqFlowLo > flowMeter.NominalFlow || reqFlowHi <= 0) + { + return Event.Error; + } + + log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}", + regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi); + + float freqLo = 2000.0f * reqFlowLo / flowMeter.NominalFlow; + float freqHi = 2000.0f * reqFlowHi / flowMeter.NominalFlow; + controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, + new float[2] { freqLo, freqHi }); + + opState = OpState.SettingFlow; + return Event.None; + } + else if (opState == OpState.SettingFlow) + { + if ((reqFlowLo <= flow) && (flow <= reqFlowHi)) + { + if (regulValve.RegulValveCfg.StoredPositionReuse) + { + float storedPosition; + if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition)) + { + /// update the stored valve position + StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f); + log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position", + regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition); + } + else + { + /// store the valve position + StoreTargetPosition(reqFlowAve, rvPosition); + log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position", + regulValveNr, reqFlowAve, rvPosition.ToString("F1")); + } + } + + opState = OpState.FlowReached; + return Event.FlowReached; + } + else if (StateMachine.CurrentTime > expireTime) + { + return Event.RegulValveTimeOut; + } + else + { + return Event.None; + } + } + else /// opState == OpState.FlowReached + { + return Event.FlowReached; + } + } + + /// Start this operation + public void Stop() + { + opState = OpState.Idle; + + if (leaveMeasurementRunning) return; + + /// Stop measurement + TestMethods tm = 0; + StopDevs sd = StopDevs.RegValveRegulation; + controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route, 50000, tm, + 0.0f, 20, 0, sd); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs new file mode 100644 index 000000000..2421d3c7f --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Elde.RegulValve +{ + public class SetRegulValvePositionOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(SetRegulValvePositionOp)); + public override string ToString() + { + return string.Format("SetRegulValvePositionOp({0},{1},{2})", regulValve.Name, posLoPct, posHiPct); + } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly RegulValve regulValve; + readonly int regulValveNr; + readonly float posLoPct; + readonly float posHiPct; + readonly int timeout; + + /// Process values + bool firstRun; + int expireTime; + bool positionReached; + + /// + /// Set required water flow. + /// Events: FlowSet, FlowTimeOut + /// + /// Control board device + /// Regulation valve component + /// Lower limit of the position to be achieved + /// Upper limit of the position to be achieved + /// Timeout in sec. for setting the flow + /// Only Elde.Valve flow are used, other flow on the lists are ignored + public SetRegulValvePositionOp(ControlBoardDev controlBoard, RegulValve regulValve, float posLoPct, float posHiPct, int timeout) + { + if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); + this.controlBoard = controlBoard; + + this.regulValve = regulValve as RegulValve; + if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); + this.regulValveNr = this.regulValve.Position; + + this.posLoPct = posLoPct; + this.posHiPct = posHiPct; + + this.timeout = timeout; + + log.Debug(this.ToString()); + } + + /// + /// Set required water flow - no timeout. + /// Events: FlowSet + /// + public SetRegulValvePositionOp(ControlBoardDev controlBoard, RegulValve regValve, float posLoPct, float posHiPct) + : this(controlBoard, regValve, posLoPct, posHiPct, int.MaxValue) + { + } + + /// Start this operation + public void Start() + { + firstRun = true; + positionReached = false; + expireTime = StateMachine.CurrentTime + timeout; + log.InfoFormat("Start(): RV#={0}, reqPosLo={1}%, reqPosHi={2}%", regulValveNr, posLoPct.ToString("F1"), posHiPct.ToString("F1")); + } + + /// Run this operation + /// + /// Event.SetFlowDone + /// + public Event Run() + { + if (firstRun) + { + if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0) + { + return Event.Error; + } + + firstRun = false; + + controlBoard.ValveMove(regulValveNr, + RegulValveMode.TargetPosition, + new float[2] { posLoPct, posHiPct }); + return Event.None; + } + + if (positionReached) return Event.PositionReached; + + float positionPct = controlBoard.RValvePosition(regulValveNr); + log.WarnFormat("Run(): RV#={0}, actPos={1}%", regulValveNr, positionPct.ToString("F1")); + + if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0) + { + return Event.Error; + } + else if (posLoPct <= positionPct && positionPct <= posHiPct) + { + positionReached = true; + return Event.PositionReached; + } + else if (StateMachine.CurrentTime > expireTime) + { + return Event.RegulValveTimeOut; + } + else + { + return Event.None; + } + } + + /// Stop this operation + public void Stop() + { + controlBoard.ValveMove(regulValveNr, + RegulValveMode.Stop, + new float[2] { posLoPct, posHiPct }); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs b/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs new file mode 100644 index 000000000..569a600cb --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs @@ -0,0 +1,68 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class StartMeasurementOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(StartMeasurementOp)); + public override string ToString() { return string.Format("StartMeasurementOp(ref={0},pulses={1})", flowMeter.Position, refPulses); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + readonly Elde.FlowMeter.FlowMeter flowMeter; + readonly int refPulses; /// Number of reference pulses for a complete test + readonly TestMethods testMethod; + + bool started = false; + + /// + /// Starts the measurement. + /// Events: MeasurementStarted + /// + /// Control board component reference + /// Flow meter component reference + /// Register readers references + /// Water volume for the test in liters + public StartMeasurementOp(ControlBoardDev controlBoardDev, GenericDevices.IFlowMeter flowMeter, int refPulses, TestMethods method) + { + if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev"); + this.controlBoard = controlBoardDev; + + this.flowMeter = flowMeter as Elde.FlowMeter.FlowMeter; + if (this.flowMeter == null) throw new ArgumentException("flowMeter is null or is not Elde"); + + this.refPulses = refPulses; + this.testMethod = method; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + controlBoard.SendCommand(Command.Start, flowMeter.Position, controlBoard.RRoute, refPulses, testMethod, + 0.0f, 20, 0, StopDevs.None); + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + if (started) return Event.MeasurementStarted; + if (0 != (controlBoard.StatusP & StatusP.TestInProgress)) + { + started = true; + return Event.MeasurementStarted; + } + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/StopPreviousOp.cs b/TestBenchFramework/BenchControl/Elde/StopPreviousOp.cs new file mode 100644 index 000000000..02312595e --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/StopPreviousOp.cs @@ -0,0 +1,63 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class StopPreviousOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(StopPreviousOp)); + public override string ToString() { return string.Format("StopPreviousOp(.)"); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + + bool stopped = false; + + /// + /// Stop the previous control board operation (diverter, gate, etc.) + /// Events: None or PreviousStopped + /// + /// Control board component reference + public StopPreviousOp(ControlBoardDev controlBoardDev) + { + if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev"); + this.controlBoard = controlBoardDev; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + controlBoard.SendCommand(Command.Stop, + 0, /// ref. flowmeter number + controlBoard.RRoute, /// route + 0, /// ref. pulses + TestMethods.Diverter, + 0.0f, + 20, + 0, + StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation); + } + + /// Run this operation + /// + /// Event.None or Event.PreviousStopped + /// + public Event Run() + { + if (stopped) return Event.PreviousStopped; + if (0 == (controlBoard.StatusP & StatusP.TestCompleted)) + { + stopped = true; + return Event.PreviousStopped; + } + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs new file mode 100644 index 000000000..40251e171 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs @@ -0,0 +1,57 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde.TempMeter +{ + public class ReadTempOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadTempOp)); + public override string ToString() { return string.Format("ReadTempOp(.,{0},{1},.)", eventDone, tempMeterNr); } + + /// Set by the constructor + ControlBoardDev controlBoardDev; + Event eventDone; + int tempMeterNr; + FloatBox temp; + + /// + /// Events: TempInDone, TempOutDone, TempDivDone or Error + /// + /// TempMeter reference + /// Reference to the variable, value is in degree Celsius + /// Event to be returned by Run() when completed OK + public ReadTempOp(TempMeter tempMeter, ref FloatBox temp, Event eventDone) + { + if (tempMeter == null) throw new ArgumentNullException("tempMeter"); + this.controlBoardDev = tempMeter.ControlBoard; + this.tempMeterNr = tempMeter.Index; + this.temp = temp; + this.eventDone = eventDone; + log.Debug(this.ToString()); + } + public ReadTempOp(TempMeter tempMeter, ref FloatBox temp) + : this(tempMeter, ref temp, Event.TempDone) + { + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.TempInDone, Event.TempOutDone or Event.TempDivDone + /// + public Event Run() + { + temp.F = controlBoardDev.Temperature(tempMeterNr); + return eventDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs new file mode 100644 index 000000000..6acd88bf5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.TempMeter +{ + public class TempMeter : IComponent, GenericDevices.ITempMeter + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter)); + public override string ToString() + { + return string.Format("TempMeter({0},{1})", Name, Index); + } + + public static void ResetStaticProperties() { } + + TempMeterCfg tempMeterCfg; + public Generic.IComponentCfg Cfg { get { return tempMeterCfg; } } + + public string Name { get { return tempMeterCfg.Name; } } + + public readonly ControlBoardDev ControlBoard; + + public readonly int Index; /// 0..7 + public readonly float A1; + public readonly float A2; + public readonly float A3; + public readonly float A4; + public readonly float A5; + + public TempMeter(TempMeterCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.tempMeterCfg = cfg; + + ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + Index = cfg.Position; + A1 = cfg.A1; + A2 = cfg.A2; + A3 = cfg.A3; + A4 = cfg.A4; + A5 = cfg.A5; + + /// Prepare data for SendCalibData() control board component method + ControlBoard.TempCalibData[Index, 0] = A1; + ControlBoard.TempCalibData[Index, 1] = A2; + ControlBoard.TempCalibData[Index, 2] = A3; + ControlBoard.TempCalibData[Index, 3] = A4; + ControlBoard.TempCalibData[Index, 4] = A5; + + log.Debug(this.ToString()); + } + + /// + /// Events: TempDone, Error + /// + /// Reference to a variable for the temperature in Celsius + /// ReadTempOp instance reference casted to IOperaton + public IOperation ReadTempOp(ref FloatBox temp) + { + return new ReadTempOp(this, ref temp); + } + + /// + /// Events: tempDone, Error + /// + /// Reference to a variable for the temperature in Celsius + /// Event returned when measurement done + /// ReadTempOp instance reference casted to IOperaton + public IOperation ReadTempOp(ref FloatBox temp, Event tempDone) + { + return new ReadTempOp(this, ref temp, tempDone); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs new file mode 100644 index 000000000..cb7dc18c6 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs @@ -0,0 +1,78 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.TempMeter +{ + public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg + { + public int Position; /// 0..7 + + public float A1; + public float A2; + public float A3; + public float A4; + public float A5; + + /// Parameterless constructor + public TempMeterCfg() + { + } + /// + /// Temperature meter configuration parameters + /// + /// Temperature meter name + /// Position on the control board 0..7 + /// A1 + /// A2 + /// A3 + /// A4 + /// A5 + public TempMeterCfg(IComponentFactory factory, string name, string parentName, int index, float a1, float a2, float a3, float a4, float a5) + : base(factory, name, parentName) + { + if (index < 0 || index > 7) throw new ArgumentOutOfRangeException("position"); + this.Position = index; + + this.A1 = a1; + this.A2 = a2; + this.A3 = a3; + this.A4 = a4; + this.A5 = a5; + } + public TempMeterCfg(IComponentFactory factory, string name, string parentName, int index) + : this(factory, name, parentName, index, -21.0116f, 0.0017727f, 0.00000000068422f, -7.40415E-16f, 0) + { + } + + public IComponentCfg Clone() + { + return new TempMeterCfg(Factory, Name, ParentName, Position, A1, A2, A3, A4, A5); + } + + public string ToString(int i) + { + return string.Format("index={0}, A1={1}, A2={2}, A3={3}, A4={4}, A5={5}", Position, A1, A2, A3, A4, A5); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + TempMeterCfg config = (TempMeterCfg)(new XmlSerializer(typeof(TempMeterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.Designer.cs new file mode 100644 index 000000000..1c4296443 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.Designer.cs @@ -0,0 +1,245 @@ +namespace TBF.BenchControl.Elde.TempMeter +{ + partial class TempMeterCfgCtrl + { + /// + /// 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() + { + this.positionTextBox = new System.Windows.Forms.TextBox(); + this.positionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.a1TextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.a2TextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.a3TextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.a5TextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.a4TextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // positionTextBox + // + this.positionTextBox.Enabled = false; + this.positionTextBox.Location = new System.Drawing.Point(130, 82); + this.positionTextBox.Name = "positionTextBox"; + this.positionTextBox.Size = new System.Drawing.Size(46, 20); + this.positionTextBox.TabIndex = 6; + // + // positionLabel + // + this.positionLabel.AutoSize = true; + this.positionLabel.Location = new System.Drawing.Point(20, 85); + this.positionLabel.Name = "positionLabel"; + this.positionLabel.Size = new System.Drawing.Size(44, 13); + this.positionLabel.TabIndex = 5; + this.positionLabel.Text = "Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(20, 61); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(130, 34); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(20, 37); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(127, 10); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // a1TextBox + // + this.a1TextBox.Enabled = false; + this.a1TextBox.Location = new System.Drawing.Point(130, 107); + this.a1TextBox.Name = "a1TextBox"; + this.a1TextBox.Size = new System.Drawing.Size(130, 20); + this.a1TextBox.TabIndex = 8; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(20, 110); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(20, 13); + this.label1.TabIndex = 7; + this.label1.Text = "A1"; + // + // a2TextBox + // + this.a2TextBox.Enabled = false; + this.a2TextBox.Location = new System.Drawing.Point(130, 128); + this.a2TextBox.Name = "a2TextBox"; + this.a2TextBox.Size = new System.Drawing.Size(130, 20); + this.a2TextBox.TabIndex = 10; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(20, 131); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(20, 13); + this.label2.TabIndex = 9; + this.label2.Text = "A2"; + // + // a3TextBox + // + this.a3TextBox.Enabled = false; + this.a3TextBox.Location = new System.Drawing.Point(130, 149); + this.a3TextBox.Name = "a3TextBox"; + this.a3TextBox.Size = new System.Drawing.Size(130, 20); + this.a3TextBox.TabIndex = 12; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(20, 152); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(20, 13); + this.label3.TabIndex = 11; + this.label3.Text = "A3"; + // + // a5TextBox + // + this.a5TextBox.Enabled = false; + this.a5TextBox.Location = new System.Drawing.Point(130, 191); + this.a5TextBox.Name = "a5TextBox"; + this.a5TextBox.Size = new System.Drawing.Size(130, 20); + this.a5TextBox.TabIndex = 16; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(20, 194); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(20, 13); + this.label5.TabIndex = 15; + this.label5.Text = "A5"; + // + // a4TextBox + // + this.a4TextBox.Enabled = false; + this.a4TextBox.Location = new System.Drawing.Point(130, 170); + this.a4TextBox.Name = "a4TextBox"; + this.a4TextBox.Size = new System.Drawing.Size(130, 20); + this.a4TextBox.TabIndex = 14; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(20, 173); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(20, 13); + this.label4.TabIndex = 13; + this.label4.Text = "A4"; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(130, 58); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // TempMeterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.a5TextBox); + this.Controls.Add(this.label5); + this.Controls.Add(this.a4TextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.a3TextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.a2TextBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.a1TextBox); + this.Controls.Add(this.label1); + this.Controls.Add(this.positionTextBox); + this.Controls.Add(this.positionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "TempMeterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.Load += new System.EventHandler(this.TempMeterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox positionTextBox; + private System.Windows.Forms.Label positionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.TextBox a1TextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox a2TextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox a3TextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox a5TextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox a4TextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox parentNameComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs new file mode 100644 index 000000000..c5f3ec2aa --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs @@ -0,0 +1,140 @@ +using System; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.TempMeter +{ + public partial class TempMeterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TempMeterCfgCtrl)); + + ComponentParametersDlg parent; + TempMeterCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TempMeterCfg; + Redraw(); + } + } + + public TempMeterCfgCtrl() + { + InitializeComponent(); + } + + private void TempMeterCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + positionTextBox.Text = config.Position.ToString(); + a1TextBox.Text = config.A1.ToString(); + a2TextBox.Text = config.A2.ToString(); + a3TextBox.Text = config.A3.ToString(); + a4TextBox.Text = config.A4.ToString(); + a5TextBox.Text = config.A5.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + positionTextBox.Enabled = true; + a1TextBox.Enabled = true; + a2TextBox.Enabled = true; + a3TextBox.Enabled = true; + a4TextBox.Enabled = true; + a5TextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 0 || dummy > 7) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Position' should be between 0 and 7"; + } + + float fdummy; + if (!Utils.TryParseEFloat(a1TextBox.Text, out fdummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'A1' is not valid"; + } + + if (!Utils.TryParseEFloat(a2TextBox.Text, out fdummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'A2' is not valid"; + } + + if (!Utils.TryParseEFloat(a3TextBox.Text, out fdummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'A3' is not valid"; + } + + if (!Utils.TryParseEFloat(a4TextBox.Text, out fdummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'A4' is not valid"; + } + + if (!Utils.TryParseEFloat(a5TextBox.Text, out fdummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'A5' is not valid"; + } + + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.Position = int.Parse(positionTextBox.Text); + bool updateOk = Utils.TryParseEFloat(a1TextBox.Text, out config.A1) && + Utils.TryParseEFloat(a2TextBox.Text, out config.A2) && + Utils.TryParseEFloat(a3TextBox.Text, out config.A3) && + Utils.TryParseEFloat(a4TextBox.Text, out config.A4) && + Utils.TryParseEFloat(a5TextBox.Text, out config.A5); + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.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/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterFactory.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterFactory.cs new file mode 100644 index 000000000..6cab71abd --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterFactory.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.TempMeter +{ + public class TempMeterFactory : IComponentFactory + { + public string ClassName { get { return "TempMeter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 8; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new TempMeterCfg(this, "TempMeter", "CB", 0); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new TempMeterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new TempMeter((TempMeterCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return TempMeterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { TempMeter.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/UpdateTankWeightOp.cs b/TestBenchFramework/BenchControl/Elde/UpdateTankWeightOp.cs new file mode 100644 index 000000000..0a620546b --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/UpdateTankWeightOp.cs @@ -0,0 +1,48 @@ +using System; +using log4net; + +namespace TBF.BenchControl.Elde +{ + public class UpdateTankWeightOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(UpdateTankWeightOp)); + public override string ToString() { return string.Format("UpdateTankWeightOp(.)"); } + + /// Set by the constructor + readonly ControlBoardDev controlBoard; + + /// + /// Stop the previous control board operation (diverter, gate, etc.) + /// Events: None or PreviousStopped + /// + /// Control board component reference + public UpdateTankWeightOp(ControlBoardDev controlBoardDev) + { + if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev"); + this.controlBoard = controlBoardDev; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + controlBoard.UpdateWeights(); + } + + /// Run this operation + /// + /// Event.None or Event.PreviousStopped + /// + public Event Run() + { + controlBoard.UpdateWeights(); + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/SetValvesOp.cs b/TestBenchFramework/BenchControl/Elde/Valve/SetValvesOp.cs new file mode 100644 index 000000000..a83210ffa --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/SetValvesOp.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Elde.Valve +{ + public class SetValvesOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(SetValvesOp)); + + /// Set by the constructor + ControlBoardDev controlBoard; + + class SwitchPoint + { + public int TimeSec; + public IList VOpen; + public IList VClose; + public ulong MasksOpen; + public ulong MasksClose; + } + + IList switchPointsRaw; + IList switchPoints; + int nextIx; + int swStartTime; + + /// + /// Processes coupled valves and creates switch points. + /// + /// A list of opening master valves + /// A list of closing master valves + /// + IList CollectSwitchPoints(IList valvesOpen, IList valvesClose) + { + IList result = new List(); + result.Add(new SwitchPoint { TimeSec = 0, VOpen = valvesOpen, VClose = valvesClose }); + + foreach (var valve in StateMachine.CoupledValves) + { + if ((!valve.Invert && valvesOpen.Contains(valve.CoupledTo)) || + (valve.Invert && valvesClose.Contains(valve.CoupledTo))) + { + /// The coupled valve 'valve' is opening + int time = valve.LagOpening; + if (time == 0) + { + result[0].VOpen.Add(valve); + } + else + { + result.Add(new SwitchPoint { TimeSec = time, + VOpen = ValveBase.MakeList(valve), + VClose = new List() }); + } + } + else if ((!valve.Invert && valvesClose.Contains(valve.CoupledTo)) || + (valve.Invert && valvesOpen.Contains(valve.CoupledTo))) + { + /// The coupled valve 'valve' is closing + int time = valve.LagClosing; + if (time == 0) + { + result[0].VClose.Add(valve); + } + else + { + result.Add(new SwitchPoint { TimeSec = time, + VOpen = new List(), + VClose = ValveBase.MakeList(valve) }); + } + } + } + return result; + } + + + IList SortAndMergeSwitchPoints(IList unsorted) + { + IList result = new List(); + + SwitchPoint lastAdded = null; + while (unsorted.Count > 0) + { + SwitchPoint first = null; + foreach (var point in unsorted) + { + if (first == null || first.TimeSec > point.TimeSec) first = point; + } + if (lastAdded == null || lastAdded.TimeSec != first.TimeSec) + { + result.Add(first); + lastAdded = first; + } + else + { + lastAdded.VOpen = ValveBase.Merge(lastAdded.VOpen, first.VOpen); + lastAdded.VClose = ValveBase.Merge(lastAdded.VClose, first.VClose); + } + unsorted.Remove(first); + } + return result; + } + + + void MakeMasks(IList switchPoints, int timeShift) + { + foreach (var point in switchPoints) + { + /// Only Elde.Valve valves are used, other valves are ignored + point.MasksOpen = 0; + foreach (var valve in point.VOpen) + { + if (valve is Valve) point.MasksOpen |= (valve as Valve).Mask; + if (valve is Pump.Pump) point.MasksOpen |= (valve as Pump.Pump).Mask; + if (valve is PumpWithFM.Pump) point.MasksOpen |= (valve as PumpWithFM.Pump).Mask; + } + point.MasksClose = 0; + foreach (var valve in point.VClose) + { + if (valve is Valve) point.MasksClose |= (valve as Valve).Mask; + if (valve is Pump.Pump) point.MasksClose |= (valve as Pump.Pump).Mask; + if (valve is PumpWithFM.Pump) point.MasksClose |= (valve as PumpWithFM.Pump).Mask; + } + point.TimeSec += timeShift; + } + } + + + /// + /// Open and/or close multiple valves. + /// Events: ValvesSet + /// + /// Control board device + /// A list of opening master valves + /// A list of closing master valves + /// Only Elde.Valve valves are used, other valves on the lists are ignored + public SetValvesOp(ControlBoardDev controlBoard, IList valvesOpen, IList valvesClose) + { + if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); + this.controlBoard = controlBoard; + + if (valvesOpen == null) valvesOpen = new List(); + if (valvesClose == null) valvesOpen = new List(); + + switchPointsRaw = CollectSwitchPoints(valvesOpen, valvesClose); + switchPoints = SortAndMergeSwitchPoints(switchPointsRaw); + int timeShift = -switchPoints[0].TimeSec; + MakeMasks(switchPoints, timeShift); + } + + /// + /// Open one valve and/or close one valve. + /// Events: ValvesSet + /// + /// Control board device + /// Valve to be opened + /// Valve to be closed + /// Only Elde.Valve valves are used, other valves on the lists are ignored + public SetValvesOp(ControlBoardDev controlBoard, IValve valveOpen, IValve valveClose) + : this(controlBoard, ValveBase.MakeList(valveOpen), ValveBase.MakeList(valveClose)) + { + } + + /// Start this operation + public void Start() + { + controlBoard.SetValves(switchPoints[0].MasksOpen, switchPoints[0].MasksClose); + swStartTime = StateMachine.CurrentTime; + nextIx = 1; + } + + /// Run this operation + /// + /// Event.SetValvesDone + /// + public Event Run() + { + if (nextIx >= switchPoints.Count) return Event.ValvesSet; + + if (StateMachine.CurrentTime >= swStartTime + switchPoints[nextIx].TimeSec) + { + controlBoard.SetValves(switchPoints[nextIx].MasksOpen, switchPoints[nextIx].MasksClose); + nextIx++; + } + return Event.None; + } + + /// Start this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/Valve.cs b/TestBenchFramework/BenchControl/Elde/Valve/Valve.cs new file mode 100644 index 000000000..f6a8cad22 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/Valve.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Elde.Valve +{ + public class Valve : GenericDevices.ValveBase, Generic.IComponent, IValve + { + /// + /// Info: StartMassMeasurement() and "Balance response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(Valve)); + public override string ToString() + { + return string.Format("Valve({0},{1},{2})", Name, bitPosition, (CoupledTo != null ? CoupledTo.Cfg.Name : "-")); + } + + public static void ResetStaticProperties() { } + + readonly ValveCfg valveCfg; + public Generic.IComponentCfg Cfg { get { return valveCfg; } } + + readonly IValve coupledTo; + readonly ControlBoardDev controlBoard; + readonly int bitPosition; /// 0 .. 63 + + public string Name { get { return valveCfg.Name; } } + public IValve CoupledTo { get { return coupledTo; } } + public bool Invert { get { return valveCfg.Invert; } } + public int LagOpening { get { return valveCfg.LagOpening; } } + public int LagClosing { get { return valveCfg.LagClosing; } } + + public readonly ulong Mask; /// derived from bitPosition in the constructor + + + public Valve(ValveCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.valveCfg = cfg; + + controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); + if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); + + if (bitPosition < 0 || bitPosition >= 64) throw new ArgumentOutOfRangeException("position"); + this.bitPosition = cfg.BitPosition; + this.Mask = (((ulong)1) << bitPosition); + + if (cfg.CoupledToName != null) + { + this.coupledTo = (IValve)TbfComponents.FindComponent(cfg.CoupledToName, components); + } + + log.Debug(this.ToString()); + } + + public bool State + { + get { return (controlBoard.Route & Mask) != 0; } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/ValveCfg.cs b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfg.cs new file mode 100644 index 000000000..059025cd9 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfg.cs @@ -0,0 +1,67 @@ +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Valve +{ + public class ValveCfg : ComponentCfgBase, IChildComponentCfg + { + public int BitPosition; /// Bit-position + public string CoupledToName; /// Name of the coupled valve or null + public bool Invert; /// The coupled valve has inverted position + public int LagOpening; /// Delay (referred to the master valve) when opening this valve in [s] + public int LagClosing; /// Delay (referred to the master valve) when closing this valve in [s] + /// Negative values of delays mean an earlier function of the coupled valve. + + /// Parameterless constructor + public ValveCfg() + { + } + /// Constructor 1 + public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition, string coupledToName, bool invert, int lagOpening, int lagClosing) + : base(factory, name, parentName) + { + this.BitPosition = bitPosition; + this.CoupledToName = coupledToName; + this.Invert = invert; + this.LagOpening = lagOpening; + this.LagClosing = lagClosing; + } + /// Constructor 2 without CoupledTo valve + public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition) + : this(factory, name, parentName, bitPosition, null, false, 0, 0) + { + } + + public IComponentCfg Clone() + { + return new ValveCfg(Factory, Name, ParentName, BitPosition, CoupledToName, Invert, LagOpening, LagClosing); + } + + public string ToString(int i) + { + return string.Format("bit={0}, coupledTo={1}, invert={2}, lagOpen={3}, lagClose={4}", + BitPosition, CoupledToName, (Invert ? "yes" : "no"), LagOpening, LagClosing); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, + DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + ValveCfg config = (ValveCfg)(new XmlSerializer(typeof(ValveCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.Designer.cs new file mode 100644 index 000000000..c1803b628 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.Designer.cs @@ -0,0 +1,214 @@ +namespace TBF.BenchControl.Elde.Valve +{ + partial class ValveCfgCtrl + { + /// + /// 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() + { + this.bitPositionTextBox = new System.Windows.Forms.TextBox(); + this.bitPositionLabel = new System.Windows.Forms.Label(); + this.parentNameLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.coupledToLabel = new System.Windows.Forms.Label(); + this.invertCheckBox = new System.Windows.Forms.CheckBox(); + this.parentNameComboBox = new System.Windows.Forms.ComboBox(); + this.lagOpeningLabel = new System.Windows.Forms.Label(); + this.lagClosingLabel = new System.Windows.Forms.Label(); + this.lagOpeningTextBox = new System.Windows.Forms.TextBox(); + this.lagClosingTextBox = new System.Windows.Forms.TextBox(); + this.coupledToComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // bitPositionTextBox + // + this.bitPositionTextBox.Enabled = false; + this.bitPositionTextBox.Location = new System.Drawing.Point(138, 82); + this.bitPositionTextBox.Name = "bitPositionTextBox"; + this.bitPositionTextBox.Size = new System.Drawing.Size(81, 20); + this.bitPositionTextBox.TabIndex = 6; + // + // bitPositionLabel + // + this.bitPositionLabel.AutoSize = true; + this.bitPositionLabel.Location = new System.Drawing.Point(22, 85); + this.bitPositionLabel.Name = "bitPositionLabel"; + this.bitPositionLabel.Size = new System.Drawing.Size(59, 13); + this.bitPositionLabel.TabIndex = 5; + this.bitPositionLabel.Text = "Bit Position"; + // + // parentNameLabel + // + this.parentNameLabel.AutoSize = true; + this.parentNameLabel.Location = new System.Drawing.Point(22, 60); + this.parentNameLabel.Name = "parentNameLabel"; + this.parentNameLabel.Size = new System.Drawing.Size(69, 13); + this.parentNameLabel.TabIndex = 3; + this.parentNameLabel.Text = "Parent Name"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(138, 33); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(22, 36); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(136, 13); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // coupledToLabel + // + this.coupledToLabel.AutoSize = true; + this.coupledToLabel.Location = new System.Drawing.Point(22, 124); + this.coupledToLabel.Name = "coupledToLabel"; + this.coupledToLabel.Size = new System.Drawing.Size(56, 13); + this.coupledToLabel.TabIndex = 7; + this.coupledToLabel.Text = "Copled To"; + // + // invertCheckBox + // + this.invertCheckBox.AutoSize = true; + this.invertCheckBox.Enabled = false; + this.invertCheckBox.Location = new System.Drawing.Point(232, 124); + this.invertCheckBox.Name = "invertCheckBox"; + this.invertCheckBox.Size = new System.Drawing.Size(53, 17); + this.invertCheckBox.TabIndex = 9; + this.invertCheckBox.Text = "Invert"; + this.invertCheckBox.UseVisualStyleBackColor = true; + // + // parentNameComboBox + // + this.parentNameComboBox.Enabled = false; + this.parentNameComboBox.FormattingEnabled = true; + this.parentNameComboBox.Location = new System.Drawing.Point(138, 57); + this.parentNameComboBox.Name = "parentNameComboBox"; + this.parentNameComboBox.Size = new System.Drawing.Size(130, 21); + this.parentNameComboBox.TabIndex = 4; + // + // lagOpeningLabel + // + this.lagOpeningLabel.AutoSize = true; + this.lagOpeningLabel.Location = new System.Drawing.Point(22, 147); + this.lagOpeningLabel.Name = "lagOpeningLabel"; + this.lagOpeningLabel.Size = new System.Drawing.Size(109, 13); + this.lagOpeningLabel.TabIndex = 10; + this.lagOpeningLabel.Text = "Lag when opening [s]"; + // + // lagClosingLabel + // + this.lagClosingLabel.AutoSize = true; + this.lagClosingLabel.Location = new System.Drawing.Point(22, 171); + this.lagClosingLabel.Name = "lagClosingLabel"; + this.lagClosingLabel.Size = new System.Drawing.Size(104, 13); + this.lagClosingLabel.TabIndex = 11; + this.lagClosingLabel.Text = "Lag when closing [s]"; + // + // lagOpeningTextBox + // + this.lagOpeningTextBox.Enabled = false; + this.lagOpeningTextBox.Location = new System.Drawing.Point(138, 144); + this.lagOpeningTextBox.Name = "lagOpeningTextBox"; + this.lagOpeningTextBox.Size = new System.Drawing.Size(81, 20); + this.lagOpeningTextBox.TabIndex = 12; + // + // lagClosingTextBox + // + this.lagClosingTextBox.Enabled = false; + this.lagClosingTextBox.Location = new System.Drawing.Point(138, 168); + this.lagClosingTextBox.Name = "lagClosingTextBox"; + this.lagClosingTextBox.Size = new System.Drawing.Size(81, 20); + this.lagClosingTextBox.TabIndex = 13; + // + // coupledToComboBox + // + this.coupledToComboBox.Enabled = false; + this.coupledToComboBox.FormattingEnabled = true; + this.coupledToComboBox.Location = new System.Drawing.Point(138, 121); + this.coupledToComboBox.Name = "coupledToComboBox"; + this.coupledToComboBox.Size = new System.Drawing.Size(81, 21); + this.coupledToComboBox.TabIndex = 14; + // + // ValveCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.coupledToComboBox); + this.Controls.Add(this.lagClosingTextBox); + this.Controls.Add(this.lagOpeningTextBox); + this.Controls.Add(this.lagClosingLabel); + this.Controls.Add(this.lagOpeningLabel); + this.Controls.Add(this.parentNameComboBox); + this.Controls.Add(this.invertCheckBox); + this.Controls.Add(this.coupledToLabel); + this.Controls.Add(this.bitPositionTextBox); + this.Controls.Add(this.bitPositionLabel); + this.Controls.Add(this.parentNameLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "ValveCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.ValveCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox bitPositionTextBox; + private System.Windows.Forms.Label bitPositionLabel; + private System.Windows.Forms.Label parentNameLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label coupledToLabel; + private System.Windows.Forms.CheckBox invertCheckBox; + private System.Windows.Forms.ComboBox parentNameComboBox; + private System.Windows.Forms.Label lagOpeningLabel; + private System.Windows.Forms.Label lagClosingLabel; + private System.Windows.Forms.TextBox lagOpeningTextBox; + private System.Windows.Forms.TextBox lagClosingTextBox; + private System.Windows.Forms.ComboBox coupledToComboBox; + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.cs new file mode 100644 index 000000000..28a190ce3 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.cs @@ -0,0 +1,125 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Valve +{ + public partial class ValveCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(ValveCfgCtrl)); + + ComponentParametersDlg parent; + ValveCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as ValveCfg; + Redraw(); + } + } + + public ValveCfgCtrl() + { + InitializeComponent(); + } + + private void ValveCfgCtrl_Load(object sender, EventArgs e) + { + parent = ParentForm as ComponentParametersDlg; + if (parent == null) return; + + if (parent.TbfComponents != null) + { + parentNameComboBox.Items.Add("---"); + coupledToComboBox.Items.Add("---"); + foreach (var cmpnt in parent.TbfComponents) + { + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.ControlBoardFactory) + { + parentNameComboBox.Items.Add(cmpnt.Name); + } + if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Elde.Valve.ValveFactory) + { + coupledToComboBox.Items.Add(cmpnt.Name); + } + } + } + + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; + bitPositionTextBox.Text = config.BitPosition.ToString(); + coupledToComboBox.Text = string.IsNullOrEmpty(config.CoupledToName) ? "---" : config.CoupledToName; + invertCheckBox.Checked = config.Invert; + lagOpeningTextBox.Text = config.LagOpening.ToString(); + lagClosingTextBox.Text = config.LagClosing.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + parentNameComboBox.Enabled = true; + bitPositionTextBox.Enabled = true; + coupledToComboBox.Enabled = true; + invertCheckBox.Enabled = true; + lagOpeningTextBox.Enabled = true; + lagClosingTextBox.Enabled = true; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; + config.BitPosition = int.Parse(bitPositionTextBox.Text); + config.CoupledToName = coupledToComboBox.Text.Equals("---") ? string.Empty : coupledToComboBox.Text; + config.Invert = invertCheckBox.Checked; + config.LagOpening = int.Parse(lagOpeningTextBox.Text); + config.LagClosing = int.Parse(lagClosingTextBox.Text); + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Parent Name'"; + } + if (!coupledToComboBox.Items.Contains(coupledToComboBox.Text)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "Invalid 'Coupled To'"; + } + if (!int.TryParse(bitPositionTextBox.Text, out dummy) || dummy < 0 || dummy >= 64) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Bit Position' should be between 0 and 63"; + } + if (!int.TryParse(lagOpeningTextBox.Text, out dummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Delay when opening' error"; + } + if (!int.TryParse(lagClosingTextBox.Text, out dummy)) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Delay when closing' error"; + } + return flags; + } + } +} diff --git a/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.resx b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/ValveCfgCtrl.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/TestBenchFramework/BenchControl/Elde/Valve/ValveFactory.cs b/TestBenchFramework/BenchControl/Elde/Valve/ValveFactory.cs new file mode 100644 index 000000000..1130758e7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Elde/Valve/ValveFactory.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Elde.Valve +{ + public class ValveFactory : IComponentFactory + { + public string ClassName { get { return "Valve"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return int.MaxValue; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new ValveCfg(this, "Valve", "CB", 0); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new ValveCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Valve((ValveCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return ValveCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Valve.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Events.cs b/TestBenchFramework/BenchControl/Events.cs new file mode 100644 index 000000000..c53d95239 --- /dev/null +++ b/TestBenchFramework/BenchControl/Events.cs @@ -0,0 +1,97 @@ +namespace TBF.BenchControl +{ + /// + /// Lower level measurement event provided by devices and polled by operations + /// + public enum MsrmntState + { + Valid, + Overload, + Failed, + Busy, + } + + /// + /// Flags returned by each device configuration control Verify(...) function. + /// + public enum CfgVerifyFlags + { + None = 0, + Error = 0x1, /// Some settings in the user control are invalid and cannot be set + Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation + } + + /// + /// StateMachine events (issued by operations, IOperation derived classes) + /// + public enum Event + { + None = 0, + Done, + ValvesSet, + AmbientDone, + BalanceDone, + BalanceOverload, + PressureDone, + PressureInDone, + PressureOutDone, + TempDone, + TempInDone, + TempOutDone, + TempDivDone, + FlowMeasurementDone, + FlowReached, + PositionReached, + RegulValveTimeOut, /// Maximum allowed flow setting time has elapsed + ReadRegisterDone, + ReadReferenceDone, + AllPositionsReached, /// Used in SetAllRegulValvesOp + TurnPumpOnOffDone, + + /// CheckUi events + UiCmdStartTest, + UiCmdStartQ1, + UiCmdStartQ2, + UiCmdStartQ3, + UiCmdStartCycle, + UiCmdStop, + UiCmdPurgeBegin, + UiCmdPurgeEnd, + UiCmdEmptyTank1, + UiCmdEmptyTank2, + UiCmdTestOpticalHeads, + UiCmdResetResults, + UiCmdAcceptResults, + UiCmdCalibration, + UiCmdCameraTest, + UiCmdSensitivityTest, + UiCmdB1, + UiCmdB2, + UiCmdB3, + + /// Process/Test oriented + PreviousStopped, + Wait, + ProcedureLoaded, + MeasurementStarted, + ReadAllRegistersDone, + MeasurementCompleted, + ResultsPrinted, + ResultsWritten, + + /// Timer events + TimerExpired, + + /// IDC camera events + CameraBusy, + CameraOpCompleted, + CameraOpFailed, + + /// Generic + Error, /// Many ops.: Fatal error occurred + ConfigurationError, + Yes, + No, + Next, /// To move to the next state when debugging + } +} diff --git a/TestBenchFramework/BenchControl/FeedingPath.cs b/TestBenchFramework/BenchControl/FeedingPath.cs new file mode 100644 index 000000000..a4f8ec2ce --- /dev/null +++ b/TestBenchFramework/BenchControl/FeedingPath.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl +{ + public class FeedingPath + { + public int ItemNr; + public string Name; + public float Qfrom; + public float Qto; + public IValve Pump; /// pump to use with this path or null + public IList ValvesOpen; /// a list of valves to open or null + public IList ValvesClose; /// a list of valves to close or null + + /// Constructor from name, the rest is empty + public FeedingPath(string name, int itemNr) + { + ItemNr = itemNr; + Name = name; + ValvesOpen = new List(); + ValvesClose = new List(); + } + + /// Constructor from data entity + public FeedingPath(Entities.FeedingPath entity, IList components) + : this(entity.Name, entity.ItemNr) + { + Qfrom = entity.Qfrom; + Qto = entity.Qto; + Pump = (IValve)TbfComponents.FindComponent(entity.Pump, components); + + string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' }); + ValvesOpen = new List(); + foreach (var vName in vOpen) ValvesOpen.Add((IValve)TbfComponents.FindComponent(vName, components)); + + string[] vClose = entity.ValvesClose.Split(new char[] { ';' }); + ValvesClose = new List(); + foreach (var vName in vClose) ValvesClose.Add((IValve)TbfComponents.FindComponent(vName, components)); + } + } +} diff --git a/TestBenchFramework/BenchControl/FloatBox.cs b/TestBenchFramework/BenchControl/FloatBox.cs new file mode 100644 index 000000000..c4e555dab --- /dev/null +++ b/TestBenchFramework/BenchControl/FloatBox.cs @@ -0,0 +1,22 @@ +namespace TBF.BenchControl +{ + public class FloatBox + { + public float F; + + public FloatBox() + { + F = 0.0f; + } + + public FloatBox(float f) + { + F = f; + } + + public override string ToString() + { + return F.ToString(); + } + } +} diff --git a/TestBenchFramework/BenchControl/Formulas.cs b/TestBenchFramework/BenchControl/Formulas.cs new file mode 100644 index 000000000..bbf02b438 --- /dev/null +++ b/TestBenchFramework/BenchControl/Formulas.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; + +namespace TBF.BenchControl +{ + public static class Formulas + { + /// + /// Calculate water density from temperature + /// + /// Temperature in [degC] + /// Density in [kg/m3] + public static float WaterDensityFromTemp(float t) + { + double tt = (double)t; + const double a0 = 999.842594; + const double a1 = 0.06793952; + const double a2 = -0.00909529; + const double a3 = 0.0001001685; + const double a4 = -0.000001120083; + const double a5 = 6.536332e-09; + + return (float)(((((a5 * tt + a4) * tt + a3) * tt + a2) * tt + a1) * tt + a0); + } + + + public static float AirDensityFromAmbientVales(float tempC, float pressureBar, float humiPct) + { + double pressurePa = 100000.0 * (double)pressureBar; /// [Pa] + double tempKelvin = 273.15 + (double)tempC; + double coef1 = 1.2811805 / 10000.0 * tempKelvin * tempKelvin + - 1.950987 / 100.0 * tempKelvin + + 34.04926034 + - 6.353631 * 1000.0 / tempKelvin; + double coef3 = humiPct / 100.0 * System.Math.Exp(coef1) / pressurePa; + double airDensityKgm3 = 0.00348353 * pressurePa * (1.0 - 0.378 * coef3) / tempKelvin; /// kg/m3 + return (float)airDensityKgm3; + } + + /// + /// Convert 'pulses' to 'volume', prevent division by zero + /// + public static float VolumeFromPulses(int pulses, float pulsesPerLiter) + { + if (pulsesPerLiter <= float.Epsilon) return 0; + return Convert.ToSingle(pulses) / pulsesPerLiter; + } + + /// + /// Calculate the error in % from 'measured' and 'true' volume, prevent division by zero + /// + public static float ErrorFromVolumes(float measuredVolume, float trueVolume) + { + if (trueVolume <= float.Epsilon) + { + if (measuredVolume <= float.Epsilon) return 0; + return 100.0f; + } + return 100.0f * (measuredVolume - trueVolume) / trueVolume; + } + + /// + /// Calcuate progress of the test while setting the flow. + /// + /// Current time from the beginning in [s] + /// Estimated time to set the flow in [s] + /// Estimated test time in [s] + /// Test progress 0 .. 1.0f + public static float TestProgress(float currentTime, float flowSetTime, float testTime) + { + // Never return more then 'fixedPart' + if (flowSetTime <= float.Epsilon) return 0; + float fixedPart = flowSetTime / (flowSetTime + testTime); + return (currentTime < flowSetTime) ? (currentTime / flowSetTime) * fixedPart : fixedPart; + } + + /// + /// Calculate progress of the test during measurement. + /// + /// Current number of reference pulses + /// Total number of reference pulses to complete the test + /// Estimated time to set the flow in [s] + /// Estimated test time in [s] + /// Test progress 0 .. 1.0f + public static float TestProgress(int refPulses, int totalPulses, float flowSetTime, float testTime) + { + // Never return less then 'fixedPart' and more then 1.0f + if (refPulses > totalPulses) refPulses = totalPulses; + float fixedPart = flowSetTime / (flowSetTime + testTime); + return fixedPart + (1.0f - fixedPart) * Convert.ToSingle(refPulses) / Convert.ToSingle(totalPulses); + } + + /// + /// Calculates corrected value form a list of corrections by interpolation. + /// It is assumed that values in the list 'corrections' are sorted. + /// + /// Raw uncorrected value + /// Sorted (value, correction) pairs + /// Corrected value + public static float CorrectedValue(float rawValue, IList corrections) + { + if (corrections == null || corrections.Count == 0) return rawValue; + + if (rawValue < corrections[0].Measurement) + { + return rawValue + corrections[0].Correction; + } + + int count = corrections.Count; + for (int i = 1; i < count; i++) + { + if (rawValue < corrections[i].Measurement) + { + float d1 = rawValue - corrections[i-1].Measurement; + float d2 = corrections[i].Measurement - rawValue; + + float corr; + if (d1 + d2 <= float.Epsilon) + { + corr = (corrections[i - 1].Correction + corrections[i].Correction) / 2.0f; + } + else + { + corr = (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2); + } + return rawValue + corr; + } + } + + return rawValue + corrections[count - 1].Correction; + } + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IChildComponentCfg.cs b/TestBenchFramework/BenchControl/Generic/IChildComponentCfg.cs new file mode 100644 index 000000000..9f28e4eaf --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IChildComponentCfg.cs @@ -0,0 +1,8 @@ + +namespace TBF.BenchControl.Generic +{ + interface IChildComponentCfg : IComponentCfg + { + + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IComponent.cs b/TestBenchFramework/BenchControl/Generic/IComponent.cs new file mode 100644 index 000000000..d80c1a45e --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IComponent.cs @@ -0,0 +1,8 @@ + +namespace TBF.BenchControl.Generic +{ + public interface IComponent + { + IComponentCfg Cfg { get; } + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IComponentCfg.cs b/TestBenchFramework/BenchControl/Generic/IComponentCfg.cs new file mode 100644 index 000000000..24bb65d0d --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IComponentCfg.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; + +namespace TBF.BenchControl.Generic +{ + public interface IComponentCfg + { + /// + /// Unique component # (0 .. nr.of components-1) + /// + int ItemNr { get; set; } + + /// + /// Component name + /// + string Name { get; set; } + + /// + /// Reference to the component factory (it is a singleton) + /// + IComponentFactory Factory { get; } + + /// + /// Component class / component type name + /// + string ParentName { get; set; } + + /// + /// Debug level, 0 = debugging off + /// + Entities.DebugMode DebugLevel { get; set; } + + /// + /// Log level, 0 = logging off + /// + Entities.LogLevel LogLevel { get; } + + /// + /// Measurement correction values + /// + IList Corrections { get; } + + IComponentCfg Clone(); + TBF.Entities.Component CreateDbEntity(); + + string ToString(int i); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IComponentCfgCtrl.cs b/TestBenchFramework/BenchControl/Generic/IComponentCfgCtrl.cs new file mode 100644 index 000000000..69db0ee14 --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IComponentCfgCtrl.cs @@ -0,0 +1,28 @@ + +namespace TBF.BenchControl.Generic +{ + public interface IComponentCfgCtrl + { + /// + /// Reference to device configuration class instance + /// + IComponentCfg Config { get; set; } + + /// + /// Verify current user controls for validity. + /// Called when user wants to close/save the configuration. + /// + /// See VerifyFlags + CfgVerifyFlags VerifyCfg(ref string message); + + /// + /// Save settings to the configuration class. + /// + void Unlock(); + + /// + /// Save settings to the configuration class. + /// + void UpdateCfg(); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IComponentFactory.cs b/TestBenchFramework/BenchControl/Generic/IComponentFactory.cs new file mode 100644 index 000000000..7e5b0091b --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IComponentFactory.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; + +namespace TBF.BenchControl.Generic +{ + public interface IComponentFactory + { + string ClassName { get; } /// Name of the class of components (for instance "Valve") + bool HasProcedureParams { get; } /// true = create an entity with component specific procedure parameters + bool HasTestParams { get; } /// true = create an entity with component specific test parameters + + /// + /// Max. number of components of this class in the system: 1, some integer value or int.MaxValue + /// + int MaxCount { get; } + + /// + /// Returns the default configuration + /// + IComponentCfg DefaultConfig(IList components); + + /// + /// Returns the UserControl used inside ComponentConfigForm to display and edit the configuration + /// + IComponentCfgCtrl CreateCfgCtrl(); + + /// + /// Returns the component + /// + IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components); + + /// + /// Converts an Entities.Component object into an instance of an appropriate class implementing IComponentCfg + /// + IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component); + + IParamsProvider GetTestParams(Entities.ComponentTest testParams); + IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams); + + + void ResetStaticProperties(); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IDevice.cs b/TestBenchFramework/BenchControl/Generic/IDevice.cs new file mode 100644 index 000000000..142480ec5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IDevice.cs @@ -0,0 +1,35 @@ +namespace TBF.BenchControl.Generic +{ + public interface IDevice + { + void Initialize(); + + /// + /// This function is invoked regularly each 1000 ms (once per second) + /// just before Start(), Run() and Stop() functions of acrive operations. + /// + /// It runs in a thread created by class Machine (not the user interface thread). + /// The function should not block (otherwise it blocks all other devices) !!! + /// In case needed, the device must create its own thread to handle hardware + /// without any interference with the rest of the system. + /// + void RunDeviceBefore(); + + /// + /// This function is invoked regularly each 1000 ms (once per second) + /// just before Start(), Run() and Stop() functions of acrive operations. + /// + /// It runs in a thread created by class Machine (not the user interface thread). + /// The function should not block (otherwise it blocks all other devices) !!! + /// In case needed, the device must create its own thread to handle hardware + /// without any interference with the rest of the system. + /// + void RunDeviceAfter(); + + /// + /// Should be invoked once before state machine is stopped and program exits. + /// Only Stop() operations may be called afterwards (No Start() / Run() operation). + /// + void StopDevice(); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IParamsProvider.cs b/TestBenchFramework/BenchControl/Generic/IParamsProvider.cs new file mode 100644 index 000000000..9e021d852 --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IParamsProvider.cs @@ -0,0 +1,43 @@ + +namespace TBF.BenchControl.Generic +{ + public interface IParamsProvider + { + string ComponentName { get; } + + /// + /// Number of parameters + /// + int ParamsCount(); + + /// + /// Parameter names + /// + /// Zero based index of the parameter + string ParamName(int ix); + + /// + /// Parameter values in string form + /// + /// Zero based index of the parameter + string ToString(int i); + + /// + /// Validates the string representation of a parameter + /// + /// Zero based index of the parameter + /// String representation of the parameter + /// Warning message in case the string is wrong or null + /// true = string is OK, false = string is wrong (see 'message') + bool ValidateParam(int ix, string strValue, out string message); + + /// + /// Update the parameter from a string + /// + /// Zero based index of the parameter + /// String representation of the parameter + void UpdateParam(int ix, string strValue); + + void UpdateDbEntity(); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/IProcedureParams.cs b/TestBenchFramework/BenchControl/Generic/IProcedureParams.cs new file mode 100644 index 000000000..53e1e6274 --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/IProcedureParams.cs @@ -0,0 +1,9 @@ + +namespace TBF.BenchControl.Generic +{ + public interface IProcedureParams + { + Entities.ComponentProcedure ProcedureParamsEntity { get; } + TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure); + } +} diff --git a/TestBenchFramework/BenchControl/Generic/ITestParams.cs b/TestBenchFramework/BenchControl/Generic/ITestParams.cs new file mode 100644 index 000000000..b9a34dcc1 --- /dev/null +++ b/TestBenchFramework/BenchControl/Generic/ITestParams.cs @@ -0,0 +1,9 @@ + +namespace TBF.BenchControl.Generic +{ + public interface ITestParams + { + Entities.ComponentTest TestParamsEntity { get; } + TBF.Entities.ComponentTest ToDbEntity(IComponent component, Entities.Test test); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IAmbient.cs b/TestBenchFramework/BenchControl/GenericDevices/IAmbient.cs new file mode 100644 index 000000000..15d101d10 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IAmbient.cs @@ -0,0 +1,16 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IAmbient : IComponent + { + /// + /// Events: Event.AmbientDone, Event.Error + /// + /// FloatBox for the air temperature in [deg.C] + /// FloatBox for the air pressure in [mBar] + /// FloatBox for the air humidity in [%] + /// Operation + IOperation ReadAmbientOp(FloatBox temperature, FloatBox pressure, FloatBox humidity); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IBalance.cs b/TestBenchFramework/BenchControl/GenericDevices/IBalance.cs new file mode 100644 index 000000000..e373eea65 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IBalance.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + /// + /// Basic balance functions + /// + public interface IBalance : IDevice, IComponent + { + /// + /// Camera number: 0-based index required for communication with the Elde component + /// + int BalanceNr { get; } + + /// + /// Balance water tank capacity in kg or ltr + /// + float Capacity { get; } + + /// + /// Measurement correction table + /// + IList Corrections { get; } + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for 'tara' in kg + /// TaringOp instance reference casted to IOperaton + IOperation TaringOp(ref FloatBox tara); + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for the measured mass in kg + /// ReadMassOp instance reference casted to IOperaton + IOperation ReadMassOp(ref FloatBox mass); + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for the measured mass in kg + /// Required mass readings count (>= 3) + /// ReadMassAverageOp instance reference casted to IOperaton + IOperation ReadStableMassOp(ref FloatBox mass, int readingsCount); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IBalance2.cs b/TestBenchFramework/BenchControl/GenericDevices/IBalance2.cs new file mode 100644 index 000000000..6a200d774 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IBalance2.cs @@ -0,0 +1,14 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IBalance2 : IBalance, IComponent + { + /// + /// Events: Done, Error + /// + /// Reference to the serialNumber + /// GetBalanceSNOp instance reference casted to IOperaton + IOperation GetBalanceSNOp(ref string serialNumber); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/ICamera.cs b/TestBenchFramework/BenchControl/GenericDevices/ICamera.cs new file mode 100644 index 000000000..3a8becf71 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ICamera.cs @@ -0,0 +1,46 @@ +using TBF.BenchControl; + +namespace TBF.BenchControl.GenericDevices +{ + public interface ICamera : Generic.IComponent + { + /// + /// Camera number: 0-based index required for communication with 'Pictures'screen + /// + int CameraNr { get; } + + float Brightness { get; } + + /// + /// Grab an image. + /// + /// Reference to operation object instance + IOperation GrabOp(); + + /// + /// Display live image. + /// + /// Reference to operation object instance + IOperation LiveOp(); + + /// + /// Display live detail to focus the camera. + /// + /// Reference to operation object instance + IOperation FocusOp(); + + /// + /// Watermeter wheel/arrow detection process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + IOperation DetectOp(int roiId, Cameras.IdcCamera.IWorkerCmd cmd); + + /// + /// Watermeter wheel/arrow angle measurement process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + IOperation MeasureOp(int roiId, Cameras.IdcCamera.IWorkerCmd cmd); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/ICameraRoi.cs b/TestBenchFramework/BenchControl/GenericDevices/ICameraRoi.cs new file mode 100644 index 000000000..4f993a26d --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ICameraRoi.cs @@ -0,0 +1,23 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface ICameraRoi : IComponent, IRegisterReader + { + GenericDevices.ICamera Camera { get; } + + /// + /// Watermeter wheel/arrow detection process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + IOperation DetectOp(); + + /// + /// Watermeter wheel/arrow angle measurement process. + /// + /// Region of interest (1..4) + /// Reference to operation object instance + IOperation MeasureOp(); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs b/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs new file mode 100644 index 000000000..2f5fa0c24 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IDataEntry : IComponent + { + IOperation ShowFormAtCycleBeginningOp(IList waterMeters); + IOperation ShowFormAtCycleEndOp(IList waterMeters); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IDiverter.cs b/TestBenchFramework/BenchControl/GenericDevices/IDiverter.cs new file mode 100644 index 000000000..2ab6fe8fd --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IDiverter.cs @@ -0,0 +1,12 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IDiverter : IComponent + { + /// + /// Diverter state: true = to tank, false = bypass tank + /// + bool State { get; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs b/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs new file mode 100644 index 000000000..f99eaea86 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + /// + /// Basic flow meter functions + /// + public interface IFlowMeter : IComponent + { + /// + /// Nominal flow @2kHz output frequency in m3 + /// + float NominalFlow { get; } + + /// + /// Measurement correction table + /// + IList Corrections { get; } + + /// + /// Events: FlowDone, Error + /// + /// Reference to a variable for the measured flow in xxx + /// ReadFlowOp instance reference casted to IOperaton + IOperation ReadFlowOp(ref FloatBox flow); + + /// + /// Events: flowDone, Error + /// + /// Reference to a variable for the measured flow in xxx + /// Event returned when measurement done + /// ReadFlowOp instance reference casted to IOperaton + IOperation ReadFlowOp(ref FloatBox flow, Event flowDone); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IHasCompleted.cs b/TestBenchFramework/BenchControl/GenericDevices/IHasCompleted.cs new file mode 100644 index 000000000..894c2e851 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IHasCompleted.cs @@ -0,0 +1,8 @@ + +namespace TBF.BenchControl.GenericDevices +{ + interface IHasCompleted + { + bool Completed { get; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IHasProtocolTitle.cs b/TestBenchFramework/BenchControl/GenericDevices/IHasProtocolTitle.cs new file mode 100644 index 000000000..2c096630d --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IHasProtocolTitle.cs @@ -0,0 +1,8 @@ + +namespace TBF.BenchControl.GenericDevices +{ + public interface IHasProtocolTitle + { + string ProtocolTitle { get; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IPressureMeter.cs b/TestBenchFramework/BenchControl/GenericDevices/IPressureMeter.cs new file mode 100644 index 000000000..117551dff --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IPressureMeter.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + /// + /// Basic pressure meter functions + /// + public interface IPressureMeter : IComponent + { + /// + /// Measurement correction table + /// + IList Corrections { get; } + + /// + /// Events: PressureDone, Error + /// + /// Reference to a variable for the measured pressure in bar + /// ReadPressureOp instance reference casted to IOperaton + IOperation ReadPressureOp(ref FloatBox pressure); + + /// + /// Events: pressureDone, Error + /// + /// Reference to a variable for the measured pressure in bar + /// Event returned when measurement done + /// ReadPressureOp instance reference casted to IOperaton + IOperation ReadPressureOp(ref FloatBox pressure, Event pressureDone); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IPump.cs b/TestBenchFramework/BenchControl/GenericDevices/IPump.cs new file mode 100644 index 000000000..8da3c6d72 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IPump.cs @@ -0,0 +1,12 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IPump : IComponent + { + /// + /// Pump state: true = on, false = off + /// + bool State { get; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs b/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs new file mode 100644 index 000000000..1f268054e --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs @@ -0,0 +1,21 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + /// + /// A pump controlled by a frequency inverter + /// using the test parameter 'Power' (0 .. 100.0f %) + /// + public interface IPumpFM : IPump + { + /// + /// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %) + /// + IOperation TurnOn(); + + /// + /// Turns the frequency inverter off + /// + IOperation TurnOff(); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IRegisterReader.cs b/TestBenchFramework/BenchControl/GenericDevices/IRegisterReader.cs new file mode 100644 index 000000000..aabdc54e1 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IRegisterReader.cs @@ -0,0 +1,12 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IRegisterReader : IComponent + { + float PulsesPerLtr { get; } + IOperation ReadRegisterOp(ref IntBox pulses); + IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses); + IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs b/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs new file mode 100644 index 000000000..4b55c1513 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IRegulValve : IComponent + { + IDictionary Dict { get; } + + /// + /// Operation to set the water flow within tolerances + /// Events: Event.None, Event.FlowReached, Event.FlowTimeOut + /// + /// Lower limit of the required flow [m3/h] + /// Higher limit of the required flow [m3/h] + /// Measured flow [m3/h] + /// Timeout in [s] + /// SetFlowOp instance + IOperation SetFlowOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout); + + /// + /// Operation to set the water flow within tolerances. Leave the measurement running. + /// Events: Event.None, Event.FlowReached, Event.FlowTimeOut + /// + /// Lower limit of the required flow [m3/h] + /// Higher limit of the required flow [m3/h] + /// Measured flow [m3/h] + /// Timeout in [s] + /// SetFlowOp instance + IOperation SetFlowAndMeasureOp(IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, FloatBox measuredFlow, int timeout); + + /// + /// Operation to set the regulation valve to a required position + /// Events: Event.None + /// + /// Lower limit of the required valve position in % + /// Higher limit of the required valve position in % + /// Timeout in [s] + /// SetPositionOp instance + IOperation SetRegulValvePositionOp(float posLoPct, float posHiPct, int timeout); + + /// + /// Operation to set the regulation valve to a required position + /// Events: Event.None + /// + /// Time pulse in sec + /// SetPositionOp instance + IOperation ChangeRegulValvePositionOp(float timePulseSec); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IResultsPrinter.cs b/TestBenchFramework/BenchControl/GenericDevices/IResultsPrinter.cs new file mode 100644 index 000000000..de9fb7be1 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IResultsPrinter.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IResultsPrinter : IComponent + { + /// + /// Prints the test cycle results, Events: Event.ResultsPrinted + /// + /// Results to print + /// Reference to the operation + IOperation PrintResultsOp(BenchControl.BenchId.Component benchId, + IList waterMeters, + IList results, + string title); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IResultsWriter.cs b/TestBenchFramework/BenchControl/GenericDevices/IResultsWriter.cs new file mode 100644 index 000000000..c2c206cee --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IResultsWriter.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IResultsWriter : IComponent + { + /// + /// Writes the test cycle results into a file, Events: Event.ResultsWritten + /// + /// Results to write into a file + /// Reference to the operation + IOperation WriteResultsOp(IList results); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/ITempMeter.cs b/TestBenchFramework/BenchControl/GenericDevices/ITempMeter.cs new file mode 100644 index 000000000..147ec1eb4 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ITempMeter.cs @@ -0,0 +1,24 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + /// + /// Basic temperature meter functions + /// + public interface ITempMeter : IComponent + { + /// + /// Events: TempDone, Error + /// + /// Reference to a variable for the temperature in Celsius + /// ReadTempInOp instance reference casted to IOperaton + IOperation ReadTempOp(ref FloatBox temp); + + /// + /// Events: tempDone, Error + /// + /// Reference to a variable for the temperature in Celsius + /// ReadTempInOp instance reference casted to IOperaton + IOperation ReadTempOp(ref FloatBox temp, Event tempDone); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs b/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs new file mode 100644 index 000000000..fc0a61938 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface ITestMethod : IComponent, ISequence + { + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IValve.cs b/TestBenchFramework/BenchControl/GenericDevices/IValve.cs new file mode 100644 index 000000000..e3dfda958 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IValve.cs @@ -0,0 +1,37 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IValve : IComponent + { + /// + /// Valve state: true = open, false = closed + /// + bool State { get; } + + /// + /// Coupled valve or null. + /// This valve is a slave and follows the coupled valve, which is a master. + /// In case of CoupledValve == null, this valve can be independently controlled. + /// + IValve CoupledTo { get; } + + /// + /// The coupled valve is inverted referred to the master valve. + /// This property is used only in case 'CoupledTo' is non-null. + /// + bool Invert { get; } + + /// + /// Delay (referred to the master valve) when opening this (coupled, slave) valve in [s] + /// This property is used only in case 'CoupledTo' is non-null. + /// + int LagOpening { get; } + + /// + /// Delay (referred to the master valve) when opening this (coupled, slave) valve in [s] + /// This property is used only in case 'CoupledTo' is non-null. + /// + int LagClosing { get; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IValveControl.cs b/TestBenchFramework/BenchControl/GenericDevices/IValveControl.cs new file mode 100644 index 000000000..912745c92 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IValveControl.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IValveControl + { + /// + /// Open one valve and/or close one valve. + /// Events: RouteDone, Error + /// + /// Valve to be opened + /// Valve to be closed + /// Newly created operation instance reference casted to IOperaton + IOperation SetValvesOp(IValve valveToOpen, IValve valveToClose); + + /// + /// Open and/or close multiple valves. + /// Events: RouteDone, Error + /// + /// A list of valves to be opened + /// A list of valves to be closed + /// Newly created operation instance reference casted to IOperaton + IOperation SetValvesOp(IList valvesToOpen, IList valvesToClose); + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/IWaterMeter.cs b/TestBenchFramework/BenchControl/GenericDevices/IWaterMeter.cs new file mode 100644 index 000000000..33f075a0e --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/IWaterMeter.cs @@ -0,0 +1,14 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface IWaterMeter : IComponent + { + string Producer { get; } + float Qn { get; } + string ApprovalInfo { get; } + string MetrologicalClass { get; } + string SerialNr { get; set; } + string State { get; set; } + } +} diff --git a/TestBenchFramework/BenchControl/GenericDevices/ValveBase.cs b/TestBenchFramework/BenchControl/GenericDevices/ValveBase.cs new file mode 100644 index 000000000..94ca500dc --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ValveBase.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TBF.BenchControl.GenericDevices +{ + public class ValveBase + { + /// + /// Process the list of components and return all valves (masters and coupled) + /// + public static IList AllValves(IList cmpnts) + { + IList result = new List(); + foreach (var cmpnt in cmpnts) if (cmpnt is IValve) result.Add(cmpnt as IValve); + return result; + } + + /// + /// Process the list of components and return the masters valves + /// + public static IList MasterValves(IList cmpnts) + { + IList result = new List(); + foreach (var cmpnt in cmpnts) + { + IValve valve = cmpnt as IValve; + if (valve != null && valve.CoupledTo == null) result.Add(valve); + } + return result; + } + + /// + /// Process the list of components and return the coupled valves + /// + public static IList CoupledValves(IList cmpnts) + { + IList result = new List(); + foreach (var cmpnt in cmpnts) + { + IValve valve = cmpnt as IValve; + if (valve != null && valve.CoupledTo != null) result.Add(valve); + } + return result; + } + + public static IList MakeList(IValve valve) + { + IList result = new List(); + if (valve != null) result.Add(valve); + return result; + } + + public static IList Merge(IList valves1, IList valves2) + { + IList result = new List(); + if (valves1 != null) foreach (var valve in valves1) result.Add(valve); + if (valves2 != null) foreach (var valve in valves2) result.Add(valve); + return result; + } + + public static IList Merge(IList valves1, IList valves2, IList valves3) + { + IList result = new List(); + if (valves1 != null) foreach (var valve in valves1) result.Add(valve); + if (valves2 != null) foreach (var valve in valves2) result.Add(valve); + if (valves3 != null) foreach (var valve in valves3) result.Add(valve); + return result; + } + } +} diff --git a/TestBenchFramework/BenchControl/Greco/Ambient.cs b/TestBenchFramework/BenchControl/Greco/Ambient.cs new file mode 100644 index 000000000..fe25a1833 --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/Ambient.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO.Ports; +using System.Text; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Greco +{ + /// + /// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232) + /// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware. + /// + public class Ambient : TestBenchSim, IComponent, IDevice, IOperation, GenericDevices.IAmbient + { + /// + /// Info: Successful measurement + /// Warn: Invalid serial response format + /// + private static readonly ILog log = LogManager.GetLogger(typeof(Ambient)); + + public static void ResetStaticProperties() { } + + private readonly AmbientCfg ambientCfg; + public Generic.IComponentCfg Cfg { get { return ambientCfg; } } + + public string Name { get { return ambientCfg.Name; } } + + /// Private fields + SerialPort serialPort; + StringBuilder measurementBuilder; + + /// The state of the measurement + MsrmntState msrmntState; + + /// Measured temperature when MsrmntState == MsrmntState.Valid + float temperature; + + /// Measured humidity when MsrmntState == MsrmntState.Valid + float humidity; + + /// Measured pressure when MsrmntState == MsrmntState.Valid + float pressure; + + /// Measurement time stamp when MsrmntState == MsrmntState.Valid + int msrmntTimeStamp; + + /// + /// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232) + /// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware. + /// + public Ambient(AmbientCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.ambientCfg = cfg; + } + + public new void Initialize() + { + if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate) + { + temperature = 20.0f; + humidity = 40.0f; + pressure = 1.0f; + msrmntTimeStamp = StateMachine.CurrentTime; + msrmntState = BenchControl.MsrmntState.Valid; + return; + } + + string comPortName = "COM" + ambientCfg.ComPortNr.ToString(); + serialPort = new SerialPort(comPortName, ambientCfg.BaudRate, ambientCfg.Parity, ambientCfg.DataBits, ambientCfg.StopBits); + serialPort.Handshake = ambientCfg.Handshake; + serialPort.Open(); + measurementBuilder = new StringBuilder(40); + msrmntState = MsrmntState.Busy; + } + + /// Run this device + public void RunDeviceBefore() + { + if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate) + { + msrmntTimeStamp = StateMachine.CurrentTime; + return; + } + + measurementBuilder.Append(serialPort.ReadExisting()); + int len = measurementBuilder.Length; + + /// + /// Device sends each 20 sec one line of ASCII text with data in the following format: + /// (temp) 6 characters, two decimal digits, with leading spaces + /// TAB 1 character + /// (humi) 6 characters, two decimal digits, with leading spaces + /// TAB 1 character + /// (pressure) 6 characters, one decimal digits, with leading spaces is LT 1000 + /// CR + LF 2 characters + /// Example: + /// 23.42 38.08 1061.1 + /// 23.39 38.04 1060.8 + /// 23.39 38.08 1061.4 + /// + if (len >= 22) + { + string measurement = measurementBuilder.ToString(); + measurementBuilder.Clear(); + + float t = 0; + float h = 0; + float p = 0; + if (float.TryParse(measurement.Substring(len - 22, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out t) && + measurement[len - 16] == '\t' && + float.TryParse(measurement.Substring(len - 15, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out h) && + measurement[len - 9] == '\t' && + float.TryParse(measurement.Substring(len - 8, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out p) && + measurement[len - 2] == '\r' && + measurement[len - 1] == '\n') + { + temperature = t; + humidity = h; + pressure = p; + msrmntTimeStamp = StateMachine.CurrentTime; + msrmntState = MsrmntState.Valid; + + log.InfoFormat("Msrmnt OK: time = {0}, temp={1}, humi={2}, pres={3}", msrmntTimeStamp, t, h, p); + } + else + { + log.Warn("Invalid string received: " + measurement); + } + } + } + + /// Run this device + public void RunDeviceAfter() + { + } + + /// Stop this device + public void StopDevice() + { + if (serialPort != null) serialPort.Close(); + } + + /// + /// Boxes for the operation result + /// + FloatBox tempBox; + FloatBox pressureBox; + FloatBox humiBox; + + public IOperation ReadAmbientOp(FloatBox temperature, FloatBox pressure, FloatBox humidity) + { + this.tempBox = temperature; + this.pressureBox = pressure; + this.humiBox = humidity; + return this; + } + + /// Start this operation + public void Start() + { + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + tempBox.F = temperature; + pressureBox.F = pressure; + humiBox.F = humidity; + return Event.AmbientDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Greco/AmbientCfg.cs b/TestBenchFramework/BenchControl/Greco/AmbientCfg.cs new file mode 100644 index 000000000..470dc9687 --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/AmbientCfg.cs @@ -0,0 +1,62 @@ +using System.IO; +using System.IO.Ports; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Greco +{ + public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg + { + public int ComPortNr; + public int BaudRate; + public Parity Parity; + public int DataBits; + public StopBits StopBits; + public Handshake Handshake; + + /// Parameterless constructor + public AmbientCfg() + { + } + /// Constructor + public AmbientCfg(IComponentFactory factory, string name, int comPortNr, int baudRate, Parity parity, int dataBits, StopBits stopBits, Handshake handshake) + : base(factory, name) + { + this.ComPortNr = comPortNr; + this.BaudRate = baudRate; + this.Parity = parity; + this.DataBits = dataBits; + this.StopBits = stopBits; + this.Handshake = handshake; + } + + public IComponentCfg Clone() + { + return new AmbientCfg(Factory, Name, ComPortNr, BaudRate, Parity, DataBits, StopBits, Handshake); + } + + public string ToString(int i) + { + return string.Format("COM{0}, {1}Bd, {2}bits, parity={3}, stopBits={4}, {5}", ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + AmbientCfg config = (AmbientCfg)(new XmlSerializer(typeof(AmbientCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.Designer.cs new file mode 100644 index 000000000..4894b0f03 --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.Designer.cs @@ -0,0 +1,226 @@ +namespace TBF.BenchControl.Greco +{ + partial class AmbientCfgCtrl + { + /// + /// 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() + { + this.comPortNrTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.baudRateLabel = new System.Windows.Forms.Label(); + this.baudRateTextBox = new System.Windows.Forms.TextBox(); + this.partityLabel = new System.Windows.Forms.Label(); + this.dataBitsLabel = new System.Windows.Forms.Label(); + this.dataBitsTextBox = new System.Windows.Forms.TextBox(); + this.stopBitsLabel = new System.Windows.Forms.Label(); + this.handshakeLabel = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.parityComboBox = new System.Windows.Forms.ComboBox(); + this.stopBitsComboBox = new System.Windows.Forms.ComboBox(); + this.handshakeComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // comPortNrTextBox + // + this.comPortNrTextBox.Enabled = false; + this.comPortNrTextBox.Location = new System.Drawing.Point(140, 52); + this.comPortNrTextBox.Name = "comPortNrTextBox"; + this.comPortNrTextBox.Size = new System.Drawing.Size(34, 20); + this.comPortNrTextBox.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(29, 55); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Serial Port Number:"; + // + // baudRateLabel + // + this.baudRateLabel.AutoSize = true; + this.baudRateLabel.Location = new System.Drawing.Point(29, 79); + this.baudRateLabel.Name = "baudRateLabel"; + this.baudRateLabel.Size = new System.Drawing.Size(58, 13); + this.baudRateLabel.TabIndex = 5; + this.baudRateLabel.Text = "Baud Rate"; + // + // baudRateTextBox + // + this.baudRateTextBox.Enabled = false; + this.baudRateTextBox.Location = new System.Drawing.Point(140, 76); + this.baudRateTextBox.Name = "baudRateTextBox"; + this.baudRateTextBox.Size = new System.Drawing.Size(130, 20); + this.baudRateTextBox.TabIndex = 6; + // + // partityLabel + // + this.partityLabel.AutoSize = true; + this.partityLabel.Location = new System.Drawing.Point(29, 103); + this.partityLabel.Name = "partityLabel"; + this.partityLabel.Size = new System.Drawing.Size(33, 13); + this.partityLabel.TabIndex = 7; + this.partityLabel.Text = "Parity"; + // + // dataBitsLabel + // + this.dataBitsLabel.AutoSize = true; + this.dataBitsLabel.Location = new System.Drawing.Point(29, 127); + this.dataBitsLabel.Name = "dataBitsLabel"; + this.dataBitsLabel.Size = new System.Drawing.Size(50, 13); + this.dataBitsLabel.TabIndex = 9; + this.dataBitsLabel.Text = "Data Bits"; + // + // dataBitsTextBox + // + this.dataBitsTextBox.Enabled = false; + this.dataBitsTextBox.Location = new System.Drawing.Point(140, 124); + this.dataBitsTextBox.Name = "dataBitsTextBox"; + this.dataBitsTextBox.Size = new System.Drawing.Size(34, 20); + this.dataBitsTextBox.TabIndex = 10; + // + // stopBitsLabel + // + this.stopBitsLabel.AutoSize = true; + this.stopBitsLabel.Location = new System.Drawing.Point(29, 151); + this.stopBitsLabel.Name = "stopBitsLabel"; + this.stopBitsLabel.Size = new System.Drawing.Size(49, 13); + this.stopBitsLabel.TabIndex = 11; + this.stopBitsLabel.Text = "Stop Bits"; + // + // handshakeLabel + // + this.handshakeLabel.AutoSize = true; + this.handshakeLabel.Location = new System.Drawing.Point(29, 175); + this.handshakeLabel.Name = "handshakeLabel"; + this.handshakeLabel.Size = new System.Drawing.Size(62, 13); + this.handshakeLabel.TabIndex = 13; + this.handshakeLabel.Text = "Handshake"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(140, 28); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(30, 31); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(137, 7); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // parityComboBox + // + this.parityComboBox.Enabled = false; + this.parityComboBox.FormattingEnabled = true; + this.parityComboBox.Location = new System.Drawing.Point(140, 100); + this.parityComboBox.Name = "parityComboBox"; + this.parityComboBox.Size = new System.Drawing.Size(130, 21); + this.parityComboBox.TabIndex = 8; + // + // stopBitsComboBox + // + this.stopBitsComboBox.Enabled = false; + this.stopBitsComboBox.FormattingEnabled = true; + this.stopBitsComboBox.Location = new System.Drawing.Point(140, 148); + this.stopBitsComboBox.Name = "stopBitsComboBox"; + this.stopBitsComboBox.Size = new System.Drawing.Size(130, 21); + this.stopBitsComboBox.TabIndex = 12; + // + // handshakeComboBox + // + this.handshakeComboBox.Enabled = false; + this.handshakeComboBox.FormattingEnabled = true; + this.handshakeComboBox.Location = new System.Drawing.Point(140, 172); + this.handshakeComboBox.Name = "handshakeComboBox"; + this.handshakeComboBox.Size = new System.Drawing.Size(130, 21); + this.handshakeComboBox.TabIndex = 14; + // + // AmbientCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Controls.Add(this.handshakeComboBox); + this.Controls.Add(this.stopBitsComboBox); + this.Controls.Add(this.parityComboBox); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.handshakeLabel); + this.Controls.Add(this.stopBitsLabel); + this.Controls.Add(this.dataBitsTextBox); + this.Controls.Add(this.dataBitsLabel); + this.Controls.Add(this.partityLabel); + this.Controls.Add(this.baudRateTextBox); + this.Controls.Add(this.baudRateLabel); + this.Controls.Add(this.comPortNrTextBox); + this.Controls.Add(this.label1); + this.Name = "AmbientCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.Load += new System.EventHandler(this.AbbientCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox comPortNrTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label baudRateLabel; + private System.Windows.Forms.TextBox baudRateTextBox; + private System.Windows.Forms.Label partityLabel; + private System.Windows.Forms.Label dataBitsLabel; + private System.Windows.Forms.TextBox dataBitsTextBox; + private System.Windows.Forms.Label stopBitsLabel; + private System.Windows.Forms.Label handshakeLabel; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.ComboBox parityComboBox; + private System.Windows.Forms.ComboBox stopBitsComboBox; + private System.Windows.Forms.ComboBox handshakeComboBox; + + } +} diff --git a/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.cs b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.cs new file mode 100644 index 000000000..23399502e --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.cs @@ -0,0 +1,156 @@ +using System; +using System.Windows.Forms; +using System.IO.Ports; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Greco +{ + public partial class AmbientCfgCtrl : UserControl, IComponentCfgCtrl + { + AmbientCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as AmbientCfg; + Redraw(); + } + } + + public AmbientCfgCtrl() + { + InitializeComponent(); + + parityComboBox.Items.Add(Parity.None.ToString()); + parityComboBox.Items.Add(Parity.Even.ToString()); + parityComboBox.Items.Add(Parity.Odd.ToString()); + + stopBitsComboBox.Items.Add(StopBits.None.ToString()); + stopBitsComboBox.Items.Add(StopBits.One.ToString()); + stopBitsComboBox.Items.Add(StopBits.OnePointFive.ToString()); + stopBitsComboBox.Items.Add(StopBits.Two.ToString()); + + handshakeComboBox.Items.Add(Handshake.None.ToString()); + handshakeComboBox.Items.Add(Handshake.RequestToSend.ToString()); + handshakeComboBox.Items.Add(Handshake.XOnXOff.ToString()); + } + + int GetParityIx(Parity par) + { + if (par == Parity.None) return 0; + if (par == Parity.Even) return 0; + if (par == Parity.Odd) return 0; + return -1; + } + Parity GetParity(string str) + { + if (str.Equals(Parity.None.ToString())) return Parity.None; + if (str.Equals(Parity.Even.ToString())) return Parity.Even; + if (str.Equals(Parity.Odd.ToString())) return Parity.Odd; + return (Parity)(-1); + } + + int GetStopBitsIx(StopBits sb) + { + if (sb == StopBits.None) return 0; + if (sb == StopBits.One) return 1; + if (sb == StopBits.OnePointFive) return 2; + if (sb == StopBits.Two) return 3; + return -1; + } + StopBits GetStopBits(string str) + { + if (str.Equals(StopBits.None.ToString())) return StopBits.None; + if (str.Equals(StopBits.One.ToString())) return StopBits.One; + if (str.Equals(StopBits.OnePointFive.ToString())) return StopBits.OnePointFive; + if (str.Equals(StopBits.Two.ToString())) return StopBits.Two; + return (StopBits)(-1); + } + + int GetHandshakeIx(Handshake par) + { + if (par == Handshake.None) return 0; + if (par == Handshake.RequestToSend) return 0; + if (par == Handshake.XOnXOff) return 0; + return -1; + } + Handshake GetHandshake(string str) + { + if (str.Equals(Handshake.None.ToString())) return Handshake.None; + if (str.Equals(Handshake.RequestToSend.ToString())) return Handshake.RequestToSend; + if (str.Equals(Handshake.XOnXOff.ToString())) return Handshake.XOnXOff; + return (Handshake)(-1); + } + + private void AbbientCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + comPortNrTextBox.Text = config.ComPortNr.ToString(); + baudRateTextBox.Text = config.BaudRate.ToString(); + parityComboBox.Text = config.Parity.ToString(); + dataBitsTextBox.Text = config.DataBits.ToString(); + stopBitsComboBox.Text = config.StopBits.ToString(); + handshakeComboBox.Text = config.Handshake.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + comPortNrTextBox.Enabled = true; + baudRateTextBox.Enabled = true; + parityComboBox.Enabled = true; + dataBitsTextBox.Enabled = true; + stopBitsComboBox.Enabled = true; + handshakeComboBox.Enabled = true; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ComPortNr = int.Parse(comPortNrTextBox.Text); + config.BaudRate = int.Parse(baudRateTextBox.Text); + config.Parity = GetParity(parityComboBox.SelectedItem.ToString()); + config.DataBits = int.Parse(dataBitsTextBox.Text); + config.StopBits = GetStopBits(stopBitsComboBox.SelectedItem.ToString()); + config.Handshake = GetHandshake(handshakeComboBox.SelectedItem.ToString()); + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!int.TryParse(comPortNrTextBox.Text, out dummy) || dummy < 1 || dummy > 999) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Serial Port Number' is not valid"; + } + + if (!int.TryParse(baudRateTextBox.Text, out dummy) || dummy < 150 || dummy > 115200) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Baud Rate' is not valid"; + } + + if (!int.TryParse(dataBitsTextBox.Text, out dummy) || dummy < 7 || dummy > 8) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Data Bits' is not valid"; + } + + return flags; + } + } +} diff --git a/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.resx b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/AmbientCfgCtrl.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/TestBenchFramework/BenchControl/Greco/AmbientFactory.cs b/TestBenchFramework/BenchControl/Greco/AmbientFactory.cs new file mode 100644 index 000000000..8d3332142 --- /dev/null +++ b/TestBenchFramework/BenchControl/Greco/AmbientFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Greco +{ + public class AmbientFactory : IComponentFactory + { + public string ClassName { get { return "Greco Ambient"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new AmbientCfg(this, "Ambient", 6, 19200, System.IO.Ports.Parity.None, 8, + System.IO.Ports.StopBits.One, System.IO.Ports.Handshake.None); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new AmbientCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Ambient((AmbientCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return Greco.AmbientCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Ambient.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/IOperation.cs b/TestBenchFramework/BenchControl/IOperation.cs new file mode 100644 index 000000000..d6b064bba --- /dev/null +++ b/TestBenchFramework/BenchControl/IOperation.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TBF.BenchControl +{ + /// + /// This interface has to be implemented by each 'operation'. 'operations' are classes + /// in TBF.BenchControl name space with a class name ending with 'Op' (e.g. TimerOp). + /// This class name rule is a convention, not a requirement. + /// + public interface IOperation + { + /// + /// Method is called when a state machine enters a state in which this operation + /// takes place/ will be executed. + /// Method is not called when this operation took place also in the previous state. + /// StateMachine checks whether Start() should be called depending on the previous + /// and the current state. + /// + /// true on success + void Start(); + + /// + /// Method is called in regular time intervals when state machine is + /// in a state in which this operation takes place. + /// During operation the IOparation derived object may issue events, + /// that means Run() method returns a value different from Event.Void (=0). + /// Examples: Timer expired + /// + /// + Event Run(); + + /// + /// Method is called when the state machine leaves a state in which + /// this operation takes place / was executed. + /// Method is not called when this operation takes place also in the next state. + /// StateMachine checks whether Start() should be called depending on the previous + /// and the current state. + /// + void Stop(); + } +} diff --git a/TestBenchFramework/BenchControl/ISequence.cs b/TestBenchFramework/BenchControl/ISequence.cs new file mode 100644 index 000000000..11d515305 --- /dev/null +++ b/TestBenchFramework/BenchControl/ISequence.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +namespace TBF.BenchControl +{ + public interface ISequence + { + IList Execute(Entities.Test test); + } +} diff --git a/TestBenchFramework/BenchControl/IntBox.cs b/TestBenchFramework/BenchControl/IntBox.cs new file mode 100644 index 000000000..0d1b892b7 --- /dev/null +++ b/TestBenchFramework/BenchControl/IntBox.cs @@ -0,0 +1,22 @@ +namespace TBF.BenchControl +{ + public class IntBox + { + public int N; + + public IntBox() + { + N = 0; + } + + public IntBox(int n) + { + N = n; + } + + public override string ToString() + { + return N.ToString(); + } + } +} diff --git a/TestBenchFramework/BenchControl/MetersPath.cs b/TestBenchFramework/BenchControl/MetersPath.cs new file mode 100644 index 000000000..11a3ccab6 --- /dev/null +++ b/TestBenchFramework/BenchControl/MetersPath.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl +{ + public class MetersPath + { + public int ItemNr; + public string Name; + public float Qfrom; + public float Qto; + public IRegisterReader[] RegisterReaders; + + /// Constructor from name, the rest is empty + public MetersPath(string name, int itemNr) + { + ItemNr = itemNr; + Name = name; + RegisterReaders = new IRegisterReader[Program.WMsCount]; + } + + public MetersPath(Entities.MetersPath entity, IList components) + : this(entity.Name, entity.ItemNr) + { + Qfrom = entity.Qfrom; + Qto = entity.Qto; + for (int i = 0; i < Program.WMsCount; i++) + { + RegisterReaders[i] = (IRegisterReader)TbfComponents.FindComponent(entity.GetSensor(i), components); + } + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfg.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfg.cs new file mode 100644 index 000000000..de94c9e26 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfg.cs @@ -0,0 +1,66 @@ +using System.IO; +using System.IO.Ports; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + public class BalanceCfg : ComponentCfgBase, Generic.IComponentCfg + { + public int ComPortNr; + public int BaudRate; + public Parity Parity; + public int DataBits; + public StopBits StopBits; + public Handshake Handshake; + + public float Capacity; /// Balance range in 'kg' or tank volume in 'l' + + /// Parameterless constructor + public BalanceCfg() + { + } + + /// Constructor + public BalanceCfg(IComponentFactory factory, string name, int comPortNr, int baudRate, Parity parity, int dataBits, StopBits stopBits, Handshake handshake, float capacity) + : base(factory, name) + { + this.ComPortNr = comPortNr; + this.BaudRate = baudRate; + this.Parity = parity; + this.DataBits = dataBits; + this.StopBits = stopBits; + this.Handshake = handshake; + this.Capacity = capacity; + } + + public IComponentCfg Clone() + { + return new BalanceCfg(Factory, Name, ComPortNr, BaudRate, Parity, DataBits, StopBits, Handshake, Capacity); + } + + public string ToString(int i) + { + return string.Format("COM{0}, {1}Bd, {2}bits, parity={3}, stopBits={4}, {5}, capacity={6}kg", ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake, Capacity); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + BalanceCfg config = (BalanceCfg)(new XmlSerializer(typeof(BalanceCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.Designer.cs new file mode 100644 index 000000000..fad4eb468 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.Designer.cs @@ -0,0 +1,259 @@ +namespace TBF.BenchControl.MettlerToledo +{ + partial class BalanceCfgCtrl + { + /// + /// 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() + { + this.handshakeComboBox = new System.Windows.Forms.ComboBox(); + this.stopBitsComboBox = new System.Windows.Forms.ComboBox(); + this.parityComboBox = new System.Windows.Forms.ComboBox(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.handshakeLabel = new System.Windows.Forms.Label(); + this.stopBitsLabel = new System.Windows.Forms.Label(); + this.dataBitsTextBox = new System.Windows.Forms.TextBox(); + this.dataBitsLabel = new System.Windows.Forms.Label(); + this.partityLabel = new System.Windows.Forms.Label(); + this.baudRateTextBox = new System.Windows.Forms.TextBox(); + this.baudRateLabel = new System.Windows.Forms.Label(); + this.comPortNrTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.rangeLabel = new System.Windows.Forms.Label(); + this.rangeTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // handshakeComboBox + // + this.handshakeComboBox.Enabled = false; + this.handshakeComboBox.FormattingEnabled = true; + this.handshakeComboBox.Location = new System.Drawing.Point(136, 173); + this.handshakeComboBox.Name = "handshakeComboBox"; + this.handshakeComboBox.Size = new System.Drawing.Size(130, 21); + this.handshakeComboBox.TabIndex = 14; + // + // stopBitsComboBox + // + this.stopBitsComboBox.Enabled = false; + this.stopBitsComboBox.FormattingEnabled = true; + this.stopBitsComboBox.Location = new System.Drawing.Point(136, 149); + this.stopBitsComboBox.Name = "stopBitsComboBox"; + this.stopBitsComboBox.Size = new System.Drawing.Size(130, 21); + this.stopBitsComboBox.TabIndex = 12; + // + // parityComboBox + // + this.parityComboBox.Enabled = false; + this.parityComboBox.FormattingEnabled = true; + this.parityComboBox.Location = new System.Drawing.Point(136, 101); + this.parityComboBox.Name = "parityComboBox"; + this.parityComboBox.Size = new System.Drawing.Size(130, 21); + this.parityComboBox.TabIndex = 8; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(136, 29); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(26, 32); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(133, 8); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // handshakeLabel + // + this.handshakeLabel.AutoSize = true; + this.handshakeLabel.Location = new System.Drawing.Point(25, 176); + this.handshakeLabel.Name = "handshakeLabel"; + this.handshakeLabel.Size = new System.Drawing.Size(62, 13); + this.handshakeLabel.TabIndex = 13; + this.handshakeLabel.Text = "Handshake"; + // + // stopBitsLabel + // + this.stopBitsLabel.AutoSize = true; + this.stopBitsLabel.Location = new System.Drawing.Point(25, 152); + this.stopBitsLabel.Name = "stopBitsLabel"; + this.stopBitsLabel.Size = new System.Drawing.Size(49, 13); + this.stopBitsLabel.TabIndex = 11; + this.stopBitsLabel.Text = "Stop Bits"; + // + // dataBitsTextBox + // + this.dataBitsTextBox.Enabled = false; + this.dataBitsTextBox.Location = new System.Drawing.Point(136, 125); + this.dataBitsTextBox.Name = "dataBitsTextBox"; + this.dataBitsTextBox.Size = new System.Drawing.Size(43, 20); + this.dataBitsTextBox.TabIndex = 10; + // + // dataBitsLabel + // + this.dataBitsLabel.AutoSize = true; + this.dataBitsLabel.Location = new System.Drawing.Point(25, 128); + this.dataBitsLabel.Name = "dataBitsLabel"; + this.dataBitsLabel.Size = new System.Drawing.Size(50, 13); + this.dataBitsLabel.TabIndex = 9; + this.dataBitsLabel.Text = "Data Bits"; + // + // partityLabel + // + this.partityLabel.AutoSize = true; + this.partityLabel.Location = new System.Drawing.Point(25, 104); + this.partityLabel.Name = "partityLabel"; + this.partityLabel.Size = new System.Drawing.Size(33, 13); + this.partityLabel.TabIndex = 7; + this.partityLabel.Text = "Parity"; + // + // baudRateTextBox + // + this.baudRateTextBox.Enabled = false; + this.baudRateTextBox.Location = new System.Drawing.Point(136, 77); + this.baudRateTextBox.Name = "baudRateTextBox"; + this.baudRateTextBox.Size = new System.Drawing.Size(130, 20); + this.baudRateTextBox.TabIndex = 6; + // + // baudRateLabel + // + this.baudRateLabel.AutoSize = true; + this.baudRateLabel.Location = new System.Drawing.Point(25, 80); + this.baudRateLabel.Name = "baudRateLabel"; + this.baudRateLabel.Size = new System.Drawing.Size(58, 13); + this.baudRateLabel.TabIndex = 5; + this.baudRateLabel.Text = "Baud Rate"; + // + // comPortNrTextBox + // + this.comPortNrTextBox.Enabled = false; + this.comPortNrTextBox.Location = new System.Drawing.Point(136, 53); + this.comPortNrTextBox.Name = "comPortNrTextBox"; + this.comPortNrTextBox.Size = new System.Drawing.Size(43, 20); + this.comPortNrTextBox.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(25, 56); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Serial Port Number:"; + // + // rangeLabel + // + this.rangeLabel.AutoSize = true; + this.rangeLabel.Location = new System.Drawing.Point(25, 201); + this.rangeLabel.Name = "rangeLabel"; + this.rangeLabel.Size = new System.Drawing.Size(76, 13); + this.rangeLabel.TabIndex = 15; + this.rangeLabel.Text = "Tank Capacity"; + // + // rangeTextBox + // + this.rangeTextBox.Enabled = false; + this.rangeTextBox.Location = new System.Drawing.Point(136, 198); + this.rangeTextBox.Name = "rangeTextBox"; + this.rangeTextBox.Size = new System.Drawing.Size(43, 20); + this.rangeTextBox.TabIndex = 16; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(185, 201); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(19, 13); + this.label2.TabIndex = 17; + this.label2.Text = "kg"; + // + // BalanceCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label2); + this.Controls.Add(this.rangeTextBox); + this.Controls.Add(this.rangeLabel); + this.Controls.Add(this.handshakeComboBox); + this.Controls.Add(this.stopBitsComboBox); + this.Controls.Add(this.parityComboBox); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.handshakeLabel); + this.Controls.Add(this.stopBitsLabel); + this.Controls.Add(this.dataBitsTextBox); + this.Controls.Add(this.dataBitsLabel); + this.Controls.Add(this.partityLabel); + this.Controls.Add(this.baudRateTextBox); + this.Controls.Add(this.baudRateLabel); + this.Controls.Add(this.comPortNrTextBox); + this.Controls.Add(this.label1); + this.Name = "BalanceCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.Load += new System.EventHandler(this.BalanceCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ComboBox handshakeComboBox; + private System.Windows.Forms.ComboBox stopBitsComboBox; + private System.Windows.Forms.ComboBox parityComboBox; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label handshakeLabel; + private System.Windows.Forms.Label stopBitsLabel; + private System.Windows.Forms.TextBox dataBitsTextBox; + private System.Windows.Forms.Label dataBitsLabel; + private System.Windows.Forms.Label partityLabel; + private System.Windows.Forms.TextBox baudRateTextBox; + private System.Windows.Forms.Label baudRateLabel; + private System.Windows.Forms.TextBox comPortNrTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label rangeLabel; + private System.Windows.Forms.TextBox rangeTextBox; + private System.Windows.Forms.Label label2; + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.cs new file mode 100644 index 000000000..a5de5e9a8 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.cs @@ -0,0 +1,167 @@ +using System; +using System.Globalization; +using System.Windows.Forms; +using System.IO.Ports; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + public partial class BalanceCfgCtrl : UserControl, IComponentCfgCtrl + { + BalanceCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as BalanceCfg; + Redraw(); + } + } + + public BalanceCfgCtrl() + { + InitializeComponent(); + + parityComboBox.Items.Add(Parity.None.ToString()); + parityComboBox.Items.Add(Parity.Even.ToString()); + parityComboBox.Items.Add(Parity.Odd.ToString()); + + stopBitsComboBox.Items.Add(StopBits.None.ToString()); + stopBitsComboBox.Items.Add(StopBits.One.ToString()); + stopBitsComboBox.Items.Add(StopBits.OnePointFive.ToString()); + stopBitsComboBox.Items.Add(StopBits.Two.ToString()); + + handshakeComboBox.Items.Add(Handshake.None.ToString()); + handshakeComboBox.Items.Add(Handshake.RequestToSend.ToString()); + handshakeComboBox.Items.Add(Handshake.XOnXOff.ToString()); + } + + int GetParityIx(Parity par) + { + if (par == Parity.None) return 0; + if (par == Parity.Even) return 0; + if (par == Parity.Odd) return 0; + return -1; + } + Parity GetParity(string str) + { + if (str.Equals(Parity.None.ToString())) return Parity.None; + if (str.Equals(Parity.Even.ToString())) return Parity.Even; + if (str.Equals(Parity.Odd.ToString())) return Parity.Odd; + return (Parity)(-1); + } + + int GetStopBitsIx(StopBits sb) + { + if (sb == StopBits.None) return 0; + if (sb == StopBits.One) return 1; + if (sb == StopBits.OnePointFive) return 2; + if (sb == StopBits.Two) return 3; + return -1; + } + StopBits GetStopBits(string str) + { + if (str.Equals(StopBits.None.ToString())) return StopBits.None; + if (str.Equals(StopBits.One.ToString())) return StopBits.One; + if (str.Equals(StopBits.OnePointFive.ToString())) return StopBits.OnePointFive; + if (str.Equals(StopBits.Two.ToString())) return StopBits.Two; + return (StopBits)(-1); + } + + int GetHandshakeIx(Handshake par) + { + if (par == Handshake.None) return 0; + if (par == Handshake.RequestToSend) return 0; + if (par == Handshake.XOnXOff) return 0; + return -1; + } + Handshake GetHandshake(string str) + { + if (str.Equals(Handshake.None.ToString())) return Handshake.None; + if (str.Equals(Handshake.RequestToSend.ToString())) return Handshake.RequestToSend; + if (str.Equals(Handshake.XOnXOff.ToString())) return Handshake.XOnXOff; + return (Handshake)(-1); + } + + private void BalanceCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + comPortNrTextBox.Text = config.ComPortNr.ToString(); + baudRateTextBox.Text = config.BaudRate.ToString(); + parityComboBox.Text = config.Parity.ToString(); + dataBitsTextBox.Text = config.DataBits.ToString(); + stopBitsComboBox.Text = config.StopBits.ToString(); + handshakeComboBox.Text = config.Handshake.ToString(); + rangeTextBox.Text = config.Capacity.ToString(); + } + + public void Unlock() + { + nameTextBox.Enabled = true; + comPortNrTextBox.Enabled = true; + baudRateTextBox.Enabled = true; + parityComboBox.Enabled = true; + dataBitsTextBox.Enabled = true; + stopBitsComboBox.Enabled = true; + handshakeComboBox.Enabled = true; + rangeTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + + int dummy; + if (!int.TryParse(comPortNrTextBox.Text, out dummy) || dummy < 1 || dummy > 999) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Serial Port Number' is not valid"; + } + if (!int.TryParse(baudRateTextBox.Text, out dummy) || dummy < 150 || dummy > 115200) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Baud Rate' is not valid"; + } + if (!int.TryParse(dataBitsTextBox.Text, out dummy) || dummy < 7 || dummy > 8) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Data Bits' is not valid"; + } + float fdummy; + bool floatOk = (float.TryParse(rangeTextBox.Text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out fdummy) || + float.TryParse(rangeTextBox.Text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out fdummy)); + if (!floatOk || fdummy <= 0) + { + flags |= CfgVerifyFlags.Error; + message += Environment.NewLine + "'Range' is not valid"; + } + + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.ComPortNr = int.Parse(comPortNrTextBox.Text); + config.BaudRate = int.Parse(baudRateTextBox.Text); + config.Parity = GetParity(parityComboBox.SelectedItem.ToString()); + config.DataBits = int.Parse(dataBitsTextBox.Text); + config.StopBits = GetStopBits(stopBitsComboBox.SelectedItem.ToString()); + config.Handshake = GetHandshake(handshakeComboBox.SelectedItem.ToString()); + bool floatOk = (float.TryParse(rangeTextBox.Text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out config.Capacity) || + float.TryParse(rangeTextBox.Text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out config.Capacity)); + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.resx b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceCfgCtrl.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/TestBenchFramework/BenchControl/MettlerToledo/BalanceDev.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceDev.cs new file mode 100644 index 000000000..65f9f90c5 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceDev.cs @@ -0,0 +1,423 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.IO.Ports; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + /// + /// Mettler Toledo ICS4_5 Weighting terminal connected via serial interface (RS232) + /// + /// + /// Implemented and tested on 15.10.2013 by Milan Hanajik + /// + public class BalanceDev : TestBenchSim, IComponent, IDevice, GenericDevices.IBalance + { + /// + /// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(BalanceDev)); + public override string ToString() { return string.Format("{0}, Mettler-Toledo Balance", balanceCfg.Name); } + + /// + /// Enumeration of balances via static fields and methods + /// + static int nextBalanceIdx = 0; + public static void ResetStaticProperties() { nextBalanceIdx = 0; } + public static int BalancesCount { get { return nextBalanceIdx; } } + public static BalanceDev[] Balances; + public static float[] Masses; + /// + protected int balanceNr; /// 0-based balance number + + protected readonly BalanceCfg balanceCfg; + public Generic.IComponentCfg Cfg { get { return balanceCfg; } } + + protected SerialPort serialPort; + protected StringBuilder stringBuilder; + + public string Name { get { return balanceCfg.Name; } } + public int BalanceNr { get { return balanceNr; } } + public float Capacity { get { return balanceCfg.Capacity; } } + public IList Corrections { get { return balanceCfg.Corrections; } } + + /// The state of the mass measurement + public MsrmntState MsrmntState + { + get { return msrmntState; } + } + protected MsrmntState msrmntState; + + /// The mass after StartMassMeasurement() when MsrmntState == MsrmntState.Valid + public float Mass + { + get { return mass; } + } + protected float mass; + + /// The time stamp after StartMassMeasurement() when MsrmntState == MsrmntState.Valid + public int MsrmntTimeStamp + { + get { return msrmntTimeStamp; } + } + protected int msrmntTimeStamp; + + /// + /// Constructor + /// + /// Balance properties + public BalanceDev(BalanceCfg cfg, IList components) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.balanceCfg = cfg; + + balanceNr = nextBalanceIdx++; + Masses = new float[nextBalanceIdx]; /// (re)initialize the static array of masses of all balances + + if (Balances == null || Balances.Length < nextBalanceIdx) + { + BalanceDev[] balancesSoFar = Balances; + Balances = new BalanceDev[nextBalanceIdx]; + if (balancesSoFar != null) for (int i = 0; i < balancesSoFar.Length; i++) Balances[i] = balancesSoFar[i]; + Balances[nextBalanceIdx - 1] = this; + } + } + + public new void Initialize() + { + msrmntState = MsrmntState.Failed; /// Data not valid yet + + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + stringBuilder = new StringBuilder(40); + string comPortName = "COM" + balanceCfg.ComPortNr.ToString(); + serialPort = new SerialPort(comPortName, balanceCfg.BaudRate, balanceCfg.Parity, balanceCfg.DataBits, balanceCfg.StopBits); + serialPort.Handshake = balanceCfg.Handshake; + serialPort.Open(); + } + + public void ZeroWhenStable() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("ZeroWhenStable() returns without starting zeroing the scale because measurementState == MeasurementState.Busy"); + return; + } + + log.Info("ZeroWhenStable()"); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + serialPort.Write("Z\r\n"); + } + + public void Taring() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("Taring() returns without starting taring the scale because measurementState == MeasurementState.Busy"); + return; + } + + log.Info("Taring()"); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + serialPort.Write("T\r\n"); + } + + /// + /// Get a stable mass measurement + /// + public void GetStableMassMeasurement() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("GetStableMassMeasurement() returns without starting a measurement because measurementState == MeasurementState.Busy"); + return; + } + + log.Info("GetStableMassMeasurement()"); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + serialPort.Write("S\r\n"); + } + + /// + /// Get an immediate mass measurement + /// + public void GetImmediateMassMeasurement() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("GetImmediateMassMeasurement() returns without starting a measurement because measurementState == MeasurementState.Busy"); + return; + } + + log.Info("GetImmediateMassMeasurement()"); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + serialPort.Write("SI\r\n"); + } + + /// Units for SetUnits() argument + public enum Units + { + g, + kg, + t, + lb, + oz + } + + /// + /// Get the serial number + /// + /// After a successful SetUnits(kg) mass is still sent in g. MH 15.10.2013 + public void SetUnits(Units unit) + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("SetUnits() returns without setting the units because measurementState == MeasurementState.Busy"); + return; + } + + log.InfoFormat("SetUnits({0})", unit); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + switch (unit) + { + case Units.g: serialPort.Write("U g\r\n"); break; + case Units.kg: serialPort.Write("U kg\r\n"); break; + case Units.t: serialPort.Write("U t\r\n"); break; + case Units.lb: serialPort.Write("U lb\r\n"); break; + case Units.oz: serialPort.Write("U oz\r\n"); break; + } + } + + /// + /// Parse characters received from the serial port + /// + public virtual void RunDeviceBefore() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) + { + mass = GetSimMass(balanceNr); + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + msrmntTimeStamp = StateMachine.CurrentTime; + return; + } + + log.Debug("RunDevice()"); + + if (msrmntState != MsrmntState.Busy) return; /// No measurement in progress + + string justReceived = serialPort.ReadExisting(); + if (justReceived != null && justReceived.Length > 0) + { + log.Debug("RunDevice() received " + justReceived); + stringBuilder.Append(justReceived); + } + + string currentBuffer = stringBuilder.ToString(); + int eolPos = currentBuffer.IndexOf("\r\n"); + if (eolPos >= 0) + { + msrmntTimeStamp = StateMachine.CurrentTime; + + /// Get part of theh string before EOL + string received = currentBuffer.Substring(0, eolPos); + + /// Put the rest back to the string builder + stringBuilder.Clear(); + if (currentBuffer.Length > eolPos + 2) + { + stringBuilder.Append(currentBuffer.Substring(eolPos + 2)); + } + + while (true) + { + string tmp = received.Replace(" ", " "); + if (tmp.Length == received.Length) break; + received = tmp; + } + + string[] fields = received.Split(new char[] { ' ' }); + + if (fields.Length == 1 && fields[0].Equals("ZA")) /// Zero when stable + { + mass = 0; + Masses[balanceNr] = mass; + //msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\"", received); + return; + } + else if (fields.Length < 2) + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Unexpected error !!!", received); + return; + } + + if (fields[0].Equals("Z")) /// Zero when stable + { + if (fields.Length == 2 && fields[1].Equals("A")) + { + mass = 0; + Masses[balanceNr] = mass; + //msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\"", received); + return; + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", error !!!", received); + } + } + else if (fields[0].Equals("S")) /// Stable mass: field[1] = field[2] = "kg" + { + if (fields.Length >= 3 && + float.TryParse(fields[1], + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, + CultureInfo.InvariantCulture, + out mass)) + { + if (fields[2].Equals("g")) mass /= 1000.0f; + if (fields[2].Equals("t")) mass *= 1000.0f; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\", Mass = {1}", received, mass); + } + else if (fields.Length == 2 && fields[1].Equals("-")) + { + mass = 0; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\", Mass = {1}", received, mass); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Overload or and unexpected error !!!", received); + bool b = float.TryParse(fields[1], NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out mass); + + } + } + else if (fields[0].Equals("SD")) /// Dynamic mass: field[1] = field[2] = "kg" + { + if (fields.Length >= 3 && + float.TryParse(fields[1], + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, + CultureInfo.InvariantCulture, + out mass)) + { + if (fields[2].Equals("g")) mass /= 1000.0f; + if (fields[2].Equals("t")) mass *= 1000.0f; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\", Mass = {1}", received, mass); + } + else if (fields.Length == 2 && fields[1].Equals("-")) + { + mass = 0; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\", Mass = {1}", received, mass); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Overload or and unexpected error !!!", received); + bool b = float.TryParse(fields[1], NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out mass); + + } + } + else if (fields[0].Equals("TB")) /// Taring + { + if (fields.Length >= 3 && + float.TryParse(fields[1], + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, + CultureInfo.InvariantCulture, + out mass)) + { + if (fields[2].Equals("g")) mass /= 1000.0f; + if (fields[2].Equals("t")) mass *= 1000.0f; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\", Tara = {1}", received, mass); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Overload or and unexpected error !!!", received); + } + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Unexpected error !!!", received); + } + } + } + + /// Run this device + public void RunDeviceAfter() + { + } + + /// Stop this device + public void StopDevice() + { + if (serialPort != null) serialPort.Close(); + } + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for 'tara' in kg + /// TaringOp instance reference casted to IOperaton + public IOperation TaringOp(ref FloatBox tara) + { + return new TaringOp(this, ref tara); + } + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for the measured mass in kg + /// ReadMassOp instance reference casted to IOperaton + public IOperation ReadMassOp(ref FloatBox mass) + { + return new ReadMassOp(this, ref mass); + } + + /// + /// Events: BalanceDone, Error + /// + /// Reference to a variable for the measured mass in kg + /// Required mass readings count (>= 3) + /// ReadMassAverageOp instance reference casted to IOperaton + public IOperation ReadStableMassOp(ref FloatBox mass, int readingsCount) + { + return new ReadStableMassOp(this, ref mass, readingsCount); + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceFactory.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceFactory.cs new file mode 100644 index 000000000..4ff847339 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceFactory.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + public class BalanceFactory : IComponentFactory + { + public string ClassName { get { return "MettlerToledo Balance"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new BalanceCfg(this, "Balance1", 3, 2400, System.IO.Ports.Parity.Even, 7, + System.IO.Ports.StopBits.One, System.IO.Ports.Handshake.XOnXOff, + 200); // kg + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new BalanceCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new BalanceDev((BalanceCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return MettlerToledo.BalanceCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { BalanceDev.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewDev.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewDev.cs new file mode 100644 index 000000000..bbd8021d2 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewDev.cs @@ -0,0 +1,264 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.IO.Ports; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + /// + /// Mettler Toledo ICS4_5 Weighting terminal connected via serial interface (RS232) + /// + /// + /// Implemented and tested on 15.10.2013 by Milan Hanajik + /// + public class BalanceNewDev : BalanceDev, IComponent, IDevice, GenericDevices.IBalance2 + { + /// + /// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..." + /// Warn: Start measurement when busy is true + /// + private static readonly ILog log = LogManager.GetLogger(typeof(BalanceNewDev)); + public override string ToString() { return string.Format("Mettler-Toledo Balance with SN"); } + + public static void ResetStaticProperties() { } + + /// Serial number after GetSerialNumber() when MsrmntState == MsrmntState.Valid + public string SerialNumber + { + get { return serialNumber; } + } + string serialNumber; + + public BalanceNewDev(BalanceCfg cfg, IList components) + : base(cfg, components) + { + } + + /// + /// Get the serial number + /// + public void GetSerialNumber() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return; + + if (msrmntState == MsrmntState.Busy) + { + log.Warn("GetSerialNumber() returns without getting the s/n because measurementState == MeasurementState.Busy"); + return; + } + + log.Info("GetSerialNumber()"); + + msrmntState = MsrmntState.Busy; + stringBuilder.Clear(); + serialPort.Write("I4\r\n"); + } + + /// + /// Parse characters received from the serial port + /// + public override void RunDeviceBefore() + { + if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) + { + mass = GetSimMass(balanceNr); + Masses[balanceNr] = mass; + serialNumber = "1234567890"; + msrmntState = MsrmntState.Valid; + msrmntTimeStamp = StateMachine.CurrentTime; + return; + } + + log.Debug("RunDevice()"); + + if (base.msrmntState != MsrmntState.Busy) return; /// No measurement in progress + + string justReceived = serialPort.ReadExisting(); + if (justReceived != null && justReceived.Length > 0) + { + log.Debug("RunDevice() received " + justReceived); + stringBuilder.Append(justReceived); + + if (stringBuilder.ToString().EndsWith("\r\n")) + { + msrmntTimeStamp = StateMachine.CurrentTime; + + string received = stringBuilder.ToString(); + + while (true) + { + string tmp = received.Replace(" ", " "); + if (tmp.Length == received.Length) break; + received = tmp; + } + + string[] fields = received.Substring(0, received.Length - 2).Split(new char[] { ' ' }); + if (fields.Length < 2) + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = {0}, Unexpected error !!!", + received.Replace("\r", "").Replace("\n", "")); + return; + } + + if (fields[0].Equals("I4")) /// Serial number + { + if (fields.Length == 3 && fields[1].Equals("A") && fields[2].Length >= 3) + { + serialNumber = fields[2].Substring(1, fields[2].Length - 2); + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}, s/n = {1}", + received.Replace("\r", "").Replace("\n", ""), serialNumber); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = {0}, error !!!", + received.Replace("\r", "").Replace("\n", "")); + } + } + else if (fields[0].Equals("Z")) /// Zero when stable + { + if (fields.Length == 2 && fields[1].Equals("A")) + { + mass = 0; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}", + received.Replace("\r", "").Replace("\n", "")); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", error !!!", + received.Replace("\r", "").Replace("\n", "")); + } + } + else if (fields[0].Equals("S")) /// Stable (field[1] == "S") or dynamic (field[1] == "D") mass measurement + { + if (fields.Length == 4 && fields[1].Equals("S") && + float.TryParse(fields[2], NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out mass)) + { + if (fields[3].Equals("g")) mass /= 1000.0f; + if (fields[3].Equals("t")) mass *= 1000.0f; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}, Mass = {1}", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else if (fields.Length == 4 && fields[1].Equals("D") && + float.TryParse(fields[2], NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out mass)) + { + if (fields[3].Equals("g")) mass /= 1000.0f; + if (fields[3].Equals("t")) mass *= 1000.0f; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}, Mass = {1}", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else if (fields.Length == 2 && fields[1].Equals("-")) + { + mass = 0; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}, Mass = {1}", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else if (fields.Length >= 2 && fields[1].Equals("I")) + { + mass = balanceCfg.Capacity; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Overload; + log.InfoFormat("Balance response = {0}, Overload", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Overload or and unexpected error !!!", + received.Replace("\r", "").Replace("\n", "")); + } + } + else if (fields[0].Equals("T")) /// Taring + { + if (fields.Length == 4 && fields[1].Equals("S") && + float.TryParse(fields[2], NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite, + CultureInfo.InvariantCulture, out mass)) + { + if (fields[3].Equals("g")) mass /= 1000.0f; + if (fields[3].Equals("t")) mass *= 1000.0f; + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = {0}, Mass = {1}", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else if (fields.Length >= 2 && fields[1].Equals("I")) + { + mass = mass = balanceCfg.Capacity; + msrmntState = MsrmntState.Overload; + log.InfoFormat("Balance response = {0}, Overload", + received.Replace("\r", "").Replace("\n", ""), mass); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Overload or and unexpected error !!!", + received.Replace("\r", "").Replace("\n", "")); + } + } + else if (fields[0].Equals("U")) + { + if (fields.Length == 2 && fields[1].Equals("A")) + { + msrmntState = MsrmntState.Valid; + log.InfoFormat("Balance response = \"{0}\"", + received.Replace("\r", "").Replace("\n", "")); + } + else + { + msrmntState = MsrmntState.Failed; + log.WarnFormat("Balance response = \"{0}\", Unexpected error !!!", + received.Replace("\r", "").Replace("\n", "")); + } + } + else if (fields[0].Equals("SI")) /// "SI I" received in case of overload -> empty the tank + { + if (fields.Length >= 2 && fields[1].Equals("I")) + { + mass = balanceCfg.Capacity; + Masses[balanceNr] = mass; + msrmntState = MsrmntState.Valid; + //msrmntState = MsrmntState.Overload; + log.WarnFormat("Balance response = \"{0}\", Overload.", + received.Replace("\r", "").Replace("\n", "")); + } + } + } + } + } + + /// + /// Events: BalanceDone, Error + /// + /// Reference to the serialNumber + /// GetBalanceSNOp instance reference casted to IOperaton + public IOperation GetBalanceSNOp(ref string serialNumber) + { + return new GetBalanceSNOp(this, ref serialNumber); + } + + /// + /// Events: BalanceDone, Error + /// + /// + /// SetUnitsOp instance reference casted to IOperaton + public IOperation SetUnitsOp(Units units) + { + return new SetUnitsOp(this, units); + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewFactory.cs b/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewFactory.cs new file mode 100644 index 000000000..7ff676ce5 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/BalanceNewFactory.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.MettlerToledo +{ + public class BalanceNewFactory : IComponentFactory + { + public string ClassName { get { return "MettlerToledoBalanceSN"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 5; } } + + public IComponentCfg DefaultConfig(IList components) + { + return new BalanceCfg(this, "Balance1", 3, 2400, System.IO.Ports.Parity.Even, 7, + System.IO.Ports.StopBits.One, System.IO.Ports.Handshake.XOnXOff, + 200); // kg + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new BalanceCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new BalanceNewDev((BalanceCfg)config, components); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return MettlerToledo.BalanceCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { BalanceNewDev.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/GetBalanceSNOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/GetBalanceSNOp.cs new file mode 100644 index 000000000..159c6795a --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/GetBalanceSNOp.cs @@ -0,0 +1,59 @@ +using System; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + public class GetBalanceSNOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(GetBalanceSNOp)); + public override string ToString() { return string.Format("GetBalanceSNOp(.,.)"); } + + /// Set by the constructor + BalanceNewDev balanceDev; + string serialNumber; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Reference to the serialNumber + public GetBalanceSNOp(BalanceNewDev balanceDev, ref string serialNumber) + { + if (balanceDev == null) throw new ArgumentNullException("balanceDev"); + this.balanceDev = balanceDev; + + this.serialNumber = serialNumber; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + log.Debug("Start()"); + balanceDev.GetSerialNumber(); + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// + public Event Run() + { + if (balanceDev.MsrmntState == MsrmntState.Valid) + { + serialNumber = balanceDev.SerialNumber; + return Event.BalanceDone; /// S/N read successful + } + if (balanceDev.MsrmntState == MsrmntState.Failed) return Event.Error; /// S/N read failed + return Event.None; /// No result yet + } + + /// Stop this operation + public void Stop() + { + log.Debug("Stop()"); + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/ReadMassOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/ReadMassOp.cs new file mode 100644 index 000000000..7bfab0e04 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/ReadMassOp.cs @@ -0,0 +1,68 @@ +using System; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + public class ReadMassOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadMassOp)); + public override string ToString() { return string.Format("ReadMassOp(.,.)"); } + + bool done; + + /// Set by the constructor + BalanceDev balanceDev; + FloatBox result; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Required mass readings count (>= 3) + /// Reference to the measured mass in kg + public ReadMassOp(BalanceDev balanceDev, ref FloatBox result) + { + if (balanceDev == null) throw new ArgumentNullException("balanceDev"); + this.balanceDev = balanceDev; + + this.result = result; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + done = false; + balanceDev.GetImmediateMassMeasurement(); + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// Event.Error . . . . . Current.Tick == null + /// + public Event Run() + { + if (done) return Event.BalanceDone; /// Mass has already been read + + if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.None; + + if (balanceDev.MsrmntState == MsrmntState.Valid) + { + result.F = balanceDev.Mass; + done = true; + return Event.BalanceDone; /// Mass read OK + } + + balanceDev.GetImmediateMassMeasurement(); /// Failed -> repeat the measurement + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/ReadMassesOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/ReadMassesOp.cs new file mode 100644 index 000000000..4d83e512f --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/ReadMassesOp.cs @@ -0,0 +1,60 @@ +using System; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + public class ReadMassesOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadMassesOp)); + public override string ToString() { return string.Format("ReadMassesOp()"); } + + bool done; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Required mass readings count (>= 3) + /// Reference to the measured mass in kg + public ReadMassesOp() + { + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + done = false; + for (int i = 0; i < BalanceDev.BalancesCount; i++) + { + BalanceDev.Balances[i].GetImmediateMassMeasurement(); + } + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// Event.Error . . . . . Current.Tick == null + /// + public Event Run() + { + if (done) return Event.BalanceDone; /// Mass has already been read + + for (int i = 0; i < BalanceDev.BalancesCount; i++) + { + if (BalanceDev.Balances[i].MsrmntState == MsrmntState.Busy) + { + return Event.None; + } + } + done = true; + return Event.BalanceDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/ReadStableMassOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/ReadStableMassOp.cs new file mode 100644 index 000000000..31bc41f96 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/ReadStableMassOp.cs @@ -0,0 +1,88 @@ +using System; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + /// + /// Operation to read more mass values and average them to obtain a more accurate result. + /// + public class ReadStableMassOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadStableMassOp)); + public override string ToString() { return string.Format("ReadStableMassOp(.,{0},.)", totalReadingsCount); } + + /// Operation specific + float[] massReadings; + int currentReadingsCount; + + /// Set by the constructor + BalanceDev balanceDev; + int totalReadingsCount; + FloatBox result; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Reference to the measured mass in kg + /// Required mass readings count (>= 3) + public ReadStableMassOp(BalanceDev balanceDev, ref FloatBox result, int readingsCount) + { + if (balanceDev == null) throw new ArgumentNullException("balanceDev"); + this.balanceDev = balanceDev; + + if (readingsCount < 3) throw new ArgumentOutOfRangeException("requiredReadingsCount"); + this.totalReadingsCount = readingsCount; + + this.result = result; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + currentReadingsCount = 0; + massReadings = new float[totalReadingsCount]; + balanceDev.GetStableMassMeasurement(); + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// Event.Error . . . . . Current.Tick == null + /// + public Event Run() + { + if (currentReadingsCount >= totalReadingsCount) return Event.BalanceDone; /// Mass has already been calculated + + if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.None; + + if (balanceDev.MsrmntState == MsrmntState.Valid) + { + massReadings[currentReadingsCount++] = balanceDev.Mass; + + if (currentReadingsCount == totalReadingsCount) + { + /// calculate the average + float calcMass = 0; + Array.Sort(massReadings); + for (int i = 1; i < totalReadingsCount - 1; i++) calcMass += massReadings[i]; + calcMass = (calcMass / (totalReadingsCount - 2)); + + result.F = calcMass; + return Event.BalanceDone; /// Mass has just been calculated + } + } + + balanceDev.GetStableMassMeasurement(); + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/SetUnitsOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/SetUnitsOp.cs new file mode 100644 index 000000000..848d1b634 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/SetUnitsOp.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + public class SetUnitsOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(SetUnitsOp)); + public override string ToString() { return string.Format("SetUnitsOp({0})", units); } + + /// Set by the constructor + BalanceDev balanceDev; + BalanceDev.Units units; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Reference to the serialNumber + public SetUnitsOp(BalanceDev balanceDev, BalanceDev.Units units) + { + if (balanceDev == null) throw new ArgumentNullException("balanceDev"); + this.balanceDev = balanceDev; + + this.units = units; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + log.Debug("Start()"); + balanceDev.SetUnits(units); + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// + public Event Run() + { + if (balanceDev.MsrmntState == MsrmntState.Valid) return Event.BalanceDone; /// Units set + if (balanceDev.MsrmntState == MsrmntState.Failed) return Event.Error; /// Failed + return Event.None; /// No result yet + } + + /// Stop this operation + public void Stop() + { + log.Debug("Stop()"); + } + } +} diff --git a/TestBenchFramework/BenchControl/MettlerToledo/TaringOp.cs b/TestBenchFramework/BenchControl/MettlerToledo/TaringOp.cs new file mode 100644 index 000000000..de7a435e9 --- /dev/null +++ b/TestBenchFramework/BenchControl/MettlerToledo/TaringOp.cs @@ -0,0 +1,74 @@ +using System; +using log4net; + +namespace TBF.BenchControl.MettlerToledo +{ + public class TaringOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(TaringOp)); + public override string ToString() { return string.Format("TaringOp(.,.)"); } + + bool done; + + /// Set by the constructor + BalanceDev balanceDev; + FloatBox tara; + + /// + /// Events: BalanceDone, Error + /// + /// Balance device instance + /// Reference to variable for 'tara' in kg + public TaringOp(BalanceDev balanceDev, ref FloatBox tara) + { + if (balanceDev == null) throw new ArgumentNullException("balanceDev"); + this.balanceDev = balanceDev; + + this.tara = tara; + + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + done = false; + balanceDev.Taring(); + } + + /// Run this operation + /// + /// Event.None + /// Event.BalanceDone + /// Event.Error . . . . . Current.Tick == null + /// + public Event Run() + { + if (done) return Event.BalanceDone; /// Taring has been done already + + if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.None; + + if (balanceDev.MsrmntState == MsrmntState.Overload) + { + tara.F = balanceDev.Capacity; + done = true; + return Event.BalanceOverload; + } + + if (balanceDev.MsrmntState == MsrmntState.Valid) + { + tara.F = balanceDev.Mass; + done = true; + return Event.BalanceDone; /// Taring completed + } + + balanceDev.Taring(); /// Failed -> repeat taring + return Event.None; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/AskYesNoForm.Designer.cs b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.Designer.cs new file mode 100644 index 000000000..4517e6cd7 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.Designer.cs @@ -0,0 +1,94 @@ +namespace TBF.BenchControl.Operations +{ + partial class AskYesNoForm + { + /// + /// 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 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.yesButton = new System.Windows.Forms.Button(); + this.noButton = new System.Windows.Forms.Button(); + this.questionLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // yesButton + // + this.yesButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.yesButton.ForeColor = System.Drawing.Color.Black; + this.yesButton.Location = new System.Drawing.Point(200, 96); + this.yesButton.Name = "yesButton"; + this.yesButton.Size = new System.Drawing.Size(98, 63); + this.yesButton.TabIndex = 1; + this.yesButton.Text = "Yes"; + this.yesButton.UseVisualStyleBackColor = true; + this.yesButton.Click += new System.EventHandler(this.yesButton_Click); + // + // noButton + // + this.noButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.noButton.ForeColor = System.Drawing.Color.Black; + this.noButton.Location = new System.Drawing.Point(65, 96); + this.noButton.Name = "noButton"; + this.noButton.Size = new System.Drawing.Size(98, 63); + this.noButton.TabIndex = 2; + this.noButton.Text = "No"; + this.noButton.UseVisualStyleBackColor = true; + this.noButton.Click += new System.EventHandler(this.noButton_Click); + // + // questionLabel + // + this.questionLabel.AutoSize = true; + this.questionLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.questionLabel.Location = new System.Drawing.Point(34, 38); + this.questionLabel.Name = "questionLabel"; + this.questionLabel.Size = new System.Drawing.Size(300, 23); + this.questionLabel.TabIndex = 4; + this.questionLabel.Text = "Fill the test bench with water?"; + // + // AskYesNoForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Goldenrod; + this.ClientSize = new System.Drawing.Size(363, 201); + this.Controls.Add(this.questionLabel); + this.Controls.Add(this.noButton); + this.Controls.Add(this.yesButton); + this.Name = "AskYesNoForm"; + this.Text = "Question"; + this.TopMost = true; + this.Load += new System.EventHandler(this.AskYesNoForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button yesButton; + private System.Windows.Forms.Button noButton; + private System.Windows.Forms.Label questionLabel; + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/Operations/AskYesNoForm.cs b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.cs new file mode 100644 index 000000000..974fe95c0 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.cs @@ -0,0 +1,38 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.BenchControl.Operations +{ + public partial class AskYesNoForm : Form + { + public string Question; + public bool CompletedYes; + public bool CompletedNo; + + public AskYesNoForm() + { + InitializeComponent(); + } + + private void AskYesNoForm_Load(object sender, EventArgs e) + { + Text = Strings.Question; + questionLabel.Text = Strings.Fill_with_water; + yesButton.Text = Strings.YesBtn; + noButton.Text = Strings.NoBtn; + } + + private void yesButton_Click(object sender, EventArgs e) + { + CompletedYes = true; + Close(); + } + + private void noButton_Click(object sender, EventArgs e) + { + CompletedNo = true; + Close(); + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/AskYesNoForm.resx b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/AskYesNoForm.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/TestBenchFramework/BenchControl/Operations/AskYesNoOp.cs b/TestBenchFramework/BenchControl/Operations/AskYesNoOp.cs new file mode 100644 index 000000000..740f230e8 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/AskYesNoOp.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.Operations +{ + public class AskYesNoOp : IOperation + { + AskYesNoForm modelessDlg; + + string question; + + /// Reference to the operation + public AskYesNoOp() + { + } + + public AskYesNoOp(string question) + { + this.question = question; + } + + delegate void AskYesNoFormDlgt(AskYesNoOp myRef); + /// + void OpenFormDlg(AskYesNoOp myRef) + { + myRef.modelessDlg = new AskYesNoForm(); + myRef.modelessDlg.Question = this.question; + modelessDlg.Show(); + } + + /// Start this operation + public void Start() + { + Program.MainWnd.Invoke(new AskYesNoFormDlgt(OpenFormDlg), this); + } + + /// Run this operation + /// Event.ResultsPrinted + public Event Run() + { + if (modelessDlg.CompletedYes) return Event.Yes; + if (modelessDlg.CompletedNo) return Event.No; + return Event.None; + } + + /// Stop this operation + public void Stop() + { + modelessDlg = null; + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/CheckUIOp.cs b/TestBenchFramework/BenchControl/Operations/CheckUIOp.cs new file mode 100644 index 000000000..2ec7528d5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/CheckUIOp.cs @@ -0,0 +1,109 @@ +using log4net; +using TBF.UiBridge; + +namespace TBF.BenchControl.Operations +{ + /// + /// Implements User Interface input for the state machine. + /// UI inserts commands int a queue (FIFO buffer). + /// UiBridgeOp class reads the queue and generates events that + /// in turn control state transitions in the state machine. + /// + public class CheckUIOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(CheckUIOp)); + public override string ToString() { return "CheckUIOp(" + clearInputQueue.ToString() + ")"; } + + /// Set by constructors + bool clearInputQueue; + + /// + /// Check input from UI for the state machine. + /// Events: Start,Stop,Cycle,Purge,LetOutLine,LetOutBalance,TestOpticalHeads,ResetResults,Calibration,SensitivityTest + /// + /// true = clear queue on start + public CheckUIOp(bool clearInputQueue) + { + this.clearInputQueue = clearInputQueue; + } + public CheckUIOp() + : this(false) + { + } + + void UiEventHandlerMethod(UI2BenchCmd cmd) + { + lock (Bridge.Ui2MachineQueue) + { + Bridge.Ui2MachineQueue.Enqueue(cmd); + } + } + + public void Start() + { + if (clearInputQueue) + { + lock (Bridge.Ui2MachineQueue) + { + Bridge.Ui2MachineQueue.Clear(); + } + } + } + + public Event Run() + { + if (Bridge.Ui2MachineQueue.Count <= 0) return Event.None; + + UI2BenchCmd cmd; + + lock (Bridge.Ui2MachineQueue) + { + if (Bridge.Ui2MachineQueue.Contains(UI2BenchCmd.Stop)) + { + do { + cmd = Bridge.Ui2MachineQueue.Dequeue(); + } + while (cmd != UI2BenchCmd.Stop); + } + else + { + cmd = Bridge.Ui2MachineQueue.Dequeue(); + } + } + + switch (cmd) + { + /// Bench Control Panel buttons + case UI2BenchCmd.StartTest: return Event.UiCmdStartTest; + case UI2BenchCmd.StartQ1: return Event.UiCmdStartQ1; + case UI2BenchCmd.StartQ2: return Event.UiCmdStartQ2; + case UI2BenchCmd.StartQ3: return Event.UiCmdStartQ3; + case UI2BenchCmd.StartCycle: return Event.UiCmdStartCycle; + case UI2BenchCmd.Stop: return Event.UiCmdStop; + case UI2BenchCmd.PurgeBegin: return Event.UiCmdPurgeBegin; + case UI2BenchCmd.PurgeEnd: return Event.UiCmdPurgeEnd; + case UI2BenchCmd.EmptyTank1: return Event.UiCmdEmptyTank1; + case UI2BenchCmd.EmptyTank2: return Event.UiCmdEmptyTank2; + case UI2BenchCmd.TryOpticalHeads: return Event.UiCmdTestOpticalHeads; + case UI2BenchCmd.ResetResults: return Event.UiCmdResetResults; + case UI2BenchCmd.AcceptResults: return Event.UiCmdAcceptResults; + case UI2BenchCmd.Calibration: return Event.UiCmdCalibration; + case UI2BenchCmd.CameraTest: return Event.UiCmdCameraTest; + case UI2BenchCmd.SensitivityTest: return Event.UiCmdSensitivityTest; + + case UI2BenchCmd.Next: return Event.Next; + + /// Test buttons + case UI2BenchCmd.B1: return Event.UiCmdB1; + case UI2BenchCmd.B2: return Event.UiCmdB2; + case UI2BenchCmd.B3: return Event.UiCmdB3; + + default: return Event.None; + } + } + + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/ClearResultsOp.cs b/TestBenchFramework/BenchControl/Operations/ClearResultsOp.cs new file mode 100644 index 000000000..b3a1c9c18 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/ClearResultsOp.cs @@ -0,0 +1,25 @@ +using log4net; + +namespace TBF.BenchControl.Operations +{ + class ClearResultsOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ClearResultsOp)); + public override string ToString() { return "ClearResultsOp"; } + + public void Start() + { + //Results.Clear(); + } + + public Event Run() + { + log.Info("Event.Done"); + return Event.Done; + } + + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/EmptyBalanceTankOp.cs b/TestBenchFramework/BenchControl/Operations/EmptyBalanceTankOp.cs new file mode 100644 index 000000000..06fa5c3c4 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/EmptyBalanceTankOp.cs @@ -0,0 +1,51 @@ +using log4net; + +namespace TBF.BenchControl.Operations +{ + /// + /// An empty operation. + /// + /// Constructors: + /// EmptyBalanceTank() + /// Start argument: + /// - + /// Events: + /// Event.None ... operation is in progress + /// + class EmptyBalanceTankOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(EmptyBalanceTankOp)); + public override string ToString() { return "EmptyBalanceTankOp"; } + + /// + /// Constructor + /// + public EmptyBalanceTankOp() + { + } + + /// + /// When started + /// + public void Start() + { + } + + /// + /// When running + /// + /// + public Event Run() + { + /// Must return some event + return Event.None; + } + + /// + /// When stopped + /// + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/LoadProcedureOp.cs b/TestBenchFramework/BenchControl/Operations/LoadProcedureOp.cs new file mode 100644 index 000000000..d07274ad8 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/LoadProcedureOp.cs @@ -0,0 +1,75 @@ +using System.Threading; +using log4net; +using NHibernate; + +namespace TBF.BenchControl.Operations +{ + public class LoadProcedureOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(LoadProcedureOp)); + + Thread loaderThread; + bool error; + bool completed; + + /// + /// Events: Wait, ProcedureLoaded or Error + /// + public LoadProcedureOp() + { + error = false; + completed = false; + } + + /// Start this operation + public void Start() + { + if (loaderThread != null) + { + error = true; + return; + } + + loaderThread = new Thread(Loader); + loaderThread.Start(); + } + + void Loader() + { + StateMachine.LoadProcedure(false); + StateMachine.LoadProcedureParams(StateMachine.Procedure); + + completed = true; + } + + /// Run this operation + /// + /// Event.Error, Event.ProcedureLoaded or Event.Wait + /// + public Event Run() + { + if (error) return Event.Error; + if (!completed) return Event.Wait; + + /// + /// Check for incomplete configuration mistakes + /// + if (StateMachine.Tests.Count == 0) return Event.ConfigurationError; + foreach (var test in StateMachine.Tests) + { + if (test.FeedingPath == null || test.BenchPath == null || + test.OutputPath == null || test.MetersPath == null) + { + return Event.ConfigurationError; + } + } + + return Event.ProcedureLoaded; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/OpTemplate.cs b/TestBenchFramework/BenchControl/Operations/OpTemplate.cs new file mode 100644 index 000000000..f759cdd12 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/OpTemplate.cs @@ -0,0 +1,61 @@ +using log4net; +using System; +using System.Diagnostics; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.Operations +{ + /// + /// An empty operation. + /// + /// Constructors: + /// OpTemplate() + /// + /// Start argument: + /// + /// Events: + /// Event.None ...... operation is in progress + /// + class OpTemplate : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(OpTemplate)); + public override string ToString() { return string.Format("OpTemplate({0})", someValue); } + + /// Set by the constructor + int someValue; + + /// + /// Constructor + /// + public OpTemplate(int someValue) + { + if (someValue < 0 || someValue > 5) throw new ArgumentOutOfRangeException("someValue"); + this.someValue = someValue; + } + + /// + /// When started + /// + public void Start() + { + } + + /// + /// When running + /// + /// + public Event Run() + { + /// Must return some event + return Event.None; + } + + /// + /// When stopped + /// + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/ReadMoreRegistersOp.cs b/TestBenchFramework/BenchControl/Operations/ReadMoreRegistersOp.cs new file mode 100644 index 000000000..b5a47773e --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/ReadMoreRegistersOp.cs @@ -0,0 +1,134 @@ +using System; +using log4net; +using TBF.BenchControl; + +namespace TBF.BenchControl.Operations +{ + public class ReadMoreRegistersOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReadMoreRegistersOp)); + public override string ToString() { return string.Format("ReadAllRegistersOp()"); } + + /// Set by the constructor + int readersCount; + int[] iPulses; + int[] iRefPulses; + IntBox[] pulses; + IntBox[] refPulses; + IOperation[] readRegOps; + Event[] events; + + /// + /// Events: eventDone (default=Event.ReadRegisterDone) or Event.Error + /// + /// Register reader reference + /// Reference to the water meter register state in pulses + public ReadMoreRegistersOp(GenericDevices.IRegisterReader[] readers, ref int[] iPulses) + { + if (readers == null) throw new ArgumentNullException("readers"); + + readersCount = readers.Length; + + if (iPulses == null || iPulses.Length != readersCount) + { + throw new ArgumentException("iPulses"); + } + this.iPulses = iPulses; + + pulses = new IntBox[Program.WMsCount]; + + readRegOps = new IOperation[readersCount]; + for (int i = 0; i < readersCount; i++) + { + pulses[i] = new IntBox(iPulses[i]); + + if (readers[i] != null) + { + readRegOps[i] = readers[i].ReadRegisterOp(ref pulses[i]); + } + } + log.Debug(this.ToString()); + } + + /// + /// Events: eventDone (default=Event.ReadRegisterDone) or Event.Error + /// + /// Register reader reference + /// Reference to the water meter register state in pulses + public ReadMoreRegistersOp(GenericDevices.IRegisterReader[] readers, ref int[] iPulses, ref int[] iRefPulses) + : this(readers, ref iPulses) + { + if (readers == null) throw new ArgumentNullException("readers"); + + readersCount = readers.Length; + + if (iPulses == null || iPulses.Length != readersCount || + iRefPulses == null || iRefPulses.Length != readersCount) + { + throw new ArgumentException("iPulses or iRefPulses"); + } + this.iPulses = iPulses; + this.iRefPulses = iRefPulses; + + pulses = new IntBox[Program.WMsCount]; + refPulses = new IntBox[Program.WMsCount]; + + readRegOps = new IOperation[readersCount]; + for (int i = 0; i < readersCount; i++) + { + pulses[i] = new IntBox(iPulses[i]); + refPulses[i] = new IntBox(iRefPulses[i]); + + if (readers[i] != null) + { + readRegOps[i] = readers[i].ReadRegisterOp(ref pulses[i], ref refPulses[i]); + } + } + log.Debug(this.ToString()); + } + + /// Start this operation + public void Start() + { + for (int i = 0; i < readersCount; i++) + { + if (readRegOps[i] != null) readRegOps[i].Start(); + } + } + + /// Run this operation + public Event Run() + { + bool allDone = true; + bool anyError = false; + + for (int i = 0; i < readersCount; i++) + { + if (readRegOps[i] != null) + { + Event evnt = readRegOps[i].Run(); + iPulses[i] = pulses[i].N; + if (iRefPulses != null) + { + iRefPulses[i] = refPulses[i].N; + } + if (evnt == Event.Error) anyError = true; + if (evnt != Event.ReadRegisterDone) allDone = false; + } + } + + if (anyError) return Event.Error; + if (allDone) return Event.ReadAllRegistersDone; + return Event.None; + } + + /// Stop this operation + public void Stop() + { + for (int i = 0; i < readersCount; i++) + { + if (readRegOps[i] != null) readRegOps[i].Stop(); + } + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/SetAllRegulValvesOp.cs b/TestBenchFramework/BenchControl/Operations/SetAllRegulValvesOp.cs new file mode 100644 index 000000000..013ca6491 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/SetAllRegulValvesOp.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl.Operations +{ + public class SetAllRegulValvesOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(SetAllRegulValvesOp)); + public override string ToString() { return string.Format("SetAllRegulValvesOp()"); } + + IList regulValves; + int rvCount; + IOperation[] setRVPosOps; + + public SetAllRegulValvesOp(IList regulValves, string encodedPositions, int timeout) + { + if (regulValves == null) throw new ArgumentNullException("regulValves"); + this.regulValves = regulValves; + rvCount = regulValves.Count; + + // Parse the positions + float[] positions = new float[rvCount]; + string[] rvPosStr = (encodedPositions != null) ? encodedPositions.Split(new char[] { ';' }) : new string[0]; + for (int i = 0; i < Math.Min(rvCount, rvPosStr.Length); i++) + { + float posPct; + if (float.TryParse(rvPosStr[i], out posPct) && posPct >= 0 && posPct <= 100.0f) + { + positions[i] = posPct; + } + } + setRVPosOps = new IOperation[rvCount]; + for (int i = 0; i < rvCount; i++) + { + float posLo = Math.Max(positions[i] - 5.0f, 0); + float posHi = Math.Min(positions[i] + 5.0f, 100.0f); + setRVPosOps[i] = regulValves[i].SetRegulValvePositionOp(posLo, posHi, timeout); + } + } + + /// Start this operation + public void Start() + { + for (int i = 0; i < rvCount; i++) setRVPosOps[i].Start(); + } + + /// Run this operation + public Event Run() + { + bool allDone = true; + bool anyError = false; + bool anyTimeout = false; + + for (int i = 0; i < rvCount; i++) + { + Event evnt = setRVPosOps[i].Run(); + if (evnt == Event.Error) anyError = true; + else if (evnt == Event.RegulValveTimeOut) anyTimeout = true; + else if (evnt != Event.PositionReached) allDone = false; + } + + if (anyError) return Event.Error; + if (anyTimeout) return Event.Error; + if (allDone) return Event.AllPositionsReached; + return Event.None; + } + + /// Stop this operation + public void Stop() + { + for (int i = 0; i < rvCount; i++) setRVPosOps[i].Stop(); + } + } +} diff --git a/TestBenchFramework/BenchControl/Operations/TimerOp.cs b/TestBenchFramework/BenchControl/Operations/TimerOp.cs new file mode 100644 index 000000000..b93ce96f1 --- /dev/null +++ b/TestBenchFramework/BenchControl/Operations/TimerOp.cs @@ -0,0 +1,72 @@ +using log4net; + +namespace TBF.BenchControl.Operations +{ + /// + /// Implements timer function + /// + /// Constructors: + /// Timer(timerTimeMs) ................ use Event.TimerExpired as eventExpired + /// Timer(timerTimeMs, eventExpired) .. use constructor argument as eventExpired + /// + /// Start argument: + /// + /// Events: + /// Event.None ........ operation is in progress + /// eventExpired ...... timer expired + /// + public class TimerOp : IOperation + { + private static readonly ILog log = LogManager.GetLogger(typeof(TimerOp)); + public override string ToString() { return string.Format("TimerOp({0}s, Event.{1})", timerTime, eventExpired); } + + /// Private fields + bool timerStarted = false; + bool timeExpired = false; + int expireTime; + + /// Set by constructors + int timerTime; + Event eventExpired; + + /// + /// Constructors, optional argument is a timer name (you can create more then one timer) + /// + public TimerOp(int timerTime, Event eventExpired) + { + this.timerTime = timerTime; + this.eventExpired = eventExpired; + } + public TimerOp(int timerTime) + : this(timerTime, Event.TimerExpired) + { + } + + /// Time period (TimeSpan) + public void Start() + { + timeExpired = false; + timerStarted = true; + expireTime = StateMachine.CurrentTime + timerTime; + } + + public Event Run() + { + if (timerStarted && !timeExpired && StateMachine.CurrentTime >= expireTime) + { + timeExpired = true; + return eventExpired; + } + else + { + return Event.None; + } + } + + public void Stop() + { + timerStarted = false; + timeExpired = false; + } + } +} diff --git a/TestBenchFramework/BenchControl/OutputPath.cs b/TestBenchFramework/BenchControl/OutputPath.cs new file mode 100644 index 000000000..88291a666 --- /dev/null +++ b/TestBenchFramework/BenchControl/OutputPath.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using TBF.BenchControl.GenericDevices; + +namespace TBF.BenchControl +{ + public class OutputPath + { + public int ItemNr; + public string Name; + public float Qfrom; + public float Qto; + public IRegulValve RegulValve; + public IFlowMeter FlowMeter; + public IDiverter Diverter; + public ITempMeter TempDiv; + public IBalance Balance; + public IValve EmptyTankValve; + public IList ValvesOpen; + public IList ValvesClose; + + /// Constructor from name, the rest is empty + public OutputPath(string name, int itemNr) + { + ItemNr = itemNr; + Name = name; + ValvesOpen = new List(); + ValvesClose = new List(); + } + + /// Constructor from data entity + public OutputPath(Entities.OutputPath entity, IList components) + : this(entity.Name, entity.ItemNr) + { + Qfrom = entity.Qfrom; + Qto = entity.Qto; + RegulValve = (IRegulValve)TbfComponents.FindComponent(entity.RegulValve, components); + FlowMeter = (IFlowMeter)TbfComponents.FindComponent(entity.FlowMeter, components); + Diverter = (IDiverter)TbfComponents.FindComponent(entity.Diverter, components); + TempDiv = (ITempMeter)TbfComponents.FindComponent(entity.TempDiv, components); + Balance = (IBalance)TbfComponents.FindComponent(entity.Balance, components); + EmptyTankValve = (IValve)TbfComponents.FindComponent(entity.EmptyTankValve, components); + + string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' }); + ValvesOpen = new List(); + foreach (var vName in vOpen) ValvesOpen.Add((IValve)TbfComponents.FindComponent(vName, components)); + + string[] vClose = entity.ValvesClose.Split(new char[] { ';' }); + ValvesClose = new List(); + foreach (var vName in vClose) ValvesClose.Add((IValve)TbfComponents.FindComponent(vName, components)); + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs new file mode 100644 index 000000000..b4d4d2233 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Printing; + +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + public class BasicPrintDocument : PrintDocument + { + /// + /// Property variable for the Font the user wishes to use + /// + public Font Font + { + get { return font; } + set { font = value; } + } + Font font; + + /// + /// Data to print + /// + BenchControl.BenchId.Component benchId; + IList waterMeters; + IList results; + string title; + + /// + /// Constructor + /// + /// Text to be printed + public BasicPrintDocument(BenchControl.BenchId.Component benchId, + IList waterMeters, + IList results, + string title) + { + this.benchId = benchId; + this.waterMeters = waterMeters; + this.results = results; + this.title = title; + } + + /// + /// Override the default onbeginPrint method of the PrintDocument Object + /// + /// + /// + protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e) + { + base.OnBeginPrint(e); + if (font == null) { font = new Font("Times New Roman", 10); } + } + + /// + /// Override the default OnPrintPage method of the PrintDocument. + /// + /// + /// This provides the print logic for our document + protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e) + { + // Run base code + base.OnPrintPage(e); + + /// Set print area size and margins (in dots using 80 dpi) + int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom; + int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right; + int leftMargin = base.DefaultPageSettings.Margins.Left; /// X + int topMargin = base.DefaultPageSettings.Margins.Top; /// Y + + /// Check if the user selected to print in Landscape mode + /// if they did then we need to swap height/width parameters + if (base.DefaultPageSettings.Landscape) + { + int tmp = printHeight; + printHeight = printWidth; + printWidth = tmp; + } + + int x = leftMargin; + int y = topMargin; + + /// Use the StringFormat class for the text layout of our document + StringFormat format = new StringFormat(StringFormatFlags.LineLimit); + + foreach (var testResults in results) + { + RectangleF printArea = new RectangleF(x, y, printWidth, printHeight); + e.Graphics.DrawString("Test: " + testResults.TestName, font, Brushes.Black, printArea); + y += 30; + + printArea = new RectangleF(x + 100, y, printWidth, printHeight); + e.Graphics.DrawString("Watermeter1: Error = " + testResults.Meters[0].VolumeErrorPct.ToString() + + "% Result = " + testResults.Meters[0].Passed.ToString(), + font, Brushes.Black, printArea); + y += 30; + + printArea = new RectangleF(x + 100, y, printWidth, printHeight); + e.Graphics.DrawString("Watermeter2: " + testResults.Meters[1].Passed.ToString(), + font, Brushes.Black, printArea); + y += 30; + + printArea = new RectangleF(x + 100, y, printWidth, printHeight); + e.Graphics.DrawString("Watermeter3: " + testResults.Meters[2].Passed.ToString(), + font, Brushes.Black, printArea); + y += 50; + } + + e.HasMorePages = false; + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/Printer.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/Printer.cs new file mode 100644 index 000000000..e282b5565 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/Printer.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Printing; +using TBF.BenchControl; + +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + public class Printer : Generic.IComponent, IOperation, GenericDevices.IResultsPrinter + { + readonly PrinterCfg printerCfg; + public Generic.IComponentCfg Cfg { get { return printerCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return printerCfg.Name; } } + + /// + /// Data to print + /// + BenchControl.BenchId.Component benchId; + IList waterMeters; + IList results; + string title; + + public Printer(PrinterCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.printerCfg = cfg; + } + + /// + /// Prints the test cycle results, Events: Event.ResultsPrinted + /// + /// Results to print + /// Reference to the operation + public IOperation PrintResultsOp(BenchControl.BenchId.Component benchId, + IList waterMeters, + IList results, + string title) + { + this.benchId = benchId; + this.waterMeters = waterMeters; + this.results = results; + this.title = title; + return this; + } + + /// Start this operation + public void Start() + { + new BasicPrintDocument(benchId, waterMeters, results, title).Print(); + } + + /// Run this operation + /// Event.ResultsPrinted + public Event Run() + { + return Event.ResultsPrinted; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfg.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfg.cs new file mode 100644 index 000000000..892e15a28 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public PrinterCfg() + { + } + + /// + /// Basic results printer configuration parameters + /// + /// BasicPrinter factory + /// Printer name + public PrinterCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new PrinterCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + PrinterCfg config = (PrinterCfg)(new XmlSerializer(typeof(PrinterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.Designer.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.Designer.cs new file mode 100644 index 000000000..4db2db42a --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.Designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + partial class PrinterCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.cs new file mode 100644 index 000000000..13d7d66d5 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl)); + + PrinterCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as PrinterCfg; + Redraw(); + } + } + + public PrinterCfgCtrl() + { + InitializeComponent(); + } + + private void PrinterCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.resx b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.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/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterFactory.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterFactory.cs new file mode 100644 index 000000000..3de5b5cf9 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Basic +{ + public class PrinterFactory : IComponentFactory + { + public string ClassName { get { return "BasicResultsPrinter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new PrinterCfg(this, "BasicResultsPrinter"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new PrinterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Printer((PrinterCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return PrinterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Printer.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/MunichPrintDocument.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/MunichPrintDocument.cs new file mode 100644 index 000000000..085db937a --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/MunichPrintDocument.cs @@ -0,0 +1,325 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Printing; +using TBF.BenchControl; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public class MunichPrintDocument : PrintDocument + { + const int SpacingOne = 20; + const int SpacingOneAndHalf = (3 * SpacingOne) / 2; + const int TitleX = 240; + const int TitleY = 200; /// Depends on the size of the header + const int FirstLineNr = 14; /// Depends on the size of the header + const int Tab1 = 80; /// Positions of columns above the table + const int Tab2 = 240; + const int Tab3 = 430; + const int Tab4 = 590; + const int BorderW = 1; /// Table border line width + const int Margin = 7; /// Margins of the text from table lines + + /// Initialized in the constructor + readonly Printer prn; + readonly bool combined; /// true when MetersKind is MetersKind.Combined + readonly int secondTableOffset; /// Calculated in the constructor + + /// Top coordinate of the table + int top; + + /// + /// Property variable for the Font the user wishes to use + /// + public Font Font + { + get { return font; } + set { font = value; } + } + Font font; + Font fontTitle; + + /// + /// Constructor + /// + /// Text to be printed + public MunichPrintDocument(Printer printer) + { + prn = printer; + combined = (prn.Results[0].MetersKind == Entities.MetersKind.Combined); + secondTableOffset = (prn.Results.Count + 2) * SpacingOneAndHalf; + } + + /// + /// Override the default onbeginPrint method of the PrintDocument Object. + /// + /// + /// + protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e) + { + base.OnBeginPrint(e); + if (font == null) { font = new Font("Times New Roman", 10); } + if (fontTitle == null) { fontTitle = new Font("Times New Roman", 24); } + } + + /// + /// Override the default OnPrintPage method of the PrintDocument. + /// + /// + /// This provides the print logic for our document + protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e) + { + // Run base code + base.OnPrintPage(e); + + e.Graphics.DrawImageUnscaled(Properties.Resources.Headpic, 0, 0); + + /// Set print area size and margins (in dots using 80 dpi) + int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom; + int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right; + int leftMargin = base.DefaultPageSettings.Margins.Left; /// X + int topMargin = base.DefaultPageSettings.Margins.Top; /// Y + + /// Check if the user selected to print in Landscape mode + /// if they did then we need to swap height/width parameters + if (base.DefaultPageSettings.Landscape) + { + int tmp = printHeight; + printHeight = printWidth; + printWidth = tmp; + } + + int x = leftMargin; + int y = topMargin; + + /// Use the StringFormat class for the text layout of our document + StringFormat format = new StringFormat(StringFormatFlags.LineLimit); + + RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50); + e.Graphics.DrawString(prn.Title, this.fontTitle, Brushes.Black, printArea); + + int lineNr = FirstLineNr; + PrintAt(e, Tab1, lineNr * SpacingOne, prn.Version); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.BenchId.TestBenchNr.ToString()); + PrintAt(e, Tab3, lineNr * SpacingOne, "Datum :"); + PrintAt(e, Tab4, lineNr * SpacingOne, DateTime.Now.Date.ToString("d")); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Zahlertyp :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.Zaehlertyp); + PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.Eichjahr); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.Pruefvorlage); + lineNr += 2; + + if (combined) + { + PrintAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler"); + PrintAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler"); + lineNr++; + } + + PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].Producer); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].Producer); + } + lineNr++; + + PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].SerialNr); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].SerialNr); + } + lineNr++; + + PrintAt(e, Tab1, lineNr * SpacingOne, "Qn :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].Qn.ToString()); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Qn :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].Qn.ToString()); + } + lineNr++; + + PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].ApprovalInfo); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].ApprovalInfo); + } + lineNr++; + + PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].MetrologicalClass); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].MetrologicalClass); + } + lineNr++; + + PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.WaterMeters[0].State); + if (combined) + { + PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :"); + PrintAt(e, Tab4, lineNr * SpacingOne, prn.WaterMeters[1].State); + + lineNr += 2; + PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :"); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig"); + PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0f * Sequences.SequenceBase.Qrise).ToString("F1") + " l/h"); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall"); + PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0f * Sequences.SequenceBase.Qfall).ToString("F1") + " l/h"); + } + + lineNr += 2; + top = SpacingOne * lineNr; + + PrintTable(e); + DrawTable(e); + + lineNr += (secondTableOffset * 2) / SpacingOne; + PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.Results[0].AmbientTempAve.ToString("F1") + " \x00b0C"); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.Results[0].AmbientHumiAve.ToString("F0") + " %"); + lineNr++; + PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck"); + PrintAt(e, Tab2, lineNr * SpacingOne, prn.Results[0].AmbientPressAve.ToString("F0") + " mbar"); + + lineNr++; + PrintAt(e, Tab3, lineNr * SpacingOne, DateTime.Now.Date.ToString("d")); + lineNr ++; + PrintAt(e, Tab3, lineNr * SpacingOne, "Datum"); + PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift"); + } + + /// + /// Print table texts. + /// + void PrintTable(System.Drawing.Printing.PrintPageEventArgs e) + { + PrintAt(e, FromTest(-1, -1), "Prüflauf"); + PrintAt(e, FromTest(-1, 0), "Q [l/h]"); + PrintAt(e, FromTest(-1, 1), "Prüf-Vol.[l]"); + PrintAt(e, FromTest(-1, 2), combined ? "HZ-Vol.[l]" : "Z-Vol.[l]"); + PrintAt(e, FromTest(-1, 3), combined ? "NZ-Vol.[l]" : "-"); + PrintAt(e, FromTest(-1, 4), "Fehler [%]"); + PrintAt(e, FromTest(-1, 5), "Ergebnis"); + + PrintAt(e, FromTest(-1, 6), "Q [l/h]"); + PrintAt(e, FromTest(-1, 7), "Temperatur"); + PrintAt(e, FromTest(-1, 8), "Dichte"); + PrintAt(e, FromTest(-1, 9), "Prüfzeit"); + PrintAt(e, FromTest(-1, 10), "Druck Eing."); + PrintAt(e, FromTest(-1, 11), "Druck Ausg."); + + for (int i = 0; i < prn.Results.Count; i++) + { + Point p = FromTest(i, -1); + PrintAt(e, p.X, p.Y, prn.Results[i].Name); + PrintAt(e, p.X, p.Y + (prn.Results.Count + 2) * SpacingOneAndHalf, prn.Results[i].Name); + + PrintAt(e, FromTest(i, 0), prn.Results[i].FlowMass.ToString("F1")); + PrintAt(e, FromTest(i, 1), prn.Results[i].VolumeCTV.ToString("F2")); + PrintAt(e, FromTest(i, 2), prn.Results[i].Meters[0].VolumeMeter.ToString("F2")); + if (combined) + { + PrintAt(e, FromTest(i, 3), prn.Results[i].Meters[1].VolumeMeter.ToString("F2")); + PrintAt(e, FromTest(i, 4), prn.Results[i].CombinedMeters[0].VolumeErrorPct.ToString("F2")); + PrintAt(e, FromTest(i, 5), prn.Results[i].CombinedMeters[0].Passed ? "iO" : "NiO"); + } + else + { + PrintAt(e, FromTest(i, 3), "-"); + PrintAt(e, FromTest(i, 4), prn.Results[i].Meters[0].VolumeErrorPct.ToString("F2")); + PrintAt(e, FromTest(i, 5), prn.Results[i].Meters[0].Passed ? "iO" : "NiO"); + } + PrintAt(e, FromTest(i, 6), prn.Results[i].FlowMass.ToString("F1")); + PrintAt(e, FromTest(i, 7), prn.Results[i].TempOutAvrg.ToString("F2")); + PrintAt(e, FromTest(i, 8), prn.Results[i].DensityDiv.ToString("F2")); + PrintAt(e, FromTest(i, 9), prn.Results[i].Time.ToString("F1")); + PrintAt(e, FromTest(i, 10), prn.Results[i].PressInAvrg.ToString("F2")); + PrintAt(e, FromTest(i, 11), prn.Results[i].PressOutAvrg.ToString("F2")); + } + } + + /// + /// Draw table lines. + /// + void DrawTable(System.Drawing.Printing.PrintPageEventArgs e) + { + int mid = top + SpacingOneAndHalf; + int bot = top + (prn.Results.Count + 1) * SpacingOneAndHalf; + + int top2 = top + secondTableOffset; + int mid2 = mid + secondTableOffset; + int bot2 = bot + secondTableOffset; + + // Horizontal lines + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top), new Point(747, top)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid), new Point(747, mid)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot), new Point(747, bot)); + + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top2), new Point(747, top2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid2), new Point(747, mid2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot2), new Point(747, bot2)); + + // Vertical lines + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top), new Point( 80, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top), new Point(267, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top), new Point(347, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top), new Point(427, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top), new Point(507, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top), new Point(587, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top), new Point(667, bot)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top), new Point(747, bot)); + + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top2), new Point( 80, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top2), new Point(267, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top2), new Point(347, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top2), new Point(427, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top2), new Point(507, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top2), new Point(587, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top2), new Point(667, bot2)); + e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top2), new Point(747, bot2)); + } + + void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text) + { + PrintAt(e, p.X, p.Y, text); + } + + void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text) + { + RectangleF printArea = new RectangleF(x, y, 667, SpacingOne); + e.Graphics.DrawString(text, this.font, Brushes.Black, printArea); + } + + Point FromTest(int testNr, int parNr) + { + const int NrParamsInOneTableRow = 6; + + int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + Margin; + int y = top + SpacingOneAndHalf + Margin + testNr * SpacingOneAndHalf + + ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0); + + if (parNr < 0) x = 80 + Margin; /// When parNr == -1 return the left column x coordinate + + return new Point(x, y); + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/Printer.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/Printer.cs new file mode 100644 index 000000000..72eb449d4 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/Printer.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Printing; +using TBF.BenchControl; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public class Printer : ComponentBase, Generic.IComponent, IOperation, GenericDevices.IResultsPrinter + { + readonly PrinterCfg printerCfg; + + public static void ResetStaticProperties() { } + + /// + /// Data to print + /// + public BenchControl.BenchId.Component BenchId; + public IList WaterMeters; + public IList Results; + public string Title; + + public string Version + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Version : ""; } + } + + public string Zaehlertyp + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Zaehlertyp : ""; } + } + + public string Pruefvorlage + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Pruefvorlage : ""; } + } + + public string Eichjahr + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Eichjahr : ""; } + } + + public Printer(PrinterCfg cfg) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.printerCfg = cfg; + } + + /// Events: ResultsPrinted + /// Results to print + /// Reference to the operation + public IOperation PrintResultsOp(BenchControl.BenchId.Component benchId, + IList waterMeters, + IList results, + string title) + { + this.BenchId = benchId; + this.WaterMeters = waterMeters; + this.Results = results; + this.Title = title; + return this; + } + + /// Start this operation + public void Start() + { + if (Results != null && Results.Count >= 1) + { + new MunichPrintDocument(this).Print(); + } + } + + /// Run this operation + /// Event.ResultsPrinted + public Event Run() + { + return Event.ResultsPrinted; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfg.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfg.cs new file mode 100644 index 000000000..977fa051a --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public PrinterCfg() + { + } + + /// + /// Basic results printer configuration parameters + /// + /// BasicPrinter factory + /// Printer name + public PrinterCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new PrinterCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + PrinterCfg config = (PrinterCfg)(new XmlSerializer(typeof(PrinterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.cs new file mode 100644 index 000000000..1169bf8b6 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl)); + + PrinterCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as PrinterCfg; + Redraw(); + } + } + + public PrinterCfgCtrl() + { + InitializeComponent(); + } + + private void PrinterCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.designer.cs new file mode 100644 index 000000000..dce5ccb71 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + partial class PrinterCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.resx b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterCfgCtrl.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/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterFactory.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterFactory.cs new file mode 100644 index 000000000..c9bf43481 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/PrinterFactory.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public class PrinterFactory : IComponentFactory + { + public string ClassName { get { return "ResultsPrinter4Munich"; } } + public bool HasProcedureParams { get { return true; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) + { + return ProcParams.GetProcedureParams(procedureParams); + } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new PrinterCfg(this, "PrintedProtocol"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new PrinterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Printer((PrinterCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return PrinterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Printer.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Munich/ProcParams.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/ProcParams.cs new file mode 100644 index 000000000..c5b75ba30 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Munich/ProcParams.cs @@ -0,0 +1,163 @@ +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.ResultsPrinters.Munich +{ + public class ProcParams : IParamsProvider, IProcedureParams + { + public string Version; + public string Zaehlertyp; + public string Pruefvorlage; + public string Eichjahr; + + string[] paramNames = new string[] + { + Strings.Version, + "Zählertyp", + "Prüfvorlage", + "Eichjahr", + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return Version; + case 1: return Zaehlertyp; + case 2: return Pruefvorlage; + case 3: return Eichjahr; + default: return string.Empty; + } + } + + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: Version = strValue; return; + case 1: Zaehlertyp = strValue; return; + case 2: Pruefvorlage = strValue; return; + case 3: Eichjahr = strValue; return; + default: return; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + switch (i) + { + case 0: + case 1: + case 2: + case 3: + return true; + default: + message = "Invalid index"; + return false; + } + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentProcedure ProcedureParamsEntity { get { return procParamsEntity; } } + Entities.ComponentProcedure procParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Procedure Test { get { return test; } } + Entities.Procedure test; + + /// Parameterless constructor + public ProcParams() + { + Version = "4/13"; + Zaehlertyp = ""; + Pruefvorlage = ""; + Eichjahr = "2014"; + } + + public ProcParams(Entities.ComponentProcedure procParamsEntity, string componentName, Entities.Procedure test) + : this() + { + this.procParamsEntity = procParamsEntity; + this.componentName = componentName; + this.test = test; + } + + public TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentProcedure entity + TBF.Entities.ComponentProcedure entity = new TBF.Entities.ComponentProcedure(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Procedure = procedure; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + procParamsEntity.Parameters = writer.ToString(); + procParamsEntity.CmpntName = componentName; + procParamsEntity.Procedure = test; + + } + } + + public static IParamsProvider GetProcedureParams(Entities.ComponentProcedure procParamsEntity) + { + if (procParamsEntity == null) return new ProcParams(); + + ProcParams procParams; + try + { + procParams = (ProcParams)(new XmlSerializer(typeof(ProcParams))) + .Deserialize(new StringReader(procParamsEntity.Parameters)); + } + catch + { + procParams = new ProcParams(); + } + procParams.procParamsEntity = procParamsEntity; + procParams.componentName = procParamsEntity.CmpntName; + procParams.test = procParamsEntity.Procedure; + return procParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/ResultsWriters/Basic/Writer.cs b/TestBenchFramework/BenchControl/ResultsWriters/Basic/Writer.cs new file mode 100644 index 000000000..58fd852d1 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/Writer.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.IO; +using TBF.BenchControl; + +namespace TBF.BenchControl.ResultsWriters.Basic +{ + public class Writer : Generic.IComponent, IOperation, GenericDevices.IResultsWriter + { + readonly WriterCfg writerCfg; + public Generic.IComponentCfg Cfg { get { return writerCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return writerCfg.Name; } } + + /// + /// Results to print + /// + IList results; + DateTime now; + Stream stream; + StreamWriter writer; + + public Writer(WriterCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.writerCfg = cfg; + } + + /// + /// Writes the test cycle results into a file, Events: Event.ResultsWritten + /// + /// Results to write into the file + /// Reference to the operation + public IOperation WriteResultsOp(IList results) + { + this.results = results; + this.now = DateTime.Now; + this.stream = System.IO.File.Create(string.Format("{0}Results\\{1}-{2}-{3}\\{4}-{5}.txt", + Program.HomeDir, + now.Year, now.Month, now.Date, + now.Hour, now.Minute)); + this.writer = new StreamWriter(stream); + + return this; + } + + /// Start this operation + public void Start() + { + writer.WriteLine("Staatlich anerkante Prüfstelle für Meßgeräte für Wasser WB2"); + writer.WriteLine(""); + writer.WriteLine(string.Format(" PROTOKOLL Nummer {0}", 0)); + writer.WriteLine(""); + writer.WriteLine("Ver. 3/13"); + writer.WriteLine(string.Format("Datum / Zeit : {0}.{1}.{2} / {3}:{4} Seite : 1/ 1 / 1", + now.Date, now.Month, now.Year, now.Hour, now.Minute)); + writer.WriteLine("Wasserzähler Type : 110338"); + writer.WriteLine("Gerät Nr. : 1"); + writer.WriteLine("Benutzer : Bauer"); + writer.WriteLine("Impulsrate : 1 67.422 1"); + writer.WriteLine("Bereich : 22,9 °C 947 mbar 43 %"); + writer.WriteLine(""); + writer.WriteLine("Test Metode MIDFehler Durchfluss Test Zeit T1 T2 Dichte Masse Druck Volume Bor"); + writer.WriteLine(" [%] [m3/h] [s] [°C] [°C] [kg/m3] [kg] [MPa] [L] [m3/h]"); + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + + foreach (var tr in results) + { + if (tr.MetersKind == Entities.MetersKind.Single) + { + writer.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11}"), + tr.Name, + tr.Method, + tr.Meters[0].VolumeErrorPct, + tr.FlowMass, + tr.Time, + tr.TempInAvrg, + tr.TempDivAvrg, + tr.DensityOut, + tr.MassDiff, + tr.PressInAvrg, + tr.PressOutAvrg, + tr.VolumeCTV); + } + else if (tr.MetersKind == Entities.MetersKind.Combined) + { + writer.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11}"), + tr.Name, + tr.Method, + tr.CombinedMeters[0].VolumeErrorPct, + tr.FlowMass, + tr.Time, + tr.TempInAvrg, + tr.TempDivAvrg, + tr.DensityOut, + tr.MassDiff, + tr.PressInAvrg, + tr.PressOutAvrg, + tr.VolumeCTV); + } + } + + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + writer.WriteLine("No| Zähler Nr| Test. Volume [L] | Zählerabweichung [%] | Messunsicherheit k=2 |Prüfergebnis"); + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + writer.WriteLine(" Qmin Qt Qmax Qmin Qt Qmax Qmin Qt Qmax"); + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + } + + /// Run this operation + /// Event.ResultsWritten + public Event Run() + { + + return Event.ResultsWritten; + } + + /// Stop this operation + public void Stop() + { + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + writer.WriteLine(""); + writer.WriteLine("Hersteller : Bemerkung : M - Prüfung gegen Waage"); + writer.WriteLine(" V - Prüfung gegen MID"); + writer.WriteLine(" P - Start / Stopp"); + writer.WriteLine(" F - Fliegender Start"); + writer.WriteLine(" S - Impulskompensation"); + writer.WriteLine(" C - Impulszählung"); + writer.WriteLine(""); + writer.WriteLine("---------------------------------------------------------------------------------------------------------------------------------------"); + + if (writer != null) writer.Close(); + if (stream != null) stream.Close(); + writer = null; + stream = null; + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfg.cs b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfg.cs new file mode 100644 index 000000000..83ea2e5cf --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsWriters.Basic +{ + public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public WriterCfg() + { + } + + /// + /// Basic results printer configuration parameters + /// + /// BasicPrinter factory + /// Printer name + public WriterCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new WriterCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + WriterCfg config = (WriterCfg)(new XmlSerializer(typeof(WriterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.cs b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.cs new file mode 100644 index 000000000..ac2b59074 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsWriters.Basic +{ + public partial class WriterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(WriterCfgCtrl)); + + WriterCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as WriterCfg; + Redraw(); + } + } + + public WriterCfgCtrl() + { + InitializeComponent(); + } + + private void WriterCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.designer.cs new file mode 100644 index 000000000..a4907d37d --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.ResultsWriters.Basic +{ + partial class WriterCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.WriterCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.resx b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterCfgCtrl.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/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterFactory.cs b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterFactory.cs new file mode 100644 index 000000000..0517275ef --- /dev/null +++ b/TestBenchFramework/BenchControl/ResultsWriters/Basic/WriterFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.ResultsWriters.Basic +{ + public class WriterFactory : IComponentFactory + { + public string ClassName { get { return "BasicResultsWriter"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new WriterCfg(this, "BasicResultsWriter"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new WriterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new Writer((WriterCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return WriterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { Writer.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs new file mode 100644 index 000000000..c5a6dca7b --- /dev/null +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -0,0 +1,533 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.UiBridge; +using TBF.BenchControl.Operations; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.BenchControl.Sequences +{ + public class MainSeq : SequenceBase, ISequence + { + private static readonly ILog log = LogManager.GetLogger(typeof(MainSeq)); + private static readonly ILog allResults = LogManager.GetLogger("AllResults"); + private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + + public override string ToString() { return "Sequences.MainSeq"; } + + /// + /// Specifies the selection done in the main sequence + /// + public enum Selection + { + None, + Cycle, + Test, + Q1, + Q2, + Q3, + PurgeBegin, + PurgeEnd, + EmptyTank1, + EmptyTank2, + } + + public MainSeq() + { + } + + public IList Execute(Entities.Test dummyArg) + { + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + /// Operations running in more then one state + IOperation checkUiOp = new CheckUIOp(true); + + IList e; + Selection selection; + bool benchFilled = false; + + Entities.TransitionSequence purgeBegin; + Entities.TransitionSequence purgeEnd; + + StateMachine.LoadProcedure(true); + + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create(Strings.Set_route) + .AddOperation(new MettlerToledo.ReadMassesOp()) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!(e.Contains(Event.ValvesSet) && e.Contains(Event.BalanceDone))); + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Starting_the_cameras); + //------------------------------------------------ + State startNew = State.Create("MainSeq : Starting the cameras") + .AddOperation(checkUiOp); + foreach (var cmpnt in StateMachine.Components) + { + Cameras.IdcCamera.IdcCamera camera = cmpnt as Cameras.IdcCamera.IdcCamera; + if ((camera != null) && (camera.Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) + { + startNew.AddOperation(camera.StartNewOp()); + } + } + startNew.EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (e.Contains(Event.CameraBusy)); + + if (e.Contains(Event.CameraOpFailed)) goto error; /// TODO: resolve in some other way + + idle: + + Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn | + ButtonsEtc.StartCycleBtnEn | ButtonsEtc.StartTestBtnsEn | + ButtonsEtc.EmptyTankBtnsEn | ButtonsEtc.PurgeBeginBtnEn | + ButtonsEtc.CalibrationBtnEn); + //--------------------------------------------------------- + Bridge.OnActivity(this, Strings.Please_select_a_procedure); + //--------------------------------------------------------- + selection = Selection.None; + State.Create("MainSeq : Select a procedure") + .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdPurgeBegin)) selection = Selection.PurgeBegin; + if (e.Contains(Event.UiCmdStartTest)) selection = Selection.Test; + if (e.Contains(Event.UiCmdStartQ1)) selection = Selection.Q1; + if (e.Contains(Event.UiCmdStartQ2)) selection = Selection.Q2; + if (e.Contains(Event.UiCmdStartQ3)) selection = Selection.Q3; + if (e.Contains(Event.UiCmdStartCycle)) selection = Selection.Cycle; + if (e.Contains(Event.UiCmdEmptyTank1)) goto empty_tank1_idle; + if (e.Contains(Event.UiCmdEmptyTank2)) goto empty_tank2_idle; + if (e.Contains(Event.UiCmdCameraTest)) goto camera_test; + } + while (selection == Selection.None); + + //-------------------------------- + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + StateMachine.LoadProcedure(false); + if (StateMachine.Procedure == null) + { + goto idle; + } + StateMachine.LoadProcedureParams(StateMachine.Procedure); + ResetResults(); + Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure)); + + + purgeBegin = null; + purgeEnd = null; + foreach (var transition in StateMachine.TransitionSequences) + { + if (transition.Name == StateMachine.Procedure.TransitionStart) purgeBegin = transition; + if (transition.Name == StateMachine.Procedure.TransitionEnd) purgeEnd = transition; + } + + + if (selection == Selection.Q1 || selection == Selection.Q2 || + selection == Selection.Q3 || selection == Selection.Test) + { + goto assume_bench_filled; + } + else if (selection == Selection.Cycle && benchFilled) + { + //-------------------------------- + State.Create("MainSeq : Answer a question") + .AddOperation(new Operations.AskYesNoOp()) + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.No)) goto assume_bench_filled; + if (e.Contains(Event.UiCmdStop)) goto idle; + } + while (!e.Contains(Event.Yes)); + } + + fill_the_bench: + + /// Purge - Begin + switch (Transition(purgeBegin, Strings.Purging_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + //-------------------------------- + Generic.IComponent dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry); + if ((dataEntryCmpnt as GenericDevices.IDataEntry) != null) + { + Bridge.OnActivity(this, "Enter the water meter data"); + State.Create("MainSeq : Enter begin data") + .AddOperation((dataEntryCmpnt as GenericDevices.IDataEntry).ShowFormAtCycleBeginningOp(WaterMeters)) + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.Done)); + } + + assume_bench_filled: + + benchFilled = true; + Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled); + + if (selection != Selection.PurgeBegin) goto cycle_or_test; + + ready: + //--------------------------------------------------------- + Bridge.OnActivity(this, Strings.Please_select_a_cycle_a_test_or_empty); + //--------------------------------------------------------- + Bridge.Bench2UI(ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn | ButtonsEtc.StartCycleBtnEn | + ButtonsEtc.StartTestBtnsEn | ButtonsEtc.PurgeBeginBtnEn | ButtonsEtc.PurgeEndBtnEn | + ButtonsEtc.EmptyTankBtnsEn | ((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) | + ButtonsEtc.SensitivityTestBtnEn | ButtonsEtc.TryOpticalHeadsBtnEn); + selection = Selection.None; + State.Create("MainSeq : Select an activity for the selected procedure") + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStartTest)) selection = Selection.Test; + if (e.Contains(Event.UiCmdStartQ1)) selection = Selection.Q1; + if (e.Contains(Event.UiCmdStartQ2)) selection = Selection.Q2; + if (e.Contains(Event.UiCmdStartQ3)) selection = Selection.Q3; + if (e.Contains(Event.UiCmdStartCycle)) selection = Selection.Cycle; + if (e.Contains(Event.UiCmdPurgeBegin)) { selection = Selection.PurgeBegin; goto fill_the_bench; } + if (e.Contains(Event.UiCmdPurgeEnd)) goto purge_end; + if (e.Contains(Event.UiCmdEmptyTank1)) goto empty_tank1; + if (e.Contains(Event.UiCmdEmptyTank2)) goto empty_tank2; + if (e.Contains(Event.UiCmdAcceptResults)) goto save_results; + } + while (selection == Selection.None); + + cycle_or_test: + + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Hide buttons + + if (selection == Selection.Cycle) + { + TimeEstimateTotal = 0; + foreach (var test in StateMachine.Tests) TimeEstimateTotal += (test.Repeats * (test.TstTime + 10.0f)); + + TimeEstimateBeginRpts = 0; + foreach (var test in StateMachine.Tests) + { + transitionStart = null; + transitionStop = null; + foreach (var transition in StateMachine.TransitionSequences) + { + if (transition.Name == test.TransitionStart) transitionStart = transition; + if (transition.Name == test.TransitionEnd) transitionStop = transition; + } + + TimeEstimateOneTest = test.TstTime + 10.0f; + //-------------------------------------------------------------- + ISequence testMethodSequence = TbfComponents.FindComponent(test.Method) as ISequence; + if (testMethodSequence != null) + { + //-------------------------------------------------------------- + var events = testMethodSequence.Execute(test); + + if (events.Contains(Event.Error)) goto error; + if (events.Contains(Event.UiCmdStop)) goto stop; + } + + TimeEstimateBeginRpts += (test.Repeats * TimeEstimateOneTest); + } + } + else + { + Entities.Test test = StateMachine.GetTest(selection); + + TimeEstimateTotal = test.Repeats * (test.TstTime + 10.0f); + TimeEstimateOneTest = test.TstTime + 10.0f; + TimeEstimateBeginRpts = 0; + + transitionStart = null; + transitionStop = null; + foreach (var transition in StateMachine.TransitionSequences) + { + if (transition.Name == test.TransitionStart) transitionStart = transition; + if (transition.Name == test.TransitionEnd) transitionStop = transition; + } + + ISequence testMethodSequence = TbfComponents.FindComponent(test.Method) as ISequence; + if (testMethodSequence != null) + { + //-------------------------------------------------------------- + var events = testMethodSequence.Execute(test); + + if (events.Contains(Event.Error)) goto error; + if (events.Contains(Event.UiCmdStop)) goto stop; + } + } + + if (ResultsAreComplete(StateMachine.Tests)) + { + Bridge.Bench2UI(ButtonsEtc.AcceptResultsBtnEn | ButtonsEtc.ResetResultsBtnEn); + } + else + { + Bridge.Bench2UI(ButtonsEtc.ResetResultsBtnEn); + } + + goto ready; + + empty_tank1: + + switch (EmptyTheTank(StateMachine.EmptyTankValve1, StateMachine.Balance1)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + default: goto ready; + } + + empty_tank2: + + switch (EmptyTheTank(StateMachine.EmptyTankValve2, StateMachine.Balance2)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + default: goto ready; + } + + empty_tank1_idle: + + switch (EmptyTheTank(StateMachine.EmptyTankValve1, StateMachine.Balance1)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + default: goto idle; + } + + empty_tank2_idle: + + switch (EmptyTheTank(StateMachine.EmptyTankValve2, StateMachine.Balance2)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + default: goto idle; + } + + purge_end: + save_results: + + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); // Hide the most of buttons + + //-------------------------------- + string protocolTitle = string.Empty; + dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry); + if ((dataEntryCmpnt as GenericDevices.IDataEntry) != null) + { + Bridge.OnActivity(this, "Enter the protokoll data"); + State.Create("MainSeq : Enter end data") + .AddOperation((dataEntryCmpnt as GenericDevices.IDataEntry).ShowFormAtCycleEndOp(WaterMeters)) + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.Done)); + + if (dataEntryCmpnt is IHasProtocolTitle) + { + protocolTitle = (dataEntryCmpnt as IHasProtocolTitle).ProtocolTitle; + } + } + + //-------------------------------- + IResultsWriter writer = TbfComponents.FindComponent(StateMachine.Procedure.ResultsWriter) as IResultsWriter; + if (writer != null) + { + State.Create("MainSeq : Saving results") + .AddOperation(writer.WriteResultsOp(results)) + .AddOperation(checkUiOp) + .EnterState(); + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + } + + //-------------------------------- + IResultsPrinter printer = TbfComponents.FindComponent(StateMachine.Procedure.ResultsPrinter) as IResultsPrinter; + if (printer != null) + { + State.Create("MainSeq : Printing results") + .AddOperation(printer.PrintResultsOp(BenchId, WaterMeters, results, protocolTitle)) + .AddOperation(checkUiOp) + .EnterState(); + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + } + + /// Purge - End + switch (Transition(purgeEnd, Strings.Emptying_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + benchFilled = false; + Bridge.Bench2UI(ButtonsEtc.ShowBenchEmpty); + + goto idle; + + camera_test: + + Bridge.OnActivity(this, "Camera test"); + //--------------------------------------------------------- + Bridge.Bench2UI(ButtonsEtc.StartTestBtnsEn | ButtonsEtc.StopBtnEn); + selection = Selection.None; + State.Create("MainSeq : 1 = Grab, 2 = Live, 3 = Focus, Stop = Quit camera test") + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) + { + goto idle; + } + if (e.Contains(Event.UiCmdStartQ1)) goto grab; + if (e.Contains(Event.UiCmdStartQ2)) goto live; + if (e.Contains(Event.UiCmdStartQ3)) goto focus; + } + while (true); + + grab: + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + selection = Selection.None; + State.Create("MainSeq : Press 'Stop' to continue") + .AddOperation(checkUiOp) + .AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].GrabOp() : null) + .AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].GrabOp() : null) + .AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].GrabOp() : null) + .AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].GrabOp() : null) + .AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].GrabOp() : null) + .AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].GrabOp() : null) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto camera_test; + } + while (true); + + live: + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + selection = Selection.None; + State.Create("MainSeq : Press 'Stop' to stop.") + .AddOperation(checkUiOp) + .AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].LiveOp() : null) + .AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].LiveOp() : null) + .AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].LiveOp() : null) + .AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].LiveOp() : null) + .AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].LiveOp() : null) + .AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].LiveOp() : null) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto camera_test; + } + while (true); + + focus: + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + selection = Selection.None; + State.Create("MainSeq : Press 'Stop' to stop.") + .AddOperation(checkUiOp) + .AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].FocusOp() : null) + .AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].FocusOp() : null) + .AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].FocusOp() : null) + .AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].FocusOp() : null) + .AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].FocusOp() : null) + .AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].FocusOp() : null) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto camera_test; + } + while (true); + + stop: + //-------------------------------- + State.Create("MainSeq : Turning IDLE -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + goto idle; + + config_error: + //-------------------------------- + State.Create("MainSeq : Procedure configuration error") + .EnterState(); + while (true) StateMachine.WaitRunDevsRunOps(); + + error: + //-------------------------------- + State.Create("MainSeq : ERROR -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + } + while (!e.Contains(Event.ValvesSet) && !e.Contains(Event.Error)); + + //-------------------------------- + State.Create("MainSeq : ERROR state") + .EnterState(); + while (true) StateMachine.WaitRunDevsRunOps(); + } + } +} diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs new file mode 100644 index 000000000..1921f9257 --- /dev/null +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -0,0 +1,589 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using TBF.BenchControl.GenericDevices; +using TBF.UiBridge; +using TBF.Resources; +using TBF.BenchControl.Operations; +using log4net; + +namespace TBF.BenchControl.Sequences +{ + /// + /// Sequence is a group of states that can be dynamically added to + /// and removed from the state machine + /// + public class SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(SequenceBase)); + + ///------------------------------------------------------------ + /// Global static variables set only once. + ///------------------------------------------------------------ + public static BenchId.Component BenchId; + public static IList RegulValves; /// list of regulation valves + public static IList WaterMeters; /// list of water meters + public static IList Cameras; /// list of cameras + + ///------------------------------------------------------------ + /// Procedure related (static) variables. + /// They are re-initialized when LoadProcedure() is called + ///------------------------------------------------------------ + protected static IList results; + public static float Qrise; + public static float Qfall; + + /// + /// Clear all test results. + /// + protected static void ResetResults() + { + results = new List(); + Qrise = 0; + Qfall = 0; + } + + /// + /// Add result to the list of results. + /// Overwrite (=delete) any previous result with the same name. + /// + /// New test result + protected static void AddOrOverwriteResult(Entities.TestResult newTestResult) + { + try + { + Entities.TestResult toDelete = + results.First(x => x.Name.Equals(newTestResult.Name)); + results.Remove(toDelete); + } + catch { }; + + results.Add(newTestResult); + } + + /// + /// Check whether the results are complete, whether there is a result for each test. + /// + /// All tests + /// true = The results are complete + protected static bool ResultsAreComplete(IList tests) + { + foreach (var test in tests) + { + if (!test.Method.Contains("RoiDetection")) + { + for (int r = 1; r <= test.Repeats; r++) + { + bool resultExists = false; + foreach (var tr in results) + { + if ((tr.DoNotEvaluate == false) && (tr.RepetitionNr == r) && (tr.TestName == test.Name)) + { + resultExists = true; + break; + } + } + if (!resultExists) return false; + } + } + } + return true; + } + + protected static float TimeEstimateTotal; /// Time estimate of the selected cycle or test + protected static float TimeEstimateBeginRpts; /// Time estimate at the beginning of all repetitions of the current tests + protected static float TimeEstimateOneTest; /// Time estimate of the current test (one repetition) + + static SequenceBase() + { + results = new List(); + } + + ///------------------------------------------------------------ + /// Test related (instance) variables. + /// Created when test sequence is open. + /// They persist during all repetitions of the same test + ///------------------------------------------------------------ + protected BenchControl.FeedingPath inPath; + protected BenchControl.BenchPath benchPath; + protected BenchControl.OutputPath outPath; + protected BenchControl.MetersPath sensPath; + + protected Entities.TransitionSequence transitionStart; + protected Entities.TransitionSequence transitionStop; + + #region Temperature_Pressure_Humidity + + protected FloatBox tempIn = new FloatBox(20.0f); + protected FloatBox tempOut = new FloatBox(20.0f); + protected FloatBox tempDiv = new FloatBox(20.0f); + protected FloatBox pressIn = new FloatBox(); + protected FloatBox pressOut = new FloatBox(); + protected FloatBox airTemperature = new FloatBox(20.0f); + protected FloatBox airPressure = new FloatBox(1.0f); + protected FloatBox airHumidity = new FloatBox(40.0f); + /// + protected float tempInSum; + protected float tempOutSum; + protected float tempDivSum; + protected float pressInSum; + protected float pressOutSum; + protected float ambientTempSum; + protected float ambientPressSum; + protected float ambientHumiSum; + /// + protected int averagedDataCount; + /// + protected void ResetAveragedData() + { + tempInSum = 0; + tempOutSum = 0; + tempDivSum = 0; + pressInSum = 0; + pressOutSum = 0; + ambientTempSum = 0; + ambientPressSum = 0; + ambientHumiSum = 0; + /// + averagedDataCount = 0; + } + /// + protected void AccumulateAveragedData() + { + tempInSum += tempIn.F; + tempOutSum += tempOut.F; + tempDivSum += tempDiv.F; + pressInSum += pressIn.F; + pressOutSum += pressOut.F; + ambientTempSum += airTemperature.F; + ambientPressSum += airPressure.F; + ambientHumiSum += airHumidity.F; + /// + averagedDataCount++; + } + /// + protected void UpdateTestRsltWithAveragedData(Entities.TestResult tstRslt) + { + if (averagedDataCount != 0) + { + float denominator = (float)averagedDataCount; + tstRslt.AmbientTempAve = ambientTempSum / denominator; + tstRslt.AmbientPressAve = ambientPressSum / denominator; + tstRslt.AmbientHumiAve = ambientHumiSum / denominator; + tstRslt.PressInAvrg = pressInSum / denominator; + tstRslt.PressOutAvrg = pressOutSum / denominator; + tstRslt.TempInAvrg = tempInSum / denominator; + tstRslt.TempOutAvrg = tempOutSum / denominator; + tstRslt.TempDivAvrg = tempDivSum / denominator; + } + } + + #endregion + + protected FloatBox measuredFlow = new FloatBox(); + + protected FloatBox mass = new FloatBox(); + protected FloatBox stableMass = new FloatBox(); + + protected bool ticTac = false; + protected int[] WMPulses = new int[Program.WMsCount]; + protected int[] WMRefPulses = new int[Program.WMsCount]; + + + protected IOperation readRegisters1; + protected IOperation readRegisters2; + protected IOperation queryEnd1; + protected IOperation queryEnd2; + protected IOperation checkUiOp; + + /// + /// Empties the tank: opens the emptying valve and measures the weight. + /// + /// Valve to empty the tank + /// Balance underneath the tank + /// Event.Done or Event.Error + protected Event EmptyTheTank(IValve EmptyTankValve, IBalance Balance) + { + //------------------------------------------------ + Bridge.OnActivity(this, TBF.Resources.Strings.Emptying_tank); + //------------------------------------------------ + + IList e; + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); + + State.Create("SequenceBase : Opening the emptying valve") + .AddOperation(checkUiOp) + .AddOperation(StateMachine.ControlBoard.SetValvesOp(EmptyTankValve, null)) + .EnterState(); + do { e = StateMachine.WaitRunDevsRunOps(); } + while (!e.Contains(Event.ValvesSet)); + + do + { + //-------------------------------- + State.Create("SequenceBase : Emptying the tank") + .AddOperation(checkUiOp) + .AddOperation(Balance.ReadMassOp(ref mass)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + if (e.Contains(Event.UiCmdStop)) goto quit_emptying; + if (e.Contains(Event.BalanceOverload)) { }; /// Tank should be emptying now + } + while (!e.Contains(Event.BalanceDone)); + } + while (mass.F > (Balance.Capacity / 100.0f + 20.0f)); + + quit_emptying: + //-------------------------------- + State.Create("SequenceBase : Closing the emptying valve") + .AddOperation(checkUiOp) + .AddOperation(Balance.ReadMassOp(ref mass)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, EmptyTankValve)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + } + while (!e.Contains(Event.ValvesSet) || !e.Contains(Event.BalanceDone)); + + State.Create("SequenceBase : Updating the weight") + .AddOperation(checkUiOp) + .AddOperation(Balance.ReadMassOp(ref mass)) + .AddOperation(new Operations.TimerOp(5)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + } + while (!e.Contains(Event.BalanceDone) || !e.Contains(Event.TimerExpired)); + + return Event.Done; + } + + /// + /// Executes steps of a transition sequence. + /// + /// TransitionSequence entity + /// Event.Done, Event.Error or Event.UiCmdStop + protected Event Transition(Entities.TransitionSequence transitionSequence, string message) + { + if (transitionSequence == null) return Event.None; + + IList transitionSteps = StateMachine.WtSession + .CreateQuery("FROM TransitionStep WHERE TransitionSequence = :tsId ORDER BY ItemNr") + .SetParameter("tsId", transitionSequence.Id) + .List(); + + IList e; + int stepsCount = transitionSteps.Count; + foreach (var step in transitionSteps) + { + //------------------------------------------------ + Bridge.OnActivity(this, string.Format(message, transitionSequence.Name, step.ItemNr + 1, stepsCount)); + //------------------------------------------------ + + /// Get new regulation valve positions and calculate the number of valves to change + float[] allRegvPositions = Utils.RegulValvesPositions(step); + /// + IList rvPosOperations = new List(); + for (int i = 0; i < allRegvPositions.Length; i++) + { + if (allRegvPositions[i] >= 0) /// Negative value means no position change + { + rvPosOperations.Add(RegulValves[i].SetRegulValvePositionOp( + Math.Max(0, allRegvPositions[i] - 0.05f), Math.Min(100.0f, allRegvPositions[i] + 0.05f), 60)); + } + } + int changingRVsCount = rvPosOperations.Count; /// Number of RV-s with changing position in this step + + /// Duration must be at least the number of regulation valves to change seconds + int duration = Math.Max(step.Duration, changingRVsCount); + + /// + /// The first state updates all (regular) valves and the 1st regulation valve to be changed + /// Max. one regulation valve may be controlled in each sub-step (in each state) + /// + State oneStep = State.Create(string.Format("SequenceBase.Transition() : Step {0}.1/{1}", step.ItemNr + 1, stepsCount)) + .AddOperation(checkUiOp) + .AddOperation(StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step))) + .AddOperation(new TimerOp((changingRVsCount <= 1) ? step.Duration : 1)); + + if (changingRVsCount > 0) + { + oneStep.AddOperation(rvPosOperations[0]); + } + oneStep.EnterState(); + + do { + e = StateMachine.WaitRunDevsRunOps(); + log.InfoFormat("RV1={0}% RV2={1}% RV3={2}% RV4={3}% RV5={4}%", StateMachine.ControlBoard.RValvePosition(1), + StateMachine.ControlBoard.RValvePosition(2), StateMachine.ControlBoard.RValvePosition(3), + StateMachine.ControlBoard.RValvePosition(4), StateMachine.ControlBoard.RValvePosition(5)); + if (e.Contains(Event.Error)) return Event.Error; + if (e.Contains(Event.RegulValveTimeOut)) return Event.Error; + if (e.Contains(Event.UiCmdStop)) return Event.UiCmdStop; + } + while (!e.Contains(Event.TimerExpired)); + + /// + /// Additional extra states the 2nd and all subsequent regulation valves to be changed + /// Max. one regulation valve may be controlled in each sub-step (in each state) + /// + for (int j = 1; j < changingRVsCount; j++) + { + /// The first state updating all plain valves and the 1st regulation valve + /// Max. one regulation valve may change in each step + State oneStepContinued = State.Create(string.Format("SequenceBase.Transition() : Step {0}.{2}/{1}", step.ItemNr + 1, stepsCount, j+1)) + .AddOperation(checkUiOp) + .AddOperation(new TimerOp((j == changingRVsCount - 1) ? (step.Duration - changingRVsCount + 1) : 1)); + for (int k = 0; k <= j; k++) { oneStepContinued.AddOperation(rvPosOperations[k]); } + oneStepContinued.EnterState(); + + do + { + e = StateMachine.WaitRunDevsRunOps(); + log.InfoFormat("RV1={0}% RV2={1}% RV3={2}% RV4={3}% RV5={4}%", StateMachine.ControlBoard.RValvePosition(1), + StateMachine.ControlBoard.RValvePosition(2), StateMachine.ControlBoard.RValvePosition(3), + StateMachine.ControlBoard.RValvePosition(4), StateMachine.ControlBoard.RValvePosition(5)); + if (e.Contains(Event.Error)) return Event.Error; + if (e.Contains(Event.RegulValveTimeOut)) return Event.Error; + if (e.Contains(Event.UiCmdStop)) return Event.UiCmdStop; + } + while (!e.Contains(Event.TimerExpired)); + } + } + + return Event.Done; + } + + + /// + /// Main loop where measurements are collected. + /// + /// false = a flow setting or a switching flow detection, true = measurement + /// Event.MeasurementCompleted, Event.UiCmdStop, Event.Error or Event.Done + protected Event ReadRegistersTempPressAmbient(IList measureOperations, bool realTest) + { + IList e; + ticTac = !ticTac; + State.Create("Read water meters") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(ticTac ? readRegisters1 : readRegisters2) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn, Event.TempInDone)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut, Event.TempOutDone)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv, Event.TempDivDone)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn, Event.PressureInDone)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut, Event.PressureOutDone)) + .AddOperation(realTest ? outPath.Balance.ReadMassOp(ref mass) : null) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) + : null) + .AddOperation(realTest ? (ticTac ? queryEnd1 : queryEnd2) : null) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + if (e.Contains(Event.UiCmdStop)) return Event.UiCmdStop; + if (e.Contains(Event.MeasurementCompleted)) return Event.MeasurementCompleted; + } + while ( !e.Contains(Event.TempInDone) || + !e.Contains(Event.TempOutDone) || + !e.Contains(Event.TempDivDone) || + !e.Contains(Event.PressureInDone) || + !e.Contains(Event.PressureOutDone) || + (realTest && !e.Contains(Event.BalanceDone)) || + !e.Contains(Event.ReadAllRegistersDone)); + + return Event.Done; + } + + /// + /// Prepares 'TestProgressEventArgs' object that update screens during the test + /// + /// Current 'Test' entity + /// Current 'TestResult' entity + /// Current number of reference pulses + /// Curent reference frequency in [Hz] + /// Current test time in [s] + /// Current progress 0 .. 1.0f + /// Data for the UI + protected TestProgressEventArgs GetTestProgressData(Entities.Test test, Entities.TestResult tstRslt, + int currentRefPulses, float time, float progress) + { + TestProgressEventArgs data = new TestProgressEventArgs(); + + data.TestResult = tstRslt; + + //float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + float refPulsesPerLtr = 7200.0f / outPath.FlowMeter.NominalFlow; /// [pulse/ltr] + + data.RefPulses = currentRefPulses; + data.Flow = measuredFlow.F; + data.Volume = Formulas.VolumeFromPulses(currentRefPulses, refPulsesPerLtr); + data.Time = time; + + data.Progress = progress; + float estCurrentTime = TimeEstimateBeginRpts + ((float)(tstRslt.RepetitionNr - 1) + progress) * TimeEstimateOneTest; + data.OveralProgress = estCurrentTime / TimeEstimateTotal; + + data.Tin = tempIn.F; + data.Tout = tempOut.F; + data.Tdiv = tempDiv.F; + data.Pin = pressIn.F; + data.Pout = pressOut.F; + data.AmbientTemp = airTemperature.F; + data.AmbientPressure = airPressure.F; + data.AmbientHumidity = airHumidity.F; + + for (int i = 0; i < Program.WMsCount; i++) + { + if (sensPath.RegisterReaders[i] != null) + { + data.WmPulses[i] = WMPulses[i]; + data.WmRefPulses[i] = WMRefPulses[i]; + data.WmVolume[i] = Formulas.VolumeFromPulses(WMPulses[i], sensPath.RegisterReaders[i].PulsesPerLtr); + data.WmErrPct[i] = Formulas.ErrorFromVolumes(data.WmVolume[i], data.Volume); + } + } + + return data; + } + + protected string TestResult2CsvLine(Entities.TestResult tstRslt, int currentRefPulses) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + sb.Append(tstRslt.TimeStart); + sb.Append(";"); sb.Append(tstRslt.TestName); + sb.Append(";"); sb.Append(tstRslt.RepetitionNr); + sb.Append(";"); sb.Append("1"); + sb.Append(";"); sb.Append(tstRslt.Method); + sb.Append(";"); sb.Append(tstRslt.Volume); + sb.Append(";"); sb.Append(tstRslt.Qfrom); + sb.Append(";"); sb.Append(tstRslt.Qto); + sb.Append(";"); sb.Append(tstRslt.ErrLimLo); + sb.Append(";"); sb.Append(tstRslt.ErrLimHi); + sb.Append(";"); sb.Append("0"); + sb.Append(";"); sb.Append("60"); + sb.Append(";"); sb.Append("0"); + sb.Append(";"); sb.Append("0"); + sb.Append(";"); sb.Append("2"); + sb.Append(";"); sb.Append(" "); + sb.Append(";"); sb.Append(outPath.Balance.Cfg.Name); + sb.Append(";"); sb.Append(tstRslt.AmbientTempAve); + sb.Append(";"); sb.Append(tstRslt.AmbientPressAve); + sb.Append(";"); sb.Append(tstRslt.AmbientHumiAve); + sb.Append(";"); sb.Append(tstRslt.PressInAvrg); + sb.Append(";"); sb.Append(tstRslt.PressOutAvrg); + sb.Append(";"); sb.Append(tstRslt.PressInStart); + sb.Append(";"); sb.Append(tstRslt.PressOutStart); + sb.Append(";"); sb.Append(tstRslt.PressInEnd); + sb.Append(";"); sb.Append(tstRslt.PressOutEnd); + sb.Append(";"); sb.Append(tstRslt.TempInAvrg); + sb.Append(";"); sb.Append(tstRslt.TempOutAvrg); + sb.Append(";"); sb.Append(tstRslt.TempDivAvrg); + sb.Append(";"); sb.Append(tstRslt.TempInStart); + sb.Append(";"); sb.Append(tstRslt.TempOutStart); + sb.Append(";"); sb.Append(tstRslt.TempDivStart); + sb.Append(";"); sb.Append(tstRslt.TempInEnd); + sb.Append(";"); sb.Append(tstRslt.TempOutEnd); + sb.Append(";"); sb.Append(tstRslt.TempDivEnd); + sb.Append(";"); sb.Append(tstRslt.MassStartRaw); + sb.Append(";"); sb.Append(tstRslt.MassStart); + sb.Append(";"); sb.Append(tstRslt.MassEndRaw); + sb.Append(";"); sb.Append(tstRslt.MassEnd); + sb.Append(";"); sb.Append(tstRslt.MassDiff); + sb.Append(";"); sb.Append(tstRslt.DensityDiv); + sb.Append(";"); sb.Append(tstRslt.DensityIn); + sb.Append(";"); sb.Append(tstRslt.DensityOut); + sb.Append(";"); sb.Append(" "); /// d_air: Hustota vzduchu: Sheet1 - K9 + sb.Append(";"); sb.Append(" "); /// Buoyancy: Sheet1 - X9 + sb.Append(";"); sb.Append(" "); /// Exp T: teraz vynechat + sb.Append(";"); sb.Append(" "); /// Exp P: teraz vynechat + sb.Append(";"); sb.Append(" "); /// pipe expansion: teraz vynechat + sb.Append(";"); sb.Append(tstRslt.FlowMass); /// Qm [kg/h] + sb.Append(";"); sb.Append(tstRslt.FlowVolume); /// Qv [l/h] + sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// Vet . . . komercne prava hodnota - podla vahy + sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// Velm . . . . objem podla etalonu + sb.Append(";"); sb.Append(" "); /// Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame) + sb.Append(";"); sb.Append(tstRslt.Time); /// t + sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// Eelm . . . chyba etalonu voci komercne pravej hodnote + sb.Append(";"); sb.Append(" "); /// Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame) + sb.Append(";"); sb.Append(7200.0f / outPath.FlowMeter.NominalFlow); + /// Const.MID . konstanta eatlonu + sb.Append(";"); sb.Append(" "); /// Const.MA . . konstanta druheho etalonu + sb.Append(";"); sb.Append(tstRslt.TimeDivStart0); /// Time Div Start celkovy cas v [ms] + sb.Append(";"); sb.Append(tstRslt.TimeDivStart1); /// Time Div Start1 + sb.Append(";"); sb.Append(tstRslt.TimeDivStart2); /// Time Div Start2 + sb.Append(";"); sb.Append(tstRslt.TimeDivStart3); /// Time Div Start3 + sb.Append(";"); sb.Append(tstRslt.TimeDivStart4); /// Time Div Start4 + sb.Append(";"); sb.Append(tstRslt.TimeDivStart5); /// Time Div Start5 + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd0); /// Time Div End celkovy cas v [ms] + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd1); /// Time Div End1 + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd2); /// Time Div End2 + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd3); /// Time Div End3 + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd4); /// Time Div End4 + sb.Append(";"); sb.Append(tstRslt.TimeDivEnd5); /// Time Div End5 + sb.Append(";"); sb.Append(currentRefPulses); /// Celkovy pocet et. pulzov skusky + sb.Append(";"); sb.Append(" "); /// - '' - pre druhy + for (int i = 0; i < tstRslt.Meters.Count; i++) + { + Entities.MeterTestResult mtrRslt = tstRslt.Meters[i]; + + sb.Append(";"); sb.Append(mtrRslt.SerialNr); /// WM Ser.No. + sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system + sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system + sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom + sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vet - objem namerany stanicou + sb.Append(";"); sb.Append(mtrRslt.VolumeErrorPct); /// WM Emt - chyba vodomerom nameraneho objemu + sb.Append(";"); sb.Append(" "); /// WM U - neistota (zatial nechat prazdne) + sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla + sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer + sb.Append(";"); sb.Append(mtrRslt.Time); /// WM Tmet - cas merania (obmedzany pri synchro skuske) + bool ok = (mtrRslt.VolumeErrorPct >= tstRslt.ErrLimLo) && (mtrRslt.VolumeErrorPct <= tstRslt.ErrLimHi); + sb.Append(";"); sb.Append(ok ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK + sb.Append(";"); sb.Append(" "); /// WM AN value - hodnota z analogoveho prevodnika (teraz nic) + sb.Append(";"); sb.Append(" "); /// WM Vinit - pri datastreamovych hodnotach (alebo kamera) + sb.Append(";"); sb.Append(" "); /// WM Time init ??? + sb.Append(";"); sb.Append(" "); /// WM Vend ??? + sb.Append(";"); sb.Append(" "); /// WM Time end ??? + } + for (int i = 0; i < tstRslt.CombinedMeters.Count; i++) + { + Entities.MeterTestResult mtrRslt = tstRslt.CombinedMeters[i]; + + sb.Append(";"); sb.Append(mtrRslt.SerialNr); /// WM Ser.No. + sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system + sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system + sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom + sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vet - objem namerany stanicou + sb.Append(";"); sb.Append(mtrRslt.VolumeErrorPct); /// WM Emt - chyba vodomerom nameraneho objemu + sb.Append(";"); sb.Append(" "); /// WM U - neistota (zatial nechat prazdne) + sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla + sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer + sb.Append(";"); sb.Append(mtrRslt.Time); /// WM Tmet - cas merania (obmedzany pri synchro skuske) + bool ok = (mtrRslt.VolumeErrorPct >= tstRslt.ErrLimLo) && (mtrRslt.VolumeErrorPct <= tstRslt.ErrLimHi); + sb.Append(";"); sb.Append(ok ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK + sb.Append(";"); sb.Append(" "); /// WM AN value - hodnota z analogoveho prevodnika (teraz nic) + sb.Append(";"); sb.Append(" "); /// WM Vinit - pri datastreamovych hodnotach (alebo kamera) + sb.Append(";"); sb.Append(" "); /// WM Time init ??? + sb.Append(";"); sb.Append(" "); /// WM Vend ??? + sb.Append(";"); sb.Append(" "); /// WM Time end ??? + } + sb.Append(";"); + + return sb.ToString(); + } + } +} diff --git a/TestBenchFramework/BenchControl/State.cs b/TestBenchFramework/BenchControl/State.cs new file mode 100644 index 000000000..9966ea70a --- /dev/null +++ b/TestBenchFramework/BenchControl/State.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; + +namespace TBF.BenchControl +{ + public class State + { + /// + /// DEBUG: all state changes and all operations + /// INFO: all state changes and operations that returned evnt != Event.None + /// WARN: only state changes + /// + private static readonly ILog log = LogManager.GetLogger(typeof(State)); + public override string ToString() { return Name + (Label==null ? "" : ", label=" + Label); } + + /// Current state (static) + public static State CurrentState + { + get { return currentState; } + } + static State currentState; + + /// State with an empty list of operations + /// Useful when entering the first state and leaving the last one + public static State Empty + { + get { return new State("empty"); } + } + + /// + /// Static constructor that initializes CurrentState + /// + static State() + { + currentState = State.Empty; + } + + /// + /// Instance fields set or initialized by the constructor + /// + public readonly IList Operations; + public readonly IList Transitions; + public readonly string Name; + public readonly string Label; + + + /// + /// Constructor with a label + /// + public State(string name, string label) + { + this.Name = name; + this.Label = label; + Operations = new List(); + Transitions = new List(); + log.Debug(this.ToString()); + } + + /// + /// Default constructor + /// + public State(string name) + : this(name, null) + { + } + + + /// + /// Create a new state without a label + /// + public static State Create(string name) + { + return new State(name); + } + + /// + /// Create a new state with a label + /// + public static State Create(string name, string label) + { + return new State(name, label); + } + + /// + /// Add an operation to this state + /// + /// operation + public State AddOperation(IOperation operation) + { + if (operation != null) Operations.Add(operation); + return this; + } + + /// + /// Add a list of operations to this state + /// + /// operation + public State AddOperations(IList operations) + { + if (operations != null) + { + foreach (var op in operations) { if (op != null) Operations.Add(op); } + } + return this; + } + + /// + /// Add a state transition to the state + /// + /// transition + public State AddTransition(Transition transition) + { + if (transition != null) Transitions.Add(transition); + return this; + } + + /// + /// Enter a new state + /// + public State EnterState() + { + ChangeState(State.currentState, this); + State.currentState = this; + UiBridge.Bridge.OnStateChanged(this, State.currentState.ToString()); + return this; + } + + // ----------------------------------- Run time ----------------------------------------- + + /// + /// Execute Run() methods of all operations of the current state. + /// + /// List of Event-s returned from the state operations + public static IList RunOperations() + { + IList events = new List(); + + foreach (IOperation operation in currentState.Operations) + { + Event evnt = operation.Run(); + if (evnt != Event.None) + { + log.InfoFormat("Operation {0} returned {1}", operation, evnt); + events.Add(evnt); + } + else + { + log.DebugFormat("Operation {0} returned {1}", operation, evnt); + } + } + + return events; + } + + /// + /// Execute Stop() methods of all operations of the current state. + /// + public static void StopOperations() + { + foreach (IOperation operation in currentState.Operations) + { + log.DebugFormat("stopping {0}", operation); + operation.Stop(); + } + } + + /// + /// Run Stop() and Start() methods of operations when changing the state. + /// + /// Stopping state + /// Starting state + static void ChangeState(State previousState, State newState) + { + /// Stop() the previous state operations, which are not in the next state + foreach (IOperation operation in previousState.Operations) + { + if (!newState.Operations.Contains(operation)) + { + log.DebugFormat("stopping {0}", operation); + operation.Stop(); + } + } + + log.WarnFormat("ChangeState( {0} -> {1} )", previousState.ToString(), newState.ToString()); + + /// Start() the operations that are in the current (new) state, but aren't in the previous state. + foreach (IOperation operation in newState.Operations) + { + if (!previousState.Operations.Contains(operation)) + { + log.DebugFormat("starting {0}", operation); + operation.Start(); + } + } + } + } +} diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs new file mode 100644 index 000000000..8da8c28fb --- /dev/null +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -0,0 +1,513 @@ +using System; +using System.Text; +using System.Threading; +using System.Diagnostics; +using System.Collections.Generic; +using System.Windows.Forms; +using log4net; +using NHibernate; + +using TBF.BenchControl.Generic; +using TBF.BenchControl.GenericDevices; +using TBF.BenchControl.Sequences; + +namespace TBF.BenchControl +{ + public class QuitStateMachineException : Exception + { + } + + /// + /// This class controls real test bench behavior. + /// It is based on a state machine + /// + public static class StateMachine + { + private static readonly ILog log = LogManager.GetLogger(typeof(StateMachine)); + private static readonly ILog wlog = LogManager.GetLogger(typeof(StateMachine)); + + /// Private devices and components + static IList components; /// list of all components + static IList devices; /// list of devices + /// + /// Bench paths + static IList feedingPaths; + static IList benchPaths; + static IList outputPaths; + static IList metersPaths; + public static IList TransitionSequences; + + /// Public components + public static Elde.ControlBoardDev ControlBoard; + public static GenericDevices.IAmbient Ambient; + public static GenericDevices.IBalance Balance1; + public static GenericDevices.IBalance Balance2; + public static GenericDevices.IValve EmptyTankValve1; + public static GenericDevices.IValve EmptyTankValve2; + public static IList MasterValves; /// list of directly controlled valves + public static IList CoupledValves; /// list of coupled valves + + + /// Time and synchronization + public const int Period = 1; /// State machine period in sec. + static DateTime startDateTime; /// DateTime of time instance when the state machine worker thread starts + static int currentTimeSec; /// Time from the start of the state machine in seconds + static bool quitStateMachine; /// flag to stop the worker thread + + /// true when the state machine is running + static bool stateMachineRunning; + public static bool Running { get { return stateMachineRunning; } } + + /// Worker thread and database session + static Thread workerThread; + public static ISession WtSession; + + static IList states; /// list of states + + + public static IList DefaultValvesOpen + { + get + { + return GenericDevices.ValveBase.Merge( + Utils.ValvesOpen((feedingPaths != null && feedingPaths.Count > 0) ? feedingPaths[0] : null), + Utils.ValvesOpen((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null), + Utils.ValvesOpen((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null) + ); + } + } + + public static IList DefaultValvesClose + { + get + { + return GenericDevices.ValveBase.Merge( + Utils.ValvesClose((feedingPaths != null && feedingPaths.Count > 0) ? feedingPaths[0] : null), + Utils.ValvesClose((benchPaths != null && benchPaths.Count > 0) ? benchPaths[0] : null), + Utils.ValvesClose((outputPaths != null && outputPaths.Count > 0) ? outputPaths[0] : null) + ); + } + } + + /// + /// Loaded by LoadProcedure() or IOperation LoadProcedureOp(...) + /// + public static Entities.Procedure Procedure; /// Procedure + public static IList Tests; /// Tests + + + /// Hardware devices connected to the PC controlling the bench. + public static IList Components { get { return components; } } + public static IList Devices { get { return devices; } } + + /// + /// DateTime of time instance when the state machine worker thread starts + /// + public static DateTime StartDateTime { get { return startDateTime; } } + + /// + /// Current state name + /// + public static int CurrentTime { get { return currentTimeSec; } } + + /// + /// Constructor + /// + static StateMachine() + { + devices = new List(); + states = new List(); + + currentTimeSec = 0; + quitStateMachine = false; + } + + /// + /// Add a device to the state machine. + /// + /// Device + public static void AddDevice(IDevice device) + { + if (device != null && !devices.Contains(device)) devices.Add(device); + } + + /// + /// Add a state to the state machine. + /// In this way a sequence can be created programtically. + /// + /// State + public static void AddState(State state) + { + if (state != null && !states.Contains(state)) states.Add(state); + } + + /// + /// Remove the state from the state machine. + /// + /// State + public static void RemoveState(State state) + { + if (state != null && state != State.CurrentState && states.Contains(state)) states.Remove(state); + } + + /// + /// Get a state from a label + /// + /// + /// The matching state or null + static State GetStateFromLabel(string label) + { + if (label == null) return null; + + foreach (State state in states) + { + if (state.Label != null && state.Label.Equals(label)) return state; + } + return null; + } + + /// + /// Start the state machine in the state 'label' in a desired mode of operation. + /// This method is called in the UI thread and creates a new state machine thread. + /// This method call should be embedded in: try { StateMachine.Start(...); } catch { } + /// to handle configuration problems. Calls CreateDevices(mode) and CreateStates(). + /// + /// Mode of operation + /// A copy of bench data used by the state machine + /// Identifies the initial state +#if DN100 + public static void InitializeBoardEtc(ControlCom2VB.ControlCom2panel ctrlBrdComponent) +#elif MUNICH + public static void InitializeBoardEtc(ControlComponent3Munich.UserControl1 ctrlBrdComponent) +#elif FUZHOU150 + public static void InitializeBoardEtc(ControlComponent3Munich.UserControl1 ctrlBrdComponent) +#endif + { + /// Load the list of components (entities) from the database. + /// Then create the components (derived from IComponent). + components = BenchControl.TbfComponents.LoadComponentsFromDB(FluentCommon.CreateSession(Database.Bench)); + MasterValves = GenericDevices.ValveBase.MasterValves(components); + CoupledValves = GenericDevices.ValveBase.CoupledValves(components); + + /// Find all balances (to initialize tank capacities in the control board) + /// Find the control board + IList balances = new List(); + SequenceBase.RegulValves = new List(); + SequenceBase.WaterMeters = new List(); + SequenceBase.Cameras = new List(); + foreach (var cmpnt in components) + { + if (cmpnt is Elde.ControlBoardDev) ControlBoard = cmpnt as Elde.ControlBoardDev; + if (cmpnt is BenchId.Component) SequenceBase.BenchId = cmpnt as BenchId.Component; + if (cmpnt is IRegulValve) SequenceBase.RegulValves.Add(cmpnt as IRegulValve); + if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter); + if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera); + if (cmpnt is GenericDevices.IAmbient) Ambient = cmpnt as GenericDevices.IAmbient; + if (cmpnt is IBalance) + { + IBalance balance = cmpnt as IBalance; + balances.Add(balance); + + if (balance.BalanceNr == 0) Balance1 = balance; + else if (balance.BalanceNr == 1) Balance2 = balance; + } + } + + /// Create an array with tank capacities + float[] tankCapacities = new float[balances.Count]; + for (int i = 0; i < tankCapacities.Length; i++) tankCapacities[i] = balances[i].Capacity; + + /// Pre-initialize the control board (= buffer the arguments ctrlBrdComponent, tankCapacities) + ControlBoard.InitializeComponent(ctrlBrdComponent, tankCapacities); + } + + public static void InitializeDevices() + { + /// Add all devices to the state machine and initialize them + foreach (var cmpnt in components) + { + if (cmpnt is IDevice) + { + AddDevice(cmpnt as IDevice); + (cmpnt as IDevice).Initialize(); + } + } + + /// Propagate debug levels from parents to children when necessary + foreach (var cmpnt in components) + { + if (cmpnt.Cfg is IChildComponentCfg && !string.IsNullOrEmpty(cmpnt.Cfg.ParentName) && + (cmpnt.Cfg.DebugLevel == Entities.DebugMode.Inherit || cmpnt.Cfg.DebugLevel == Entities.DebugMode.AutoDetect)) + { + foreach (var par in components) + { + if (par.Cfg.Name.Equals(cmpnt.Cfg.ParentName)) { cmpnt.Cfg.DebugLevel = par.Cfg.DebugLevel; break; } + } + } + } + } + + /// + /// Start the state machine + /// + public static void Start() + { + if (stateMachineRunning) return; + + workerThread = new Thread(Worker); + workerThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; + workerThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; + workerThread.Start(); + stateMachineRunning = true; + } + + public static void LoadProcedure(bool loadPathsOnly) + { + ISession session = FluentCommon.CreateSession(Database.Procedures); + WtSession = session; + + feedingPaths = session.CreateQuery("FROM FeedingPath ORDER BY ItemNr").List(); + benchPaths = session.CreateQuery("FROM BenchPath ORDER BY ItemNr").List(); + outputPaths = session.CreateQuery("FROM OutputPath ORDER BY ItemNr").List(); + metersPaths = session.CreateQuery("FROM MetersPath ORDER BY ItemNr").List(); + TransitionSequences = session.CreateQuery("FROM TransitionSequence ORDER BY ItemNr").List(); + + // Automatic detection of empty tank valves + foreach (var opath in outputPaths) + { + if (opath.Balance == Balance1.Cfg.Name) + { + EmptyTankValve1 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve; + break; + } + } + foreach (var opath in outputPaths) + { + if (opath.Balance == Balance2.Cfg.Name) + { + EmptyTankValve2 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve; + break; + } + } + + if (loadPathsOnly) return; + + IList selectedProcs = session + .CreateQuery("FROM Procedure WHERE Name = :name") + .SetParameter("name", TBF.UiBridge.Bridge.SelectedProcedureName) + .List(); + + if (selectedProcs.Count != 1) return; + + Procedure = selectedProcs[0]; + Tests = selectedProcs[0].Tests; + } + + public static void LoadProcedureParams(Entities.Procedure procedure) + { + foreach (var cmpnt in components) + { + if (cmpnt is ComponentBase) (cmpnt as ComponentBase).GetProcedureParams(procedure); + } + } + + public static void LoadTestParams(Entities.Test test) + { + foreach (var cmpnt in components) + { + if (cmpnt is ComponentBase) (cmpnt as ComponentBase).GetTestParams(test); + } + } + + /// + /// Processes the selection done by the bench control panel in the main sequence. + /// + /// Selection.Q1, .Q2, .Q3 or .Test + /// The selected test or null + public static Entities.Test GetTest(Sequences.MainSeq.Selection selection) + { + if ((selection == Sequences.MainSeq.Selection.Q1) && (Tests.Count >= 1)) + { + return Tests[0]; + } + else if ((selection == Sequences.MainSeq.Selection.Q2) && (Tests.Count >= 2)) + { + return Tests[1]; + } + else if ((selection == Sequences.MainSeq.Selection.Q3) && (Tests.Count >= 3)) + { + return Tests[2]; + } + else if (selection == Sequences.MainSeq.Selection.Test) + { + foreach (var test in Tests) if (test.Name.Contains(TBF.UiBridge.Bridge.SelectedTestName)) return test; + } + return null; + } + + /// + /// Called from the sequence to update paths based on the selected test + /// + /// Selected test + /// + /// + /// + /// + /// true when all four paths are defined (non null) + public static bool GetPaths(Entities.Test test, + out FeedingPath pfeed, out BenchPath pben, out OutputPath pout, out MetersPath pmtrs, + out Entities.TransitionSequence transitionStart, out Entities.TransitionSequence transitionEnd) + { + pfeed = null; + pben = null; + pout = null; + pmtrs = null; + transitionStart = null; + transitionEnd = null; + + foreach (var path in feedingPaths) + { + if (test.FeedingPath == path.Name) { pfeed = new FeedingPath(path, components); break; } + } + + foreach (var path in benchPaths) + { + if (test.BenchPath == path.Name) { pben = new BenchPath(path, components); break; } + } + + foreach (var path in outputPaths) + { + if (test.OutputPath == path.Name) { pout = new OutputPath(path, components); break; } + } + + foreach (var path in metersPaths) + { + if (test.MetersPath == path.Name) { pmtrs = new MetersPath(path, components); break; } + } + if (pmtrs != null) + { + for (int i = 0; i < Program.WMsCount; i++) + { + if ((pmtrs.RegisterReaders[i] != null) && + (pmtrs.RegisterReaders[i].Cfg.DebugLevel == Entities.DebugMode.DetectedOff)) + { + pmtrs.RegisterReaders[i] = null; + } + } + } + + foreach (var transition in TransitionSequences) + { + if (transition.Name == test.TransitionStart) transitionStart = transition; + if (transition.Name == test.TransitionEnd) transitionEnd = transition; + } + + return (pfeed != null) && (pben != null) && (pout != null) && (pmtrs != null); + } + + /// + /// Stops the state machine (and the worker thread) + /// + public static void Stop() + { + if (stateMachineRunning) quitStateMachine = true; + } + + + /* + * This is and example sequence of RunDeviceBefore() / RunOperations() / RunDeviceAfter() calls + * as they are executed during normal run from the progran start to the end. + * + foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in StateMachine.Worker() + State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...) + + foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps() + WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps() + foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps() + IList events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps() + + foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps() + WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps() + foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps() + IList events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps() + + State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...) + + foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps() + WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps() + foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps() + IList events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps() + + foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps() + WaitNextTick() (assume QuitStateMachineException thrown) . . . . . . in WaitRunDevsRunOps() + State.StopOperations(); . . . . . . . . . . . . . . . . . . . . . . . in StateMachine.Worker() catch() + foreach (var device in devices) device.StopDevice(); . . . . . . . . . in StateMachine.Worker() catch() + */ + + /// + /// Worker thread: calls Start(), Run() and Stop() methods of operations. + /// It uses 'currentState', 'nextState' and 'quitStateMachine' static fields. + /// + static void Worker() + { + startDateTime = DateTime.Now; + wlog.InfoFormat(" currentTime = {0}s startDateTime = {1}", currentTimeSec.ToString(), startDateTime.ToString()); + + /// Run all devices for the first time + foreach (var device in devices) device.RunDeviceBefore(); + + try + { + (new Sequences.MainSeq()).Execute(null); + } + catch (QuitStateMachineException) + { + State.StopOperations(); + foreach (var device in devices) device.StopDevice(); + + quitStateMachine = false; + stateMachineRunning = false; + } + } + + + /// + /// Do stuff that is repeated in the state execution loops most often + /// + /// List of Event-s returned from the state operations + public static IList WaitRunDevsRunOps() + { + foreach (var device in devices) device.RunDeviceAfter(); + WaitNextTick(); + foreach (var device in devices) device.RunDeviceBefore(); + IList events = State.RunOperations(); + return events; + /// This is followed by a state change in the sequence + } + + + /// + /// Wait time period - synchronize + /// + /// true when interrupted by 'quitStateMachine', otherwise false + public static void WaitNextTick() + { + currentTimeSec += Period; + + TimeSpan timeFromStart = TimeSpan.FromSeconds(currentTimeSec); + DateTime nextLoopDateTime = startDateTime + timeFromStart; + while (DateTime.Now < nextLoopDateTime) + { + if (quitStateMachine) + { + quitStateMachine = false; + wlog.Info("quitStateMachine == true ... going to stop the StateMachine()"); + throw new QuitStateMachineException(); + } + Thread.Sleep(100); + } + + wlog.DebugFormat(" currentTime = {0}s", currentTimeSec); + } + } +} diff --git a/TestBenchFramework/BenchControl/TbfComponents.cs b/TestBenchFramework/BenchControl/TbfComponents.cs new file mode 100644 index 000000000..f68a0484b --- /dev/null +++ b/TestBenchFramework/BenchControl/TbfComponents.cs @@ -0,0 +1,150 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl +{ + public static class TbfComponents + { + public static IList Factories; + + static TbfComponents() + { + Factories = new List(); + + Factories.Add(new BenchId.ComponentFactory()); + Factories.Add(new Cameras.IdcCamera.IdcCameraFactory()); + Factories.Add(new Cameras.CameraRoi.CameraRoiFactory()); + Factories.Add(new DataEntry.Munich.EntryFormFactory()); + Factories.Add(new Elde.ControlBoardFactory()); + Factories.Add(new Elde.Diverter.DiverterFactory()); + Factories.Add(new Elde.FlowMeter.FlowMeterFactory()); + Factories.Add(new Elde.PressureMeter.PressureMeterFactory()); + Factories.Add(new Elde.Pump.PumpFactory()); + Factories.Add(new Elde.PumpWithFM.PumpFactory()); + Factories.Add(new Elde.RegisterReader.RegisterReaderFactory()); + Factories.Add(new Elde.RegulValve.RegulValveFactory()); + Factories.Add(new Elde.TempMeter.TempMeterFactory()); + Factories.Add(new Elde.Valve.ValveFactory()); + Factories.Add(new Greco.AmbientFactory()); + Factories.Add(new MettlerToledo.BalanceFactory()); + Factories.Add(new MettlerToledo.BalanceNewFactory()); + Factories.Add(new ResultsPrinters.Basic.PrinterFactory()); + Factories.Add(new ResultsPrinters.Munich.PrinterFactory()); + Factories.Add(new ResultsWriters.Basic.WriterFactory()); + Factories.Add(new TestMethods.CameraRoiDetection.RoiDetectionFactory()); + Factories.Add(new TestMethods.CombinedMeters.TestMethodFactory()); + Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory()); + Factories.Add(new TestMethods.FlyingStartCollectionMethod.TestMethodFactory()); + Factories.Add(new WaterMeter.WaterMeterFactory()); + } + + /// + /// Get a component factory given the component name + /// + /// Component class name + /// Component factory instance + public static IComponentFactory CmpntFactoryFromClassName(string className) + { + foreach (var factory in Factories) + { + if (factory.ClassName.Equals(className)) return factory; + } + return null; + } + + public static IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component entity) + { + return CmpntFactoryFromClassName(entity.ClassName).CmpntCfgFromCmpntEntity(entity); + } + + /// + /// Load component entities from the database and convert them to TBF components + /// derived from IComponent with mutual references. + /// + /// NHibernate DB session + /// A list of TBF Components + public static IList LoadComponentsFromDB(NHibernate.ISession session) + { + foreach (var factory in Factories) factory.ResetStaticProperties(); + + /// Load the list of components from the database + IList cmptnEntities = session + .CreateQuery("FROM Component ORDER BY ItemNr") + .List(); + + /// Convert database entities to TBF components + IList components = new List(); + foreach (var entity in cmptnEntities) + { + IComponent cmpnt = BenchControl.TbfComponents + .CmpntFactoryFromClassName(entity.ClassName) + .ComponentFromCmpntCfg(BenchControl.TbfComponents.CmpntCfgFromCmpntEntity(entity), components); + + /// Inherit DebugMode from the parent (if any) + if (cmpnt.Cfg.DebugLevel != Entities.DebugMode.Inherit && cmpnt.Cfg is IChildComponentCfg && + !string.IsNullOrEmpty(cmpnt.Cfg.ParentName)) + { + foreach (var par in components) + { + if (par.Cfg.Name.Equals(cmpnt.Cfg.ParentName)) { cmpnt.Cfg.DebugLevel = par.Cfg.DebugLevel; break; } + } + } + + if (cmpnt.Cfg.DebugLevel != Entities.DebugMode.Off) components.Add(cmpnt); + } + + return components; + } + + /// + /// Get a reference to a component with a given name from a list of components. + /// + /// Component name + /// A list of components + /// Matching component or null + public static IComponent FindComponent(string name, IList components) + { + if (name == null) return null; + foreach (var cmpnt in components) if (cmpnt.Cfg.Name.Equals(name)) return cmpnt; + return null; + } + public static IComponent FindComponent(string name) + { + return FindComponent(name, StateMachine.Components); + } + + + public static IParamsProvider GetTestParams(IComponent cmpnt, Entities.Test test) + { + if (cmpnt == null || cmpnt.Cfg == null || !cmpnt.Cfg.Factory.HasTestParams) return null; + + /// Search for an existing matching entity + foreach (var tstPrms in test.MoreParams) + { + if (tstPrms.CmpntName.Equals(cmpnt.Cfg.Name)) return cmpnt.Cfg.Factory.GetTestParams(tstPrms); + } + + /// Create a new entity and add it to the list test.MoreParams + Entities.ComponentTest testParams = new Entities.ComponentTest { CmpntName = cmpnt.Cfg.Name, Test = test }; + test.MoreParams.Add(testParams); + return cmpnt.Cfg.Factory.GetTestParams(testParams); + } + + + public static IParamsProvider GetProcedureParams(IComponent cmpnt, Entities.Procedure procedure) + { + if (cmpnt == null || cmpnt.Cfg == null || !cmpnt.Cfg.Factory.HasProcedureParams) return null; + + /// Search for an existing matching entity + foreach (var procPrms in procedure.MoreParams) + { + if (procPrms.CmpntName.Equals(cmpnt.Cfg.Name)) return cmpnt.Cfg.Factory.GetProcedureParams(procPrms); + } + + /// Create a new entity and add it to the list procedure.MoreParams + Entities.ComponentProcedure procParams = new Entities.ComponentProcedure { CmpntName = cmpnt.Cfg.Name, Procedure = procedure }; + procedure.MoreParams.Add(procParams); + return cmpnt.Cfg.Factory.GetProcedureParams(procParams); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestBenchSim.cs b/TestBenchFramework/BenchControl/TestBenchSim.cs new file mode 100644 index 000000000..779194aea --- /dev/null +++ b/TestBenchFramework/BenchControl/TestBenchSim.cs @@ -0,0 +1,377 @@ +using System; +using log4net; + +namespace TBF.BenchControl +{ + /// + /// Test bench model inherited by all classes for the simulation of devices. + /// Define DN100, MUNICH or nothing. + /// + public class TestBenchSim + { + private static readonly ILog log = LogManager.GetLogger(typeof(TestBenchSim)); + + /// + /// Incremented in RunDevice() depending on diverters and valves + /// + public static float Mass1sim; /// Volume in [ltr] or mass in [kg] in the tank1 on the balance1, filled by the diverter1 + public static float Mass2sim; /// Volume in [ltr] or mass in [kg] in the tank2 on the balance2, filled by the diverter2 + + /// + /// Set by regulation valves + /// + public static float Flow1sim; /// flow in [m3/h] through RV1 + public static float Flow2sim; /// flow in [m3/h] through RV2 + public static float Flow3sim; /// flow in [m3/h] through RV3 + public static float Flow4sim; /// flow in [m3/h] through RV4 + public static float Flow5sim; /// flow in [m3/h] through RV5 + + /// + /// Valves and diverters + /// + public static ulong RouteSim; + public static bool Div1sim; + public static bool Div2sim; + public static bool Div3sim; + + int regulValveNo; /// 0=undefined, 1..5 + int refFlowmtrNo; /// 0=undefined, 1..4 + + public void Initialize() + { + Mass1sim = 0.0f; /// Initialize tanks + Mass2sim = 0.0f; + Flow1sim = 0.0f; /// Initialize regulation valves + Flow2sim = 0.0f; + Flow3sim = 0.0f; + Flow4sim = 0.0f; + Flow5sim = 0.0f; + RouteSim = 0; /// Initialize other valves + Div1sim = false; + Div2sim = false; + Div3sim = false; + } + +#if DN100 + /// Paths modulating the flows + const ulong K5 = (1 << 0); + const ulong K7 = (1 << 1); + const ulong K10 = (1 << 2); + const ulong K13 = (1 << 3); + const ulong K16 = (1 << 4); + const ulong K2 = (1 << 5); + const ulong EmptyValve1 = (1 << 17); + const ulong EmptyValve2 = (1 << 18); + const ulong Vl5 = (1 << 21); + const ulong Path1 = K2 | K5 | K7; + const ulong Path2 = K2 | K5 | K10; + const ulong Path3 = K2 | K5 | K13; + const ulong Path4 = K2 | K5 | K16; + const ulong Path5 = K2 | K5 | Vl5; +#elif MUNICH + const ulong VL11 = (1 << 0); + const ulong VL13 = (1 << 1); + const ulong VL21 = (1 << 2); + const ulong VL23 = (1 << 3); + const ulong VZ1 = (1 << 4); + const ulong VP2 = (1 << 5); + const ulong VP4 = (1 << 6); + const ulong VP5 = (1 << 7); + const ulong VP6 = (1 << 8); + const ulong VL12 = (1 << 9); + const ulong VL22 = (1 << 10); + const ulong VI11 = (1 << 11); + const ulong VI12 = (1 << 12); + const ulong VI13 = (1 << 13); + const ulong VI21 = (1 << 14); + const ulong VI22 = (1 << 15); + const ulong VI2P = (1 << 16); + const ulong VI31 = (1 << 17); + const ulong VI32 = (1 << 18); + const ulong VI3P = (1 << 19); + const ulong VI41 = (1 << 20); + const ulong VI42 = (1 << 21); + const ulong VI43 = (1 << 22); + const ulong VI4P = (1 << 23); + const ulong VB1 = (1 << 24); + const ulong VB1a = (1 << 25); + const ulong VB2 = (1 << 26); + const ulong VB2a = (1 << 27); + const ulong VM1 = (1 << 28); + const ulong VM2 = (1 << 29); + const ulong VM3 = (1 << 30); + const ulong VM4 = ((ulong)1 << 31); + const ulong Pump1 = ((ulong)1 << 32); + const ulong Block = ((ulong)1 << 33); + const ulong VZ8 = ((ulong)1 << 37); + const ulong EmptyValve1 = VB1 | VB1a; + const ulong EmptyValve2 = VB2 | VB2a; + const ulong Path1 = VZ1 | VL12 | VI11 | VI13; + const ulong Path2 = VZ1 | VL11 | VL12 | VI21 | VI22 | VI13; + const ulong Path3 = VZ1 | VL11 | VL12 | VI31 | VI32; + const ulong Path4 = VZ1 | VL11 | VL12 | VI41 | VI42; + const ulong Path5 = VZ1 | VL11 | VL12 | VI41 | VI43; +#elif FUZHOU150 + const ulong VL11 = (1 << 2); + const ulong VL13 = (1 << 3); + const ulong VL4 = (1 << 4); + const ulong VZ6 = (1 << 5); + const ulong VZ7 = (1 << 6); + const ulong VP5 = (1 << 7); + + const ulong VP6 = (1 << 8); + const ulong VL12 = (1 << 9); + const ulong VZ14 = (1 << 10); + const ulong VI11 = (1 << 11); + const ulong VI12 = (1 << 12); + const ulong VI13 = (1 << 13); + const ulong VI21 = (1 << 14); + const ulong VI22 = (1 << 15); + + const ulong VI2p = (1 << 16); + const ulong VI31 = (1 << 17); + const ulong VI32 = (1 << 18); + const ulong VI3p = (1 << 19); + const ulong VI41 = (1 << 20); + const ulong VI42 = (1 << 21); + const ulong VI43 = (1 << 22); + const ulong VI4p = (1 << 23); + + const ulong VB1 = (1 << 24); + const ulong VB1a = (1 << 25); + const ulong VB2 = (1 << 26); + const ulong VB2a = (1 << 27); + const ulong VM1 = (1 << 28); + const ulong VM2 = (1 << 29); + const ulong VM3 = (1 << 20); + + const ulong Pump1 = ((ulong)1 << 32); + const ulong Pump4 = ((ulong)1 << 33); + const ulong Pump2 = ((ulong)1 << 37); + const ulong Pump3 = ((ulong)1 << 38); + const ulong Pump5 = ((ulong)1 << 39); + + const ulong EmptyValve1 = VB1 | VB1a; + const ulong EmptyValve2 = VB2 | VB2a; + + const ulong Path1 = VL12 | VI11 | VI13; + const ulong Path2 = VL12 | VI21 | VI22 | VI13; + const ulong Path3 = VL12 | VI31 | VI32; + const ulong Path4 = VL12 | VI41 | VI42; + const ulong Path5 = VL12 | VI41 | VI43; +#else + /// Paths modulating the flows + const ulong V1 = (1 << 1); + const ulong V2 = (1 << 2); + const ulong V3 = (1 << 3); + const ulong V3b = (1 << 4); + const ulong V4 = (1 << 5); + const ulong V4b = (1 << 6); + const ulong V5 = (1 << 7); + const ulong V5b = (1 << 8); + const ulong EmptyValve1 = (1 << 9); // =Ve1 + const ulong EmptyValve2 = (1 << 10); // =Ve2 + const ulong Path1 = V1 | V3 | V3b | V4 | V4b; + const ulong Path2 = V2 | V3 | V3b | V5 | V5b; + const ulong Path3 = 0; + const ulong Path4 = 0; + const ulong Path5 = 0; +#endif + /// Run this device + public void RunDevice(int regulValveNo, int refFlowmtrNo, Elde.StatusP statusP) + { + this.regulValveNo = regulValveNo; + this.refFlowmtrNo = refFlowmtrNo; + float time = 1.0f; + +#if DN100 + if (Div1sim && (RouteSim & Path1) == Path1) Mass1sim += DiffKg(Flow1sim, time); + if (Div1sim && (RouteSim & Path2) == Path2) Mass1sim += DiffKg(Flow2sim, time); + if (Div2sim && (RouteSim & Path3) == Path3) Mass2sim += DiffKg(Flow3sim, time); + if (Div2sim && (RouteSim & Path4) == Path4) Mass2sim += DiffKg(Flow4sim, time); + if (Div1sim && (RouteSim & Path5) == Path5) Mass1sim += DiffKg(Flow5sim, time); +#elif MUNICH || FUZHOU150 + if (Div1sim && (RouteSim & Path1) == Path1) Mass1sim += DiffKg(Flow1sim, time); + if (Div1sim && (RouteSim & Path2) == Path2) Mass1sim += DiffKg(Flow2sim, time); + if (Div2sim && (RouteSim & Path3) == Path3) + { + Mass2sim += DiffKg(Flow3sim, time); + } + if (Div3sim && (RouteSim & Path4) == Path4) Mass2sim += DiffKg(Flow4sim, time); + if (Div3sim && (RouteSim & Path5) == Path5) Mass2sim += DiffKg(Flow5sim, time); +#else + if (Div1sim && (RouteSim & Path1) == Path1) Mass1sim += DiffKg(Flow1sim, time); + if (Div2sim && (RouteSim & Path2) == Path2) Mass2sim += DiffKg(Flow2sim, time); +#endif + + if ((RouteSim & EmptyValve1) == EmptyValve1) Mass1sim -= DiffKg(100.0f, time); + if (Mass1sim < 0) Mass1sim = 0; + + if ((RouteSim & EmptyValve2) == EmptyValve2) Mass2sim -= DiffKg(10.0f, time); + if (Mass2sim < 0) Mass2sim = 0; + + UiBridge.Bridge.OnLog(this, string.Format("I{1}/RV{2}: q1={3}, q2={4}, q3={5}, q4={6}, q5={7}, D123={8}{9}{10}, m1={11}, m2={12}, S={13}\r\n", + time, + refFlowmtrNo, regulValveNo, + Flow1sim.ToString("F1"), Flow2sim.ToString("F1"), Flow3sim.ToString("F1"), Flow4sim.ToString("F1"), Flow5sim.ToString("F1"), + (Div1sim ? "o" : "x"), (Div2sim ? "o" : "x"), (Div3sim ? "o" : "x"), + Mass1sim.ToString("F1"), Mass2sim.ToString("F1"), ((ulong)statusP).ToString("X"))); + } + + /// + /// Calculate the mass change from the flow and the time period + /// + /// Flow in [m3/h] + /// Time period in [s] + /// Mass change in [kg] + float DiffKg(float flowM3H, float timeSec) + { + return timeSec * flowM3H / 3.6f; + } + + /// + /// Get the simulated mass. Use the balance range to distinguish the balances. + /// + /// 0-based balance number + /// Simulated mass reading [kg] + public float GetSimMass(int balanceNr) + { + if (balanceNr == 0) return Mass1sim; + else if (balanceNr == 1) return Mass2sim; + else return 0; + } + + /// + /// Set the simulated diverter. Use the nominal flow to distinguish the path. + /// + /// Diverter state: true = to the tank + /// Nominal flow of the path [m3/h] + public void SetSimDiverter(bool toTank) + { +#if DN100 + switch (regulValveNo) + { + case 1: + case 2: + case 5: + Div1sim = toTank; + break; + case 3: + case 4: + Div2sim = toTank; + break; + default: + if (toTank) { throw (new Exception()); } + break; + } +#elif MUNICH || FUZHOU150 + switch (regulValveNo) + { + case 1: + case 2: + Div1sim = toTank; + break; + case 3: + Div2sim = toTank; + break; + case 4: + case 5: + Div3sim = toTank; + break; + default: + if (toTank) { throw (new Exception()); } + break; + } +#else + switch (regulValveNo) + { + case 1: Div1sim = toTank; break; + case 2: Div2sim = toTank; break; + default: + if (toTank) { throw (new Exception()); } + break; + } +#endif + return; + } + + /// + /// Determine which autput section is used + /// + /// + /// + int OutputPathId(float nominalFlow) + { +#if DN100 + // + // Qn1=0.3, Qn2=2.5, Qn3=25, Qn4=250, Qn5=0.2 + // + if (nominalFlow < 0.25f) return 5; + else if (nominalFlow < 1.0f) return 1; + else if (nominalFlow < 10.0f) return 2; + else if (nominalFlow < 100.0f) return 3; + else return 4; +#elif MUNICH + // + // Qn1=200, Qn2=20, Qn3=3, Qn4=0.25 + // + if (nominalFlow <= 0.25f) return 4; + else if (nominalFlow <= 3.0f) return 3; + else if (nominalFlow <= 20.0f) return 2; + else return 1; +#elif FUZHOU150 + // + // Qn1=350, Qn2=50, Qn3=7, Qn4=0.5 + // + if (nominalFlow <= 0.5f) return 4; + else if (nominalFlow <= 7.0f) return 3; + else if (nominalFlow <= 50.0f) return 2; + else return 1; +#else + // + // Qn1=1, Qn2=10 + // + if (nominalFlow < 3.0f) return 1; + else return 2; +#endif + } + + /// + /// Get the simulated flow in [m3/h]. + /// + /// Simulated flow [m3/h] + public float GetSimFlow() + { + switch (refFlowmtrNo) + { + case 1: return ((RouteSim & Path1) == Path1) ? Flow1sim : 0; + case 2: return ((RouteSim & Path2) == Path2) ? Flow2sim : 0; + case 3: return ((RouteSim & Path3) == Path3) ? Flow3sim : 0; + case 4: return (((RouteSim & Path4) == Path4) ? Flow4sim : 0) + + (((RouteSim & Path5) == Path5) ? Flow5sim : 0); + default: return 0; + } + } + + /// + /// Update simulated flow. Use the nominal flow to distinguish the path. + /// + /// Target flow [m3/h] + /// Nominal flow of the path [m3/h] + public void UpdateSimFlow(float targetFlow) + { + float A = 0.7f; /// higher value -> slower regulation + float B = 1.0f - A; + + switch (regulValveNo) + { + case 1: Flow1sim = A * Flow1sim + B * targetFlow; break; + case 2: Flow2sim = A * Flow2sim + B * targetFlow; break; + case 3: Flow3sim = A * Flow3sim + B * targetFlow; break; + case 4: Flow4sim = A * Flow4sim + B * targetFlow; break; + case 5: Flow5sim = A * Flow5sim + B * targetFlow; break; + default: break; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs new file mode 100644 index 000000000..c8e272785 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + public class RoiDetection : Generic.IComponent, GenericDevices.ITestMethod, ISequence + { + readonly RoiDetectionCfg roiDetectionCfg; + public Generic.IComponentCfg Cfg { get { return roiDetectionCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return roiDetectionCfg.Name; } } + + public RoiDetection(RoiDetectionCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.roiDetectionCfg = cfg; + } + + public IList Execute(Entities.Test test) + { + return (new RoiDetectionSeq()).Execute(test); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfg.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfg.cs new file mode 100644 index 000000000..5b9a19d3e --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + public class RoiDetectionCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public RoiDetectionCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public RoiDetectionCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new RoiDetectionCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Format("ROI-s detection {0}", Name); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + RoiDetectionCfg config = (RoiDetectionCfg)(new XmlSerializer(typeof(RoiDetectionCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.cs new file mode 100644 index 000000000..311a39b34 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + public partial class RoiDetectionCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(RoiDetectionCfgCtrl)); + + RoiDetectionCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as RoiDetectionCfg; + Redraw(); + } + } + + public RoiDetectionCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.designer.cs new file mode 100644 index 000000000..41ff98eb1 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.designer.cs @@ -0,0 +1,79 @@ +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + partial class RoiDetectionCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(134, 69); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 7; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(24, 72); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 6; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(131, 43); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 5; + this.classNameLabel.Text = "ComonentName"; + // + // RoiDetectionCfgCtrl + // + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "RoiDetectionCfgCtrl"; + this.Size = new System.Drawing.Size(300, 240); + this.ResumeLayout(false); + this.PerformLayout(); + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.resx b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionCfgCtrl.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/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionFactory.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionFactory.cs new file mode 100644 index 000000000..c5e4f5a77 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + public class RoiDetectionFactory : IComponentFactory + { + public string ClassName { get { return "ROI Detection"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new RoiDetectionCfg(this, "RoiDetection"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new RoiDetectionCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new RoiDetection((RoiDetectionCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return RoiDetectionCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { RoiDetection.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs new file mode 100644 index 000000000..f0658dc37 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.BenchControl.TestMethods.CameraRoiDetection +{ + public class RoiDetectionSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetectionSeq)); + private static readonly ILog allResults = LogManager.GetLogger("AllResults"); + private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + + + public IList Execute(Entities.Test test) + { + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + /// Operations running in more then one state + checkUiOp = new Operations.CheckUIOp(true); + + IList e; /// Events from currently running operations + + //-------------------------------- + State.Create("RoiDetection : Starting the detection sequence") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// Fetch the test, the paths + bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath, + out transitionStart, out transitionStop); + if (!success) goto error; + + //==================================== + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0)); + Entities.TestResult tstRslt = new Entities.TestResult(test, 1, Entities.MetersKind.Single); + tstRslt.DoNotEvaluate = true; + tstRslt.DoNotPublish = true; + + //==================================== + // Transition or SetRoute - Start + //==================================== + if (transitionStart != null) + { + switch (Transition(transitionStart, "RoiDetection : " + Strings.Test_start_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + //-------------------------------- + State.Create("RoiDetection : Setting the route") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen), + GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose))) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + } + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + State.Create("RoiDetection : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + //-------------------------------- + State.Create("RoiDetection : Setting the flow") + .AddOperation(checkUiOp) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, measuredFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.RegulValveTimeOut)) goto error; + if (e.Contains(Event.Next)) goto flow_set; + } + while (!e.Contains(Event.FlowReached)); + + flow_set: + int time = StateMachine.CurrentTime; + float currentFlow = measuredFlow.F; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.ROI_Detection_in_Progress); + //------------------------------------------------ + State detection = State.Create("RoiDetection : Detection of ROI-s") + .AddOperation(checkUiOp); + /// Extract cameras from the current sensors path, add operations to the detection state + for (int i = 0; i < sensPath.RegisterReaders.Length; i++) + { + GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi; + if (cameraRoi != null) + { + detection.AddOperation(cameraRoi.DetectOp()); + } + } + detection.EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (e.Contains(Event.CameraBusy)); + + if (e.Contains(Event.CameraOpFailed)) goto error; /// TODO: resolve in some other way + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Detection_completed); + //------------------------------------------------ + State.Create("RoiDetection : Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + + //-------------------------------- + State.Create("RoiDetection : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + /// Stop the pump + State.Create("RoiDetection : Detection of ROI-s completed -> Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); + + /// Transition or SetRoute - End + if (transitionStop != null) + { + switch (Transition(transitionStop, "RoiDetection : " + Strings.Test_stop_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + State.Create("RoiDetection : Detection completed -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + } + + /// Create the return value: a list with one event Event.Done + IList retval = new List(); + retval.Add(Event.Done); + return retval; + + //==================================== + stop: + cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps + State.Create("RoiDetection : User selected STOP -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval2 = new List(); + retval2.Add(Event.UiCmdStop); + return retval2; + + //==================================== + error: + cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps + State.Create("RoiDetection : ERROR -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval3 = new List(); + retval3.Add(Event.Error); + return retval3; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs new file mode 100644 index 000000000..5c4e54218 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs @@ -0,0 +1,483 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using TBF.UiBridge; +using TBF.BenchControl; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + public class CombinedMetersSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(CombinedMetersSeq)); + private static readonly ILog allResults = LogManager.GetLogger("AllResults"); + private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + + + public IList Execute(Entities.Test test) + { + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + /// Specific for combined meters + int[] lastWMPulses = new int[Program.WMsCount]; + + /// Operations running in more then one state + checkUiOp = new Operations.CheckUIOp(true); + + IList e; /// Events from currently running operations + + //-------------------------------- + State.Create("CombinedMeters : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// Fetch the test, the paths + bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath, + out transitionStart, out transitionStop); + if (!success) goto error; + + /// Notes: + /// float timeHr = volumeLtr / (1000.0f * targetFlow); + /// float timeSec = 3600.0f * timeHr; + /// uint refPulses = (uint)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); + int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] + + float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + /// + /// Meters path is required for the following: + readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + + int repetitionNr = 1; /// First test: repetitionNr=1 + + //==================================== + // Transition or SetRoute - Start + //==================================== + if (transitionStart != null) + { + switch (Transition(transitionStart, "CombinedMeters : " + Strings.Test_start_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + //-------------------------------- + State.Create("CombinedMeters : Setting the route") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen), + GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose))) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + } + + //==================================== + loop: + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, (int)totalPulses)); + Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Combined); + + + if (!test.Emptying) /// Do not skip emptying if test.Emptying==true + { + //-------------------------------- + State.Create("CombinedMeters : Measuring the mass of water in the tank") + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadMassOp(ref mass)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + float estimatedEndMass = mass.F + test.Volume; + if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor) + { + goto set_flow; /// Enough room in the tank -> skip emptying + } + } + + // Empty the water tank + switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + set_flow: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + State.Create("CombinedMeters : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + //-------------------------------- + State.Create("CombinedMeters : Setting the flow") + .AddOperation(checkUiOp) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, measuredFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.RegulValveTimeOut)) goto error; + } + while (!e.Contains(Event.FlowReached)); + + int time = StateMachine.CurrentTime; + float currentFlow = measuredFlow.F; + + /// Extract cameras from the current sensors path, add operations to the detection state + IList measureOperations = new List(); + for (int i = 0; i < sensPath.RegisterReaders.Length; i++) + { + GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi; + if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp()); + } + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create("CombinedMeters : Measuring the start mass") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + tstRslt.TimeStart = DateTime.Now; + tstRslt.MassStartRaw = stableMass.F; + mass.F = stableMass.F; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create("CombinedMeters : Starting the test") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.MeasurementStarted)); + + /// + /// Measurement loop - preparation + /// + queryEnd1 = cBrd.QueryMeasurementEndOp(); + queryEnd2 = cBrd.QueryMeasurementEndOp(); + + bool firstTime = true; /// Used to reset sums for averaging + ResetAveragedData(); + + /// Measurement loop - begin + while (true) + { + //-------------------------------- + switch(ReadRegistersTempPressAmbient(measureOperations, true)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + case Event.MeasurementCompleted: goto measurement_completed; + } + + if (firstTime) + { + firstTime = false; /// Do the following only once + tstRslt.TempInStart = tempIn.F; + tstRslt.TempOutStart = tempOut.F; + tstRslt.TempDivStart = tempDiv.F; + tstRslt.PressInStart = pressIn.F; + tstRslt.PressOutStart = pressOut.F; + } + + tstRslt.TempInEnd = tempIn.F; + tstRslt.TempOutEnd = tempOut.F; + tstRslt.TempDivEnd = tempDiv.F; + tstRslt.PressInEnd = pressIn.F; + tstRslt.PressOutEnd = pressOut.F; + tstRslt.MassEndRaw = mass.F; + + AccumulateAveragedData(); + + + string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq, + cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow); + for (int i = 0; i < Program.WMsCount; i++) + { + logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]); + } + log.Info(logstr); + + + float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, 10.0f, test.TstTime); + TestProgressEventArgs data = GetTestProgressData(test, tstRslt, cBrd.EtPulses(0), cBrd.TTime, progress); + data.WmVolume[2] = data.WmVolume[0] + data.WmVolume[1]; + data.WmErrPct[2] = Formulas.ErrorFromVolumes(data.WmVolume[2], data.Volume); + Bridge.OnTestProgress(this, data); + } + /// Measurement loop - end + + + measurement_completed: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create("CombinedMeters : Measuring the end mass") + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + /// + tstRslt.MassEndRaw = stableMass.F; + tstRslt.TimeEnd = DateTime.Now; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_completed); + //------------------------------------------------ + State.Create("CombinedMeters : Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation(cBrd.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + + //-------------------------------- + State.Create("CombinedMeters : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// + /// Populate TestRasult data entity with data + /// + tstRslt.TimeEnd = DateTime.Now; + UpdateTestRsltWithAveragedData(tstRslt); + tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections); + tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections); + tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] + tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] + tstRslt.Time = cBrd.TTime; /// [s] measurement time + tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h] + tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] + tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter + tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) + tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; + /// Corrected master pulses per liter + if (tstRslt.VolumeCTV <= float.Epsilon) + { + tstRslt.ErrorMaster = 0.1f; + } + else + { + tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; + } + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; + + for (int iCmbnd = 0; iCmbnd < Program.WMsCount / 2; iCmbnd++) + { + for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++) + { + if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) + { + tstRslt.Meters[i].VolumeMeter = 0; + } + else + { + tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr; + } + + tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString(); + tstRslt.Meters[i].VolumeStart = 0; /// liter + tstRslt.Meters[i].VolumeEnd = 0; /// liter + + tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// liter + if (WMRefPulses[i] != 0) + { + tstRslt.Meters[i].VolumeMeter *= ((float)cBrd.EtPulses(0) / (float)WMRefPulses[i]); + } + + tstRslt.Meters[i].PulsesMeter = WMPulses[i]; + tstRslt.Meters[i].PulsesMaster = WMRefPulses[i]; + tstRslt.Meters[i].Time = cBrd.TTime; + + tstRslt.Meters[i].VolumeErrorPct = 0; /// Not used + } + + tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// liter + tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter; + + tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0); + tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime; + tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef); + tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.ErrLimLo <= tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct) && (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi); + } + /// Add data - end + + AddOrOverwriteResult(tstRslt); + + Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt)); + + /// Append the results to the CSV-file + allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0))); + + FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); + + if (++repetitionNr <= test.Repeats) + { + goto loop; + } + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + /// Stop the pump + State.Create("CombinedMeters : Test(s) completed -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); + + /// Transition or SetRoute - End + if (transitionStop != null) + { + switch (Transition(transitionStop, "CombinedMeters : " + Strings.Test_stop_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + State.Create("CombinedMeters : Test(s) completed -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + } + + /// Create the return value - a list with one event Event.Done - and return + IList retval = new List(); + retval.Add(Event.Done); + return retval; + + //==================================== + stop: + + State.Create("CombinedMeters : User selected STOP -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval2 = new List(); + retval2.Add(Event.UiCmdStop); + return retval2; + + //==================================== + error: + State.Create("CombinedMeters : ERROR -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval3 = new List(); + retval3.Add(Event.Error); + return retval3; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs new file mode 100644 index 000000000..7d3d5c3b7 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence + { + readonly TestMethodCfg testMethodCfg; + public Generic.IComponentCfg Cfg { get { return testMethodCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return testMethodCfg.Name; } } + + public TestMethod(TestMethodCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.testMethodCfg = cfg; + } + + public IList Execute(Entities.Test test) + { + return (new CombinedMetersSeq()).Execute(test); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfg.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfg.cs new file mode 100644 index 000000000..39d12cff6 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public TestMethodCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public TestMethodCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new TestMethodCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + TestMethodCfg config = (TestMethodCfg)(new XmlSerializer(typeof(TestMethodCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..b75f0a6ed --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl)); + + TestMethodCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..d67a0f394 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + partial class TestMethodCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.resx b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodCfgCtrl.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/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodFactory.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodFactory.cs new file mode 100644 index 000000000..68030affa --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethodFactory.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedMeters +{ + public class TestMethodFactory : IComponentFactory + { + public string ClassName { get { return "CombinedMeters"; } } + + public bool HasProcedureParams { get { return false; } } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new TestMethodCfg(this, "CombinedMeters"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new TestMethodCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new TestMethod((TestMethodCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return TestMethodCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetTestParams.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetTestParams.cs new file mode 100644 index 000000000..24f1c776d --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetTestParams.cs @@ -0,0 +1,177 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public class CombinedWithDetTestParams : IParamsProvider, ITestParams + { + public float TargetQ; /// Target=terminal flow durning detection when increasing or decreasing the flow + public float RelativeQfrom; /// Tested flow low range related to the detected flow + public float RelativeQto; /// Tested flow high range related to the detected flow + public float RateOfChange; /// Each step is calculated as (TargetQfrom - Qfrom) * RateOfChange, text form is displayed in % (*100) + public float DetectionThreshold;/// Drop of frequency for the detection, text form is displayed in % (*100) + + string[] paramNames = new string[] + { + Strings.TargetQ, + Strings.RelativeQfrom, + Strings.RelativeQto, + Strings.RateOfChangePct, + Strings.DetectionThresholdPct, + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return TargetQ.ToString(); + case 1: return RelativeQfrom.ToString(); + case 2: return RelativeQto.ToString(); + case 3: return (100.0f * RateOfChange).ToString(); + case 4: return (100.0f * DetectionThreshold).ToString(); + default: return string.Empty; + } + } + + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: TargetQ = Utils.ParseUFloat(strValue); return; + case 1: RelativeQfrom = Utils.ParseSFloat(strValue); return; + case 2: RelativeQto = Utils.ParseSFloat(strValue); return; + case 3: RateOfChange = Utils.ParseUFloat(strValue) / 100.0f; return; + case 4: DetectionThreshold = Utils.ParseUFloat(strValue) / 100.0f; return; + default: return; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + float dummy; + switch (i) + { + case 0: + case 3: + case 4: + if (Utils.TryParseUFloat(strValue, out dummy)) return true; + break; + case 1: + case 2: + if (Utils.TryParseSFloat(strValue, out dummy)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentTest TestParamsEntity { get { return testParamsEntity; } } + Entities.ComponentTest testParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Test Test { get { return test; } } + Entities.Test test; + + /// Parameterless constructor + public CombinedWithDetTestParams() + { + TargetQ = 3.0f; + RelativeQfrom = -0.4f; + RelativeQto = -0.2f; + RateOfChange = 0.05f; + DetectionThreshold = 0.25f; + } + + public CombinedWithDetTestParams(Entities.ComponentTest testParamsEntity, string componentName, Entities.Test test) + : this() + { + this.testParamsEntity = testParamsEntity; + this.componentName = componentName; + this.test = test; + } + + public TBF.Entities.ComponentTest ToDbEntity(IComponent component, Entities.Test test) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentTest entity + TBF.Entities.ComponentTest entity = new TBF.Entities.ComponentTest(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Test = test; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + testParamsEntity.Parameters = writer.ToString(); + testParamsEntity.CmpntName = componentName; + testParamsEntity.Test = test; + + } + } + + public static IParamsProvider GetTestParams(Entities.ComponentTest testParamsEntity) + { + if (testParamsEntity == null) return new CombinedWithDetTestParams(); + + CombinedWithDetTestParams testParams; + try + { + testParams = (CombinedWithDetTestParams)(new XmlSerializer(typeof(CombinedWithDetTestParams))) + .Deserialize(new StringReader(testParamsEntity.Parameters)); + } + catch + { + testParams = new CombinedWithDetTestParams(); + } + testParams.testParamsEntity = testParamsEntity; + testParams.componentName = testParamsEntity.CmpntName; + testParams.test = testParamsEntity.Test; + return testParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs new file mode 100644 index 000000000..8ce8d0993 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -0,0 +1,668 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using TBF.UiBridge; +using TBF.BenchControl; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public class CombinedWithDetectionSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(CombinedWithDetectionSeq)); + private static readonly ILog allResults = LogManager.GetLogger("AllResults"); + private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + + const int DetectionBufferSize = 9; + const int DetectionKernelSize = 5; + + public IList Execute(Entities.Test test, CombinedWithDetTestParams testParams) + { + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + /// Specific for combined meters + int[] lastWMPulses = new int[Program.WMsCount]; + + /// Operations running in more then one state + checkUiOp = new Operations.CheckUIOp(true); + + IList e; /// Events from currently running operations + + //-------------------------------- + State.Create("CombinedWithDetection : stop diverter gate etc") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// Fetch the test, the paths + bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath, + out transitionStart, out transitionStop); + if (!success) goto error; + + /// Notes: + /// float timeHr = volumeLtr / (1000.0f * targetFlow); + /// float timeSec = 3600.0f * timeHr; + /// uint refPulses = (uint)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); + int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] + + float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + /// + /// Meters path is required for the following: + readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + + int repetitionNr = 1; /// First test: repetitionNr=1 + + //==================================== + // Transition or SetRoute - Start + //==================================== + if (transitionStart != null) + { + switch (Transition(transitionStart, "CombinedWithDetection : " + Strings.Test_start_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + //-------------------------------- + State.Create("CombinedWithDetection : Setting the route") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen), + GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose))) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + } + + //==================================== + loop: + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, (int)totalPulses)); + Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Combined); + + + if (!test.Emptying) /// Do not skip emptying if test.Emptying==true + { + //-------------------------------- + State.Create("CombinedWithDetection : Get the mass of water in the tank") + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadMassOp(ref mass)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + float estimatedEndMass = mass.F + test.Volume; + if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor) + { + goto switching_flow_detection; /// Enough room in the tank -> skip emptying + } + } + + // Empty the water tank + switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + switching_flow_detection: + + /// Extract cameras from the current sensors path, add operations to the detection state + IList measureOperations = new List(); + for (int i = 0; i < sensPath.RegisterReaders.Length; i++) + { + GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi; + if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp()); + } + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Switching_flow_detection); + //------------------------------------------------ + State.Create("CombinedWithDetection : Start the pump") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + //-------------------------------- + State.Create("CombinedWithDetection : Set the initial flow") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, measuredFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.RegulValveTimeOut)) goto error; + } + while (!e.Contains(Event.FlowReached)); + + //-------------------------------- + switch (ReadRegistersTempPressAmbient(measureOperations, false)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + //==================================== + // Find the switching flow + //==================================== + + /// Allocate detection buffers + float[] flowsForDetection = new float[DetectionBufferSize]; + float[] pulseFreqsForDetection = new float[DetectionBufferSize]; + + /// Current values + flowsForDetection[0] = measuredFlow.F; + pulseFreqsForDetection[0] = 0.0f; + int startTime = StateMachine.CurrentTime; + int lastTime = StateMachine.CurrentTime; + + /// Detection parameters + float rvPulse = (testParams.TargetQ > (test.Qfrom + test.Qto) / 2.0f) ? 0.05f : -0.05f; // rise or fall? + rvPulse *= (100.0f * testParams.RateOfChange); + + bool detected = false; + bool targetReached = false; + float detectedFlow = 0; + + do + { + //-------------------------------- + State.Create("CombinedWithDetection : Change the RV position") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.RegulValve.ChangeRegulValvePositionOp(rvPulse)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PositionReached)); + + // Last pulses are kept to calculate differences + for (int i = 0; i < Program.WMsCount; i++) lastWMPulses[i] = WMPulses[i]; + + // Shift data in the detection buffers + for (int i = DetectionBufferSize - 2; i >= 0; i--) + { + flowsForDetection[i+1] = flowsForDetection[i]; + pulseFreqsForDetection[i+1] = pulseFreqsForDetection[i]; + } + + switch (ReadRegistersTempPressAmbient(measureOperations, false)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + int time = StateMachine.CurrentTime; + int diff = WMPulses[1] - lastWMPulses[1]; + flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0f; + pulseFreqsForDetection[0] = (float)diff / (float)(time - lastTime); + lastTime = StateMachine.CurrentTime; + + if ((flowsForDetection[0] > 0) && (flowsForDetection[DetectionBufferSize - 1] > 0)) + { + float[] flowBefore = new float[DetectionKernelSize]; + float[] flowAfter = new float[DetectionKernelSize]; + float[] freqBefore = new float[DetectionKernelSize]; + float[] freqAfter = new float[DetectionKernelSize]; + for (int i = 0; i < DetectionKernelSize; i++) + { + flowBefore[i] = flowsForDetection[DetectionBufferSize - DetectionKernelSize + i]; + freqBefore[i] = pulseFreqsForDetection[DetectionBufferSize - DetectionKernelSize + i]; + flowAfter[i] = flowsForDetection[i]; + freqAfter[i] = pulseFreqsForDetection[i]; + } + Array.Sort(flowBefore); + Array.Sort(flowAfter); + Array.Sort(freqBefore); + Array.Sort(freqAfter); + flowBefore[0] = 0; + flowAfter[0] = 0; + //freqBefore[0] = 0; + //freqAfter[0] = 0; + flowBefore[DetectionKernelSize - 1] = 0; + flowAfter[DetectionKernelSize - 1] = 0; + //freqBefore[DetectionKernelSize - 1] = 0; + //freqAfter[DetectionKernelSize - 1] = 0; + float aveFlowBefore = 0; + float aveFlowAfter = 0; + float aveFreqBefore = 0; + float aveFreqAfter = 0; + foreach (var f in flowBefore) aveFlowBefore += f; + foreach (var f in flowAfter) aveFlowAfter += f; + foreach (var f in freqBefore) aveFreqBefore += f; + foreach (var f in freqAfter) aveFreqAfter += f; + aveFlowBefore /= (float)(DetectionKernelSize - 2); + aveFlowAfter /= (float)(DetectionKernelSize - 2); + aveFreqBefore /= (float)(DetectionKernelSize); + aveFreqAfter /= (float)(DetectionKernelSize); + + UiBridge.Bridge.OnLog(this, string.Format("time={0}, flow{1}, aveFlowB={2}, aveFlowA={3}, pulseFreq={4}, aveFreqB={5}, aveFreqA={6}\r\n", + time - startTime, + flowsForDetection[0].ToString("F2"), + aveFlowBefore.ToString("F2"), + aveFlowAfter.ToString("F2"), + pulseFreqsForDetection[0].ToString("F2"), + aveFreqBefore.ToString("F2"), + aveFreqAfter.ToString("F2"))); + + //detectedFlow = (aveFlowBefore + aveFlowAfter) / 2.0f; + detectedFlow = aveFlowBefore; + + if (rvPulse > 0) + { + detected = (aveFreqAfter < aveFreqBefore * (1.0f - testParams.DetectionThreshold)); + targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) > testParams.TargetQ; + } + else + { + detected = (aveFreqAfter > aveFreqBefore * (1.0f + testParams.DetectionThreshold)); + targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) < testParams.TargetQ; + } + } + } + while (!detected && !targetReached); + + if (rvPulse > 0) + { + Qrise = detectedFlow; + } + else + { + Qfall = detectedFlow; + } + + UiBridge.Bridge.OnLog(this, string.Format("detected flow={0}\r\n", detectedFlow.ToString("F2"))); + + float qfrom_test = detectedFlow + testParams.RelativeQfrom; + float qto_test = detectedFlow + testParams.RelativeQto; + + /// Update test results with the test flow determined from the detected switching flow + tstRslt.Qfrom = qfrom_test; + tstRslt.Qto = qto_test; + float Qave_lps = (qfrom_test + qto_test) / 7.2f; + tstRslt.TstTime = tstRslt.Volume / Qave_lps; + + + //-------------------------------- + State.Create("CombinedWithDetection : Switching flow detected, going back") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, measuredFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.RegulValveTimeOut)) goto error; + } + while (!e.Contains(Event.FlowReached)); + + //-------------------------------- + State.Create("CombinedWithDetection : Going to the test flow") + //State.Create("set_RV_position", + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, measuredFlow, 10)) /// timeout = 10 sec. + //.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + //if (e.Contains(Event.FlowTimeOut)) goto do_detection; + } + while (!e.Contains(Event.FlowReached)); + + + start_measurement: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create(Strings.Measure_the_mass) + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + tstRslt.TimeStart = DateTime.Now; + tstRslt.MassStartRaw = stableMass.F; + mass.F = stableMass.F; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create(Strings.Start_the_test) + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.MeasurementStarted)); + + /// + /// Measurement loop - preparation + /// + queryEnd1 = cBrd.QueryMeasurementEndOp(); + queryEnd2 = cBrd.QueryMeasurementEndOp(); + + bool firstTime = true; /// Used to reset sums for averaging + ResetAveragedData(); + + /// Measurement loop - begin + while (true) + { + //-------------------------------- + switch (ReadRegistersTempPressAmbient(measureOperations, true)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + case Event.MeasurementCompleted: goto measurement_completed; + } + + if (firstTime) + { + firstTime = false; /// Do the following only once + tstRslt.TempInStart = tempIn.F; + tstRslt.TempOutStart = tempOut.F; + tstRslt.TempDivStart = tempDiv.F; + tstRslt.PressInStart = pressIn.F; + tstRslt.PressOutStart = pressOut.F; + } + + tstRslt.TempInEnd = tempIn.F; + tstRslt.TempOutEnd = tempOut.F; + tstRslt.TempDivEnd = tempDiv.F; + tstRslt.PressInEnd = pressIn.F; + tstRslt.PressOutEnd = pressOut.F; + tstRslt.MassEndRaw = mass.F; + + AccumulateAveragedData(); + + + string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq, + cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow); + for (int i = 0; i < Program.WMsCount; i++) + { + logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]); + } + log.Info(logstr); + + + float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, 10.0f, test.TstTime); + TestProgressEventArgs data = GetTestProgressData(test, tstRslt, cBrd.EtPulses(0), cBrd.TTime, progress); + data.WmVolume[2] = data.WmVolume[0] + data.WmVolume[1]; + data.WmErrPct[2] = Formulas.ErrorFromVolumes(data.WmVolume[2], data.Volume); + Bridge.OnTestProgress(this, data); + } + /// Measurement loop - end + + + measurement_completed: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create(Strings.Measure_the_mass) + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + /// + tstRslt.MassEndRaw = stableMass.F; + tstRslt.TimeEnd = DateTime.Now; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_completed); + //------------------------------------------------ + State.Create(Strings.Stop_the_pump) + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation(cBrd.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + + //-------------------------------- + State.Create("stop_diverter_gate_etc") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// + /// Populate TestRasult data entity with data + /// + tstRslt.TimeEnd = DateTime.Now; + UpdateTestRsltWithAveragedData(tstRslt); + tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections); + tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections); + tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] + tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] + tstRslt.Time = cBrd.TTime; /// [s] measurement time + tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h] + tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] + tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter + tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) + tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; + /// Corrected master pulses per liter + if (tstRslt.VolumeCTV <= float.Epsilon) + { + tstRslt.ErrorMaster = 0.1f; + } + else + { + tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; + } + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; + + for (int iCmbnd = 0; iCmbnd < Program.WMsCount / 2; iCmbnd++) + { + for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++) + { + if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) + { + tstRslt.Meters[i].VolumeMeter = 0; + } + else + { + tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr; + } + + tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString(); + tstRslt.Meters[i].VolumeStart = 0; /// liter + tstRslt.Meters[i].VolumeEnd = 0; /// liter + + tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// liter + if (WMRefPulses[i] != 0) + { + tstRslt.Meters[i].VolumeMeter *= ((float)cBrd.EtPulses(0) / (float)WMRefPulses[i]); + } + + tstRslt.Meters[i].PulsesMeter = WMPulses[i]; + tstRslt.Meters[i].PulsesMaster = WMRefPulses[i]; + tstRslt.Meters[i].Time = cBrd.TTime; + + tstRslt.Meters[i].VolumeErrorPct = 0; /// Not used + } + + tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// liter + tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter; + + tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0); + tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime; + tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef); + tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.ErrLimLo <= tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct) && (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi); + } + /// Add data - end + + Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt)); + + AddOrOverwriteResult(tstRslt); + + /// Append the results to the CSV-file + allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0))); + + FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); + + if (++repetitionNr <= test.Repeats) + { + goto loop; + } + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + /// Stop the pump + State.Create("CombinedWithDetection : Test(s) completed -> Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); + + /// Transition or SetRoute - End + if (transitionStop != null) + { + switch (Transition(transitionStop, "CombinedWithDetection : " + Strings.Test_stop_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + State.Create("CombinedWithDetection : Test(s) completed -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + } + + /// Create the return value - a list with one event Event.Done - and return + IList retval = new List(); + retval.Add(Event.Done); + return retval; + + //==================================== + stop: + + State.Create("CombinedWithDetection : User selected STOP -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval2 = new List(); + retval2.Add(Event.UiCmdStop); + return retval2; + + //==================================== + error: + State.Create("close_before_error") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval3 = new List(); + retval3.Add(Event.Error); + return retval3; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs new file mode 100644 index 000000000..5ab52ad41 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence + { + readonly TestMethodCfg testMethodCfg; + public Generic.IComponentCfg Cfg { get { return testMethodCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return testMethodCfg.Name; } } + + public TestMethod(TestMethodCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.testMethodCfg = cfg; + } + + public IList Execute(Entities.Test test) + { + IParamsProvider testParams = BenchControl.TbfComponents.GetTestParams(this, test); + return (new CombinedWithDetectionSeq()).Execute(test, testParams as CombinedWithDetTestParams); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfg.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfg.cs new file mode 100644 index 000000000..b15932913 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public TestMethodCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public TestMethodCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new TestMethodCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + TestMethodCfg config = (TestMethodCfg)(new XmlSerializer(typeof(TestMethodCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..eeb70fc60 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl)); + + TestMethodCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..af1af3fed --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + partial class TestMethodCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.resx b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodCfgCtrl.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/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodFactory.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodFactory.cs new file mode 100644 index 000000000..5847e137a --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethodFactory.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.CombinedWithDetection +{ + public class TestMethodFactory : IComponentFactory + { + public string ClassName { get { return "CombinedWithDetection"; } } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new TestMethodCfg(this, "CombinedWithDetection"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new TestMethodCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new TestMethod((TestMethodCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return TestMethodCfg.CreateFromDbEntity(component, this); + } + + public bool HasProcedureParams { get { return false; } } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + public bool HasTestParams { get { return true; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) + { + return CombinedWithDetTestParams.GetTestParams(testParams); + } + + public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs new file mode 100644 index 000000000..a0cc95483 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -0,0 +1,466 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + public class FlyingStartCollectionMethodSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartCollectionMethodSeq)); + private static readonly ILog allResults = LogManager.GetLogger("AllResults"); + private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + + + public IList Execute(Entities.Test test) + { + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + /// Operations running in more then one state + checkUiOp = new Operations.CheckUIOp(true); + + IList e; /// Events from currently running operations + + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// Fetch the test, the paths + bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath, + out transitionStart, out transitionStop); + if (!success) goto error; + + /// Notes: + /// float timeHr = volumeLtr / (1000.0f * targetFlow); + /// float timeSec = 3600.0f * timeHr; + /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); + int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] + + float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + + int repetitionNr = 1; /// First test: repetitionNr=1 + + //==================================== + // Transition or SetRoute - Start + //==================================== + if (transitionStart != null) + { + switch (Transition(transitionStart, "FlyingStartCollectionMethod : " + Strings.Test_start_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Setting the route") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen), + GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose))) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + } + + //==================================== + loop: + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); + Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); + + + if (!test.Emptying) /// Do not skip emptying if test.Emptying==true + { + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Measuring the mass of water in the tank") + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadMassOp(ref mass)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + float estimatedEndMass = mass.F + test.Volume; + if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor) + { + goto set_flow; /// Enough room in the tank -> skip emptying + } + } + + // Empty the water tank + switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + + set_flow: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + State.Create("FlyingStartCollectionMethod : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Setting the flow") + .AddOperation(checkUiOp) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, measuredFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.RegulValveTimeOut)) goto error; + if (e.Contains(Event.Next)) goto flow_set; + } + while (!e.Contains(Event.FlowReached)); + + flow_set: + int time = StateMachine.CurrentTime; + float currentFlow = measuredFlow.F; + + /// Extract cameras from the current sensors path, add operations to the detection state + IList measureOperations = new List(); + for (int i = 0; i < sensPath.RegisterReaders.Length; i++) + { + GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi; + if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp()); + } + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create("FlyingStartCollectionMethod : Measuring the start mass") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + + tstRslt.TimeStart = DateTime.Now; + tstRslt.MassStartRaw = stableMass.F; + mass.F = stableMass.F; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create("FlyingStartCollectionMethod : Starting the test") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.MeasurementStarted)); + + /// Measurement loop - preparation + readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + queryEnd1 = cBrd.QueryMeasurementEndOp(); + queryEnd2 = cBrd.QueryMeasurementEndOp(); + + bool firstTime = true; + ResetAveragedData(); + + /// Measurement loop - begin + while (true) + { + //-------------------------------- + switch (ReadRegistersTempPressAmbient(measureOperations, true)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + case Event.MeasurementCompleted: goto measurement_completed; + } + + if (firstTime) + { + firstTime = false; /// Do the following only once + tstRslt.TempInStart = tempIn.F; + tstRslt.TempOutStart = tempOut.F; + tstRslt.TempDivStart = tempDiv.F; + tstRslt.PressInStart = pressIn.F; + tstRslt.PressOutStart = pressOut.F; + } + + tstRslt.TempInEnd = tempIn.F; + tstRslt.TempOutEnd = tempOut.F; + tstRslt.TempDivEnd = tempDiv.F; + tstRslt.PressInEnd = pressIn.F; + tstRslt.PressOutEnd = pressOut.F; + tstRslt.MassEndRaw = mass.F; + + AccumulateAveragedData(); + + tstRslt.AmbientTempAve = airTemperature.F; + tstRslt.AmbientPressAve = airPressure.F; + tstRslt.AmbientHumiAve = airHumidity.F; + + + string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq, + cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow); + for (int i = 0; i < Program.WMsCount; i++) + { + logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]); + } + log.Info(logstr); + + + float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, 10.0f, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd.EtPulses(0), cBrd.TTime, progress)); + } + /// Measurement loop - end + + measurement_completed: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Measuring_the_weight); + //------------------------------------------------ + State.Create("FlyingStartCollectionMethod : Measuring the end mass") + .AddOperation(checkUiOp) + .AddOperation(outPath.Balance.ReadStableMassOp(ref stableMass, 5)) + .AddOperation(cBrd.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.BalanceDone)); + /// + tstRslt.MassEndRaw = stableMass.F; + tstRslt.TimeEnd = DateTime.Now; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_completed); + //------------------------------------------------ + cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps + State.Create("FlyingStartCollectionMethod : Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation(cBrd.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ValvesSet)); + + + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.PreviousStopped)); + + /// + /// Populate TestResult data entity with data + /// + tstRslt.TimeEnd = DateTime.Now; + UpdateTestRsltWithAveragedData(tstRslt); + tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections); + tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections); + tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] + tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] + tstRslt.Time = cBrd.TTime; /// [s] measurement time + tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h] + tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] + tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter + tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) + tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; + /// Corrected master pulses per liter + if (tstRslt.VolumeCTV <= float.Epsilon) + { + tstRslt.ErrorMaster = 0.1f; + } + else + { + tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; + } + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; + for (int i = 0; i < Program.WMsCount; i++) + { + if (sensPath.RegisterReaders[i] != null) + { + tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString(); + tstRslt.Meters[i].VolumeStart = 0; /// liter + tstRslt.Meters[i].VolumeEnd = 0; /// liter + if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0; + else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr; + tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter + tstRslt.Meters[i].PulsesMeter = WMPulses[i]; + tstRslt.Meters[i].PulsesMaster = WMRefPulses[i]; + tstRslt.Meters[i].Time = cBrd.TTime; + if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0) + { + tstRslt.Meters[i].VolumeErrorPct = + 100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef; + /// % + } + else + { + tstRslt.Meters[i].VolumeErrorPct = -100; + } + tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi); + } + } + /// Add data - end + + AddOrOverwriteResult(tstRslt); + + Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt)); + + /// Append the results to the CSV-file + allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0))); + + FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); + + if (++repetitionNr <= test.Repeats) + { + goto loop; + } + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + /// Stop the pump + State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); + + /// Transition or SetRoute - End + if (transitionStop != null) + { + switch (Transition(transitionStop, "FlyingStartCollectionMethod : " + Strings.Test_stop_sequence_i_n)) + { + case Event.Error: goto error; + case Event.UiCmdStop: goto stop; + } + } + else + { + State.Create("FlyingStartCollectionMethod : Test(s) completed -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + } + + /// Create the return value - a list with one event Event.Done - and return + IList retval = new List(); + retval.Add(Event.Done); + return retval; + + //==================================== + stop: + State.Create("FlyingStartCollectionMethod : User selected STOP -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval2 = new List(); + retval2.Add(Event.UiCmdStop); + return retval2; + + //==================================== + error: + cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps + State.Create("FlyingStartCollectionMethod : ERROR -> Closing the valves") + .AddOperation(checkUiOp) + .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) goto error; + } + while (!e.Contains(Event.ValvesSet)); + + IList retval3 = new List(); + retval3.Add(Event.Error); + return retval3; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs new file mode 100644 index 000000000..8439cad6d --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence + { + readonly TestMethodCfg testMethodCfg; + public Generic.IComponentCfg Cfg { get { return testMethodCfg; } } + + public static void ResetStaticProperties() { } + + public string Name { get { return testMethodCfg.Name; } } + + public TestMethod(TestMethodCfg cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.testMethodCfg = cfg; + } + + public IList Execute(Entities.Test test) + { + return (new FlyingStartCollectionMethodSeq()).Execute(test); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfg.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfg.cs new file mode 100644 index 000000000..1bc6c5ded --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfg.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg + { + /// Parameterless constructor + public TestMethodCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public TestMethodCfg(IComponentFactory factory, string name) + : base(factory, name) + { + } + + public IComponentCfg Clone() + { + return new TestMethodCfg(Factory, Name); + } + + public string ToString(int i) + { + return string.Empty; + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + TestMethodCfg config = (TestMethodCfg)(new XmlSerializer(typeof(TestMethodCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..152f606c5 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl)); + + TestMethodCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..a912e3ac8 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + partial class TestMethodCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.resx b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodCfgCtrl.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/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodFactory.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodFactory.cs new file mode 100644 index 000000000..4575b6ac8 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethodFactory.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod +{ + public class TestMethodFactory : IComponentFactory + { + public string ClassName { get { return "Flying-Start-Collection"; } } + public bool HasProcedureParams { get { return false; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; } + + /// Max. number of components of this class in the system + public int MaxCount { get { return 1; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new TestMethodCfg(this, "FlyingStartCollection"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new TestMethodCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new TestMethod((TestMethodCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return TestMethodCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchControl/Transition.cs b/TestBenchFramework/BenchControl/Transition.cs new file mode 100644 index 000000000..62721f6f3 --- /dev/null +++ b/TestBenchFramework/BenchControl/Transition.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace TBF.BenchControl +{ + public class Transition + { + public Event Evnt; + public State NextState; /// if not null, nextState reference is used + public string NextStateLabel; /// otherwise nextStateLabel is used + + /// + /// Constructor using a next state reference + /// + public Transition(Event evnt, State nextState) + { + this.Evnt = evnt; + this.NextState = nextState; + this.NextStateLabel = null; + } + + /// + /// Constructor using a next state label + /// + public Transition(Event evnt, string nextStateLabel) + { + this.Evnt = evnt; + this.NextState = null; + this.NextStateLabel = nextStateLabel; + } + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs b/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs new file mode 100644 index 000000000..daea4f125 --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs @@ -0,0 +1,170 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.WaterMeter +{ + public class ProcParams : IParamsProvider, IProcedureParams + { + public string Producer; + public float Qn; + public string ApprovalInfo; + public string MetrologicalClass; + + string[] paramNames = new string[] + { + Strings.Producer, + Strings.Qn, + Strings.Approval_info, + Strings.Metrological_class, + }; + public string ParamName(int i) { return paramNames[i]; } + + public string ToString(int i) + { + switch (i) + { + case 0: return Producer; + case 1: return Qn.ToString(); + case 2: return ApprovalInfo; + case 3: return MetrologicalClass; + default: return string.Empty; + } + } + + public void UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: Producer = strValue; return; + case 1: Qn = Utils.ParseUFloat(strValue); return; + case 2: ApprovalInfo = strValue; return; + case 3: MetrologicalClass = strValue; return; + default: return; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + float dummy; + switch (i) + { + case 1: + if (Utils.TryParseUFloat(strValue, out dummy)) return true; + break; + case 0: + case 2: + case 3: + return true; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + #region Boilerplate code + + public int ParamsCount() { return paramNames.Length; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ParamsCount(); i++) + { + if (i != 0) sb.Append("; "); + sb.Append(ParamName(i)); + sb.Append("="); + sb.Append(ToString(i)); + } + return sb.ToString(); + } + + [XmlIgnore] + public Entities.ComponentProcedure ProcedureParamsEntity { get { return procParamsEntity; } } + Entities.ComponentProcedure procParamsEntity; + + [XmlIgnore] + public string ComponentName { get { return componentName; } } + string componentName; + + [XmlIgnore] + public Entities.Procedure Test { get { return test; } } + Entities.Procedure test; + + /// Parameterless constructor + public ProcParams() + { + Producer = ""; + Qn = 2.5f; + ApprovalInfo = ""; + MetrologicalClass = "A"; + } + + public ProcParams(Entities.ComponentProcedure procParamsEntity, string componentName, Entities.Procedure test) + : this() + { + this.procParamsEntity = procParamsEntity; + this.componentName = componentName; + this.test = test; + } + + public TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure) + { + using (var writer = new StringWriter()) + { + /// Serialize this class with parameters + (new XmlSerializer(GetType())).Serialize(writer, this); + + /// Create and return the ComponentProcedure entity + TBF.Entities.ComponentProcedure entity = new TBF.Entities.ComponentProcedure(); + entity.CmpntName = component.Cfg.Name; + entity.Parameters = writer.ToString(); + entity.Procedure = procedure; + return entity; + } + } + + public void UpdateDbEntity() + { + using (var writer = new StringWriter()) + { + /// Serialize this class and update the entity + (new XmlSerializer(GetType())).Serialize(writer, this); + procParamsEntity.Parameters = writer.ToString(); + procParamsEntity.CmpntName = componentName; + procParamsEntity.Procedure = test; + + } + } + + public static IParamsProvider GetProcedureParams(Entities.ComponentProcedure procParamsEntity) + { + if (procParamsEntity == null) return new ProcParams(); + + ProcParams procParams; + try + { + procParams = (ProcParams)(new XmlSerializer(typeof(ProcParams))) + .Deserialize(new StringReader(procParamsEntity.Parameters)); + } + catch + { + procParams = new ProcParams(); + } + procParams.procParamsEntity = procParamsEntity; + procParams.componentName = procParamsEntity.CmpntName; + procParams.test = procParamsEntity.Procedure; + return procParams; + } + + #endregion + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeter.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeter.cs new file mode 100644 index 000000000..5835456d9 --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeter.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using TBF.BenchControl; + +namespace TBF.BenchControl.WaterMeter +{ + /// + /// This component = instance of this class is a placeholder for a combined main watermeter + /// + public class WaterMeter : ComponentBase, Generic.IComponent, GenericDevices.IWaterMeter + { + readonly WaterMeterCfg combinedMainCfg; + + public static void ResetStaticProperties() { } + + /// WaterMeter producer + public string Producer + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Producer : ""; } + } + + /// Nominal water flow in [m3/h] + public float Qn + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Qn : 0; } + } + + /// WaterMeter approval information or signature + public string ApprovalInfo + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).ApprovalInfo : ""; } + } + + /// Metrological class + public string MetrologicalClass + { + get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).MetrologicalClass : ""; } + } + + /// Properties set by the Begin and the End form + public string SerialNr + { + get { return serialNr; } + set { serialNr = value; } + } + string serialNr; + + public string State + { + get { return endState; } + set { endState = value; } + } + string endState; + + public string BeginState + { + get { return beginState; } + set { beginState = value; } + } + string beginState; + + public WaterMeter(WaterMeterCfg cfg) + : base(cfg) + { + if (cfg == null) throw new ArgumentNullException("cfg"); + this.combinedMainCfg = cfg; + } + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs new file mode 100644 index 000000000..5b0a43b9b --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs @@ -0,0 +1,66 @@ +using System; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.WaterMeter +{ + public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg + { + public string Producer; /// Hersteller + public float Qn; + public string ApprovalInfo; /// Zulassungszeichen + public string MetrologicalClass; /// Metr. Klasse + + /// Parameterless constructor + public WaterMeterCfg() + { + } + + /// + /// Data entry form configuration parameters + /// + /// Data entry form factory + /// Component name + public WaterMeterCfg(IComponentFactory factory, string name, string producer, + float qn, string approvalInfo, string metrologicalClass) + : base(factory, name) + { + Producer = producer; + Qn = qn; + ApprovalInfo = approvalInfo; + MetrologicalClass = metrologicalClass; + } + + public IComponentCfg Clone() + { + return new WaterMeterCfg(Factory, Name, Producer, + Qn, ApprovalInfo, MetrologicalClass); + } + + public string ToString(int i) + { + return string.Format(Strings.nothing_to_configure); + } + + public TBF.Entities.Component CreateDbEntity() + { + using (var writer = new StringWriter()) + { + (new XmlSerializer(GetType())).Serialize(writer, this); + return Entities.Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString()); + } + } + + public static IComponentCfg CreateFromDbEntity(Entities.Component component, IComponentFactory factory) + { + using (var reader = new StringReader(component.Parameters)) + { + WaterMeterCfg config = (WaterMeterCfg)(new XmlSerializer(typeof(WaterMeterCfg))).Deserialize(reader); + config.InitCfgBaseFromEntity(component, factory); + return config; + } + } + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.cs new file mode 100644 index 000000000..fbc48564f --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.cs @@ -0,0 +1,60 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.WaterMeter +{ + public partial class WaterMeterCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(WaterMeterCfgCtrl)); + + WaterMeterCfg config; + + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as WaterMeterCfg; + Redraw(); + } + } + + public WaterMeterCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + nameLabel.Text = Strings.Name; + Redraw(); + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + CfgVerifyFlags flags = CfgVerifyFlags.None; + return flags; + } + + public void UpdateCfg() + { + if (config == null) return; /// Control was not loaded, settings were not changed + config.Name = nameTextBox.Text; + } + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.designer.cs new file mode 100644 index 000000000..4b556a607 --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.WaterMeter +{ + partial class WaterMeterCfgCtrl + { + /// + /// 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() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(135, 55); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(25, 58); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(132, 31); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(60, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ClassName"; + // + // WaterMeterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "WaterMeterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.resx b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfgCtrl.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/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs new file mode 100644 index 000000000..bffb95501 --- /dev/null +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.WaterMeter +{ + public class WaterMeterFactory : IComponentFactory + { + public string ClassName { get { return "WaterMeter"; } } + public bool HasProcedureParams { get { return true; } } + public bool HasTestParams { get { return false; } } + public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; } + public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) + { + return ProcParams.GetProcedureParams(procedureParams); + } + + /// Max. number of components of this class in the system + public int MaxCount { get { return int.MaxValue; } } + + + public IComponentCfg DefaultConfig(IList components) + { + return new WaterMeterCfg(this, "WaterMeter", "", 2.5f, "", "A"); + } + + public IComponentCfgCtrl CreateCfgCtrl() + { + return new WaterMeterCfgCtrl(); + } + + public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList components) + { + return new WaterMeter((WaterMeterCfg)config); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return WaterMeterCfg.CreateFromDbEntity(component, this); + } + + public void ResetStaticProperties() { WaterMeter.ResetStaticProperties(); } + } +} diff --git a/TestBenchFramework/BenchesDlg.Designer.cs b/TestBenchFramework/BenchesDlg.Designer.cs new file mode 100644 index 000000000..145f5d053 --- /dev/null +++ b/TestBenchFramework/BenchesDlg.Designer.cs @@ -0,0 +1,137 @@ +namespace TBF +{ + partial class BenchesDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BenchesDlg)); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.testBenchesListBox = new System.Windows.Forms.ListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.editButton = new System.Windows.Forms.Button(); + this.addButton = new System.Windows.Forms.Button(); + this.removeButton = new System.Windows.Forms.Button(); + this.copyButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // okButton + // + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.ImageKey = global::TBF.Resources.Strings.String1; + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1; + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // testBenchesListBox + // + resources.ApplyResources(this.testBenchesListBox, "testBenchesListBox"); + this.testBenchesListBox.FormattingEnabled = true; + this.testBenchesListBox.Name = "testBenchesListBox"; + this.testBenchesListBox.DoubleClick += new System.EventHandler(this.testBenchesListBox_DoubleClick); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ImageKey = global::TBF.Resources.Strings.String1; + this.label1.Name = "label1"; + // + // editButton + // + resources.ApplyResources(this.editButton, "editButton"); + this.editButton.ImageKey = global::TBF.Resources.Strings.String1; + this.editButton.Name = "editButton"; + this.editButton.UseVisualStyleBackColor = true; + this.editButton.Click += new System.EventHandler(this.editButton_Click); + // + // addButton + // + resources.ApplyResources(this.addButton, "addButton"); + this.addButton.ImageKey = global::TBF.Resources.Strings.String1; + this.addButton.Name = "addButton"; + this.addButton.UseVisualStyleBackColor = true; + this.addButton.Click += new System.EventHandler(this.addButton_Click); + // + // removeButton + // + resources.ApplyResources(this.removeButton, "removeButton"); + this.removeButton.ImageKey = global::TBF.Resources.Strings.String1; + this.removeButton.Name = "removeButton"; + this.removeButton.UseVisualStyleBackColor = true; + this.removeButton.Click += new System.EventHandler(this.removeButton_Click); + // + // copyButton + // + resources.ApplyResources(this.copyButton, "copyButton"); + this.copyButton.ImageKey = global::TBF.Resources.Strings.String1; + this.copyButton.Name = "copyButton"; + this.copyButton.UseVisualStyleBackColor = true; + this.copyButton.Click += new System.EventHandler(this.copyButton_Click); + // + // BenchesDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.copyButton); + this.Controls.Add(this.removeButton); + this.Controls.Add(this.addButton); + this.Controls.Add(this.editButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.testBenchesListBox); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "BenchesDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.ListBox testBenchesListBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button editButton; + private System.Windows.Forms.Button addButton; + private System.Windows.Forms.Button removeButton; + private System.Windows.Forms.Button copyButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchesDlg.cs b/TestBenchFramework/BenchesDlg.cs new file mode 100644 index 000000000..7bf6f1269 --- /dev/null +++ b/TestBenchFramework/BenchesDlg.cs @@ -0,0 +1,199 @@ +using System; +using System.Windows.Forms; + +namespace TBF +{ + /// + /// Dialog to edit local settings that specify database parameters (S1.2) + /// + public partial class BenchesDlg : Form + { + // Local copy of 'local settings' initialized to Program.localSettings. + // Dialog modifies this copy and updates Program.localSettings just + // when 'OK' is pressed. + LocalSettings localSettings; + + /// + /// Constructor, initializes the dialog + /// + public BenchesDlg() + { + localSettings = new LocalSettings(); + localSettings.Assign(Program.LocalSettings); + + InitializeComponent(); + RedrawTestBenchesListBox(); + } + + void RedrawTestBenchesListBox() + { + testBenchesListBox.Items.Clear(); + if (localSettings.testBenches != null) + { + int nrBenches = localSettings.testBenches.GetLength(0); + for (int i = 0; i < nrBenches; i++) + { + testBenchesListBox.Items.Add(localSettings.testBenches[i].BenchName); + } + } + } + + /// + /// Create a new test bench DB specification and append it to the list + /// + /// Not used + /// Not used + private void addButton_Click(object sender, EventArgs e) + { + DatabaseSettings bench = new DatabaseSettings(); + DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench); + DialogResult dr = dlg.ShowDialog(); + if (dr == DialogResult.OK) + { + int nrBenches = + (localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0); + + if (nrBenches == 0) + { + localSettings.testBenches = new DatabaseSettings[1]; + localSettings.testBenches[0] = bench; + } + else + { + DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1]; + for (int i = 0; i < nrBenches; i++) + { + newTestBenches[i] = localSettings.testBenches[i]; + } + newTestBenches[nrBenches] = bench; + localSettings.testBenches = newTestBenches; + } + + testBenchesListBox.Items.Add(bench.BenchName); + } + } + + /// + /// Create a new test bench DB specification,which is a copy of the + /// selected bench, and append it to the list + /// + /// Not used + /// Not used + private void copyButton_Click(object sender, EventArgs e) + { + if (testBenchesListBox.SelectedIndex >= 0) + { + DatabaseSettings ori = localSettings.testBenches[testBenchesListBox.SelectedIndex]; + DatabaseSettings bench = (DatabaseSettings)ori.Clone(); + + DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench); + DialogResult dr = dlg.ShowDialog(); + if (dr == DialogResult.OK) + { + int nrBenches = + (localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0); + + DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1]; + for (int i = 0; i < nrBenches; i++) + { + newTestBenches[i] = localSettings.testBenches[i]; + } + newTestBenches[nrBenches] = bench; + localSettings.testBenches = newTestBenches; + + testBenchesListBox.Items.Add(bench.BenchName); + } + } + } + + /// + /// Edit selected test bench DB specification + /// + /// Not used + /// Not used + private void editButton_Click(object sender, EventArgs e) + { + if (testBenchesListBox.SelectedIndex >= 0) + { + DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(localSettings.testBenches[testBenchesListBox.SelectedIndex]); + DialogResult dr = dlg.ShowDialog(); + if (dr == DialogResult.OK) + { + // Update the item name + testBenchesListBox.Items[testBenchesListBox.SelectedIndex] = + localSettings.testBenches[testBenchesListBox.SelectedIndex].BenchName; + } + } + } + + /// + /// Remove selected test bench DB specification from the list + /// + /// Not used + /// Not used + private void removeButton_Click(object sender, EventArgs e) + { + int selectedIx = testBenchesListBox.SelectedIndex; + if (selectedIx >= 0) + { + int nrBenches = + (localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0); + + if (nrBenches == 1) + { + localSettings.testBenches = null; + } + else + { + DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches - 1]; + for (int i = 0; i < selectedIx; i++) + { + newTestBenches[i] = localSettings.testBenches[i]; + } + for (int i = selectedIx + 1; i < nrBenches; i++) + { + newTestBenches[i - 1] = localSettings.testBenches[i]; + } + localSettings.testBenches = newTestBenches; + } + + RedrawTestBenchesListBox(); + } + } + + /// + /// Update setting, return 'OK' + /// + /// Not used + /// Not used + private void okButton_Click(object sender, EventArgs e) + { + Program.LocalSettings.Assign(localSettings); // Update Program.localSettings + DialogResult = DialogResult.OK; + Close(); + return; + } + + /// + /// Throw away changes, return 'Cancel' + /// + /// Not used + /// Not used + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + + /// + /// Double click on an item = edit item + /// + /// Not used + /// Not used + private void testBenchesListBox_DoubleClick(object sender, EventArgs e) + { + editButton_Click(sender, e); + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchesDlg.de.resx b/TestBenchFramework/BenchesDlg.de.resx new file mode 100644 index 000000000..da230a148 --- /dev/null +++ b/TestBenchFramework/BenchesDlg.de.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + &OK + + + &Abbrechen + + + + 58, 13 + + + Prüfstände + + + &Bearbeiten... + + + &Neu... + + + &Löschen + + + &Kopieren + + + Datenbank Einstellungen + + \ No newline at end of file diff --git a/TestBenchFramework/BenchesDlg.resx b/TestBenchFramework/BenchesDlg.resx new file mode 100644 index 000000000..139fa0b04 --- /dev/null +++ b/TestBenchFramework/BenchesDlg.resx @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 13 + + + + 192, 105 + + + $this + + + 105, 28 + + + 192, 37 + + + 164, 134 + + + &Add + + + 1 + + + 15 + + + $this + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + BenchesDlg + + + 5 + + + label1 + + + &Remove + + + 344, 71 + + + $this + + + Cancel + + + testBenchesListBox + + + 192, 71 + + + okButton + + + $this + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 105, 28 + + + 0 + + + 14 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 79, 13 + + + 105, 28 + + + $this + + + 459, 185 + + + 11 + + + 6, 13 + + + 105, 28 + + + &Edit + + + addButton + + + + CenterParent + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 192, 139 + + + 7 + + + 344, 37 + + + 105, 28 + + + 17 + + + removeButton + + + &Copy + + + 12, 37 + + + 4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + $this + + + copyButton + + + 105, 28 + + + True + + + 3 + + + editButton + + + cancelButton + + + 12, 15 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + OK + + + Database Settings + + + $this + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 12 + + + 16 + + + Test Benches : + + + True + + + de + + \ No newline at end of file diff --git a/TestBenchFramework/ComponentParametersDlg.Designer.cs b/TestBenchFramework/ComponentParametersDlg.Designer.cs new file mode 100644 index 000000000..e161715ed --- /dev/null +++ b/TestBenchFramework/ComponentParametersDlg.Designer.cs @@ -0,0 +1,86 @@ +namespace TBF +{ + partial class ComponentParametersDlg + { + /// + /// 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 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.splitContainer = new System.Windows.Forms.SplitContainer(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.sharedButtons); + this.splitContainer.Size = new System.Drawing.Size(459, 254); + this.splitContainer.SplitterDistance = 355; + this.splitContainer.TabIndex = 1; + // + // sharedButtons + // + this.sharedButtons.Location = new System.Drawing.Point(0, 0); + this.sharedButtons.Name = "sharedButtons"; + this.sharedButtons.Size = new System.Drawing.Size(100, 521); + this.sharedButtons.TabIndex = 0; + // + // ComponentConfigForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(459, 254); + this.Controls.Add(this.splitContainer); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.HelpButton = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ComponentConfigForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Properties"; + this.Load += new System.EventHandler(this.ComponentCfgForm_Load); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private UiControls.SharedButtons sharedButtons; + } +} \ No newline at end of file diff --git a/TestBenchFramework/ComponentParametersDlg.cs b/TestBenchFramework/ComponentParametersDlg.cs new file mode 100644 index 000000000..f8513c720 --- /dev/null +++ b/TestBenchFramework/ComponentParametersDlg.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using TBF.BenchControl; +using TBF.BenchControl.Generic; +using TBF.UiControls; +using TBF.Resources; + +namespace TBF +{ + public partial class ComponentParametersDlg : Form + { + public IComponentCfgCtrl ComponentCfgCtrl; + + public IComponentCfg Config + { + get + { + if (ComponentCfgCtrl == null) return null; + return ComponentCfgCtrl.Config; + } + } + + /// + /// List of components (=component configuration instances) + /// + public IList TbfComponents; + + public ComponentParametersDlg() + { + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.None; + sharedButtons.Unlocked += Unlock; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + } + + private void ComponentCfgForm_Load(object sender, EventArgs e) + { + Text = Strings.Properties; + + if (ComponentCfgCtrl != null) + { + splitContainer.Panel1.Controls.Add((UserControl)ComponentCfgCtrl); + } + } + + private void Unlock(object sender, EventArgs e) + { + ComponentCfgCtrl.Unlock(); + } + + public CfgVerifyFlags VerifyCfg(ref string message) + { + if (ComponentCfgCtrl == null) return CfgVerifyFlags.None; /// Nothing to verify -> OK + return ComponentCfgCtrl.VerifyCfg(ref message); + } + + private void okButton_Click(object sender, EventArgs e) + { + string message = string.Empty; + CfgVerifyFlags flags = VerifyCfg(ref message); + if ((flags & CfgVerifyFlags.Error) == CfgVerifyFlags.Error) + { + MessageBox.Show(Strings.Please_change_the_following_settings + message, + Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (ComponentCfgCtrl != null) ComponentCfgCtrl.UpdateCfg(); + + DialogResult = DialogResult.OK; + Close(); + return; + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + } +} diff --git a/TestBenchFramework/ComponentParametersDlg.de.resx b/TestBenchFramework/ComponentParametersDlg.de.resx new file mode 100644 index 000000000..b344df0f9 --- /dev/null +++ b/TestBenchFramework/ComponentParametersDlg.de.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 357, 243 + + + &OK + + + &Abbrechen + + \ No newline at end of file diff --git a/TestBenchFramework/ComponentParametersDlg.resx b/TestBenchFramework/ComponentParametersDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/ComponentParametersDlg.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/TestBenchFramework/ComponentsManagerDlg.Designer.cs b/TestBenchFramework/ComponentsManagerDlg.Designer.cs new file mode 100644 index 000000000..e89dede25 --- /dev/null +++ b/TestBenchFramework/ComponentsManagerDlg.Designer.cs @@ -0,0 +1,95 @@ +namespace TBF +{ + partial class ComponentsManagerDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ComponentsManagerDlg)); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + resources.ApplyResources(this.splitContainer, "splitContainer"); + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.Controls.Add(this.listViewEx); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.sharedButtons); + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + resources.ApplyResources(this.listViewEx, "listViewEx"); + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewEx.Name = "listViewEx"; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.componentsListView_SelectedIndexChanged); + this.listViewEx.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listViewEx_MouseDoubleClick); + // + // sharedButtons + // + resources.ApplyResources(this.sharedButtons, "sharedButtons"); + this.sharedButtons.Name = "sharedButtons"; + // + // ComponentsManagerDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer); + this.Name = "ComponentsManagerDlg"; + this.Load += new System.EventHandler(this.ComponentsManagerDlg_Load); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private TBF.UiControls.ListViewEx listViewEx; + private System.Windows.Forms.SplitContainer splitContainer; + private UiControls.SharedButtons sharedButtons; + } +} \ No newline at end of file diff --git a/TestBenchFramework/ComponentsManagerDlg.cs b/TestBenchFramework/ComponentsManagerDlg.cs new file mode 100644 index 000000000..fb03011c6 --- /dev/null +++ b/TestBenchFramework/ComponentsManagerDlg.cs @@ -0,0 +1,313 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using log4net; + +using TBF.BenchControl; +using TBF.BenchControl.Generic; +using TBF.Entities; +using TBF.Resources; +using TBF.UiControls; + +namespace TBF +{ + public partial class ComponentsManagerDlg : Form, IParentOfListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(ComponentsManagerDlg)); + + /// + /// List of components (=component configuration instances) + /// + IList cmpntEntities; + + IList toBeDeletedEntities; + + NHibernate.ISession session; + + SelectComponentClassDlg selectComponentTypeDlg; /// Constructed once, the selection is kept between dialog usages + + /// + /// ListViewEx columns + /// + enum Column + { + Name, + ClassName, + ParentName, + DebugMode, + Logging, + Parameters, + ColumnsCount, + } + readonly int columnsCount = (int)Column.ColumnsCount; + + /// Editors used by listViewEx + ComboBox debugCB; + ComboBox logCB; + + bool unlocked; + + public ComponentsManagerDlg() + { + toBeDeletedEntities = new List(); + + InitializeComponent(); + + selectComponentTypeDlg = new SelectComponentClassDlg(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | + SharedButtons.Buttons.Remove | + //SharedButtons.Buttons.Up | + //SharedButtons.Buttons.Down | + SharedButtons.Buttons.Edit; + sharedButtons.Unlocked += Unlocked; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + //sharedButtons.UpClicked += upButton_Click; + //sharedButtons.DownClicked += downButton_Click; + sharedButtons.EditClicked += editButton_Click; + } + + private void ComponentsManagerDlg_Load(object sender, EventArgs e) + { + Text = Strings.Test_Bench_Components_Configuration; + listViewEx.Columns.Add(Strings.Name, 80); + listViewEx.Columns.Add(Strings.Type, 120); + listViewEx.Columns.Add(Strings.Parent, 55); + listViewEx.Columns.Add(Strings.Mode, 55); + listViewEx.Columns.Add(Strings.Logging, 55); + listViewEx.Columns.Add(Strings.Parameters, 600); + + debugCB = new ComboBox(); + for (DebugMode level = 0; level < DebugMode.Count; level++) debugCB.Items.Add(level.ToString()); + splitContainer.Panel1.Controls.Add(debugCB); + + logCB = new ComboBox(); + for (LogLevel level = 0; level < LogLevel.Count; level++) logCB.Items.Add(level.ToString()); + splitContainer.Panel1.Controls.Add(logCB); + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + sharedButtons.DisableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit); + + session = FluentCommon.CreateSession(Database.Bench); + cmpntEntities = session + .CreateQuery("FROM Component ORDER BY ItemNr") + .List(); + + RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (unlocked && e.SubItem == (int)Column.DebugMode) + { + listViewEx.StartEditing(debugCB, e.Item, e.SubItem); + } + else if (unlocked && e.SubItem == (int)Column.Logging) + { + listViewEx.StartEditing(logCB, e.Item, e.SubItem); + } + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + Entities.Component cmpnt = (Entities.Component)e.Item.Tag; + + if (e.SubItem == (int)Column.DebugMode) + { + for (DebugMode level = 0; level < DebugMode.Count; level++) + { + if (debugCB.Text.Equals(level.ToString())) + { + cmpnt.Mode = level; + return; + } + } + e.DisplayText = cmpnt.Mode.ToString(); + } + else if (e.SubItem == (int)Column.Logging) + { + for (LogLevel level = 0; level < LogLevel.Count; level++) + { + if (logCB.Text.Equals(level.ToString())) + { + cmpnt.Logging = level; + return; + } + } + e.DisplayText = cmpnt.Logging.ToString(); + } + } + + private void Unlocked(object sender, EventArgs e) + { + unlocked = true; + } + + void RedrawAll() + { + listViewEx.Items.Clear(); + foreach (var cmpnt in cmpntEntities) DrawOne(cmpnt); + } + + void DrawOne(Entities.Component cmpnt) + { + IComponentCfg cmpCfg = TbfComponents.CmpntCfgFromCmpntEntity(cmpnt); + + ListViewItem lvi = new ListViewItem(cmpCfg.Name); + lvi.SubItems.Add(cmpCfg.Factory.ClassName); + lvi.SubItems.Add(cmpCfg.ParentName); + lvi.SubItems.Add(cmpCfg.DebugLevel.ToString()); + lvi.SubItems.Add(cmpCfg.LogLevel.ToString()); + lvi.SubItems.Add(cmpCfg.ToString(1)); + + lvi.Tag = cmpnt; + + listViewEx.Items.Add(lvi); + } + + /// OK + private void okButton_Click(object sender, EventArgs e) + { + foreach (var cmpnt in toBeDeletedEntities) + { + FluentCommon.DeleteFromDb(session, cmpnt); + } + foreach (var cmpnt in cmpntEntities) + { + FluentCommon.SaveToDb(session, cmpnt); + } + + DialogResult = DialogResult.OK; + Close(); + return; + } + + /// Cancel + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + + /// Add a new component + private void addButton_Click(object sender, EventArgs e) + { + DialogResult dr = selectComponentTypeDlg.ShowDialog(); + if (dr != DialogResult.OK) return; + + IComponentFactory factory = selectComponentTypeDlg.SlctdCmpntFactory; + IComponentCfgCtrl cfgControl = factory.CreateCfgCtrl(); + cfgControl.Config = factory.DefaultConfig(cmpntEntities); + cfgControl.Config.ItemNr = listViewEx.Items.Count; + + ComponentParametersDlg cfgForm = new ComponentParametersDlg(); + cfgForm.TbfComponents = cmpntEntities; + cfgForm.ComponentCfgCtrl = cfgControl; + dr = cfgForm.ShowDialog(); + if (dr != DialogResult.OK) return; + + AddOne(cfgForm.Config.CreateDbEntity()); + } + + void AddOne(Entities.Component cmpnt) + { + cmpntEntities.Add(cmpnt); + DrawOne(cmpnt); + } + + /// Delete the component + private void removeButton_Click(object sender, EventArgs e) + { + if (listViewEx.SelectedIndices.Count != 1) return; + int ix = listViewEx.SelectedIndices[0]; + if (ix < 0) return; + + Entities.Component selectedCmpnt = (Entities.Component)listViewEx.Items[ix].Tag; + if (selectedCmpnt.Id != 0) toBeDeletedEntities.Add(selectedCmpnt); + listViewEx.Items.RemoveAt(ix); + RedrawAll(); + } + + /// DoubleClick -> Edit the component + private void listViewEx_MouseDoubleClick(object sender, MouseEventArgs e) + { + editButton_Click(sender, e); + } + + /// Edit the component + private void editButton_Click(object sender, EventArgs e) + { + if (listViewEx.SelectedIndices.Count != 1) return; + ListViewItem lvi = listViewEx.SelectedItems[0]; + + ComponentParametersDlg cfgForm = new ComponentParametersDlg(); + cfgForm.TbfComponents = cmpntEntities; + cfgForm.ComponentCfgCtrl = TbfComponents.CmpntFactoryFromClassName(((Entities.Component)lvi.Tag).ClassName).CreateCfgCtrl(); + cfgForm.ComponentCfgCtrl.Config = TbfComponents.CmpntCfgFromCmpntEntity((Entities.Component)lvi.Tag); + DialogResult dr = cfgForm.ShowDialog(); + if (dr != DialogResult.OK) return; + + sharedButtons.UnlockButtons(); /// Unlock this dialog buttons as changes were enabled + unlocked = true; /// in the ComponentParametersDlg. + + Entities.Component modified = cfgForm.Config.CreateDbEntity(); + Entities.Component original = (Entities.Component)lvi.Tag; + + original.Name = modified.Name; + original.ClassName = modified.ClassName; + original.ParentName = modified.ParentName; + original.Mode = modified.Mode; + original.Logging = modified.Logging; + original.Parameters = modified.Parameters; + + RedrawAll(); + } + + private void componentsListView_SelectedIndexChanged(object sender, EventArgs e) + { + if (listViewEx.SelectedIndices.Count == 1) + { + sharedButtons.EnableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit); + } + else + { + sharedButtons.DisableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit); + } + } + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.First) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.Last) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up); + sharedButtons.DisableButtons(SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + } +} diff --git a/TestBenchFramework/ComponentsManagerDlg.resx b/TestBenchFramework/ComponentsManagerDlg.resx new file mode 100644 index 000000000..982aa26ca --- /dev/null +++ b/TestBenchFramework/ComponentsManagerDlg.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Fill + + + + True + + + + 0, 0 + + + Fill + + + 0, 0 + + + 520, 346 + + + 7 + + + listViewEx + + + TBF.UiControls.ListViewEx, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel1 + + + 0 + + + splitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 0 + + + 1, 0 + + + 100, 521 + + + 0 + + + sharedButtons + + + TBF.UiControls.SharedButtons, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 0 + + + splitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 1 + + + 625, 346 + + + 520 + + + 8 + + + splitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 625, 346 + + + CenterParent + + + Test Bench Components Configuration + + + ComponentsManagerDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/CustomStyle.cs b/TestBenchFramework/CustomStyle.cs new file mode 100644 index 000000000..d98c9e806 --- /dev/null +++ b/TestBenchFramework/CustomStyle.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TBF +{ + /// + /// This static class maintains a set of text box styles at one place, it is then sufficient + /// to use the static method CustomStyle.Apply(id, textBox(es)) to apply this style to text box(es). + /// + public static class CustomStyle + { + const int setsCount = 20; /// Number of styles / attribute sets + + static DockStyle[] dockStyles; /// Docking style + static System.Drawing.Color[] backColors; /// Background color + static BorderStyle[] borderStyles; /// Border style + static bool[] readOnly; /// Read only + static System.Drawing.Font[] fonts; /// Font + + static CustomStyle() + { + dockStyles = new DockStyle[setsCount]; + backColors = new System.Drawing.Color[setsCount]; + borderStyles = new BorderStyle[setsCount]; + readOnly = new bool[setsCount]; + fonts = new System.Drawing.Font[setsCount]; + } + + /// + /// Set attributes of the set selected by 'set' parameter + /// + /// Attribute set ID + /// Docking style + /// Background color + /// true for read only (aka label) + /// Border style + public static void Set(int id, DockStyle dockStyle, System.Drawing.Color backColor, BorderStyle borderStyle, bool readOnly, System.Drawing.Font font) + { + if (id < 0 || id >= setsCount) return; + + CustomStyle.dockStyles[id] = dockStyle; + CustomStyle.backColors[id] = backColor; + CustomStyle.borderStyles[id] = borderStyle; + CustomStyle.readOnly[id] = readOnly; + CustomStyle.fonts[id] = font; + } + + /// + /// Apply one of the attribute sets to a TextBox instance + /// + public static void Apply(int id, TextBox textBox) + { + if (id < 0 || id >= setsCount) return; + + textBox.Dock = dockStyles[id]; + textBox.BackColor = backColors[id]; + textBox.BorderStyle = borderStyles[id]; + textBox.ReadOnly = readOnly[id]; + textBox.Font = fonts[id]; + } + + /// + /// Apply one of the attribute sets to a AttachedTextBoxes text boxes + /// + public static void Apply(int id, AttachedTextBoxes textBoxes) + { + if (id < 0 || id >= setsCount) return; + + for (int i = 0; i < textBoxes.Count; i++) + { + textBoxes[i].Dock = dockStyles[id]; + textBoxes[i].BackColor = backColors[id]; + textBoxes[i].BorderStyle = borderStyles[id]; + textBoxes[i].ReadOnly = readOnly[id]; + textBoxes[i].Font = fonts[id]; + } + } + } +} diff --git a/TestBenchFramework/DBSettings.cs b/TestBenchFramework/DBSettings.cs new file mode 100644 index 000000000..778499528 --- /dev/null +++ b/TestBenchFramework/DBSettings.cs @@ -0,0 +1,28 @@ +using System; + +namespace TBF +{ + /// + /// Database settings required to make a connection + /// + public class DBSettings : ICloneable + { + public DBType DbType; + public string ConnectionString; + + public DBSettings() + { + } + + public DBSettings(DBType dbType, string connectionString) + { + this.DbType = dbType; + this.ConnectionString = connectionString; + } + + public object Clone() + { + return new DBSettings(DbType, ConnectionString); + } + } +} diff --git a/TestBenchFramework/DatabaseSettings.cs b/TestBenchFramework/DatabaseSettings.cs new file mode 100644 index 000000000..f58c7de0e --- /dev/null +++ b/TestBenchFramework/DatabaseSettings.cs @@ -0,0 +1,48 @@ +using System; +using System.Text; +using System.Xml.Serialization; + +namespace TBF +{ + /// + /// Test bench database settings, contains bench name and settings od several databases + /// + public class DatabaseSettings : ICloneable + { + // Public fields + public string BenchName; + public bool IsRealBench; + public DBSettings UsersDBSettings; + public DBSettings BenchDBSettings; + public DBSettings ProceduresDBSettings; + public DBSettings WMTypesDBSettings; + public DBSettings WaterMetersDBSettings; + + // Constructor + public DatabaseSettings() + { + BenchName = String.Empty; /// Empty string to avoid null + IsRealBench = false; + UsersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_users; UID=root; PASSWORD=;"); + BenchDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_bench; UID=root; PASSWORD=;"); + ProceduresDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;"); + WMTypesDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_wmtypes; UID=root; PASSWORD=;"); + WaterMetersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;"); + } + + public object Clone() + { + DatabaseSettings result = new DatabaseSettings(); + + result.BenchName = BenchName; + result.IsRealBench = IsRealBench; + result.UsersDBSettings = (DBSettings)UsersDBSettings.Clone(); + result.BenchDBSettings = (DBSettings)BenchDBSettings.Clone(); + result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone(); + result.WMTypesDBSettings = (DBSettings)WMTypesDBSettings.Clone(); + result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone(); + + return result; + } + } +} diff --git a/TestBenchFramework/DatabaseSettingsDlg.Designer.cs b/TestBenchFramework/DatabaseSettingsDlg.Designer.cs new file mode 100644 index 000000000..e9ed65d9b --- /dev/null +++ b/TestBenchFramework/DatabaseSettingsDlg.Designer.cs @@ -0,0 +1,370 @@ +namespace TBF +{ + partial class DatabaseSettingsDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseSettingsDlg)); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.benchNameTextBox = new System.Windows.Forms.TextBox(); + this.usersConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.connectionStringLabel = new System.Windows.Forms.Label(); + this.benchConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.proceduresConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.wmTypesConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.watermetersConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.testConnUsersBtn = new System.Windows.Forms.Button(); + this.createUsersDbBtn = new System.Windows.Forms.Button(); + this.realBenchCheckBox = new System.Windows.Forms.CheckBox(); + this.dbTypeLabel = new System.Windows.Forms.Label(); + this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.benchDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.proceduresDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.wmTypesDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.watermetersDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.testConnBenchBtn = new System.Windows.Forms.Button(); + this.testConnProceduresBtn = new System.Windows.Forms.Button(); + this.testConnWMTypesBtn = new System.Windows.Forms.Button(); + this.testConnWaterMetersBtn = new System.Windows.Forms.Button(); + this.createBenchDbBtn = new System.Windows.Forms.Button(); + this.createProceduresDbBtn = new System.Windows.Forms.Button(); + this.createWMTypesDbBtn = new System.Windows.Forms.Button(); + this.createWaterMetersDbBtn = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ImageKey = global::TBF.Resources.Strings.String1; + this.label1.Name = "label1"; + // + // benchNameTextBox + // + resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox"); + this.benchNameTextBox.Name = "benchNameTextBox"; + // + // usersConnectionStringTextBox + // + resources.ApplyResources(this.usersConnectionStringTextBox, "usersConnectionStringTextBox"); + this.usersConnectionStringTextBox.Name = "usersConnectionStringTextBox"; + // + // connectionStringLabel + // + resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel"); + this.connectionStringLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.connectionStringLabel.Name = "connectionStringLabel"; + // + // benchConnectionStringTextBox + // + resources.ApplyResources(this.benchConnectionStringTextBox, "benchConnectionStringTextBox"); + this.benchConnectionStringTextBox.Name = "benchConnectionStringTextBox"; + // + // proceduresConnectionStringTextBox + // + resources.ApplyResources(this.proceduresConnectionStringTextBox, "proceduresConnectionStringTextBox"); + this.proceduresConnectionStringTextBox.Name = "proceduresConnectionStringTextBox"; + // + // wmTypesConnectionStringTextBox + // + resources.ApplyResources(this.wmTypesConnectionStringTextBox, "wmTypesConnectionStringTextBox"); + this.wmTypesConnectionStringTextBox.Name = "wmTypesConnectionStringTextBox"; + // + // watermetersConnectionStringTextBox + // + resources.ApplyResources(this.watermetersConnectionStringTextBox, "watermetersConnectionStringTextBox"); + this.watermetersConnectionStringTextBox.Name = "watermetersConnectionStringTextBox"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.ImageKey = global::TBF.Resources.Strings.String1; + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.ImageKey = global::TBF.Resources.Strings.String1; + this.label3.Name = "label3"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.ImageKey = global::TBF.Resources.Strings.String1; + this.label4.Name = "label4"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.ImageKey = global::TBF.Resources.Strings.String1; + this.label5.Name = "label5"; + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.ImageKey = global::TBF.Resources.Strings.String1; + this.label6.Name = "label6"; + // + // testConnUsersBtn + // + this.testConnUsersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.testConnUsersBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.testConnUsersBtn, "testConnUsersBtn"); + this.testConnUsersBtn.Name = "testConnUsersBtn"; + this.testConnUsersBtn.UseVisualStyleBackColor = true; + this.testConnUsersBtn.Click += new System.EventHandler(this.testConnUsersBtn_Click); + // + // createUsersDbBtn + // + this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.createUsersDbBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn"); + this.createUsersDbBtn.Name = "createUsersDbBtn"; + this.createUsersDbBtn.UseVisualStyleBackColor = true; + this.createUsersDbBtn.Click += new System.EventHandler(this.createDatabasesButton_Click); + // + // realBenchCheckBox + // + resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox"); + this.realBenchCheckBox.ImageKey = global::TBF.Resources.Strings.String1; + this.realBenchCheckBox.Name = "realBenchCheckBox"; + this.realBenchCheckBox.UseVisualStyleBackColor = true; + // + // dbTypeLabel + // + resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel"); + this.dbTypeLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.dbTypeLabel.Name = "dbTypeLabel"; + // + // usersDbTypeComboBox + // + this.usersDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox"); + this.usersDbTypeComboBox.Name = "usersDbTypeComboBox"; + // + // benchDbTypeComboBox + // + this.benchDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.benchDbTypeComboBox, "benchDbTypeComboBox"); + this.benchDbTypeComboBox.Name = "benchDbTypeComboBox"; + // + // proceduresDbTypeComboBox + // + this.proceduresDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.proceduresDbTypeComboBox, "proceduresDbTypeComboBox"); + this.proceduresDbTypeComboBox.Name = "proceduresDbTypeComboBox"; + // + // wmTypesDbTypeComboBox + // + this.wmTypesDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.wmTypesDbTypeComboBox, "wmTypesDbTypeComboBox"); + this.wmTypesDbTypeComboBox.Name = "wmTypesDbTypeComboBox"; + // + // watermetersDbTypeComboBox + // + this.watermetersDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.watermetersDbTypeComboBox, "watermetersDbTypeComboBox"); + this.watermetersDbTypeComboBox.Name = "watermetersDbTypeComboBox"; + // + // testConnBenchBtn + // + this.testConnBenchBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.testConnBenchBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.testConnBenchBtn, "testConnBenchBtn"); + this.testConnBenchBtn.Name = "testConnBenchBtn"; + this.testConnBenchBtn.UseVisualStyleBackColor = true; + this.testConnBenchBtn.Click += new System.EventHandler(this.testConnBenchBtn_Click); + // + // testConnProceduresBtn + // + this.testConnProceduresBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.testConnProceduresBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.testConnProceduresBtn, "testConnProceduresBtn"); + this.testConnProceduresBtn.Name = "testConnProceduresBtn"; + this.testConnProceduresBtn.UseVisualStyleBackColor = true; + this.testConnProceduresBtn.Click += new System.EventHandler(this.testConnProceduresBtn_Click); + // + // testConnWMTypesBtn + // + this.testConnWMTypesBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.testConnWMTypesBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.testConnWMTypesBtn, "testConnWMTypesBtn"); + this.testConnWMTypesBtn.Name = "testConnWMTypesBtn"; + this.testConnWMTypesBtn.UseVisualStyleBackColor = true; + this.testConnWMTypesBtn.Click += new System.EventHandler(this.testConnWMTypesBtn_Click); + // + // testConnWaterMetersBtn + // + this.testConnWaterMetersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.testConnWaterMetersBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.testConnWaterMetersBtn, "testConnWaterMetersBtn"); + this.testConnWaterMetersBtn.Name = "testConnWaterMetersBtn"; + this.testConnWaterMetersBtn.UseVisualStyleBackColor = true; + this.testConnWaterMetersBtn.Click += new System.EventHandler(this.testConnWaterMetersBtn_Click); + // + // createBenchDbBtn + // + this.createBenchDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.createBenchDbBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.createBenchDbBtn, "createBenchDbBtn"); + this.createBenchDbBtn.Name = "createBenchDbBtn"; + this.createBenchDbBtn.UseVisualStyleBackColor = true; + this.createBenchDbBtn.Click += new System.EventHandler(this.createbenchDbBtn_Click); + // + // createProceduresDbBtn + // + this.createProceduresDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.createProceduresDbBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.createProceduresDbBtn, "createProceduresDbBtn"); + this.createProceduresDbBtn.Name = "createProceduresDbBtn"; + this.createProceduresDbBtn.UseVisualStyleBackColor = true; + this.createProceduresDbBtn.Click += new System.EventHandler(this.createProecduresDbBtn_Click); + // + // createWMTypesDbBtn + // + this.createWMTypesDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.createWMTypesDbBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.createWMTypesDbBtn, "createWMTypesDbBtn"); + this.createWMTypesDbBtn.Name = "createWMTypesDbBtn"; + this.createWMTypesDbBtn.UseVisualStyleBackColor = true; + this.createWMTypesDbBtn.Click += new System.EventHandler(this.createWMTypesDbBtn_Click); + // + // createWaterMetersDbBtn + // + this.createWaterMetersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.createWaterMetersDbBtn.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.createWaterMetersDbBtn, "createWaterMetersDbBtn"); + this.createWaterMetersDbBtn.Name = "createWaterMetersDbBtn"; + this.createWaterMetersDbBtn.UseVisualStyleBackColor = true; + this.createWaterMetersDbBtn.Click += new System.EventHandler(this.createWaterMetersDbBtn_Click); + // + // DatabaseSettingsDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.createWaterMetersDbBtn); + this.Controls.Add(this.createWMTypesDbBtn); + this.Controls.Add(this.createProceduresDbBtn); + this.Controls.Add(this.createBenchDbBtn); + this.Controls.Add(this.testConnWaterMetersBtn); + this.Controls.Add(this.testConnWMTypesBtn); + this.Controls.Add(this.testConnProceduresBtn); + this.Controls.Add(this.testConnBenchBtn); + this.Controls.Add(this.watermetersDbTypeComboBox); + this.Controls.Add(this.wmTypesDbTypeComboBox); + this.Controls.Add(this.proceduresDbTypeComboBox); + this.Controls.Add(this.benchDbTypeComboBox); + this.Controls.Add(this.usersDbTypeComboBox); + this.Controls.Add(this.dbTypeLabel); + this.Controls.Add(this.realBenchCheckBox); + this.Controls.Add(this.createUsersDbBtn); + this.Controls.Add(this.testConnUsersBtn); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.watermetersConnectionStringTextBox); + this.Controls.Add(this.wmTypesConnectionStringTextBox); + this.Controls.Add(this.proceduresConnectionStringTextBox); + this.Controls.Add(this.benchConnectionStringTextBox); + this.Controls.Add(this.connectionStringLabel); + this.Controls.Add(this.usersConnectionStringTextBox); + this.Controls.Add(this.benchNameTextBox); + this.Controls.Add(this.label1); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MinimizeBox = false; + this.Name = "DatabaseSettingsDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Load += new System.EventHandler(this.BenchSettingsDlg_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox benchNameTextBox; + private System.Windows.Forms.TextBox usersConnectionStringTextBox; + private System.Windows.Forms.Label connectionStringLabel; + private System.Windows.Forms.TextBox benchConnectionStringTextBox; + private System.Windows.Forms.TextBox proceduresConnectionStringTextBox; + private System.Windows.Forms.TextBox wmTypesConnectionStringTextBox; + private System.Windows.Forms.TextBox watermetersConnectionStringTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Button testConnUsersBtn; + private System.Windows.Forms.Button createUsersDbBtn; + private System.Windows.Forms.CheckBox realBenchCheckBox; + private System.Windows.Forms.Label dbTypeLabel; + private System.Windows.Forms.ComboBox usersDbTypeComboBox; + private System.Windows.Forms.ComboBox benchDbTypeComboBox; + private System.Windows.Forms.ComboBox proceduresDbTypeComboBox; + private System.Windows.Forms.ComboBox wmTypesDbTypeComboBox; + private System.Windows.Forms.ComboBox watermetersDbTypeComboBox; + private System.Windows.Forms.Button testConnBenchBtn; + private System.Windows.Forms.Button testConnProceduresBtn; + private System.Windows.Forms.Button testConnWMTypesBtn; + private System.Windows.Forms.Button testConnWaterMetersBtn; + private System.Windows.Forms.Button createBenchDbBtn; + private System.Windows.Forms.Button createProceduresDbBtn; + private System.Windows.Forms.Button createWMTypesDbBtn; + private System.Windows.Forms.Button createWaterMetersDbBtn; + } +} \ No newline at end of file diff --git a/TestBenchFramework/DatabaseSettingsDlg.cs b/TestBenchFramework/DatabaseSettingsDlg.cs new file mode 100644 index 000000000..6459de002 --- /dev/null +++ b/TestBenchFramework/DatabaseSettingsDlg.cs @@ -0,0 +1,261 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF +{ + /// + /// Dialog to process test bench name and database settings (BenchSettings) + /// + public partial class DatabaseSettingsDlg : Form + { + // Reference to bench DB settins (not a local copy) + DatabaseSettings bench; + + /// + /// Constructor + /// + /// Test bench database settings + public DatabaseSettingsDlg(DatabaseSettings bench) + { + this.bench = bench; + + InitializeComponent(); + } + + void Localize() + { + Text = Strings.Test_Bench_Databases_Specification; + label1.Text = Strings.Test_bench_name; + realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer; + dbTypeLabel.Text = Strings.Database_type; + connectionStringLabel.Text = Strings.Connection_string; + label2.Text = Strings.Users_and_groups; + label3.Text = Strings.Bench_parameters; + label4.Text = Strings.Procedures; + label5.Text = Strings.Water_meter_types; + label6.Text = Strings.Water_meter_data; + okButton.Text = Strings.OkBtnText; + cancelButton.Text = Strings.CancelBtnText; + + testConnBenchBtn.Text = Strings.Test_connection; + testConnProceduresBtn.Text = Strings.Test_connection; + testConnUsersBtn.Text = Strings.Test_connection; + testConnWaterMetersBtn.Text = Strings.Test_connection; + testConnWMTypesBtn.Text = Strings.Test_connection; + + createBenchDbBtn.Text = Strings.Create_DB; + createProceduresDbBtn.Text = Strings.Create_DB; + createUsersDbBtn.Text = Strings.Create_DB; + createWaterMetersDbBtn.Text = Strings.Create_DB; + createWMTypesDbBtn.Text = Strings.Create_DB; + } + + private void BenchSettingsDlg_Load(object sender, EventArgs e) + { + Localize(); + + benchNameTextBox.Text = bench.BenchName; + realBenchCheckBox.Checked = bench.IsRealBench; + + /// Initialize 'Database type' combo-boxes + for (int i = 0; i < (int)DBType.DbTypesCount; i++) + { + DBType dbType = (DBType)i; + usersDbTypeComboBox.Items.Add(dbType); + benchDbTypeComboBox.Items.Add(dbType); + proceduresDbTypeComboBox.Items.Add(dbType); + wmTypesDbTypeComboBox.Items.Add(dbType); + watermetersDbTypeComboBox.Items.Add(dbType); + } + usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType; + benchDbTypeComboBox.SelectedIndex = (int)bench.BenchDBSettings.DbType; + proceduresDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType; + wmTypesDbTypeComboBox.SelectedIndex = (int)bench.WMTypesDBSettings.DbType; + watermetersDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType; + + /// Initialize connection strings + usersConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString; + benchConnectionStringTextBox.Text = bench.BenchDBSettings.ConnectionString; + proceduresConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString; + wmTypesConnectionStringTextBox.Text = bench.WMTypesDBSettings.ConnectionString; + watermetersConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString; + } + + bool UpdateBenchFromUIControls() + { + for (int i = 0; i < Program.LocalSettings.BenchesCount; i++) + { + if (bench != Program.LocalSettings.TestBenches[i] && + benchNameTextBox.Text == Program.LocalSettings.TestBenches[i].BenchName) + { + MessageBox.Show(Strings.Bench_name_conflict_Use_another_name_pls, Strings.Error, MessageBoxButtons.OK); + return false; + } + } + + bench.BenchName = benchNameTextBox.Text; + bench.IsRealBench = realBenchCheckBox.Checked; + + bench.UsersDBSettings.ConnectionString = usersConnectionStringTextBox.Text; + bench.BenchDBSettings.ConnectionString = benchConnectionStringTextBox.Text; + bench.ProceduresDBSettings.ConnectionString = proceduresConnectionStringTextBox.Text; + bench.WMTypesDBSettings.ConnectionString = wmTypesConnectionStringTextBox.Text; + bench.WaterMetersDBSettings.ConnectionString = watermetersConnectionStringTextBox.Text; + + bench.UsersDBSettings.DbType = (DBType)usersDbTypeComboBox.SelectedIndex; + bench.BenchDBSettings.DbType = (DBType)benchDbTypeComboBox.SelectedIndex; + bench.ProceduresDBSettings.DbType = (DBType)proceduresDbTypeComboBox.SelectedIndex; + bench.WMTypesDBSettings.DbType = (DBType)wmTypesDbTypeComboBox.SelectedIndex; + bench.WaterMetersDBSettings.DbType = (DBType)watermetersDbTypeComboBox.SelectedIndex; + + return true; + } + + /// + /// Update bench DB setting, return 'OK' + /// + /// Not used + /// Not used + private void okButton_Click(object sender, EventArgs e) + { + if (UpdateBenchFromUIControls()) + { + DialogResult = DialogResult.OK; + Close(); + return; + } + + DialogResult = DialogResult.None; + } + + /// + /// Throw away changes, return 'Cancel' + /// + /// Not used + /// Not used + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void createDatabasesButton_Click(object sender, EventArgs e) + { + if (!UpdateBenchFromUIControls()) return; + + if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + + Strings.Do_you_want_to_proceed, Strings.Warning, + MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) + try + { + Cursor.Current = Cursors.WaitCursor; + FluentCommon.CreateEmptyUsersDB(bench.UsersDBSettings); + MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); + Cursor.Current = Cursors.Default; + DialogResult = DialogResult.None; + } + catch (Exception exception) + { + Cursor.Current = Cursors.Default; + MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); + } + } + + private void createbenchDbBtn_Click(object sender, EventArgs e) + { + if (!UpdateBenchFromUIControls()) return; + + if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + + Strings.Do_you_want_to_proceed, Strings.Warning, + MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) + try + { + Cursor.Current = Cursors.WaitCursor; + FluentCommon.CreateEmptyBenchDB(bench.BenchDBSettings); + MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); + Cursor.Current = Cursors.Default; + DialogResult = DialogResult.None; + } + catch (Exception exception) + { + Cursor.Current = Cursors.Default; + MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); + } + } + + private void createProecduresDbBtn_Click(object sender, EventArgs e) + { + if (!UpdateBenchFromUIControls()) return; + + if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + + Strings.Do_you_want_to_proceed, Strings.Warning, + MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) + try + { + Cursor.Current = Cursors.WaitCursor; + FluentCommon.CreateEmptyProceduresDB(bench.ProceduresDBSettings); + MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); + Cursor.Current = Cursors.Default; + DialogResult = DialogResult.None; + } + catch (Exception exception) + { + Cursor.Current = Cursors.Default; + MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); + } + } + + private void createWMTypesDbBtn_Click(object sender, EventArgs e) + { + + } + + private void createWaterMetersDbBtn_Click(object sender, EventArgs e) + { + if (!UpdateBenchFromUIControls()) return; + + if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + + Strings.Do_you_want_to_proceed, Strings.Warning, + MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) + try + { + Cursor.Current = Cursors.WaitCursor; + FluentCommon.CreateEmptyWaterMetersDB(bench.WaterMetersDBSettings); + MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); + Cursor.Current = Cursors.Default; + DialogResult = DialogResult.None; + } + catch (Exception exception) + { + Cursor.Current = Cursors.Default; + MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); + } + } + + private void testConnUsersBtn_Click(object sender, EventArgs e) + { + } + + private void testConnBenchBtn_Click(object sender, EventArgs e) + { + } + + private void testConnProceduresBtn_Click(object sender, EventArgs e) + { + } + + private void testConnWMTypesBtn_Click(object sender, EventArgs e) + { + } + + private void testConnWaterMetersBtn_Click(object sender, EventArgs e) + { + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/DatabaseSettingsDlg.resx b/TestBenchFramework/DatabaseSettingsDlg.resx new file mode 100644 index 000000000..9e8ff90fa --- /dev/null +++ b/TestBenchFramework/DatabaseSettingsDlg.resx @@ -0,0 +1,930 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 614, 15 + + + 217, 28 + + + + 14 + + + OK + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 30 + + + 614, 49 + + + 217, 28 + + + 13 + + + Cancel + + + cancelButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 31 + + + True + + + 12, 18 + + + 93, 13 + + + 15 + + + Test Bench Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 29 + + + 116, 15 + + + 315, 20 + + + 16 + + + benchNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 28 + + + 202, 101 + + + 406, 20 + + + 17 + + + usersConnectionStringTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 27 + + + True + + + 199, 82 + + + 89, 13 + + + 18 + + + Connection string + + + connectionStringLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 26 + + + 202, 127 + + + 406, 20 + + + 19 + + + benchConnectionStringTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 25 + + + 202, 153 + + + 406, 20 + + + 20 + + + proceduresConnectionStringTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 24 + + + 202, 179 + + + 406, 20 + + + 21 + + + wmTypesConnectionStringTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 23 + + + 202, 205 + + + 406, 20 + + + 22 + + + watermetersConnectionStringTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 22 + + + True + + + 12, 104 + + + 90, 13 + + + 47 + + + Users and groups + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 21 + + + True + + + 12, 130 + + + 93, 13 + + + 48 + + + Bench parameters + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 20 + + + True + + + 12, 156 + + + 61, 13 + + + 49 + + + Procedures + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 19 + + + True + + + 12, 182 + + + 90, 13 + + + 50 + + + Watermeter types + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 18 + + + True + + + 12, 208 + + + 67, 13 + + + 51 + + + Watermeters + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 17 + + + 614, 99 + + + 95, 23 + + + 52 + + + Test Connection + + + testConnUsersBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 16 + + + 711, 99 + + + 120, 23 + + + 53 + + + Create DB + + + createUsersDbBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 15 + + + True + + + 116, 47 + + + 219, 17 + + + 54 + + + Test bench is controlled by this computer + + + realBenchCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 14 + + + True + + + 113, 82 + + + 76, 13 + + + 55 + + + Database type + + + dbTypeLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 + + + 116, 101 + + + 80, 21 + + + 56 + + + usersDbTypeComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 12 + + + 116, 127 + + + 80, 21 + + + 57 + + + benchDbTypeComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 116, 153 + + + 80, 21 + + + 58 + + + proceduresDbTypeComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 116, 179 + + + 80, 21 + + + 59 + + + wmTypesDbTypeComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 116, 205 + + + 80, 21 + + + 60 + + + watermetersDbTypeComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + + NoControl + + + 614, 125 + + + 95, 23 + + + 61 + + + Test Connection + + + testConnBenchBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + NoControl + + + 614, 151 + + + 95, 23 + + + 62 + + + Test Connection + + + testConnProceduresBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + NoControl + + + 614, 177 + + + 95, 23 + + + 63 + + + Test Connection + + + testConnWMTypesBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + NoControl + + + 614, 203 + + + 95, 23 + + + 64 + + + Test Connection + + + testConnWaterMetersBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + NoControl + + + 711, 124 + + + 120, 23 + + + 65 + + + Create DB + + + createBenchDbBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + NoControl + + + 711, 150 + + + 120, 23 + + + 66 + + + Create DB + + + createProceduresDbBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + NoControl + + + 711, 176 + + + 120, 23 + + + 67 + + + Create DB + + + createWMTypesDbBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + NoControl + + + 711, 202 + + + 120, 23 + + + 68 + + + Create DB + + + createWaterMetersDbBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 836, 241 + + + CenterParent + + + Test Bench Databases Specification + + + DatabaseSettingsDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Entities/BenchPath.cs b/TestBenchFramework/Entities/BenchPath.cs new file mode 100644 index 000000000..5ef6f8968 --- /dev/null +++ b/TestBenchFramework/Entities/BenchPath.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class BenchPath : IHasItemNr, IHasValves + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual float Qfrom { get; set; } /// Water flow in [m3/h] + public virtual float Qto { get; set; } /// Water flow in [m3/h] + public virtual string TempIn { get; set; } + public virtual string TempOut { get; set; } + public virtual string PressIn { get; set; } + public virtual string PressOut { get; set; } + + /// Valves + public virtual string ValvesOpen { get; set; } + public virtual string ValvesClose { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public BenchPath() + { + } + + public BenchPath(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public BenchPath(BenchControl.BenchPath path) + : this(path.Name, path.ItemNr) + { + Qfrom = path.Qfrom; + Qto = path.Qto; + TempIn = (path.TempIn != null) ? path.TempIn.Cfg.Name : null; + TempOut = (path.TempOut != null) ? path.TempOut.Cfg.Name : null; + PressIn = (path.PressIn != null) ? path.PressIn.Cfg.Name : null; + PressOut = (path.PressOut != null) ? path.PressOut.Cfg.Name : null; + + string vOpen = string.Empty; + foreach (var valve in path.ValvesOpen) + { + if (vOpen != string.Empty) vOpen += ";"; + vOpen += valve.Cfg.Name; + } + ValvesOpen = vOpen; + + string vClose = string.Empty; + foreach (var valve in path.ValvesClose) + { + if (vClose != string.Empty) vClose += ";"; + vClose += valve.Cfg.Name; + } + ValvesClose = vClose; + } + + public virtual BenchPath Clone(string name, int itemNr) + { + BenchPath result = new BenchPath(name, itemNr); + + result.Qfrom = Qfrom; + result.Qto = Qto; + result.TempIn = TempIn; + result.TempOut = TempOut; + result.PressIn = PressIn; + result.PressOut = PressOut; + result.ValvesOpen = ValvesOpen; + result.ValvesClose = ValvesClose; + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/Component.cs b/TestBenchFramework/Entities/Component.cs new file mode 100644 index 000000000..0e8312421 --- /dev/null +++ b/TestBenchFramework/Entities/Component.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class Component : IHasItemNr + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual string ClassName { get; set; } + public virtual string ParentName { get; set; } + public virtual DebugMode Mode { get; set; } + public virtual LogLevel Logging { get; set; } + public virtual string Parameters { get; set; } + public virtual IList Corrections { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public Component() + { + Corrections = new List(); + } + + public static Component CreateFromCfg(string name, string className, string parentName, int itemNr, + DebugMode debugLevel, LogLevel logLevel, string parameters) + { + Component result = new Component(); + result.ItemNr = itemNr; + result.Name = name; + result.ClassName = className; + result.ParentName = parentName; + result.Mode = debugLevel; + result.Logging = logLevel; + result.Parameters = parameters; + return result; + } + + // Makes a new copy of this object (not just a reference) + public virtual Component Clone() + { + Component result = new Component(); + result.ItemNr = ItemNr; + result.Name = Name; + result.ClassName = ClassName; + result.ParentName = ParentName; + result.Mode = Mode; + result.Logging = Logging; + result.Parameters = Parameters; + return result; + } + + public virtual string ToString(string indent) + { + string result = string.Empty; + + result += indent + "ItemNr = " + (ItemNr + 1).ToString() + Environment.NewLine; + result += indent + "Name = " + Name + Environment.NewLine; + result += indent + "ClassName = " + ClassName + Environment.NewLine; + if (ParentName != null) + { + result += indent + "ParentName = " + ParentName + Environment.NewLine; + } + result += indent + "DebugLevel = " + Mode.ToString() + Environment.NewLine; + result += indent + "LogLevel = " + Logging.ToString() + Environment.NewLine; + result += indent + "Parameters = " + Parameters + Environment.NewLine; + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/ComponentProcedure.cs b/TestBenchFramework/Entities/ComponentProcedure.cs new file mode 100644 index 000000000..399a1c693 --- /dev/null +++ b/TestBenchFramework/Entities/ComponentProcedure.cs @@ -0,0 +1,19 @@ + +namespace TBF.Entities +{ + public class ComponentProcedure + { + public virtual int Id { get; protected set; } + public virtual string CmpntName { get; set; } /// Component name + public virtual string Parameters { get; set; } + public virtual Procedure Procedure { get; set; } + + public virtual ComponentProcedure Clone() + { + ComponentProcedure result = new ComponentProcedure(); + result.CmpntName = CmpntName; + result.Parameters = Parameters; + return result; + } + } +} diff --git a/TestBenchFramework/Entities/ComponentTest.cs b/TestBenchFramework/Entities/ComponentTest.cs new file mode 100644 index 000000000..c9d43a15e --- /dev/null +++ b/TestBenchFramework/Entities/ComponentTest.cs @@ -0,0 +1,19 @@ + +namespace TBF.Entities +{ + public class ComponentTest + { + public virtual int Id { get; protected set; } + public virtual string CmpntName { get; set; } /// Component name + public virtual string Parameters { get; set; } + public virtual Test Test { get; set; } + + public virtual ComponentTest Clone() + { + ComponentTest result = new ComponentTest(); + result.CmpntName = CmpntName; + result.Parameters = Parameters; + return result; + } + } +} diff --git a/TestBenchFramework/Entities/Enums.cs b/TestBenchFramework/Entities/Enums.cs new file mode 100644 index 000000000..5dc70d7a2 --- /dev/null +++ b/TestBenchFramework/Entities/Enums.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + /// + /// Kind of meters for the procedure / test + /// + public enum MetersKind + { + Single, + Combined, + } + + /// + /// Flow set method Std/ComposedMeter + /// + public enum QSetMethod + { + Std, + ComposedMeter, + Count, + } + + /// + /// Procedure method FSS/SSS + /// + public enum TestMethod2 + { + FSS, + SSS, + Count, + } + + public enum TestRedType + { + Fix, + /// etc. + Count, + } + + public enum FQC1 + { + FQC1, + FQP1, + Count, + } + + /// + /// Possible modes of operation of components and devices. + /// + public enum DebugMode + { + DetectedOff = -2, + DetectedOn = -1, + Normal = 0, /// Normal operation + AutoDetect, /// The component (device) will be auto-detected + Off, /// The component is off + Record, + Reply, + Simulate, /// Test bench simulation, this mode does not require any hardware + Inherit, + Count, + } + + public enum LogLevel + { + Off, + Fatal, + Error, + Warn, + Info, + Debug, + All, + Count, + } +} + diff --git a/TestBenchFramework/Entities/FeedingPath.cs b/TestBenchFramework/Entities/FeedingPath.cs new file mode 100644 index 000000000..461f77f2d --- /dev/null +++ b/TestBenchFramework/Entities/FeedingPath.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class FeedingPath : IHasItemNr, IHasValves + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual float Qfrom { get; set; } /// Water flow in [m3/h] + public virtual float Qto { get; set; } /// Water flow in [m3/h] + public virtual string Pump { get; set; } + + /// Valves + public virtual string ValvesOpen { get; set; } + public virtual string ValvesClose { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public FeedingPath() + { + } + + public FeedingPath(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public FeedingPath(BenchControl.FeedingPath path) + : this(path.Name, path.ItemNr) + { + Qfrom = path.Qfrom; + Qto = path.Qto; + Pump = (path.Pump != null) ? path.Pump.Cfg.Name : null; + + string vOpen = string.Empty; + foreach (var valve in path.ValvesOpen) + { + if (vOpen != string.Empty) vOpen += ";"; + vOpen += valve.Cfg.Name; + } + ValvesOpen = vOpen; + + string vClose = string.Empty; + foreach (var valve in path.ValvesClose) + { + if (vClose != string.Empty) vClose += ";"; + vClose += valve.Cfg.Name; + } + ValvesClose = vClose; + } + + public virtual FeedingPath Clone(string name, int itemNr) + { + FeedingPath result = new FeedingPath(name, itemNr); + + result.Qfrom = Qfrom; + result.Qto = Qto; + result.Pump = Pump; + result.ValvesOpen = ValvesOpen; + result.ValvesClose = ValvesClose; + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/Group.cs b/TestBenchFramework/Entities/Group.cs new file mode 100644 index 000000000..333a712a8 --- /dev/null +++ b/TestBenchFramework/Entities/Group.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class Group + { + public virtual int Id { get; protected set; } + public virtual int Gid { get; set; } + public virtual string Name { get; set; } + } +} diff --git a/TestBenchFramework/Entities/IHasItemNr.cs b/TestBenchFramework/Entities/IHasItemNr.cs new file mode 100644 index 000000000..42d37a6ad --- /dev/null +++ b/TestBenchFramework/Entities/IHasItemNr.cs @@ -0,0 +1,9 @@ + +namespace TBF.Entities +{ + interface IHasItemNr + { + int Id { get; } + int ItemNr { get; set; } + } +} diff --git a/TestBenchFramework/Entities/IHasValves.cs b/TestBenchFramework/Entities/IHasValves.cs new file mode 100644 index 000000000..7ad73f50e --- /dev/null +++ b/TestBenchFramework/Entities/IHasValves.cs @@ -0,0 +1,9 @@ + +namespace TBF.Entities +{ + public interface IHasValves + { + string ValvesOpen { get; set; } /// List of valves to be opened + string ValvesClose { get; set; } /// List of valves to be closed + } +} diff --git a/TestBenchFramework/Entities/MeasurementCorrection.cs b/TestBenchFramework/Entities/MeasurementCorrection.cs new file mode 100644 index 000000000..cc66d7c10 --- /dev/null +++ b/TestBenchFramework/Entities/MeasurementCorrection.cs @@ -0,0 +1,11 @@ +using System; + +namespace TBF.Entities +{ + public class MeasurementCorrection + { + public virtual int Id { get; protected set; } + public virtual float Measurement { get; set; } + public virtual float Correction { get; set; } + } +} diff --git a/TestBenchFramework/Entities/MeterTestResult.cs b/TestBenchFramework/Entities/MeterTestResult.cs new file mode 100644 index 000000000..4fee66c39 --- /dev/null +++ b/TestBenchFramework/Entities/MeterTestResult.cs @@ -0,0 +1,48 @@ +using System; + +namespace TBF.Entities +{ + public class MeterTestResult + { + public virtual int Id { get; protected set; } + public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity + + public virtual string SerialNr { get; set; } + public virtual float VolumeStart { get; set; } /// liter + public virtual float VolumeEnd { get; set; } /// liter + public virtual float VolumeMeter { get; set; } /// liter + public virtual float VolumeRef { get; set; } /// liter + public virtual float VolumeErrorPct { get; set; } /// % + public virtual float PulsesMeter { get; set; } /// Not applicable for a combined meter + public virtual float PulsesMaster { get; set; } + public virtual float Time { get; set; } /// sec. + public virtual bool Passed { get; set; } /// true = test passed + + public MeterTestResult() + { + } + + public MeterTestResult(TestResult testResult) + : this() + { + TestResult = testResult; + } + + public virtual MeterTestResult Clone(TestResult testResult) + { + MeterTestResult result = new MeterTestResult(testResult); + + result.SerialNr = SerialNr; + result.VolumeStart = VolumeStart; + result.VolumeEnd = VolumeEnd; + result.VolumeMeter = VolumeMeter; + result.VolumeRef = VolumeRef; + result.VolumeErrorPct = VolumeErrorPct; + result.PulsesMeter = PulsesMeter; + result.PulsesMaster = PulsesMaster; + result.Time = Time; + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/MetersPath.cs b/TestBenchFramework/Entities/MetersPath.cs new file mode 100644 index 000000000..e8a0c7bff --- /dev/null +++ b/TestBenchFramework/Entities/MetersPath.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class MetersPath : IHasItemNr + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual float Qfrom { get; set; } /// Water flow in [m3/h] + public virtual float Qto { get; set; } /// Water flow in [m3/h] + + /// Sensors + public virtual string Sensor1 { get; set; } + public virtual string Sensor2 { get; set; } + public virtual string Sensor3 { get; set; } + public virtual string Sensor4 { get; set; } + public virtual string Sensor5 { get; set; } + public virtual string Sensor6 { get; set; } + public virtual string Sensor7 { get; set; } + public virtual string Sensor8 { get; set; } + public virtual string Sensor9 { get; set; } + public virtual string Sensor10 { get; set; } + public virtual string Sensor11 { get; set; } + public virtual string Sensor12 { get; set; } + public virtual string Sensor13 { get; set; } + public virtual string Sensor14 { get; set; } + public virtual string Sensor15 { get; set; } + public virtual string Sensor16 { get; set; } + public virtual string Sensor17 { get; set; } + public virtual string Sensor18 { get; set; } + public virtual string Sensor19 { get; set; } + public virtual string Sensor20 { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public MetersPath() + { + } + + public MetersPath(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public MetersPath(BenchControl.MetersPath path) + : this(path.Name, path.ItemNr) + { + Qfrom = path.Qfrom; + Qto = path.Qto; + Sensor1 = (path.RegisterReaders[0] != null) ? path.RegisterReaders[0].Cfg.Name : null; +#pragma warning disable + if (Program.WMsCount >= 2) Sensor2 = (path.RegisterReaders[1] != null) ? path.RegisterReaders[1].Cfg.Name : null; + if (Program.WMsCount >= 3) Sensor3 = (path.RegisterReaders[2] != null) ? path.RegisterReaders[2].Cfg.Name : null; + if (Program.WMsCount >= 4) Sensor4 = (path.RegisterReaders[3] != null) ? path.RegisterReaders[3].Cfg.Name : null; + if (Program.WMsCount >= 5) Sensor5 = (path.RegisterReaders[4] != null) ? path.RegisterReaders[4].Cfg.Name : null; + if (Program.WMsCount >= 6) Sensor6 = (path.RegisterReaders[5] != null) ? path.RegisterReaders[5].Cfg.Name : null; + if (Program.WMsCount >= 7) Sensor7 = (path.RegisterReaders[6] != null) ? path.RegisterReaders[6].Cfg.Name : null; + if (Program.WMsCount >= 8) Sensor8 = (path.RegisterReaders[7] != null) ? path.RegisterReaders[7].Cfg.Name : null; + if (Program.WMsCount >= 9) Sensor9 = (path.RegisterReaders[8] != null) ? path.RegisterReaders[8].Cfg.Name : null; + if (Program.WMsCount >= 10) Sensor10 = (path.RegisterReaders[9] != null) ? path.RegisterReaders[9].Cfg.Name : null; + if (Program.WMsCount >= 11) Sensor11 = (path.RegisterReaders[10] != null) ? path.RegisterReaders[10].Cfg.Name : null; + if (Program.WMsCount >= 12) Sensor12 = (path.RegisterReaders[11] != null) ? path.RegisterReaders[11].Cfg.Name : null; + if (Program.WMsCount >= 13) Sensor13 = (path.RegisterReaders[12] != null) ? path.RegisterReaders[12].Cfg.Name : null; + if (Program.WMsCount >= 14) Sensor14 = (path.RegisterReaders[13] != null) ? path.RegisterReaders[13].Cfg.Name : null; + if (Program.WMsCount >= 15) Sensor15 = (path.RegisterReaders[14] != null) ? path.RegisterReaders[14].Cfg.Name : null; + if (Program.WMsCount >= 16) Sensor16 = (path.RegisterReaders[15] != null) ? path.RegisterReaders[15].Cfg.Name : null; + if (Program.WMsCount >= 17) Sensor17 = (path.RegisterReaders[16] != null) ? path.RegisterReaders[16].Cfg.Name : null; + if (Program.WMsCount >= 18) Sensor18 = (path.RegisterReaders[17] != null) ? path.RegisterReaders[17].Cfg.Name : null; + if (Program.WMsCount >= 19) Sensor19 = (path.RegisterReaders[18] != null) ? path.RegisterReaders[18].Cfg.Name : null; + if (Program.WMsCount >= 20) Sensor20 = (path.RegisterReaders[19] != null) ? path.RegisterReaders[19].Cfg.Name : null; +#pragma warning restore + } + + public virtual MetersPath Clone(string name, int itemNr) + { + MetersPath result = new MetersPath(name, itemNr); + result.Qfrom = Qfrom; + result.Qto = Qto; + result.Sensor1 = Sensor1; + result.Sensor2 = Sensor2; + result.Sensor3 = Sensor3; + result.Sensor4 = Sensor4; + result.Sensor5 = Sensor5; + result.Sensor6 = Sensor6; + result.Sensor7 = Sensor7; + result.Sensor8 = Sensor8; + result.Sensor9 = Sensor9; + result.Sensor10 = Sensor10; + result.Sensor11 = Sensor11; + result.Sensor12 = Sensor12; + result.Sensor13 = Sensor13; + result.Sensor14 = Sensor14; + result.Sensor15 = Sensor15; + result.Sensor16 = Sensor16; + result.Sensor17 = Sensor17; + result.Sensor18 = Sensor18; + result.Sensor19 = Sensor19; + result.Sensor20 = Sensor20; + return result; + } + + /// Returns the component name + public virtual string GetSensor(int i) + { + if (i == 0) return Sensor1; + else if (i == 1) return Sensor2; + else if (i == 2) return Sensor3; + else if (i == 3) return Sensor4; + else if (i == 4) return Sensor5; + else if (i == 5) return Sensor6; + else if (i == 6) return Sensor7; + else if (i == 7) return Sensor8; + else if (i == 8) return Sensor9; + else if (i == 9) return Sensor10; + else if (i == 10) return Sensor11; + else if (i == 11) return Sensor12; + else if (i == 12) return Sensor13; + else if (i == 13) return Sensor14; + else if (i == 14) return Sensor15; + else if (i == 15) return Sensor16; + else if (i == 16) return Sensor17; + else if (i == 17) return Sensor18; + else if (i == 18) return Sensor19; + else if (i == 19) return Sensor20; + else return null; + } + + /// Sets the component name + public virtual void SetSensor(int i, string cmpntName) + { + if (i == 0) Sensor1 = cmpntName; + else if (i == 1) Sensor2 = cmpntName; + else if (i == 2) Sensor3 = cmpntName; + else if (i == 3) Sensor4 = cmpntName; + else if (i == 4) Sensor5 = cmpntName; + else if (i == 5) Sensor6 = cmpntName; + else if (i == 6) Sensor7 = cmpntName; + else if (i == 7) Sensor8 = cmpntName; + else if (i == 8) Sensor9 = cmpntName; + else if (i == 9) Sensor10 = cmpntName; + else if (i == 10) Sensor11 = cmpntName; + else if (i == 11) Sensor12 = cmpntName; + else if (i == 12) Sensor13 = cmpntName; + else if (i == 13) Sensor14 = cmpntName; + else if (i == 14) Sensor15 = cmpntName; + else if (i == 15) Sensor16 = cmpntName; + else if (i == 16) Sensor17 = cmpntName; + else if (i == 17) Sensor18 = cmpntName; + else if (i == 18) Sensor19 = cmpntName; + else if (i == 19) Sensor20 = cmpntName; + } + } +} diff --git a/TestBenchFramework/Entities/OutputPath.cs b/TestBenchFramework/Entities/OutputPath.cs new file mode 100644 index 000000000..839044ade --- /dev/null +++ b/TestBenchFramework/Entities/OutputPath.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class OutputPath : IHasItemNr, IHasValves + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual float Qfrom { get; set; } /// Water flow in [m3/h] + public virtual float Qto { get; set; } /// Water flow in [m3/h] + public virtual string RegulValve { get; set; } + public virtual string FlowMeter { get; set; } + public virtual string Diverter { get; set; } + public virtual string TempDiv { get; set; } + public virtual string Balance { get; set; } + public virtual string EmptyTankValve { get; set; } + + /// Valves + public virtual string ValvesOpen { get; set; } + public virtual string ValvesClose { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public OutputPath() + { + } + + public OutputPath(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public OutputPath(BenchControl.OutputPath path) + : this(path.Name, path.ItemNr) + { + Qfrom = path.Qfrom; + Qto = path.Qto; + RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null; + FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null; + Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null; + TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null; + Balance = (path.Balance != null) ? path.Balance.Cfg.Name : null; + EmptyTankValve = (path.EmptyTankValve != null) ? path.EmptyTankValve.Cfg.Name : null; + + string vOpen = string.Empty; + foreach (var valve in path.ValvesOpen) + { + if (vOpen != string.Empty) vOpen += ";"; + vOpen += valve.Cfg.Name; + } + ValvesOpen = vOpen; + + string vClose = string.Empty; + foreach (var valve in path.ValvesClose) + { + if (vClose != string.Empty) vClose += ";"; + vClose += valve.Cfg.Name; + } + ValvesClose = vClose; + } + + public virtual OutputPath Clone(string name, int itemNr) + { + OutputPath result = new OutputPath(name, itemNr); + + result.Name = Name; + result.Qfrom = Qfrom; + result.Qto = Qto; + result.RegulValve = RegulValve; + result.FlowMeter = FlowMeter; + result.Diverter = Diverter; + result.TempDiv = TempDiv; + result.Balance = Balance; + result.EmptyTankValve = EmptyTankValve; + result.ValvesOpen = ValvesOpen; + result.ValvesClose = ValvesClose; + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/Procedure.cs b/TestBenchFramework/Entities/Procedure.cs new file mode 100644 index 000000000..08fa42334 --- /dev/null +++ b/TestBenchFramework/Entities/Procedure.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using TBF.Resources; + +namespace TBF.Entities +{ + /// + /// Stores one test procedure, supports revisions and history log + /// + public class Procedure : IHasItemNr + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual string Description { get; set; } /// Short description + public virtual string CreationUser { get; set; } /// Name of the user who has created or changed this procedure + public virtual DateTime CreationTime { get; set; } /// Date and time of the creation or change + public virtual string LastChgUser { get; set; } /// Name of the user who has created or changed this procedure + public virtual DateTime LastChgTime { get; set; } /// Date and time of the creation or change + public virtual string LongDescription { get; set; } /// Long description (notes) + public virtual string Watermeters { get; set; } /// Water meter name or Id + + public virtual string DataEntry { get; set; } /// Component to use for data entry + public virtual string ResultsPrinter { get; set; } /// Component to use for printing the results + public virtual string ResultsWriter { get; set; } /// Component to use for saving the results into the file + public virtual string TransitionStart { get; set; } + public virtual string TransitionEnd { get; set; } + + public virtual IList MoreParams { get; set; } + public virtual IList Tests { get; set; } + + ////public virtual string MetrologicalClass { get; set; } + ////public virtual IList WMTypes { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public Procedure() + { + CreationUser = (User.CurrentUser != null) ? User.CurrentUser.Name : null; + CreationTime = DateTime.Now; + LastChgUser = CreationUser; + LastChgTime = CreationTime; + + MoreParams = new List(); + Tests = new List(); + + //WMTypes = new List(); + } + + public Procedure(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public virtual Procedure Clone() + { + Procedure result = new Procedure(); + + result.Name = Name; + result.Description = Description; + result.CreationUser = CreationUser; + result.CreationTime = CreationTime; + result.LastChgUser = LastChgUser; + result.LastChgTime = LastChgTime; + result.LongDescription = LongDescription; + + foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); } + foreach (var test in Tests) { result.Tests.Add(test.Clone()); } + + //result.MetrologicalClass = MetrologicalClass; + //result.WMType = WMType.Clone(); + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/ProcedureHistory.cs b/TestBenchFramework/Entities/ProcedureHistory.cs new file mode 100644 index 000000000..27e58148e --- /dev/null +++ b/TestBenchFramework/Entities/ProcedureHistory.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class ProcedureHistory + { + public virtual int Id { get; protected set; } + public virtual Procedure Current { get; set; } + public virtual IList OldProcedures { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public ProcedureHistory() + { + Current = new Procedure(); + OldProcedures = new List(); + } + + public virtual ProcedureHistory Clone() + { + ProcedureHistory result = new ProcedureHistory(); + result.Current = Current.Clone(); + foreach (Procedure p in OldProcedures) result.OldProcedures.Add(p.Clone()); + return result; + } + } +} diff --git a/TestBenchFramework/Entities/Test.cs b/TestBenchFramework/Entities/Test.cs new file mode 100644 index 000000000..fdffe7c47 --- /dev/null +++ b/TestBenchFramework/Entities/Test.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + /// + /// Test, consisting of one or more repetitions of the test 'SingleTest'. + /// + public class Test : IHasItemNr + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h] + public virtual float Qto { get; set; } /// Water flow high limit in [m3/h] + public virtual float Volume { get; set; } /// Test volume (target) in [l] + public virtual float TstTime { get; set; } /// Test time (estimate) in [s] + public virtual int Repeats { get; set; } + public virtual bool Emptying { get; set; } + public virtual bool Zeroing { get; set; } + public virtual string Method { get; set; } + public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) + public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) + public virtual double TolerRed { get; set; } /// in [%] (always > 0) + public virtual TestRedType RedType { get; set; } + public virtual string FeedingPath { get; set; } + public virtual string BenchPath { get; set; } + public virtual string OutputPath { get; set; } + public virtual string MetersPath { get; set; } + public virtual string TransitionStart { get; set; } + public virtual string TransitionEnd { get; set; } + + public virtual IList MoreParams { get; set; } + + public virtual Procedure Procedure { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public Test() + { + MoreParams = new List(); + } + + public Test(string name, int itemNr, Procedure procedure) + : this() + { + Name = name; + ItemNr = itemNr; + Procedure = procedure; + } + + // Makes a new copy of this object (not just a reference) + public virtual Test Clone() + { + Test result = new Test(Name, ItemNr, Procedure); + + result.Qfrom = Qfrom; + result.Qto = Qto; + result.Volume = Volume; + result.TstTime = TstTime; + result.Repeats = Repeats; + result.Emptying = Emptying; + result.Zeroing = Zeroing; + result.Method = Method; + result.ErrLimLo = ErrLimLo; + result.ErrLimHi = ErrLimHi; + result.TolerRed = TolerRed; + result.RedType = RedType; + result.FeedingPath = FeedingPath; + result.BenchPath = BenchPath; + result.OutputPath = OutputPath; + result.MetersPath = MetersPath; + foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); } + + return result; + } + } +} diff --git a/TestBenchFramework/Entities/TestResult.cs b/TestBenchFramework/Entities/TestResult.cs new file mode 100644 index 000000000..0a1f48f61 --- /dev/null +++ b/TestBenchFramework/Entities/TestResult.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class TestResult + { + public virtual int Id { get; protected set; } + public virtual string Name { get; set; } + public virtual MetersKind MetersKind { get; set; } + public virtual IList Meters { get; set; } + public virtual IList CombinedMeters { get; set; } + + /// Values copied from the test (Entities.Test) + public virtual string TestName { get; set; } + public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database + public virtual bool DoNotPublish { get; set; } /// Not mapped to the database + public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h] + public virtual float Qto { get; set; } /// Water flow high limit in [m3/h] + public virtual float Volume { get; set; } /// Test volume (target) in [l] + public virtual float TstTime { get; set; } /// Test time (estimate) in [s] + public virtual int Repeats { get; set; } + public virtual bool Emptying { get; set; } + public virtual bool Zeroing { get; set; } + public virtual string Method { get; set; } + public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) + public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) + + /// To be replaced by the virtual bench component parameters + public virtual string FeedingPath { get; set; } + public virtual string BenchPath { get; set; } + public virtual string OutputPath { get; set; } + public virtual string MetersPath { get; set; } + + /// Results + public virtual DateTime TimeStart { get; set; } /// Date and time of the test start + public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end + public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...) + public virtual float AmbientTempAve { get; set; } /// Average ambient air temperature [degC] + public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure + public virtual float AmbientHumiAve { get; set; } /// Average ambient air relative humidity [%] + public virtual float PressInAvrg { get; set; } /// Input water pressure (average) [Bar] + public virtual float PressInStart { get; set; } + public virtual float PressInEnd { get; set; } + public virtual float PressOutAvrg { get; set; } + public virtual float PressOutStart { get; set; } + public virtual float PressOutEnd { get; set; } + public virtual float TempInAvrg { get; set; } + public virtual float TempInStart { get; set; } + public virtual float TempInEnd { get; set; } + public virtual float TempOutAvrg { get; set; } + public virtual float TempOutStart { get; set; } + public virtual float TempOutEnd { get; set; } + public virtual float TempDivAvrg { get; set; } + public virtual float TempDivStart { get; set; } + public virtual float TempDivEnd { get; set; } + public virtual float MassStartRaw { get; set; } + public virtual float MassStart { get; set; } + public virtual float MassEndRaw { get; set; } + public virtual float MassEnd { get; set; } + public virtual float MassDiff { get; set; } + public virtual float DensityIn { get; set; } + public virtual float DensityOut { get; set; } + public virtual float DensityDiv { get; set; } + public virtual float Buoyancy { get; set; } ///TODO -> map + public virtual float FlowMass { get; set; } /// from conventional true value + public virtual float FlowVolume { get; set; } /// from conventional true value + public virtual float VolumeCTV { get; set; } /// volume conventional true value + public virtual float VolumeMaster { get; set; } /// volume from the master flow meter + public virtual float Time { get; set; } /// measurement time in seconds + public virtual float ErrorMaster { get; set; } + public virtual float PulsesMaster { get; set; } + public virtual float ConstMaster { get; set; } /// Pulses per liter master flow meter + public virtual float TimeDivStart0 { get; set; } + public virtual float TimeDivStart1 { get; set; } + public virtual float TimeDivStart2 { get; set; } + public virtual float TimeDivStart3 { get; set; } + public virtual float TimeDivStart4 { get; set; } + public virtual float TimeDivStart5 { get; set; } + public virtual float TimeDivEnd0 { get; set; } + public virtual float TimeDivEnd1 { get; set; } + public virtual float TimeDivEnd2 { get; set; } + public virtual float TimeDivEnd3 { get; set; } + public virtual float TimeDivEnd4 { get; set; } + public virtual float TimeDivEnd5 { get; set; } + + public TestResult() + { + Meters = new List(); + CombinedMeters = new List(); + } + + public TestResult(MetersKind kind) + : this() + { + MetersKind = kind; + + if (kind == MetersKind.Single) + { + for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult()); + } + else if (kind == MetersKind.Combined) + { + int combinedCount = Program.WMsCount / 2; + for (int i = 0; i < 2 * combinedCount; i++) Meters.Add(new MeterTestResult()); + for (int i = 0; i < combinedCount; i++) CombinedMeters.Add(new MeterTestResult()); + } + } + + public TestResult(Test test, int repetitionNr, MetersKind kind) + : this(kind) + { + if (test.Repeats == 1) + { + Name = test.Name; + } + else + { + Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats); + } + RepetitionNr = repetitionNr; + + /// Copy test parameters from Entities.Test object + TestName = test.Name; + Qfrom = test.Qfrom; + Qto = test.Qto; + Volume = test.Volume; + TstTime = test.TstTime; + Repeats = test.Repeats; + Emptying = test.Emptying; + Zeroing = test.Zeroing; + Method = test.Method; + ErrLimLo = test.ErrLimLo; + ErrLimHi = test.ErrLimHi; + + FeedingPath = test.FeedingPath; + BenchPath = test.BenchPath; + OutputPath = test.OutputPath; + MetersPath = test.MetersPath; + } + } +} diff --git a/TestBenchFramework/Entities/TransitionSequence.cs b/TestBenchFramework/Entities/TransitionSequence.cs new file mode 100644 index 000000000..480c2da21 --- /dev/null +++ b/TestBenchFramework/Entities/TransitionSequence.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; + +namespace TBF.Entities +{ + /// + /// Stores one transition sequence + /// + public class TransitionSequence : IHasItemNr + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } + public virtual string Name { get; set; } + public virtual string Description { get; set; } /// Short description + public virtual IList TransitionSteps { get; set; } + + public TransitionSequence() + { + TransitionSteps = new List(); + } + + public TransitionSequence(string name, int itemNr) + : this() + { + Name = name; + ItemNr = itemNr; + } + + public virtual TransitionSequence Clone() + { + TransitionSequence result = new TransitionSequence(); + result.Name = Name; + result.Description = Description; + foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); } + return result; + } + } +} diff --git a/TestBenchFramework/Entities/TransitionStep.cs b/TestBenchFramework/Entities/TransitionStep.cs new file mode 100644 index 000000000..431a0e1f0 --- /dev/null +++ b/TestBenchFramework/Entities/TransitionStep.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; + +namespace TBF.Entities +{ + public class TransitionStep : IHasItemNr, IHasValves + { + public virtual int Id { get; protected set; } + public virtual int ItemNr { get; set; } /// Order of the preparation step + public virtual int Duration { get; set; } /// Duration in seconds + public virtual string ValvesOpen { get; set; } /// List of valves to be opened + public virtual string ValvesClose { get; set; } /// List of valves to be closed + public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';' + + public virtual TransitionSequence TransitionSequence { get; set; } + + /// ------------- Additional stuff not mapped into the database ------------- + + public TransitionStep() + { + Duration = 5; /// sec. + } + + public TransitionStep(int itemNr, TransitionSequence sequence) + : this() + { + ItemNr = itemNr; + TransitionSequence = sequence; + } + + public virtual TransitionStep Clone() + { + TransitionStep result = new TransitionStep(ItemNr, TransitionSequence); + result.Duration = Duration; + result.ValvesOpen = ValvesOpen; + result.ValvesClose = ValvesClose; + result.RegulValvesPct = RegulValvesPct; + return result; + } + + public virtual string ToString(string indent) + { + string result = ""; + result += indent + "ItemNr = " + ItemNr.ToString() + ", "; + result += indent + "Duration = " + Duration.ToString() + ", "; + result += indent + "ValvesOpen = " + ValvesOpen.ToString() + ", "; + result += indent + "ValvesClose = " + ValvesClose.ToString() + ", "; + result += indent + "RegulValvesPct = " + RegulValvesPct.ToString() + Environment.NewLine; + return result; + } + } +} diff --git a/TestBenchFramework/Entities/User.cs b/TestBenchFramework/Entities/User.cs new file mode 100644 index 000000000..fba683d46 --- /dev/null +++ b/TestBenchFramework/Entities/User.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; +using System.Diagnostics; + +namespace TBF.Entities +{ + public class User + { + public virtual int Id { get; protected set; } + public virtual string Name { get; set; } + public virtual string Password { get; set; } + public virtual string Description { get; set; } + public virtual DateTime LastPwChange { get; set; } + public virtual IList Groups { get; set; } //User can be a member of a list of groups + + public User() + { + Groups = new List(); + } + + public virtual void AddGroup(Group group) + { + Groups.Add(group); + } + + /// ------------- Additional stuff not mapped into the database ------------- + + /// + /// Authorized user (static) + /// + private static User currentUser = null; /// Updated by instance methods Authorize, Unauthorize + public static User CurrentUser + { + get { return currentUser; } + set { currentUser = value; } + } + + private static DateTime lastAuthorization = DateTime.Now; + public static DateTime LastAuthorization { get { return lastAuthorization; } } + + /// + /// Check whether user is a member of a group. + /// + /// Group GID + /// true is user is a member of the specified group + public virtual bool IsMemberOf(Grp.GID groupId) + { + if (groupId == Grp.GID.None) + { + return true; + } + else if (groupId >= 0 && (int)groupId < Grp.Count) + { + // for all group elements in User.groups + for (int i = 0; i < Groups.Count; ++i) + { + // element GID = parameter GroupId ? + if (((Group)Groups[i]).Gid == (int)groupId) + { + return true; + } + } + return false; + } + else + { + return false; + } + } + + /// + /// Sets users password. It then will be encrypted. + /// + /// Password + public virtual void SetPassword(string password) + { + this.Password = EncryptedPassword(password); + LastPwChange = DateTime.Now; + } + + + public virtual string EncryptedPassword(string password) + { + return getHash(password); + } + + /// + /// Verifies users password. Used by static bool Authorisation(...) + /// + /// Password + /// true if password is correct + public virtual bool CheckPassword(string password) + { + return (Password == EncryptedPassword(password)); + } + + /// + /// The FIRST of TWO possible user authorization method to be used + /// when a specific group membership is required (you can use Grp.GID.None). + /// If the user is not authorized, the current user remains to be a current user + /// (i.e. the access rights were not risen to a higher level). + /// If you require different behavior, use Unauthorize() before calling Authorize(). + /// + /// + /// + /// + /// true = authorized + public virtual bool Authorize(string userName, string password, TBF.Grp.GID requiredGroupMembership) + { + if (Name.ToLower() == userName.ToLower()) + { + if (IsMemberOf(requiredGroupMembership) && CheckPassword(password)) + { + currentUser = this; + lastAuthorization = DateTime.Now; + return true; + } + else + { + return false; + } + } + return false; + } + + /// + /// The SECOND of TWO possible user authorization method to be used when + /// no specific group membership is required. + /// If the user is not authorized, the current user remains to be a current user + /// (i.e. the access rights were not risen to a higher level). + /// If you require different behavior, use Unauthorize() before calling Authorize(). + /// + /// + /// + /// + /// true = authorized + public virtual bool Authorize(string userName, string password) + { + return Authorize(userName, password, Grp.GID.None); + } + + /// + /// Returns a 'User' with a given username from a database. + /// + /// User name for the query + /// reference to a 'User' (if it exists) or null + public static User AuthorizeDummyUser(string username) + { + User user = new User(); + user.Name = username; + currentUser = user; + return user; + } + + /// + /// Returns a 'User' with a given username from an ARBITRARY database. + /// + /// User name for the query + /// reference to a 'User' (if it exists) or null + public static User LoadUserByName(string username, DBSettings dbSettings) + { + IList listOfUsers = FluentCommon.CreateSessionFactory(Database.Users, dbSettings, false) + .OpenSession() + .CreateQuery("FROM User WHERE LOWER(Name) = :username") + .SetParameter("username", username.ToLower()) + .List(); + if (listOfUsers.Count > 0) return listOfUsers[0]; + return null; + } + + /// + /// Returns a 'User' with a given username from the users database. + /// + /// User name for the query + /// reference to a 'User' (if it exists) or null + public static User LoadUserByName(string username) + { + IList listOfUsers = FluentCommon.CreateSession(Database.Users) + .CreateQuery("FROM User WHERE LOWER(Name) = :username") + .SetParameter("username", username.ToLower()) + .List(); + if (listOfUsers.Count > 0) return listOfUsers[0]; + return null; + } + + /// + /// returns an IList of all Users + /// + public static IList GetAllUsers() + { + return FluentCommon.CreateSession(Database.Users) + .CreateQuery("FROM User") + .List(); + } + + + /// + /// Unauthorize, abandon current users authorization. + /// + public static void Unauthorize() + { + currentUser = null; + lastAuthorization = DateTime.Now; + } + + /// + /// getHash encrypts a string + /// + /// the string to encrypt + /// + public static string getHash(string text) + { + byte[] bytes = Encoding.Unicode.GetBytes(text); + SHA512Managed hashstring = new SHA512Managed(); + byte[] hash = hashstring.ComputeHash(bytes); + string hashString = string.Empty; + foreach (byte x in hash) + { + hashString += String.Format("{0:x2}", x); + } + return hashString; + } + } +} diff --git a/TestBenchFramework/Entities/WMType.cs b/TestBenchFramework/Entities/WMType.cs new file mode 100644 index 000000000..2a66a92ab --- /dev/null +++ b/TestBenchFramework/Entities/WMType.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +/// This class holds the watermeter type specific data +/// that have all watermaters of the same type in common + +namespace TBF.Entities +{ + public class WMType + { + // mapped + public virtual int Id { get; protected set; } /// primary key + public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change + public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure + public virtual string CreateDescription { get; set; } /// Description\ + + public virtual string Name { get; set; } /// type name + public virtual float PulseRate { get; set; } /// Pulses per Liter + + // not yet mapped + public virtual int IdentNr { get; protected set; } /// identification number of watermeter tzpe + public virtual int Diameter { get; set; } /// nominal diameter + public virtual int Pressure { get; set; } /// nominal pressure + public virtual int Length { get; set; } /// construction length + public virtual int Temperatur { get; set; } /// nominal temperature in C + public virtual float NominalFlow { get; set; } /// nominal flow Qn + + /// ------------- Additional stuff not mapped into the database ------------- + + public WMType() + { + } + + public static WMType DefaultWMType() + { + WMType procedure = new WMType() + { + CreateTime = DateTime.Now, + CreateUserName = User.CurrentUser.Name, + CreateDescription = "A default water meter created.", + Name = "Watermeter", + PulseRate = 1000, + }; + return procedure; + } + + public virtual WMType Clone() + { + WMType result = new WMType(); + + result.CreateTime = CreateTime; + result.CreateUserName = CreateUserName; + result.CreateDescription = CreateDescription; + result.Name = Name; + result.PulseRate = PulseRate; + + return result; + } + + public override string ToString() + { + string result = ""; + result += "WMTpe: " + Environment.NewLine; + result += " Name = " + Name + Environment.NewLine; + result += " Created by = " + CreateUserName + Environment.NewLine; + result += " Created on = " + CreateTime.ToString() + Environment.NewLine; + result += " Description = " + CreateDescription + Environment.NewLine; + result += " Pulse rate = " + PulseRate.ToString() + Environment.NewLine; + return result; + } + } +} + diff --git a/TestBenchFramework/Entities/Watermeter.cs b/TestBenchFramework/Entities/Watermeter.cs new file mode 100644 index 000000000..69d8333f6 --- /dev/null +++ b/TestBenchFramework/Entities/Watermeter.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using TBF; +using NHibernate; +using FluentNHibernate; + +namespace TBF.Entities +{ + public class Watermeter + { + public virtual int Id { get; protected set; } /// primary key + + public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change + public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure + public virtual string CreateDescription { get; set; } /// Description + + /// mapped + public virtual string Serial { get; set; } /// serial number + public virtual WMType WMType { get; set; } /// type of watermeter + /// + + /// + /// Load a watermeter from the database + /// + public static Watermeter LoadBySerialnr(string SerialNr) + { + IList ListOfWatermeters = FluentCommon.CreateSession(Database.WaterMeters) + .CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter") + .SetParameter("SerialNrParameter", SerialNr) + .List(); + if (ListOfWatermeters.Count > 0) return ListOfWatermeters.ElementAt(0); + return null; + } + } +} diff --git a/TestBenchFramework/ErrorHandler.cs b/TestBenchFramework/ErrorHandler.cs new file mode 100644 index 000000000..219723302 --- /dev/null +++ b/TestBenchFramework/ErrorHandler.cs @@ -0,0 +1,31 @@ +using System; +using System.Windows.Forms; +using TBF.Forms; +using TBF.Resources; + +namespace TBF.ErrorHandler { + + public static class ErrorHandler + { + public static DialogResult HandleError(Exception e, string Message, string Origin) + { + + //catch (FluentNHibernate.Cfg.FluentConfigurationException fe) + // { + // string message; + // if (fe.InnerException != null) + // { + // message = fe.InnerException.Message; + // } + // else + // { + // message = fe.Message; + // } + // MessageBox.Show( message, "RetVal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + + ErrorDlg dlg = new ErrorDlg(Strings.Unhandled_error_occured_in_ + Origin + Environment.NewLine + Message + Environment.NewLine + e.ToString() + Environment.NewLine + e.InnerException.ToString()); + dlg.ShowDialog(); + return dlg.returnvalue; + } + } +} diff --git a/TestBenchFramework/FluentCommon.cs b/TestBenchFramework/FluentCommon.cs new file mode 100644 index 000000000..e697367d5 --- /dev/null +++ b/TestBenchFramework/FluentCommon.cs @@ -0,0 +1,317 @@ +using System; +using FluentNHibernate.Cfg; +using FluentNHibernate.Cfg.Db; +using NHibernate; +using NHibernate.Cfg; +using NHibernate.Tool.hbm2ddl; +using TBF.Resources; + +namespace TBF +{ + /// + /// Identifies the content of a database + /// + public enum Database + { + Users, + Bench, + Procedures, + WaterMeters, + Count, + } + + /// + /// Identifies the type of a database + /// + public enum DBType + { + SQLite, /// SQLite + MySql, /// MySQL database + DbTypesCount, + } + + + public static class FluentCommon + { + /// + /// Session factories for regular sessions. + /// + public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Database.Count]; + + /// + /// NHibernate session factory (to create the database session 'SessionFactory') + /// + /// A database session + static ISessionFactory CreateSessionFactory(Database database) + { + DBType dbType; + string connectionString; + + switch (database) + { + default: + case Database.Users: + dbType = Program.CurrentBench.UsersDBSettings.DbType; + connectionString = Program.CurrentBench.UsersDBSettings.ConnectionString; + break; + case Database.Bench: + dbType = Program.CurrentBench.BenchDBSettings.DbType; + connectionString = Program.CurrentBench.BenchDBSettings.ConnectionString; + break; + case Database.Procedures: + dbType = Program.CurrentBench.ProceduresDBSettings.DbType; + connectionString = Program.CurrentBench.ProceduresDBSettings.ConnectionString; + break; + case Database.WaterMeters: + dbType = Program.CurrentBench.WaterMetersDBSettings.DbType; + connectionString = Program.CurrentBench.WaterMetersDBSettings.ConnectionString; + break; + } + + return CreateSessionFactory(database, new DBSettings(dbType, connectionString), false); + } + + /// + /// NHibernate session factory (to create the database session 'SessionFactory') + /// + /// A database session + public static ISessionFactory CreateSessionFactory(Database database, DBSettings dbSettings, bool createDB) + { + try + { + FluentConfiguration cfg = Fluently.Configure(); + + switch (dbSettings.DbType) + { + default: + case DBType.SQLite: + cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(dbSettings.ConnectionString)); + break; + case DBType.MySql: + cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(dbSettings.ConnectionString)); + break; + } + + switch (database) + { + default: + case Database.Users: + cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); + break; + case Database.Bench: + cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); + break; + case Database.Procedures: + cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); + break; + case Database.WaterMeters: + cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); + break; + } + + if (createDB) + { + return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory(); + } + else + { + return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory(); + } + } + catch (Exception e) + { + return null; + } + } + + public delegate void BuildSchemaDlgt(Configuration config); + + static void BuildSchema(Configuration config) + { + /// This NHibernate tool takes a configuration (with mapping info in) + /// and exports a database schema from it + new SchemaExport(config).SetOutputFile("db_schema"); + } + + static void BuildSchemaCreate(Configuration config) + { + /// This NHibernate tool takes a configuration (with mapping info in) + /// and exports a database schema from it + new SchemaExport(config).Create(true, true); + } + + /// Create a NHibernate session for the given database + public static ISession CreateSession(Database database) + { + int ix = (int)database; + if (ix < 0 || ix >= (int)Database.Count) return null; + + if (SessionFactories[ix] == null) SessionFactories[ix] = CreateSessionFactory(database); + + return SessionFactories[ix].OpenSession(); + } + + public static void SaveToDb(Database database, object obj) + { + ISession session = FluentCommon.CreateSession(database); + SaveToDb(session, obj); + } + + public static void SaveToDb(ISession session, object obj) + { + using (var transaction = session.BeginTransaction()) + { + session.SaveOrUpdate(obj); + try { transaction.Commit(); } + catch { } + } + } + + public static void DeleteFromDb(Database database, object obj) + { + ISession session = FluentCommon.CreateSession(database); + SaveToDb(session, obj); + } + + public static void DeleteFromDb(ISession session, object obj) + { + using (var transaction = session.BeginTransaction()) + { + session.Delete(obj); + transaction.Commit(); + } + } + + /// + /// Create an empty users database. + /// Database contains only the user 'admin' and the control board component 'CB'. + /// + /// DBType.SQLite or DBType.MySql + /// Connection string + /// true=success, false=error + public static bool CreateEmptyUsersDB(DBSettings dbSettings) + { + ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); + if (sessionFactory == null) return false; + + /// Populate the database + using (var session = sessionFactory.OpenSession()) + { + using (var transaction = session.BeginTransaction()) + { + /// + /// Prepare all groups + /// + var testers = new Entities.Group { Gid = (int)TBF.Grp.GID.Testers, Name = Strings.Tester }; + var testingSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.TestingSpecialists, Name = Strings.Testing_Specialist }; + var headOfLab = new Entities.Group { Gid = (int)TBF.Grp.GID.HeadOfLab, Name = Strings.Head_of_Lab }; + var maintenanceSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.MaintenanceSpecialists, Name = Strings.Maintenance_Specialist }; + var metrologists = new Entities.Group { Gid = (int)TBF.Grp.GID.Metrologists, Name = Strings.Metrologist }; + var calibrationSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.CalibrationSpecialists, Name = Strings.Calibration_Specialist }; + var administrators = new Entities.Group { Gid = (int)TBF.Grp.GID.Administrators, Name = Strings.Administrator }; + + /// Create the user 'admin' add his groups + var admin = new Entities.User + { + Name = Program.AdminUsername, + Description = "Administrator", + LastPwChange = DateTime.Now + }; + admin.SetPassword(Program.AdminPassword); + admin.AddGroup(testers); + admin.AddGroup(testingSpecialists); + admin.AddGroup(headOfLab); + admin.AddGroup(maintenanceSpecialists); + admin.AddGroup(metrologists); + admin.AddGroup(calibrationSpecialists); + admin.AddGroup(administrators); + + session.SaveOrUpdate(admin); + + /// Create the control board component + var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory(), "CB", 1)).CreateDbEntity(); + session.SaveOrUpdate(cmpnt); + + transaction.Commit(); + } + } + + return true; + } + + /// + /// Create an empty bench database + /// + /// DBType.SQLite or DBType.MySql + /// Connection string + /// true=success, false=error + public static bool CreateEmptyBenchDB(DBSettings dbSettings) + { + ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); + if (sessionFactory == null) return false; + + /// Populate the database + //using (var session = sessionFactory.OpenSession()) + //{ + // using (var transaction = session.BeginTransaction()) + // { + // /// Create one component + // var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity(); + // session.SaveOrUpdate(cmpnt); + // transaction.Commit(); + // } + //} + return true; + } + + /// + /// Create an empty procedures database + /// + /// DBType.SQLite or DBType.MySql + /// Connection string + /// true=success, false=error + public static bool CreateEmptyProceduresDB(DBSettings dbSettings) + { + ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); + if (sessionFactory == null) return false; + + /// Populate the database + //using (var session = sessionFactory.OpenSession()) + //{ + // using (var transaction = session.BeginTransaction()) + // { + // /// Create one component + // var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity(); + // session.SaveOrUpdate(cmpnt); + // transaction.Commit(); + // } + //} + return true; + } + + /// + /// Create an empty water meters database + /// + /// DBType.SQLite or DBType.MySql + /// Connection string + /// true=success, false=error + public static bool CreateEmptyWaterMetersDB(DBSettings dbSettings) + { + ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); + if (sessionFactory == null) return false; + + /// Populate the database + //using (var session = sessionFactory.OpenSession()) + //{ + // using (var transaction = session.BeginTransaction()) + // { + // /// Create one component + // var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity(); + // session.SaveOrUpdate(cmpnt); + // transaction.Commit(); + // } + //} + return true; + } + } +} diff --git a/TestBenchFramework/Forms/AboutDlg.Designer.cs b/TestBenchFramework/Forms/AboutDlg.Designer.cs new file mode 100644 index 000000000..06b1a1733 --- /dev/null +++ b/TestBenchFramework/Forms/AboutDlg.Designer.cs @@ -0,0 +1,100 @@ +namespace TBF.Forms +{ + partial class AboutDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDlg)); + this.copyrightLabel = new System.Windows.Forms.Label(); + this.versionLabel = new System.Windows.Forms.Label(); + this.buildDateLabel = new System.Windows.Forms.Label(); + this.closeButton = new System.Windows.Forms.Button(); + this.logoPictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); + this.SuspendLayout(); + // + // copyrightLabel + // + resources.ApplyResources(this.copyrightLabel, "copyrightLabel"); + this.copyrightLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.copyrightLabel.Name = "copyrightLabel"; + // + // versionLabel + // + resources.ApplyResources(this.versionLabel, "versionLabel"); + this.versionLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.versionLabel.Name = "versionLabel"; + // + // buildDateLabel + // + resources.ApplyResources(this.buildDateLabel, "buildDateLabel"); + this.buildDateLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.buildDateLabel.Name = "buildDateLabel"; + // + // closeButton + // + resources.ApplyResources(this.closeButton, "closeButton"); + this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.closeButton.ImageKey = global::TBF.Resources.Strings.String1; + this.closeButton.Name = "closeButton"; + this.closeButton.UseVisualStyleBackColor = true; + // + // logoPictureBox + // + resources.ApplyResources(this.logoPictureBox, "logoPictureBox"); + this.logoPictureBox.BackgroundImage = global::TBF.Properties.Resources.sensus_logo; + this.logoPictureBox.Name = "logoPictureBox"; + this.logoPictureBox.TabStop = false; + // + // AboutDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.logoPictureBox); + this.Controls.Add(this.closeButton); + this.Controls.Add(this.buildDateLabel); + this.Controls.Add(this.versionLabel); + this.Controls.Add(this.copyrightLabel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "AboutDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label copyrightLabel; + private System.Windows.Forms.Label versionLabel; + private System.Windows.Forms.Label buildDateLabel; + private System.Windows.Forms.Button closeButton; + private System.Windows.Forms.PictureBox logoPictureBox; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/AboutDlg.cs b/TestBenchFramework/Forms/AboutDlg.cs new file mode 100644 index 000000000..e7ad3131b --- /dev/null +++ b/TestBenchFramework/Forms/AboutDlg.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace TBF.Forms +{ + /// + /// About dialog + /// + public partial class AboutDlg : Form + { + /// + /// Contsructor + /// + /// Language neutral version string + /// Regionally formated build date string + public AboutDlg(string version, string buildDate) + { + InitializeComponent(); + versionLabel.Text = versionLabel.Text.Replace("_VERSION_", version); + buildDateLabel.Text = buildDateLabel.Text.Replace("_BUILD_DATE_", buildDate); + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/AboutDlg.de.resx b/TestBenchFramework/Forms/AboutDlg.de.resx new file mode 100644 index 000000000..85a3599fe --- /dev/null +++ b/TestBenchFramework/Forms/AboutDlg.de.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 117, 13 + + + © 2014 Sensus GmbH + + + erstellt am _BUILD_DATE_ + + + &Schließen + + + Über Test Bench Framework + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/AboutDlg.resx b/TestBenchFramework/Forms/AboutDlg.resx new file mode 100644 index 000000000..a3a3d45f5 --- /dev/null +++ b/TestBenchFramework/Forms/AboutDlg.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + $this + + + About Test Bench Framework + + + $this + + + + 6, 13 + + + versionLabel + + + copyrightLabel + + + logoPictureBox + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + AboutDlg + + + $this + + + + True + + + True + + + 103, 30 + + + 3 + + + 105, 13 + + + + Stretch + + + 458, 99 + + + 0 + + + 145, 41 + + + CenterParent + + + 341, 36 + + + 145, 64 + + + Version _VERSION_ + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 136, 13 + + + closeButton + + + 11 + + + 4 + + + 12 + + + 105, 28 + + + 6 + + + Copyright © 2013 + + + 4 + + + &Close + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 12, 34 + + + 2 + + + $this + + + 1 + + + $this + + + buildDateLabel + + + 90, 13 + + + + + + 145, 19 + + + 5 + + + Build date _BUILD_DATE_ + + + True + + + de + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/ClosingProgram.Designer.cs b/TestBenchFramework/Forms/ClosingProgram.Designer.cs new file mode 100644 index 000000000..8acdbce86 --- /dev/null +++ b/TestBenchFramework/Forms/ClosingProgram.Designer.cs @@ -0,0 +1,66 @@ +namespace TBF.Forms +{ + partial class ClosingProgram + { + /// + /// 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 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.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(37, 68); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(306, 24); + this.label1.TabIndex = 0; + this.label1.Text = "Closing the Test Bench Framework"; + // + // ClosingProgram + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.PeachPuff; + this.ClientSize = new System.Drawing.Size(373, 161); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ClosingProgram"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Closing the Test Bench Framework"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/ClosingProgram.cs b/TestBenchFramework/Forms/ClosingProgram.cs new file mode 100644 index 000000000..ac5cd3315 --- /dev/null +++ b/TestBenchFramework/Forms/ClosingProgram.cs @@ -0,0 +1,31 @@ +using System; +using System.Windows.Forms; + +namespace TBF.Forms +{ + public partial class ClosingProgram : Form + { + Timer timer; + + public ClosingProgram() + { + InitializeComponent(); + + timer = new Timer(); + timer.Interval = 1000; + timer.Tick += new EventHandler(timer_Tick); + timer.Start(); + } + + void timer_Tick(object sender, EventArgs args) + { + if (!TBF.BenchControl.StateMachine.Running) + { + timer.Stop(); + timer.Dispose(); + DialogResult = DialogResult.OK; + Close(); + } + } + } +} diff --git a/TestBenchFramework/Forms/ClosingProgram.resx b/TestBenchFramework/Forms/ClosingProgram.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Forms/ClosingProgram.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/TestBenchFramework/Forms/EditSelectedUser.Designer.cs b/TestBenchFramework/Forms/EditSelectedUser.Designer.cs new file mode 100644 index 000000000..a4897dada --- /dev/null +++ b/TestBenchFramework/Forms/EditSelectedUser.Designer.cs @@ -0,0 +1,145 @@ +namespace TBF.Forms +{ + partial class EditSelectedUser + { + /// + /// 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 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(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditSelectedUser)); + this.txtName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtDescription = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.checkedListBoxGroups = new System.Windows.Forms.CheckedListBox(); + this.label5 = new System.Windows.Forms.Label(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // txtName + // + resources.ApplyResources(this.txtName, "txtName"); + this.txtName.Name = "txtName"; + this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); + this.txtName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtName_KeyPress); + this.txtName.Validated += new System.EventHandler(this.txtName_Validated); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // btnOk + // + resources.ApplyResources(this.btnOk, "btnOk"); + this.btnOk.Name = "btnOk"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // btnCancel + // + resources.ApplyResources(this.btnCancel, "btnCancel"); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // txtPassword + // + resources.ApplyResources(this.txtPassword, "txtPassword"); + this.txtPassword.Name = "txtPassword"; + this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // txtDescription + // + resources.ApplyResources(this.txtDescription, "txtDescription"); + this.txtDescription.Name = "txtDescription"; + this.txtDescription.TextChanged += new System.EventHandler(this.txtDescription_TextChanged); + this.txtDescription.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDescription_KeyPress); + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // checkedListBoxGroups + // + this.checkedListBoxGroups.CheckOnClick = true; + this.checkedListBoxGroups.FormattingEnabled = true; + resources.ApplyResources(this.checkedListBoxGroups, "checkedListBoxGroups"); + this.checkedListBoxGroups.Name = "checkedListBoxGroups"; + this.checkedListBoxGroups.Click += new System.EventHandler(this.checkedListBoxGroups_Click); + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // EditSelectedUser + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label5); + this.Controls.Add(this.checkedListBoxGroups); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label1); + this.Controls.Add(this.txtDescription); + this.Controls.Add(this.txtPassword); + this.Controls.Add(this.txtName); + this.Name = "EditSelectedUser"; + this.Load += new System.EventHandler(this.EditSelectedUser_Load); + this.Shown += new System.EventHandler(this.EditSelectedUser_Shown); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox txtName; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.TextBox txtPassword; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtDescription; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckedListBox checkedListBoxGroups; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ToolTip toolTip1; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/EditSelectedUser.cs b/TestBenchFramework/Forms/EditSelectedUser.cs new file mode 100644 index 000000000..89db52e02 --- /dev/null +++ b/TestBenchFramework/Forms/EditSelectedUser.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using NHibernate; +using TBF.Entities; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class EditSelectedUser : Form + { + public User CurrentEditUser; + public NHibernate.ISession Session; + + public EditSelectedUser() + { + InitializeComponent(); + this.toolTip1.SetToolTip(this.txtName, Strings.MaxChars.Replace("_X_", Convert.ToString(20))); + + btnOk.Enabled = false; + } + + private void EditSelectedUser_Load(object sender, EventArgs e) + { + txtName.Text = CurrentEditUser.Name; + txtDescription.Text = CurrentEditUser.Description; + txtPassword.Text = ""; + ShowGroups(); + } + + + public void ShowGroups() + { + checkedListBoxGroups.Items.Clear(); + for (int i= 0; (int)i < Grp.Count; i++) + { + Group group = Grp.FromId((Grp.GID)i); + + bool boolIsMember = CurrentEditUser.IsMemberOf((Grp.GID)group.Gid); + if (boolIsMember == true) + { + checkedListBoxGroups.Items.Add(group.Name); + checkedListBoxGroups.SetItemCheckState(i, CheckState.Checked); + } + else + { + checkedListBoxGroups.Items.Add(group.Name); + checkedListBoxGroups.SetItemCheckState(i, CheckState.Unchecked); + + } + } + } + + + public bool Save() { + + // todo: check if this name is given to another user + if (IsUserNameAllreadyTaken(txtName.Text)) + { + MessageBox.Show(Strings.Username_taken); + return false; + } + + + CurrentEditUser.Name = txtName.Text; + + if (txtPassword.Text != "") + { + CurrentEditUser.SetPassword(txtPassword.Text); + } + CurrentEditUser.Description = txtDescription.Text; + + // Groups + CurrentEditUser.Groups.Clear(); + for (int i = 0; (int)i < checkedListBoxGroups.Items.Count ; i++) + { + if (checkedListBoxGroups.GetItemChecked(i)) { + Group newGroup = Grp.FromId((Grp.GID)i); + CurrentEditUser.Groups.Add(newGroup ); + } + } + + Cursor.Current = Cursors.WaitCursor; + FluentCommon.SaveToDb(Session, CurrentEditUser); + Cursor.Current = Cursors.Default; + + return true; + } + + /// + /// returns true if the username allready exists for another user + /// + private bool IsUserNameAllreadyTaken(string Username) + { + // have a look into all other users + IList ListOfUsers = User.GetAllUsers(); + foreach (var person in ListOfUsers) + { + if (person.Id != CurrentEditUser.Id) { + // other user + if (person.Name.ToLower() == Username.ToLower()) + { + // Name is equal, so allready taken + return true; + } + } + } + return false; + } + + + private void btnOk_Click(object sender, EventArgs e) + { + if (Save()) + { + this.Close(); + } + } + + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + + + private void CheckIfFormCanBeSubmitted() + { + btnOk.Enabled = false; + if (txtName.Text == "") return; + btnOk.Enabled = true; + } + + private void EditSelectedUser_Shown(object sender, EventArgs e) + { + txtName.Focus(); + } + + private void txtName_Validated(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + + private void txtName_KeyPress(object sender, KeyPressEventArgs e) + { + CheckIfFormCanBeSubmitted(); + + } + + private void txtName_TextChanged(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + + private void txtPassword_TextChanged(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + + private void txtDescription_TextChanged(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + + private void txtDescription_KeyPress(object sender, KeyPressEventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + + private void checkedListBoxGroups_Click(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + } +} diff --git a/TestBenchFramework/Forms/EditSelectedUser.de.resx b/TestBenchFramework/Forms/EditSelectedUser.de.resx new file mode 100644 index 000000000..95145c290 --- /dev/null +++ b/TestBenchFramework/Forms/EditSelectedUser.de.resx @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 106, 9 + + + 9, 16 + + + 75, 13 + + + Benutzername + + + 106, 252 + + + 232, 252 + + + 74, 23 + + + Abbrechen + + + 106, 40 + + + 9, 43 + + + 50, 13 + + + Passwort + + + 106, 70 + + + 72, 13 + + + Beschreibung + + + 106, 135 + + + 9, 135 + + + 48, 13 + + + Gruppen + + + Benutzer einrichten + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/EditSelectedUser.resx b/TestBenchFramework/Forms/EditSelectedUser.resx new file mode 100644 index 000000000..c37f77d1b --- /dev/null +++ b/TestBenchFramework/Forms/EditSelectedUser.resx @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 75, 9 + + + 200, 20 + + + + 0 + + + txtName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + True + + + 12, 9 + + + 35, 13 + + + 1 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 75, 252 + + + 75, 23 + + + 3 + + + OK + + + btnOk + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 200, 252 + + + 75, 23 + + + 3 + + + Cancel + + + btnCancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 75, 40 + + + * + + + 200, 20 + + + 0 + + + txtPassword + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + True + + + 9, 40 + + + 53, 13 + + + 1 + + + Password + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 75, 70 + + + True + + + 200, 59 + + + 0 + + + txtDescription + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + True + + + 9, 70 + + + 60, 13 + + + 1 + + + Description + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 75, 135 + + + 200, 94 + + + 4 + + + checkedListBoxGroups + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 12, 135 + + + 41, 13 + + + 5 + + + Groups + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 17, 17 + + + de + + + True + + + 6, 13 + + + 318, 287 + + + Edit User + + + toolTip1 + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + EditSelectedUser + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/EditUsers.Designer.cs b/TestBenchFramework/Forms/EditUsers.Designer.cs new file mode 100644 index 000000000..f78329859 --- /dev/null +++ b/TestBenchFramework/Forms/EditUsers.Designer.cs @@ -0,0 +1,125 @@ +namespace TBF.Forms +{ + partial class EditUsers + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditUsers)); + this.listViewUsers = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnEdit = new System.Windows.Forms.Button(); + this.btnDelete = new System.Windows.Forms.Button(); + this.btnOk = new System.Windows.Forms.Button(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.SuspendLayout(); + // + // listViewUsers + // + this.listViewUsers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listViewUsers.FullRowSelect = true; + resources.ApplyResources(this.listViewUsers, "listViewUsers"); + this.listViewUsers.MultiSelect = false; + this.listViewUsers.Name = "listViewUsers"; + this.listViewUsers.UseCompatibleStateImageBehavior = false; + this.listViewUsers.View = System.Windows.Forms.View.Details; + this.listViewUsers.SelectedIndexChanged += new System.EventHandler(this.listViewUsers_SelectedIndexChanged); + this.listViewUsers.DoubleClick += new System.EventHandler(this.listViewUsers_DoubleClick); + // + // columnHeader1 + // + resources.ApplyResources(this.columnHeader1, "columnHeader1"); + // + // columnHeader2 + // + resources.ApplyResources(this.columnHeader2, "columnHeader2"); + // + // btnAdd + // + resources.ApplyResources(this.btnAdd, "btnAdd"); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnEdit + // + resources.ApplyResources(this.btnEdit, "btnEdit"); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); + // + // btnDelete + // + resources.ApplyResources(this.btnDelete, "btnDelete"); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.UseVisualStyleBackColor = true; + this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); + // + // btnOk + // + resources.ApplyResources(this.btnOk, "btnOk"); + this.btnOk.Name = "btnOk"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // statusStrip1 + // + resources.ApplyResources(this.statusStrip1, "statusStrip1"); + this.statusStrip1.Name = "statusStrip1"; + // + // EditUsers + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.btnDelete); + this.Controls.Add(this.btnEdit); + this.Controls.Add(this.btnAdd); + this.Controls.Add(this.listViewUsers); + this.Name = "EditUsers"; + this.Activated += new System.EventHandler(this.EditUsers_Activated); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ListView listViewUsers; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnEdit; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/EditUsers.cs b/TestBenchFramework/Forms/EditUsers.cs new file mode 100644 index 000000000..6cb574e7c --- /dev/null +++ b/TestBenchFramework/Forms/EditUsers.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +using NHibernate; +using TBF.Entities; + + +namespace TBF.Forms +{ + public partial class EditUsers: Form + { + NHibernate.ISession session; + IList ListOfUsers; + int LastSelectedIndex; + + public EditUsers() + { + InitializeComponent(); + } + + private void EditUsers_Activated(object sender, EventArgs e) + { + Cursor.Current = Cursors.WaitCursor; + session = FluentCommon.CreateSession(Database.Users); + ListUsers(); + RefreshButtonStates(); + } + + public void ListUsers() + { + Cursor.Current = Cursors.WaitCursor; + + if (User.CurrentUser.IsMemberOf(Grp.GID.Administrators) || User.CurrentUser.IsMemberOf(Grp.GID.HeadOfLab)) + { + /// Admin and HeadOfLab can edit all users + ListOfUsers = session.CreateQuery("FROM User") + .List(); + } + else + { + /// user can only edit their own data + ListOfUsers = session.CreateQuery("FROM User WHERE id= :CurrentUserId") + .SetParameter("CurrentUserId", User.CurrentUser.Id) + .List(); + } + + listViewUsers.Items.Clear(); + foreach (var person in ListOfUsers) + { + ListViewItem item = new ListViewItem(person.Name); + item.SubItems.Add(person.Id.ToString()); + item.Tag = person; + this.listViewUsers.Items.Add(item); + } + this.listViewUsers.Refresh(); + + Cursor.Current = Cursors.Default; + } + + private void btnOk_Click(object sender, EventArgs e) + { + this.Close(); + } + + + private void RefreshButtonStates() + { + btnEdit.Enabled = (listViewUsers.SelectedItems.Count > 0); + btnDelete.Enabled = (listViewUsers.SelectedItems.Count > 0); + } + + private void listViewUsers_SelectedIndexChanged(object sender, EventArgs e) + { + RefreshButtonStates(); + if (listViewUsers.SelectedItems.Count > 0) + { + LastSelectedIndex = listViewUsers.SelectedItems[0].Index; + } + else + { + LastSelectedIndex = -1; + } + } + + private void btnEdit_Click(object sender, EventArgs e) + { + Forms.EditSelectedUser dlg = new Forms.EditSelectedUser(); + dlg.CurrentEditUser = (User)listViewUsers.SelectedItems[0].Tag; + dlg.Session = session; + dlg.ShowDialog(); + ListUsers(); + } + + private void listViewUsers_DoubleClick(object sender, EventArgs e) + { + btnEdit_Click (sender, e); + } + + private void btnAdd_Click(object sender, EventArgs e) + { + Forms.EditSelectedUser dlg; + dlg = new Forms.EditSelectedUser(); + dlg.Session = session; + dlg.CurrentEditUser = new Entities.User(); + dlg.ShowDialog(); + ListUsers(); + } + + private void btnDelete_Click(object sender, EventArgs e) + { + Object Selecteduser = listViewUsers.SelectedItems[0].Tag; + FluentCommon.DeleteFromDb(session, Selecteduser); + ListUsers(); + } + } + +} + + diff --git a/TestBenchFramework/Forms/EditUsers.de.resx b/TestBenchFramework/Forms/EditUsers.de.resx new file mode 100644 index 000000000..c75bf86b5 --- /dev/null +++ b/TestBenchFramework/Forms/EditUsers.de.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + &Neu... + + + &Bearbeiten + + + &Löschen + + + Benutzerverwaltung + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/EditUsers.resx b/TestBenchFramework/Forms/EditUsers.resx new file mode 100644 index 000000000..2da933732 --- /dev/null +++ b/TestBenchFramework/Forms/EditUsers.resx @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Name + + + + 162 + + + ID + + + + 12, 12 + + + 357, 399 + + + 0 + + + listViewUsers + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 388, 42 + + + 75, 23 + + + 1 + + + Add + + + btnAdd + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 388, 71 + + + 75, 23 + + + 1 + + + Edit + + + btnEdit + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 388, 100 + + + 75, 23 + + + 1 + + + Delete + + + btnDelete + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 388, 388 + + + 75, 23 + + + 1 + + + OK + + + btnOk + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 17, 17 + + + 0, 442 + + + 475, 22 + + + 2 + + + statusStrip1 + + + statusStrip1 + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + de + + + True + + + 6, 13 + + + 475, 464 + + + user management + + + columnHeader1 + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnHeader2 + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + EditUsers + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/EmergencyStopForm.cs b/TestBenchFramework/Forms/EmergencyStopForm.cs new file mode 100644 index 000000000..83c996286 --- /dev/null +++ b/TestBenchFramework/Forms/EmergencyStopForm.cs @@ -0,0 +1,56 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class EmergencyStopForm : Form + { + public static bool ClosingForm = false; + + /// + /// Parameterless constructor (does the localization) + /// + public EmergencyStopForm() + { + Visible = false; + InitializeComponent(); + emergencyStopMsgLabel.Text = Strings.Emergency_STOP; + emergencyStopMsgLabel.Enabled = false; + emergencyStopMsgLabel.Visible = false; + + UiBridge.Bridge.EmergencyStopChangedHandler += delegate(object sender, UiBridge.EmergencyStopEventArgs args) + { + if (ClosingForm) return; + + if (InvokeRequired) + { + Invoke(new EventHandler(OnEmergencyStopStateChanged), sender, args); + } + else OnEmergencyStopStateChanged(sender, args); + }; + } + + void OnEmergencyStopStateChanged(Object sender, UiBridge.EmergencyStopEventArgs args) + { + if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.Active) + { + Visible = true; + emergencyStopMsgLabel.Enabled = true; + emergencyStopMsgLabel.Visible = true; + } + else if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.Inactive) + { + Visible = false; + emergencyStopMsgLabel.Enabled = false; + emergencyStopMsgLabel.Visible = false; + } + else if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.CloseForm) + { + ClosingForm = true; + Close(); + } + } + } +} diff --git a/TestBenchFramework/Forms/EmergencyStopForm.designer.cs b/TestBenchFramework/Forms/EmergencyStopForm.designer.cs new file mode 100644 index 000000000..d8d406f57 --- /dev/null +++ b/TestBenchFramework/Forms/EmergencyStopForm.designer.cs @@ -0,0 +1,73 @@ +namespace TBF.Forms +{ + partial class EmergencyStopForm + { + /// + /// 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 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.emergencyStopMsgLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // emergencyStopMsgLabel + // + this.emergencyStopMsgLabel.AutoSize = true; + this.emergencyStopMsgLabel.Enabled = false; + this.emergencyStopMsgLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.emergencyStopMsgLabel.ForeColor = System.Drawing.Color.Yellow; + this.emergencyStopMsgLabel.Location = new System.Drawing.Point(67, 86); + this.emergencyStopMsgLabel.Name = "emergencyStopMsgLabel"; + this.emergencyStopMsgLabel.Size = new System.Drawing.Size(287, 37); + this.emergencyStopMsgLabel.TabIndex = 1; + this.emergencyStopMsgLabel.Text = "Emergency STOP"; + this.emergencyStopMsgLabel.Visible = false; + // + // EmergencyStopForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.Color.Red; + this.ClientSize = new System.Drawing.Size(412, 212); + this.Controls.Add(this.emergencyStopMsgLabel); + this.Enabled = false; + this.ForeColor = System.Drawing.Color.Yellow; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EmergencyStopForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Emergency STOP"; + this.TopMost = true; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label emergencyStopMsgLabel; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/EmergencyStopForm.resx b/TestBenchFramework/Forms/EmergencyStopForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Forms/EmergencyStopForm.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/TestBenchFramework/Forms/EnterPasswordDlg.Designer.cs b/TestBenchFramework/Forms/EnterPasswordDlg.Designer.cs new file mode 100644 index 000000000..18eeacada --- /dev/null +++ b/TestBenchFramework/Forms/EnterPasswordDlg.Designer.cs @@ -0,0 +1,106 @@ +namespace TBF.Forms +{ + partial class EnterPasswordDlg + { + /// + /// 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 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.cancelButton = new System.Windows.Forms.Button(); + this.passwordTextBox = new System.Windows.Forms.TextBox(); + this.passwordLabel = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.cancelButton.Location = new System.Drawing.Point(275, 43); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(105, 28); + this.cancelButton.TabIndex = 8; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // passwordTextBox + // + this.passwordTextBox.Location = new System.Drawing.Point(85, 26); + this.passwordTextBox.Name = "passwordTextBox"; + this.passwordTextBox.Size = new System.Drawing.Size(168, 20); + this.passwordTextBox.TabIndex = 7; + this.passwordTextBox.UseSystemPasswordChar = true; + // + // passwordLabel + // + this.passwordLabel.AutoSize = true; + this.passwordLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.passwordLabel.Location = new System.Drawing.Point(12, 29); + this.passwordLabel.Name = "passwordLabel"; + this.passwordLabel.Size = new System.Drawing.Size(53, 13); + this.passwordLabel.TabIndex = 6; + this.passwordLabel.Text = "Password"; + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.okButton.Location = new System.Drawing.Point(275, 10); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(105, 28); + this.okButton.TabIndex = 9; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // EnterPasswordDlg + // + this.AcceptButton = okButton; + this.CancelButton = cancelButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(392, 79); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.passwordTextBox); + this.Controls.Add(this.passwordLabel); + this.Name = "EnterPasswordDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Enter password"; + this.Load += new System.EventHandler(this.PasswordDlg_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.TextBox passwordTextBox; + private System.Windows.Forms.Label passwordLabel; + private System.Windows.Forms.Button okButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/EnterPasswordDlg.cs b/TestBenchFramework/Forms/EnterPasswordDlg.cs new file mode 100644 index 000000000..229db2ccb --- /dev/null +++ b/TestBenchFramework/Forms/EnterPasswordDlg.cs @@ -0,0 +1,48 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class EnterPasswordDlg : Form + { + /// + /// If set, this is the password that should be entered by the user to pass, + /// otherwise user has to enter the current user password (Entities.User.CurrentUser). + /// + public string Password; + + public EnterPasswordDlg() + { + InitializeComponent(); + } + + private void PasswordDlg_Load(object sender, EventArgs e) + { + Text = Strings.Enter_password; + passwordLabel.Text = Strings.Password; + okButton.Text = Strings.OkBtnText; + cancelButton.Text = Strings.CancelBtnText; + } + + private void okButton_Click(object sender, EventArgs e) + { + if ((Password != null && Password.Equals(passwordTextBox.Text)) || + (Password == null && Entities.User.CurrentUser.CheckPassword(passwordTextBox.Text))) + { + DialogResult = DialogResult.OK; + Close(); + return; + } + + MessageBox.Show(Strings.Invalid_password, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + DialogResult = DialogResult.None; + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/TestBenchFramework/Forms/EnterPasswordDlg.resx b/TestBenchFramework/Forms/EnterPasswordDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Forms/EnterPasswordDlg.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/TestBenchFramework/Forms/ErrorDlg.Designer.cs b/TestBenchFramework/Forms/ErrorDlg.Designer.cs new file mode 100644 index 000000000..135c3a45e --- /dev/null +++ b/TestBenchFramework/Forms/ErrorDlg.Designer.cs @@ -0,0 +1,106 @@ +namespace TBF.Forms +{ + + partial class ErrorDlg + { + private string m_message; + + public string Message + { + get + { + return m_message; + } + + set + { + m_message = value; + textBoxMessage.Text = m_message; + } + } + + + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorDlg)); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnIgnore = new System.Windows.Forms.Button(); + this.btnRetry = new System.Windows.Forms.Button(); + this.textBoxMessage = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // btnCancel + // + resources.ApplyResources(this.btnCancel, "btnCancel"); + this.btnCancel.ImageKey = global::TBF.Resources.Strings.String1; + this.btnCancel.Name = "btnCancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // btnIgnore + // + resources.ApplyResources(this.btnIgnore, "btnIgnore"); + this.btnIgnore.ImageKey = global::TBF.Resources.Strings.String1; + this.btnIgnore.Name = "btnIgnore"; + this.btnIgnore.UseVisualStyleBackColor = true; + this.btnIgnore.Click += new System.EventHandler(this.btnIgnore_Click); + // + // btnRetry + // + resources.ApplyResources(this.btnRetry, "btnRetry"); + this.btnRetry.ImageKey = global::TBF.Resources.Strings.String1; + this.btnRetry.Name = "btnRetry"; + this.btnRetry.UseVisualStyleBackColor = true; + this.btnRetry.Click += new System.EventHandler(this.btnRetry_Click); + // + // textBoxMessage + // + resources.ApplyResources(this.textBoxMessage, "textBoxMessage"); + this.textBoxMessage.Name = "textBoxMessage"; + // + // ErrorDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.textBoxMessage); + this.Controls.Add(this.btnRetry); + this.Controls.Add(this.btnIgnore); + this.Controls.Add(this.btnCancel); + this.Name = "ErrorDlg"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnIgnore; + private System.Windows.Forms.Button btnRetry; + private System.Windows.Forms.TextBox textBoxMessage; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/ErrorDlg.cs b/TestBenchFramework/Forms/ErrorDlg.cs new file mode 100644 index 000000000..9896e1066 --- /dev/null +++ b/TestBenchFramework/Forms/ErrorDlg.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF; +using TBF.ErrorHandler; + +namespace TBF.Forms +{ + public partial class ErrorDlg : Form + { + public ErrorDlg() + { + InitializeComponent(); + } + + public DialogResult returnvalue; + + public ErrorDlg(string ErrorDescription) + { + InitializeComponent(); + textBoxMessage.Text = ErrorDescription; + } + + private void btnOk_Click(object sender, EventArgs e) + { + returnvalue = DialogResult.OK; + this.Close(); + } + + private void btnIgnore_Click(object sender, EventArgs e) + { + returnvalue = DialogResult.Ignore; + this.Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + returnvalue = DialogResult.Cancel; + this.Close(); + } + + private void btnRetry_Click(object sender, EventArgs e) + { + returnvalue = DialogResult.Retry; + this.Close(); + } + } +} diff --git a/TestBenchFramework/Forms/ErrorDlg.de.resx b/TestBenchFramework/Forms/ErrorDlg.de.resx new file mode 100644 index 000000000..5983d6919 --- /dev/null +++ b/TestBenchFramework/Forms/ErrorDlg.de.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + &Abbrechen + + + Ein unbehandelter Fehler ist aufgetreten! + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/ErrorDlg.resx b/TestBenchFramework/Forms/ErrorDlg.resx new file mode 100644 index 000000000..b267ccbac --- /dev/null +++ b/TestBenchFramework/Forms/ErrorDlg.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Vertical + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 6, 13 + + + 1 + + + Ignore + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 1 + + + ErrorDlg + + + 508, 280 + + + 399, 340 + + + btnIgnore + + + 2 + + + $this + + + 1 + + + 0 + + + 530, 375 + + + 187, 340 + + + 100, 23 + + + 12, 43 + + + 1 + + + textBoxMessage + + + $this + + + 3 + + + btnCancel + + + btnRetry + + + $this + + + 100, 23 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 293, 340 + + + 2 + + + True + + + 100, 23 + + + $this + + + An unhandled Error occured + + + Retry + + + True + + + de + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.Designer.cs b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.Designer.cs new file mode 100644 index 000000000..6dd239be9 --- /dev/null +++ b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.Designer.cs @@ -0,0 +1,120 @@ +namespace TBF.Forms +{ + partial class NoBenchOrDatabaseDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NoBenchOrDatabaseDlg)); + this.exitButton = new System.Windows.Forms.Button(); + this.retryButton = new System.Windows.Forms.Button(); + this.configureButton = new System.Windows.Forms.Button(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.errorMessageLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // exitButton + // + this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.exitButton.Location = new System.Drawing.Point(42, 68); + this.exitButton.Name = "exitButton"; + this.exitButton.Size = new System.Drawing.Size(246, 33); + this.exitButton.TabIndex = 0; + this.exitButton.Text = "Exit"; + this.exitButton.UseVisualStyleBackColor = true; + this.exitButton.Click += new System.EventHandler(this.exitButton_Click); + // + // retryButton + // + this.retryButton.Location = new System.Drawing.Point(42, 146); + this.retryButton.Name = "retryButton"; + this.retryButton.Size = new System.Drawing.Size(246, 33); + this.retryButton.TabIndex = 1; + this.retryButton.Text = "Retry database connection"; + this.retryButton.UseVisualStyleBackColor = true; + this.retryButton.Click += new System.EventHandler(this.retryButton_Click); + // + // configureButton + // + this.configureButton.Location = new System.Drawing.Point(42, 107); + this.configureButton.Name = "configureButton"; + this.configureButton.Size = new System.Drawing.Size(246, 33); + this.configureButton.TabIndex = 2; + this.configureButton.Text = "Configure test benches (password required)"; + this.configureButton.UseVisualStyleBackColor = true; + this.configureButton.Click += new System.EventHandler(this.configureButton_Click); + // + // pictureBox1 + // + this.pictureBox1.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.ErrorImage"))); + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.InitialImage = null; + this.pictureBox1.Location = new System.Drawing.Point(42, 21); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.TabIndex = 3; + this.pictureBox1.TabStop = false; + // + // errorMessageLabel + // + this.errorMessageLabel.AutoSize = true; + this.errorMessageLabel.Location = new System.Drawing.Point(80, 31); + this.errorMessageLabel.Name = "errorMessageLabel"; + this.errorMessageLabel.Size = new System.Drawing.Size(160, 13); + this.errorMessageLabel.TabIndex = 4; + this.errorMessageLabel.Text = "Cannot connect to the database"; + // + // NoBenchOrDatabaseDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.exitButton; + this.ClientSize = new System.Drawing.Size(328, 194); + this.Controls.Add(this.errorMessageLabel); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.configureButton); + this.Controls.Add(this.retryButton); + this.Controls.Add(this.exitButton); + this.Name = "NoBenchOrDatabaseDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Error"; + this.Load += new System.EventHandler(this.NoDatabaseMsgDlg_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button exitButton; + private System.Windows.Forms.Button retryButton; + private System.Windows.Forms.Button configureButton; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label errorMessageLabel; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.cs b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.cs new file mode 100644 index 000000000..780207983 --- /dev/null +++ b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class NoBenchOrDatabaseDlg : Form + { + public string Message; + public bool ShowRetry; + + public NoBenchOrDatabaseDlg() + { + InitializeComponent(); + } + + private void NoDatabaseMsgDlg_Load(object sender, EventArgs e) + { + Text = Strings.Error; + errorMessageLabel.Text = (Message != null) ? Message : Strings.Error; + exitButton.Text = Strings.ExitBtnText; + retryButton.Text = Strings.RetryDatabaseText; + configureButton.Text = Strings.ConfigureDatabaseText; + if (!ShowRetry) retryButton.Enabled = false; + } + + private void exitButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Abort; + } + + private void retryButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Retry; + } + + private void configureButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + } + } +} diff --git a/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.resx b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.resx new file mode 100644 index 000000000..e42c6fc53 --- /dev/null +++ b/TestBenchFramework/Forms/NoBenchOrDatabaseDlg.resx @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + iVBORw0KGgoAAAANSUhEUgAAA0sAAALBCAIAAAAGeq0rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAF7tJREFUeF7t3Vtw + l/Wdx3HvCEkQldrOdJiOhx6o2GqrUEAQFDlExcNuW7fVqb2o3c44g9Orbhc7uDe7nemO2M5gdXWtBBYS + BA0oa1By4BwIIWAgIYEi4aCEJFhd123VKfvk0O1h2t274H7m9Zonmf/h9/s+t+95kv/zv+Dc/6qnp2fn + jh3VVVVLHn304UWLHlq4sDiKB8XT4sXirWLB8FIAAD4a/mLhdXZ2rq6ufmTx4srKysbGxq6urrP9/R8M + Kh4UT4sXi7eKBcWyYvHwNgAAzrc/U3i9vb01NTVLlixpaGjoK550HjpZV3dkVVXH0scP/OOP9/5o8Ws/ + +efOymXd9Y1nOjv7zpwplhWLiy3F2uERAACcP39aeIc6OpYuXbqxtvatvr5TW7Z2P7/29L8+c+yhh7rv + u+/4X321++67Xr/zzsN33tl+192td9/ddP/9bcuWHWva+ebJk8WWYmOxfXgQAADnyR8V3v79+3/62GNt + bW19+/a9Xr26r7LyxAMPvHH33SfvvPPkgjuPLVjw+oIFRxYsOFxx+6Fbb22vmHdg3rzmioqtt92279FH + T+9pKTYW24shw+MAADgffl94hzo6ij7r7u4+vmHDyZWrTv3g704Ntt3xO+4o2u7o7bcfue22wxUVHfPn + H5w3r23OnP1z5rTOnr3n5pubZ87cMnv2v8+Ze2Tt2mJ7McSVPACA82i48Hp7e5cuXdrW1jaQd888c/y7 + f/vGXXccmzu3a8aMI7fcMtB28+d3zpt/cO7cttm37J89u/Xmm1tm39Q0bdr2a760ddKkrdOn18+YsWHm + rCNr1hRDilH+Jw8A4HwZLryampqNtbV9+/YdXrLkxPe+d/yOOw7PurHngQf+a/36kw888NoNUzvmzj0w + e/ZQ2zXPmrV75sxt113XfMcdx595pvXe+1656vObJk+unTJ13Y0ze5qbi1HFwKHJAACMsIHC6+zsXLJk + yVt9fe2PP35i0aJjty04fNNNb9x//7k33xxY0tNz5Jvf3H3ddUNtt2vGjKYbZ2y59tpd8+f/srHx6Nm+ + Y/v27fzq116cMOGlL3953fXXv/zXXy1GFQPdQgUA4LwYKLzV1dX19fVv7N51+Id///rttxd5d+yee86d + OTO0YsCbpzvuvXfHF7+468Ybt0+btvmLVzdV3PrLLVu6Tpw4cPBgW1dXZ/PuV+fNW/uZz6yZePXzX77u + 0Ip/a2hoKMYObwcAYARd0NPT88jixb09PV2rVh3+9rcPz5vTPn360Xv+5tw77wwvGfTr06cP3Htv3YQJ + dROv2l5RcXjr1q6TJw8ePLhv795Tp0+/++67L1RUrLz88pVXXVU98erae77Wd+ZMMdY3XgAAjLwLdu7Y + UVlZeaazq/XBBztuuaV99k1tN9/ccv31h7/znXNvvVWs+PDDD9977713P/zwV93H99x11+ZZs4q8O9Td + ffDAgdbW1oG8e+edylmzniwvrxw79tmxY/917Njqa649vX//8uXLi+FDpwEAYMRcUF1V1djY2P1KXevX + vn7gpptemzlz78yZe2bM2HrV1W3f+tZ7vb3vnzv39ttvn+3v7/nVr9547bX2urq2rq6i7Xbv2nX81Kn/ + ePvtZ6dNe6K8fHlZ2S/Kyp4ZPFaMH9/29NObN28uhg+fBwCAkXLBkkcf7erqOvjU0y0VFftm3Lh3xvTd + 06c3TZu2c+oNdRMm7Lnvvv5Tp/rfffeNU6eOHj3aeeRIW2dnS0tLU1NT91DezZz5ZHn5itLSZWVlzw4e + RedVjhvX+OCDxdhi+PB5AAAYKRc8vGjR2f7+5kcW77lp1lDbNU2bsm3KlC2TJzdOnfrylZdvufXWo83N + R44da29vb3vttb0tLbt27eo+fvydt99efvPNQ3k3dCwvKyuOIvWWXXhhzexbirHF8OHzAAAwUi54aOHC + Dz74oP4b39h9ww1F3m37yle2TJrUOHly/eTJtVdeuW706FWlpfUVFQfa2/e3tQ1dvdu6bVt/f/+L99// + RHl58e7K3x1F5A39XlFWtvILXyjGFsOHzwMAwEgZKLzf/OY3m7/73YHrdkXbXX99/aRJm6699qVx49aO + Hl1VWvripz61b/Xqlra2PXv2DOTd1q2bt2xp2Latef36lyZOLHquWFMc1X94FIX3pS+9//77Cg8AYOQN + /JW290zvzod/1DBlSn2Rd5Mn1V51Vc3o0WsG827d+PH71q/f09HR3NzctHPn1qLwduzY3NBQV1e3afv2 + vbW1Gz7/+WJZsbjIwRd+d9SUl78wb15/X5+/0gIAjLyBT1p0HOrc/+STr06Zsmny5JevvrpoterBP7a+ + MH5867p1ze3tzXv27Ny5s/vkybN9fS+vWbNpy5aG+vrGxsYdra0HN2+u/dznisJbP3i8VBwlJRsuvLBh + 4cKBr8rwSQsAgBE3cLeU+vr6I6++8vLUabXXXDOUdytLS9dcemnr2rVF3u1ubt6xY0eRd2+dPbtsypTK + K66ofW5NY1NT086dLS0tnd3d3bubNn3600XYbSwpeaWk5NWSkucuHHuwclmRgO6WAgAw8gbuePzssmdP + drS/OG3a2ksuqRq8erd63LjW554byLvdu4u8OzaYd0M3Rini77kJExrWr9976NCh9vZjx471/+d7/fv3 + N47/VP2oUQ2jRjWOGrX6sst7DrYtX17pjscAACNv+FvLTp04sX7u3KqPfazIu2fLyqovv3x3XV3Tvn3b + t2/vPnHirf7+Z2688YnBvBv6UEXNxIktjY3Hz5zp7e399W9/e7a/v27ChG2jRu0cXbJt7NjmH/9TX2/v + PzzyiG8tAwAYeRcUP6urqxsaGg4+9dTK8eOXlZf/oqzsX8rKVk2aVL9hw+tvvFHk3dPTp/988L53ReEV + ebd29Oia0aM3fPazR/fu/eDcubfPnn1l/vxNJSUtpaV7y8qeu/jiY431DY0NxdihcwAAMJIGCm/gIxFL + lrzV17duzpwVH//4U2VlT5aXP15eXnnddfs2bnxq2tSl5eXLysqKwltVWvpcaWmRdy+VlLxcUrLlmmuO + P/98w2231Y8atb+srK28fM+4j62bP78YVQwsxg6dAwCAkTRQeIWampqNtbWnd+9e/unP/GLcuJ+XlxdV + Vxw/Hfz9zODXkRWFVzV4AW/96NG1JSWbSkoaR40qfm8fNapou44xY/Zfcsmqyy7rbWl5ZePGYuDQZAAA + Rthw4fX29i5durStra2zqmrFZZc9NW7czwbbrki9J/+g8Ab+A2/wAt6rg3m3o7R0z+jRRd4dGjOmbdy4 + qk9+8uja5w8cOFCMKgYOTQYAYIQNF17hUEfHTx97rLu7u6uq6tkrr3z60kt/NmZMEXn/U3gDt1D5gwt4 + W0tKdpWX7ysvbx8zpnXcuOorrjj6wgvF9mJIMWp4KAAAI+73hVfYv39/0WdtbW2nd++umX3Lk5/4xNMX + X/xEeflTf1x4r5SUNIwa1TS6bO+YMXsuvviFiy5aX3Frb2trsbHYXgwZHgcAwPnwR4VXONTRsXTp0o21 + tW/19b3e2LjtBz989vIrnrrkkhUXXVRVXr6mtPSl0tKNpaX1Y8asGzt25cUX137960fWPl8sLrYUG129 + AwA47/608Aq9vb01NTVLliypq6vr7enp6ez85YYNLT/5ycvf/EbV1K+suHriuopbN3//+x2Vy063tfWe + OdNQX18sLrb43zsAgI+CP1N4Qzo7O1dXVz+yeHFlZWVjY2NXV9fZ/v4PBhUPiqfFi8VbxYJimRujAAB8 + dPzFwhvS09Ozc8eO6qqqJY8++vCiRQ8tXFgcxYPiafFi8ZZvrQAA+Kj5PwoPAID/dxQeAEAahQcAkEbh + AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk + UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA + AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU + HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA + GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH + AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG + 4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA + pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4 + AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp + FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A + QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF + BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ + RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB + AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR + eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA + aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe + AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa + hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA + kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh + AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk + UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA + AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU + HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA + GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH + AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG + 4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA + pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4 + AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp + FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A + QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF + BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ + RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB + AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR + eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA + aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe + AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa + hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA + kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh + AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk + UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA + AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU + HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA + GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH + AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG + 4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA + pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4 + AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp + FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A + QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF + BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ + RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB + AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR + eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA + Wc6d+2/gNp2ukwoN8QAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvwAA + Dr8BOAVTJAAACG1JREFUSEu1lmlQW9cVx/mG0GIZZCczGcZjvCQEiLHNYpABAQKEwBjTeqmXCfkQ3Mx4 + xp58SlMnY/dLmxl3TJIZu3UhBAQBsYNsisBoByS0C21oMUhCYIQkbFzqxo4n9C89TElqt/3SM1dv3tM7 + 93fOPfecc1/M+n+UQCCgnJzs5PPrb9787OrVK5cvY+AGj/gTr6Cwofoaea0Bh8PR1dl5/do1Ho8nlUqd + TudKOPxDVHCDR/yJV1CAGpQ3pv2bvMJAMBgcGBior6+XSCQhPDhm/CKRu4Nvv3Xb8vsv9J9fm77xRwev + xSuWLjscoeVlqEEZU6C7gdgiPzcwY7ffunVrRCh8FAotyBXevt6lb5o8V654L1zw/eKkt+bEXHW1q7ra + dqLGUFOjqq01t7R4VMqHfj+mYCKmb4Beyk8MmEymr7780mw2h4zGuc6uEI83X1e3WFPjr672V1V7qqrm + qqrcVVUu7rGZigobl2PhcDRcrqKy0njz5pJWh4mYDsgGLir/MgDjeO31en1DQ/72joVPfrMQRfuOHwd6 + 9tgxd2Wli8u1l5dbORxzaamptNTAZmuLizUslpzN/mtpmbu3F9MB2bqODQMIHxYIFyL0pibfxV8vnjju + KStz5ue7S0oi6PJyB6fcWlZmZpeY2GxDcbGOXaRiMifSDymyshR5eeL8/CFWobunBxCgNvdjwwC2CEFE + ZFz19fMffQSvXYUFgbq6fwgE/rq66aO59rIyC5tNoDWFhWoWazwjQ3P8uK+pyXD+wmjKu2PZ2cKc3MEC + VkCjAQpAghwxgCRDGmBXbbdvz1+96qmschUVLdbWrj98GFEJBNznzqkzMgj0VH6+qiBffvDgVHn5A6l0 + diXkMRqVJ0/dTU6+d/jwYGbm8C9PAgUgkbsRA0hksVi8qJ5yffrbuWPHQPecObO+vByhE/JwyX7+/OSB + A1MFBRNMpuxAmopb8UAud87PW6xWs9Pp0Kjvczi9+/f3pKb1Hc6YafsOuQsspsagFFEswUDA2dHh+uAD + F6fUlpc3e+ZX60+eEHBCvl9aspw/L0pOFqWmTHC5LoXC6fdbrVajXr+wtLS2ttbP5bYnJbWnpHSmpgnP + nEJ9AAt4DModBbnscBouXbKXlNjYRWZsYGam68MP1x89AvrFixdPnz5de/HisdenPXFCVlgI+ozXa7VY + DAZDhP7kCa+w8A6VyqPTm+n0b+j0zvSDSyZTa2sr4DFoKSh676jIcOq0pahomsXSs1ja/HxFSpr5/fef + BoPP19dXV1fRHgKPHy9OT9tEIsQEaPXUlG9h4W+rq81M5p+p1FYK5VsKpSk62hITzY2NMpkM8Bi0LTQW + a0Ojjss15hfo8/PUeXnIP2XuUQREe+FCeGEhvLa2uLAwOzvrcLvNDodOp1OpVF6CzmLB9zYyuYVCaY4O + mOExGNJLl4AFPAatEd5prl/TFhUSaBUzZzwnR56dLc3NHd6bJK+omNVo3B6PzWYzT0/rdbqpqSmvz/dk + dbW1uJigEwOLwICllm3bBtglwAIeg/aLBik+e1Z99Cjo40eOyLOypNnZYuT13r2DcXEdZLKYy7XYbCaz + mfBdMT4eDofv1tYiMnjb/nLABnFto1Da33sPWMAjBp49eya7eDHiNdCZmeKsrLGDB+8xGL1xcXwy+e6u + XcauLjQarVYboSsUMrlcMj6uEQjupaYCBx2Mzq0DBg4dev78ecQAVhFcDio/+1ySkyMGPTtLmJIyEBfX + E6UPJiYaBQKt3a7RaFRKpQIGJidlEolIJBqbmNALhUPvvgs1KMOb/pdjgErt53DCoVAkRNgH+4zDdOfO + /ZwclPtwWhpU4QVc609MNAwOamw2jVarVCq9fv9KKDTc0zOGFYjFyL1Jg8EqkwnfeQcGBNFxD4NEGtq2 + TXL5cqRBYJORSShj9/3R4VymMD2doCOUPTt3Gnp7QVdrNJOTk6A/Wllpycnh7dkj7O6RIlhKJbbEgf6p + Vo3t2wfuCIk0SiLdJ5G6t9GtvBZ4EElT1EJzS7PfbrvLZPYmJGC98L2LwTB0d0foajXoniidyEjY7k5O + lggE+pmZGZvN4/GE//40bDJJE3eJY2MlsbHS2Niu3UkBq7m1lRcpNKJVLMzPC8rK+Dt2gI5c7kxKUotE + KqNxYmLCOz//KBxuKihAzoBO7OdAaqpOKvUtL6Mtf//jj8hIFM14bKwyjjROp2u++APO2t9dvx5pFWgG + 6EroTdaGhvbExBYqFZXyFwqlIytLPDQ0t7gIemNe3p+i+Q4DoCOMyIKht9+e1et/QJ2vrIyWl4+RSDoy + WU+hdMfHe6RiifRls8Nvs10Plpa2vfFGA4WCUNxGb8nIMI6MNDBzb1GpKB8YQNZ3w/3oTg6TSPL0dF9f + n6SyEsExUShmKlXL2DFYXv7zdg0hDpwltbp13/5vGQz4CyjGV9Er2gviBgOID9xHtghJJLiMcOM6ERsL + tJ1GMyUkdOzeHdTpRkdGfnLgQDaPTAef37Z7dwOD8XUUDUtYzaaBSPSj7iNVQJ8kk7VxcaDP0GhmBoP/ + 1luzvX0Wi+UVRyZk89B38vnNe/c27tz5NY0GG5sGIrm7xX0FiTRFpRqpVBuNZmAwOvfsme3vf+2hT8jm + ZwtihW515803G+PjkTzYla0GkOxIR1UcRU+jaePj+7dvF3ArggbDf/lsIQTGsUDiw2tOKh3/5NPmpD0N + CQlt27fzqdQeMvkemTyC9kejDdLp7fHxwtOn3b19UP6fPrwIQfiwRUgDNBwcpQGH48HQkO7GjeFzZ/m5 + R9rSUge5FbKPP7bzWpbM5iA+HcViKGPKZty3yisMEIIkQyL/Xz5+twoWgHJHS0HbQmtE+8XADR7xJ15B + YUP1lbK+/k8KJ49ubHudCAAAAABJRU5ErkJggg== + + + \ No newline at end of file diff --git a/TestBenchFramework/Forms/ResultsConfig.Designer.cs b/TestBenchFramework/Forms/ResultsConfig.Designer.cs new file mode 100644 index 000000000..f83b14b28 --- /dev/null +++ b/TestBenchFramework/Forms/ResultsConfig.Designer.cs @@ -0,0 +1,254 @@ +namespace TBF.Forms +{ + partial class ResultsConfig + { + /// + /// 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 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.testsRowsRadioButton = new System.Windows.Forms.RadioButton(); + this.testsColumnsRadioButton = new System.Windows.Forms.RadioButton(); + this.testsArangementGroupBox = new System.Windows.Forms.GroupBox(); + this.metersArangementGroupBox = new System.Windows.Forms.GroupBox(); + this.verticallyRadioButton = new System.Windows.Forms.RadioButton(); + this.horizontallyRadioButton = new System.Windows.Forms.RadioButton(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.availableResultsListBox = new System.Windows.Forms.ListBox(); + this.selectedResultsListBox = new System.Windows.Forms.ListBox(); + this.availableResultsLabel = new System.Windows.Forms.Label(); + this.selectedResultsLabel = new System.Windows.Forms.Label(); + this.removeAllButton = new System.Windows.Forms.Button(); + this.removeButton = new System.Windows.Forms.Button(); + this.addButton = new System.Windows.Forms.Button(); + this.testsArangementGroupBox.SuspendLayout(); + this.metersArangementGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // testsRowsRadioButton + // + this.testsRowsRadioButton.AutoSize = true; + this.testsRowsRadioButton.Location = new System.Drawing.Point(21, 24); + this.testsRowsRadioButton.Name = "testsRowsRadioButton"; + this.testsRowsRadioButton.Size = new System.Drawing.Size(120, 17); + this.testsRowsRadioButton.TabIndex = 0; + this.testsRowsRadioButton.TabStop = true; + this.testsRowsRadioButton.Text = "Tests are table rows"; + this.testsRowsRadioButton.UseVisualStyleBackColor = true; + // + // testsColumnsRadioButton + // + this.testsColumnsRadioButton.AutoSize = true; + this.testsColumnsRadioButton.Location = new System.Drawing.Point(21, 46); + this.testsColumnsRadioButton.Name = "testsColumnsRadioButton"; + this.testsColumnsRadioButton.Size = new System.Drawing.Size(137, 17); + this.testsColumnsRadioButton.TabIndex = 1; + this.testsColumnsRadioButton.TabStop = true; + this.testsColumnsRadioButton.Text = "Tests are table columns"; + this.testsColumnsRadioButton.UseVisualStyleBackColor = true; + // + // testsArangementGroupBox + // + this.testsArangementGroupBox.Controls.Add(this.testsColumnsRadioButton); + this.testsArangementGroupBox.Controls.Add(this.testsRowsRadioButton); + this.testsArangementGroupBox.Location = new System.Drawing.Point(12, 12); + this.testsArangementGroupBox.Name = "testsArangementGroupBox"; + this.testsArangementGroupBox.Size = new System.Drawing.Size(254, 74); + this.testsArangementGroupBox.TabIndex = 2; + this.testsArangementGroupBox.TabStop = false; + this.testsArangementGroupBox.Text = "Arangement of tests"; + // + // metersArangementGroupBox + // + this.metersArangementGroupBox.Controls.Add(this.verticallyRadioButton); + this.metersArangementGroupBox.Controls.Add(this.horizontallyRadioButton); + this.metersArangementGroupBox.Location = new System.Drawing.Point(12, 92); + this.metersArangementGroupBox.Name = "metersArangementGroupBox"; + this.metersArangementGroupBox.Size = new System.Drawing.Size(254, 75); + this.metersArangementGroupBox.TabIndex = 3; + this.metersArangementGroupBox.TabStop = false; + this.metersArangementGroupBox.Text = "Arangement of tested meters"; + // + // verticallyRadioButton + // + this.verticallyRadioButton.AutoSize = true; + this.verticallyRadioButton.Location = new System.Drawing.Point(21, 24); + this.verticallyRadioButton.Name = "verticallyRadioButton"; + this.verticallyRadioButton.Size = new System.Drawing.Size(67, 17); + this.verticallyRadioButton.TabIndex = 3; + this.verticallyRadioButton.TabStop = true; + this.verticallyRadioButton.Text = "Vertically"; + this.verticallyRadioButton.UseVisualStyleBackColor = true; + // + // horizontallyRadioButton + // + this.horizontallyRadioButton.AutoSize = true; + this.horizontallyRadioButton.Location = new System.Drawing.Point(21, 46); + this.horizontallyRadioButton.Name = "horizontallyRadioButton"; + this.horizontallyRadioButton.Size = new System.Drawing.Size(79, 17); + this.horizontallyRadioButton.TabIndex = 2; + this.horizontallyRadioButton.TabStop = true; + this.horizontallyRadioButton.Text = "Horizontally"; + this.horizontallyRadioButton.UseVisualStyleBackColor = true; + // + // okButton + // + this.okButton.Location = new System.Drawing.Point(283, 18); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(104, 30); + this.okButton.TabIndex = 4; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(283, 55); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(104, 30); + this.cancelButton.TabIndex = 5; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // availableResultsListBox + // + this.availableResultsListBox.FormattingEnabled = true; + this.availableResultsListBox.Location = new System.Drawing.Point(12, 205); + this.availableResultsListBox.Name = "availableResultsListBox"; + this.availableResultsListBox.Size = new System.Drawing.Size(135, 160); + this.availableResultsListBox.TabIndex = 6; + this.availableResultsListBox.DoubleClick += new System.EventHandler(this.availableResultsListBox_DoubleClick); + // + // selectedResultsListBox + // + this.selectedResultsListBox.FormattingEnabled = true; + this.selectedResultsListBox.Location = new System.Drawing.Point(252, 205); + this.selectedResultsListBox.Name = "selectedResultsListBox"; + this.selectedResultsListBox.Size = new System.Drawing.Size(135, 160); + this.selectedResultsListBox.TabIndex = 7; + this.selectedResultsListBox.DoubleClick += new System.EventHandler(this.selectedResultsListBox_DoubleClick); + // + // availableResultsLabel + // + this.availableResultsLabel.AutoSize = true; + this.availableResultsLabel.Location = new System.Drawing.Point(12, 183); + this.availableResultsLabel.Name = "availableResultsLabel"; + this.availableResultsLabel.Size = new System.Drawing.Size(86, 13); + this.availableResultsLabel.TabIndex = 8; + this.availableResultsLabel.Text = "Available results:"; + // + // selectedResultsLabel + // + this.selectedResultsLabel.AutoSize = true; + this.selectedResultsLabel.Location = new System.Drawing.Point(249, 183); + this.selectedResultsLabel.Name = "selectedResultsLabel"; + this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13); + this.selectedResultsLabel.TabIndex = 9; + this.selectedResultsLabel.Text = "Selected results:"; + // + // removeAllButton + // + this.removeAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.removeAllButton.Location = new System.Drawing.Point(153, 306); + this.removeAllButton.Name = "removeAllButton"; + this.removeAllButton.Size = new System.Drawing.Size(94, 30); + this.removeAllButton.TabIndex = 46; + this.removeAllButton.Text = "<< R&emove all"; + this.removeAllButton.UseVisualStyleBackColor = true; + this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click); + // + // removeButton + // + this.removeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.removeButton.Location = new System.Drawing.Point(153, 271); + this.removeButton.Name = "removeButton"; + this.removeButton.Size = new System.Drawing.Size(93, 30); + this.removeButton.TabIndex = 45; + this.removeButton.Text = "< &Remove"; + this.removeButton.UseVisualStyleBackColor = true; + this.removeButton.Click += new System.EventHandler(this.removeButton_Click); + // + // addButton + // + this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.addButton.Location = new System.Drawing.Point(153, 236); + this.addButton.Name = "addButton"; + this.addButton.Size = new System.Drawing.Size(93, 30); + this.addButton.TabIndex = 44; + this.addButton.Text = "&Add >"; + this.addButton.UseVisualStyleBackColor = true; + this.addButton.Click += new System.EventHandler(this.addButton_Click); + // + // ResultsConfig + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(399, 379); + this.Controls.Add(this.removeAllButton); + this.Controls.Add(this.removeButton); + this.Controls.Add(this.addButton); + this.Controls.Add(this.selectedResultsLabel); + this.Controls.Add(this.availableResultsLabel); + this.Controls.Add(this.selectedResultsListBox); + this.Controls.Add(this.availableResultsListBox); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.metersArangementGroupBox); + this.Controls.Add(this.testsArangementGroupBox); + this.Name = "ResultsConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ResultsConfig"; + this.Load += new System.EventHandler(this.ResultsConfig_Load); + this.testsArangementGroupBox.ResumeLayout(false); + this.testsArangementGroupBox.PerformLayout(); + this.metersArangementGroupBox.ResumeLayout(false); + this.metersArangementGroupBox.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.RadioButton testsRowsRadioButton; + private System.Windows.Forms.RadioButton testsColumnsRadioButton; + private System.Windows.Forms.GroupBox testsArangementGroupBox; + private System.Windows.Forms.GroupBox metersArangementGroupBox; + private System.Windows.Forms.RadioButton verticallyRadioButton; + private System.Windows.Forms.RadioButton horizontallyRadioButton; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.ListBox availableResultsListBox; + private System.Windows.Forms.ListBox selectedResultsListBox; + private System.Windows.Forms.Label availableResultsLabel; + private System.Windows.Forms.Label selectedResultsLabel; + private System.Windows.Forms.Button removeAllButton; + private System.Windows.Forms.Button removeButton; + private System.Windows.Forms.Button addButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/ResultsConfig.cs b/TestBenchFramework/Forms/ResultsConfig.cs new file mode 100644 index 000000000..03b540c95 --- /dev/null +++ b/TestBenchFramework/Forms/ResultsConfig.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class ResultsConfig : Form + { + /// Arrangement of tests + public enum TestsAre + { + Rows, + Columns, + } + public TestsAre TestsArrangement; + + /// Arrangement of meters + public enum Meters + { + Vertically, + Horizontally, + } + public Meters MetersArrangement; + + /// Results items to be selected in the configuration + public enum ResultsItem + { + Hovno, + Makove, + Count + } + // + public IList AvailableItems; + public IList SelectedItems; + + + public ResultsConfig() + { + InitializeComponent(); + + SelectedItems = new List(); + AvailableItems = GetListOfAvailableItems(); + } + + void Localize() + { + Text = Strings.Configuration; + testsArangementGroupBox.Text = Strings.Arrangement_of_tests; + metersArangementGroupBox.Text = Strings.Arrangement_of_meters; + testsRowsRadioButton.Text = Strings.Tests_are_rows; + testsColumnsRadioButton.Text = Strings.Tests_are_columns; + horizontallyRadioButton.Text = Strings.Horizontally; + verticallyRadioButton.Text = Strings.Vertically; + availableResultsLabel.Text = Strings.Available_results; + selectedResultsLabel.Text = Strings.Selected_results; + addButton.Text = Strings.Add; + removeButton.Text = Strings.Remove; + removeAllButton.Text = Strings.Remove_all; + okButton.Text = Strings.OkBtnText; + cancelButton.Text = Strings.CancelBtnText; + } + + void ResultsConfig_Load(object sender, EventArgs e) + { + Localize(); + + testsRowsRadioButton.Checked = (TestsArrangement == TestsAre.Rows); + testsColumnsRadioButton.Checked = (TestsArrangement == TestsAre.Columns); + + horizontallyRadioButton.Checked = (MetersArrangement == Meters.Horizontally); + verticallyRadioButton.Checked = (MetersArrangement == Meters.Vertically); + + RedrawAvailable(); + RedrawSelected(); + } + + /// + /// Create a list of available items from the complete list from 'auxBrdUpgInfo' + /// and the list of selected items. In this way the order of items in the created list + /// is always the same as in the original list in 'auxBrdUpgInfo'. + /// + /// A list of available items which does not contain the selected items + IList GetListOfAvailableItems() + { + IList availableItems = new List(); + for (ResultsItem item = 0; item < ResultsItem.Count; item++) + { + if (!SelectedItems.Contains(item)) availableItems.Add(item); + } + return availableItems; + } + + /// + /// Redraw selected items (right hand side) + /// + void RedrawAvailable() + { + availableResultsListBox.Items.Clear(); + foreach (var item in AvailableItems) availableResultsListBox.Items.Add(item.ToString()); + } + + /// + /// Redraw selected items (right hand side) + /// + void RedrawSelected() + { + selectedResultsListBox.Items.Clear(); + foreach (var item in SelectedItems) selectedResultsListBox.Items.Add(item.ToString()); + } + + void okButton_Click(object sender, EventArgs e) + { + if (testsColumnsRadioButton.Checked) TestsArrangement = TestsAre.Columns; + else TestsArrangement = TestsAre.Rows; + + if (horizontallyRadioButton.Checked) MetersArrangement = Meters.Horizontally; + else MetersArrangement = Meters.Vertically; + + DialogResult = DialogResult.OK; + Close(); + } + + private void availableResultsListBox_DoubleClick(object sender, EventArgs e) + { + /// Double click works when just one item is selected + IList itemsToRemove = new List(); + if (availableResultsListBox.SelectedIndices.Count == 1) + { + var item = AvailableItems[availableResultsListBox.SelectedIndices[0]]; + SelectedItems.Add(item); + AvailableItems.Remove(item); + RedrawAvailable(); + RedrawSelected(); + } + } + + void addButton_Click(object sender, EventArgs e) + { + /// Append at the end, this code supports multiple selected items, + /// although ListBox control settings may limit the max.number of selected items to one. + + for (int i = availableResultsListBox.SelectedIndices.Count - 1; i >= 0; i--) + { + var item = AvailableItems[availableResultsListBox.SelectedIndices[i]]; + SelectedItems.Add(item); + AvailableItems.Remove(item); + } + RedrawAvailable(); + RedrawSelected(); + } + + private void selectedResultsListBox_DoubleClick(object sender, EventArgs e) + { + /// Double click works when just one item is selected + + if (selectedResultsListBox.SelectedIndices.Count == 1) + { + SelectedItems.RemoveAt(selectedResultsListBox.SelectedIndices[0]); + AvailableItems = GetListOfAvailableItems(); + RedrawAvailable(); + RedrawSelected(); + } + } + + void removeButton_Click(object sender, EventArgs e) + { + /// Remove from the list (the last selected item first so that the indexes are not affected) + + for (int i = selectedResultsListBox.SelectedIndices.Count - 1; i >= 0; i--) + { + ResultsItem item = SelectedItems[selectedResultsListBox.SelectedIndices[i]]; + SelectedItems.Remove(item); + } + AvailableItems = GetListOfAvailableItems(); + RedrawAvailable(); + RedrawSelected(); + } + + void removeAllButton_Click(object sender, EventArgs e) + { + /// Remove all items from 'Selected' list + + SelectedItems.Clear(); + AvailableItems = GetListOfAvailableItems(); + RedrawAvailable(); + RedrawSelected(); + } + } +} diff --git a/TestBenchFramework/Forms/ResultsConfig.resx b/TestBenchFramework/Forms/ResultsConfig.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Forms/ResultsConfig.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/TestBenchFramework/Forms/TabNameDlg.Designer.cs b/TestBenchFramework/Forms/TabNameDlg.Designer.cs new file mode 100644 index 000000000..24302293f --- /dev/null +++ b/TestBenchFramework/Forms/TabNameDlg.Designer.cs @@ -0,0 +1,73 @@ +namespace TBF.Forms +{ + partial class TabNameDlg + { + /// + /// 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 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.tabNameTextBox = new System.Windows.Forms.TextBox(); + this.okButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // tabNameTextBox + // + this.tabNameTextBox.Location = new System.Drawing.Point(33, 25); + this.tabNameTextBox.Name = "tabNameTextBox"; + this.tabNameTextBox.Size = new System.Drawing.Size(145, 20); + this.tabNameTextBox.TabIndex = 1; + // + // okButton + // + this.okButton.Location = new System.Drawing.Point(209, 18); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(85, 33); + this.okButton.TabIndex = 2; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // TabNameDlg + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(316, 69); + this.Controls.Add(this.okButton); + this.Controls.Add(this.tabNameTextBox); + this.Name = "TabNameDlg"; + this.Text = "TabName"; + this.Load += new System.EventHandler(this.TabNameDlg_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox tabNameTextBox; + private System.Windows.Forms.Button okButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/Forms/TabNameDlg.cs b/TestBenchFramework/Forms/TabNameDlg.cs new file mode 100644 index 000000000..a66332127 --- /dev/null +++ b/TestBenchFramework/Forms/TabNameDlg.cs @@ -0,0 +1,31 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.Forms +{ + public partial class TabNameDlg : Form + { + public string TabNameLabel; + public string TabName; + + public TabNameDlg() + { + InitializeComponent(); + } + + private void TabNameDlg_Load(object sender, EventArgs e) + { + Text = TabNameLabel; + tabNameTextBox.Text = TabName; + okButton.Text = Strings.OkBtnText; + } + + private void okButton_Click(object sender, EventArgs e) + { + TabName = tabNameTextBox.Text; + DialogResult = DialogResult.OK; + Close(); + } + } +} diff --git a/TestBenchFramework/Forms/TabNameDlg.resx b/TestBenchFramework/Forms/TabNameDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Forms/TabNameDlg.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/TestBenchFramework/Grp.cs b/TestBenchFramework/Grp.cs new file mode 100644 index 000000000..3e0ee3a29 --- /dev/null +++ b/TestBenchFramework/Grp.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using TBF.Entities; +using NHibernate; +using FluentNHibernate; + +namespace TBF +{ + /// + /// Enum Grp.GID specifies GID-s of user groups. + /// An instance of this class represenst a group, which contains a list of its members (users). + /// Static private array 'groups' of this class, accesible through indexer, contains all groups. + /// + public class Grp + { + /// + /// GID-s of user groups, each user is member of one or more groups. + /// + public enum GID + { + // The first NrOfGroups items are GroupID-s (0..NrOfGroups-1) + Testers = 0, + TestingSpecialists, + HeadOfLab, + MaintenanceSpecialists, + Metrologists, + CalibrationSpecialists, + Administrators, // application / network / database administrator + Custom1, + Custom2, + Custom3, + NrOfGroups, // Number of groups (this is not a GroupID) + None, // Not a GroupID, can be used to indicate no group membership is required + Invalid = -1, // Not a GroupID, indicates a variable has not been properly set so far + } + + /// + /// Number of groups. + /// + public const int Count = (int)GID.NrOfGroups; + + // Static array of all groups. + static Grp[] groups; + + /// + /// Static constructor, creates all groups with no members. + /// + static Grp() + { + groups = new Grp[Count]; + for (int i = 0; i < Count; i++) + { + groups[i] = new Grp((GID)i); + } + } + + /// + /// Returns a Group from Id. + /// + /// Group Gid + /// Entities.Group object reference + public static Entities.Group FromId(GID gid) + { + int i = (int)gid; + + if (i >= 0 && i < Count) + { + return groups[i].group; + } + else + { + return null; + } + } + + ///////////////////// ^ static ^ ///////////////////// v instance v ///////////////////// + + /// Public properties + public GID Gid { get { return (GID)group.Gid; } } + public string Name { get { return group.Name; } set { group.Name = value; } } + + /// Private fields + Entities.Group group; + + /// + /// Instance constructor. + /// + /// + public Grp(GID gid) + { + group = new Entities.Group(); + this.group.Gid = (int)gid; + this.group.Name = gid.ToString(); + } + } +} diff --git a/TestBenchFramework/LocalSettings.cs b/TestBenchFramework/LocalSettings.cs new file mode 100644 index 000000000..8cbe2fe2c --- /dev/null +++ b/TestBenchFramework/LocalSettings.cs @@ -0,0 +1,135 @@ +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +namespace TBF +{ + /// + /// Class to be serialized to an XML file... + /// Public members are local settings. + /// These settings are modified by dialogs invoked by menu items + /// Edit->Preferences ... PreferencesDlg ... S1.1(language, etc. local settings), and + /// Edit->Advanced settings ... AdvancedSettingsDlg ... S1.2(spec. where bench settings are stored) + /// + [XmlRootAttribute("TestBenchFramework")] + public class LocalSettings + { + /// + /// Available languages. + /// Method ToString should give a supported culture info string: + /// ("en","de","fr","es","it","cn", etc.). + /// + public enum Languages + { + en, + de, + sk, + Count, + } + + /// + /// User interface language ("en","de","fr","es","it","cn", etc.). + /// + public string Language = "en"; + + /// + /// Names and database settings of test benches. + /// + [XmlArrayAttribute("TestBenches")] + public DatabaseSettings[] testBenches; + + [XmlIgnore] + public DatabaseSettings[] TestBenches { get { return testBenches; } } + + [XmlIgnore] + public int BenchesCount { get { return testBenches != null ? testBenches.GetLength(0) : 0; } } + + /// + /// Currently selected bench name (local or remote) or null (= no selection done). + /// + [XmlElementAttribute("LastBench")] + public string LastBenchName; + + /// + /// Currently selected procedure name or null (= no selection done yet). + /// + [XmlElementAttribute("LastProcedure")] + public string LastProcedureName; + + public int RightPaneHorizSplitterDistance; + + public Forms.ResultsConfig.Meters ResultsConfigMeters; + public Forms.ResultsConfig.TestsAre ResultsConfigTests; + + /// + /// Copy public fields from a LocalSettings object to this object. + /// + /// Origin + public void Assign(LocalSettings ls) + { + if (ls != null) + { + Language = ls.Language; + testBenches = new DatabaseSettings[ls.testBenches.Length]; + for (int i = 0; i < testBenches.Length; i++) testBenches[i] = ls.testBenches[i]; + LastBenchName = ls.LastBenchName; + LastProcedureName = ls.LastProcedureName; + RightPaneHorizSplitterDistance = ls.RightPaneHorizSplitterDistance; + ResultsConfigMeters = ls.ResultsConfigMeters; + ResultsConfigTests = ls.ResultsConfigTests; + } + } + + [XmlIgnore] + public readonly bool AlwaysAskPasswdWhenUnlocking; + + [XmlIgnore] + public readonly bool RestoreUserWhenLeavingDialog; + + + public LocalSettings() + { + AlwaysAskPasswdWhenUnlocking = false; + RestoreUserWhenLeavingDialog = true; + } + + /// + /// Load public fields of this class from the XML file. + /// + public void Load() + { + try + { + using (TextReader reader = new StreamReader(Program.LocalSettingsFileName)) + { + LocalSettings ls = (new XmlSerializer(typeof(LocalSettings))).Deserialize(reader) as LocalSettings; + // Copy the settings just in case De-serialize() completes OK + this.Assign(ls); + } + } + catch (Exception e) + { + string msg = e.Message; + } + } + + /// + /// Save public fields of this class to the XML file. + /// + public void Save() + { + try + { + using (TextWriter writer = new StreamWriter(Program.LocalSettingsFileName)) + { + (new XmlSerializer(typeof(LocalSettings))).Serialize(writer, this); + } + } + catch (Exception e) + { + string msg = e.Message; + } + } + } +} diff --git a/TestBenchFramework/LoginDlg.Designer.cs b/TestBenchFramework/LoginDlg.Designer.cs new file mode 100644 index 000000000..716264e0e --- /dev/null +++ b/TestBenchFramework/LoginDlg.Designer.cs @@ -0,0 +1,107 @@ +namespace TBF +{ + partial class LoginDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlg)); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.passwordTextBox = new System.Windows.Forms.TextBox(); + this.cancelButton = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.userNameTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // passwordTextBox + // + resources.ApplyResources(this.passwordTextBox, "passwordTextBox"); + this.passwordTextBox.Name = "passwordTextBox"; + this.passwordTextBox.UseSystemPasswordChar = true; + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // userNameTextBox + // + resources.ApplyResources(this.userNameTextBox, "userNameTextBox"); + this.userNameTextBox.Name = "userNameTextBox"; + // + // LoginDlg + // + this.AcceptButton = this.okButton; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.Controls.Add(this.userNameTextBox); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.passwordTextBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "LoginDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Load += new System.EventHandler(this.LoginDlg_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox userNameTextBox; + private System.Windows.Forms.TextBox passwordTextBox; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button okButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/LoginDlg.cs b/TestBenchFramework/LoginDlg.cs new file mode 100644 index 000000000..63ad41f21 --- /dev/null +++ b/TestBenchFramework/LoginDlg.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF +{ + /// + /// Provides login dialog as well as user authorization using TBF.User.Authorize(...) + /// (i.e. when DialogResult is OK, user was authorized). + /// + public partial class LoginDlg : Form + { + // Private fields + string user; + string password; + Grp.GID requiredGroupMembership = Grp.GID.Invalid; + + /// + /// Constructor. + /// + public LoginDlg() + { + InitializeComponent(); + } + + /// + /// Constructor with a predefined user. + /// + public LoginDlg(string predefinedUser) + : this() + { + user = predefinedUser; + userNameTextBox.Text = predefinedUser; + } + + /// + /// Constructor when a specific group membership is required. + /// + public LoginDlg(Grp.GID requiredGroupMembership) + : this() + { + this.requiredGroupMembership = requiredGroupMembership; + } + + /// + /// Constructor with a predefined user when a specific group membership is required. + /// + public LoginDlg(string predefinedUser, Grp.GID requiredGroupMembership) + : this() + { + user = predefinedUser; + userNameTextBox.Text = predefinedUser; + this.requiredGroupMembership = requiredGroupMembership; + } + + private void LoginDlg_Load(object sender, EventArgs e) + { + Text = Strings.User_Login; + label1.Text = Strings.Username; + label2.Text = Strings.Password; + okButton.Text = Strings.OkBtnText; + cancelButton.Text = Strings.CancelBtnText; + + if (user == null) userNameTextBox.Select(); + else passwordTextBox.Select(); + } + + /// + /// Try to authorize the user when OK clicked. + /// + private void okButton_Click(object sender, EventArgs e) + { + user = userNameTextBox.Text; + password = passwordTextBox.Text; + + Entities.User loadedUser = Entities.User.LoadUserByName(user); + if (loadedUser != null) + { + bool authorized; + + if (requiredGroupMembership == Grp.GID.Invalid) + { + authorized = loadedUser.Authorize(user, password); + } + else + { + authorized = loadedUser.Authorize(user, password, requiredGroupMembership); + } + + if (authorized) + { + DialogResult = DialogResult.OK; + Close(); + Program.MainWnd.UpdateUser(); + return; + } + } + + MessageBox.Show(Strings.Invalid_username_or_password, Strings.Error, MessageBoxButtons.OK); + DialogResult = DialogResult.None; + return; + } + + /// + /// Cancel clicked, do not try to authorize. + /// + private void cancelButton_Click(object sender, EventArgs e) + { + if (requiredGroupMembership == Grp.GID.Invalid) + { + Entities.User.Unauthorize(); + } + + DialogResult = DialogResult.Cancel; + Close(); + return; + } + } +} diff --git a/TestBenchFramework/LoginDlg.de.resx b/TestBenchFramework/LoginDlg.de.resx new file mode 100644 index 000000000..e161a92e1 --- /dev/null +++ b/TestBenchFramework/LoginDlg.de.resx @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 75, 13 + + + Benutzername + + + 50, 13 + + + Passwort + + + &Abbrechen + + + &OK + + + Anmelden + + \ No newline at end of file diff --git a/TestBenchFramework/LoginDlg.resx b/TestBenchFramework/LoginDlg.resx new file mode 100644 index 000000000..96457b1db --- /dev/null +++ b/TestBenchFramework/LoginDlg.resx @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + True + + + + 8, 24 + + + 58, 13 + + + 0 + + + User name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + True + + + 8, 51 + + + 53, 13 + + + 1 + + + Password + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 96, 48 + + + 168, 20 + + + 3 + + + passwordTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 285, 48 + + + 105, 28 + + + 5 + + + Cancel + + + cancelButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 285, 14 + + + 105, 28 + + + 4 + + + OK + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 96, 22 + + + 168, 20 + + + 2 + + + userNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + de + + + True + + + 6, 13 + + + 402, 88 + + + + CenterScreen + + + User login + + + LoginDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/LoginDlgWithBenchSelection.cs b/TestBenchFramework/LoginDlgWithBenchSelection.cs new file mode 100644 index 000000000..7b9e7d4b4 --- /dev/null +++ b/TestBenchFramework/LoginDlgWithBenchSelection.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + + +namespace TBF +{ + /// + /// Provides login dialog that includes test bench selection. + /// It is used only once on program startup. Does not do authorisation + /// as User.users have not been loadded from the DB yet. + /// + public partial class LoginDlgWithBenchSelection : Form + { + // Private fields + string user; + string password; + string benchName = null; + + // Readonly public properties to do the authorization. + public string User { get { return user; } } + public string Password { get { return password; } } + public string BenchName { get { return benchName; } } + + /// + /// Constructor. + /// + public LoginDlgWithBenchSelection() + { + InitializeComponent(); + } + + /// + /// Constructor with a predefined bench. + /// + public LoginDlgWithBenchSelection(string predefinedBench) + : this() + { + benchName = predefinedBench; + } + + private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e) + { +#if DEBUG + userNameTextBox.Text = Program.AdminUsername; + passwordTextBox.Text = Program.AdminPassword; +#endif + int nrOfBenches = Program.LocalSettings.testBenches == null ? 0 : Program.LocalSettings.testBenches.GetLength(0); + for (int i = 0; i < nrOfBenches; i++) + { + testBenchComboBox.Items.Add(Program.LocalSettings.testBenches[i].BenchName); + if (benchName != null && benchName == Program.LocalSettings.testBenches[i].BenchName) + { + testBenchComboBox.Text = benchName; + } + } + } + + /// + /// OK clicked (authorization is done outside this dialog). + /// + private void okButton_Click(object sender, EventArgs e) + { + if (testBenchComboBox.SelectedItem != null) + { + user = userNameTextBox.Text; + password = passwordTextBox.Text; + benchName = testBenchComboBox.SelectedItem.ToString(); + + DialogResult = DialogResult.OK; + Close(); + return; + } + else + { + MessageBox.Show(Strings.PLs_select_testbench, Strings.Warning, MessageBoxButtons.OK); + } + } + + /// + /// Cancel clicked. + /// + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + + private void passwordTextBox_TextChanged(object sender, EventArgs e) + { + if (passwordTextBox.Text != "") + { + this.AcceptButton = okButton; + } + } + + private void userNameTextBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (Convert.ToInt32(e.KeyChar) == 13) + { + passwordTextBox.Focus(); + } + } + } +} diff --git a/TestBenchFramework/LoginDlgWithBenchSelection.de.resx b/TestBenchFramework/LoginDlgWithBenchSelection.de.resx new file mode 100644 index 000000000..030cbca00 --- /dev/null +++ b/TestBenchFramework/LoginDlgWithBenchSelection.de.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 75, 13 + + + Benutzername + + + 50, 13 + + + Passwort + + + 52, 13 + + + Prüfstand + + + Abbrechen + + + Anmelden am Prüfstand + + \ No newline at end of file diff --git a/TestBenchFramework/LoginDlgWithBenchSelection.designer.cs b/TestBenchFramework/LoginDlgWithBenchSelection.designer.cs new file mode 100644 index 000000000..38d169add --- /dev/null +++ b/TestBenchFramework/LoginDlgWithBenchSelection.designer.cs @@ -0,0 +1,130 @@ +namespace TBF +{ + partial class LoginDlgWithBenchSelection + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection)); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.testBenchComboBox = new System.Windows.Forms.ComboBox(); + this.passwordTextBox = new System.Windows.Forms.TextBox(); + this.cancelButton = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.userNameTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ImageKey = global::TBF.Resources.Strings.String1; + this.label1.Name = "label1"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.ImageKey = global::TBF.Resources.Strings.String1; + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.ImageKey = global::TBF.Resources.Strings.String1; + this.label3.Name = "label3"; + // + // testBenchComboBox + // + resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox"); + this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.testBenchComboBox.FormattingEnabled = true; + this.testBenchComboBox.Name = "testBenchComboBox"; + // + // passwordTextBox + // + resources.ApplyResources(this.passwordTextBox, "passwordTextBox"); + this.passwordTextBox.Name = "passwordTextBox"; + this.passwordTextBox.UseSystemPasswordChar = true; + this.passwordTextBox.TextChanged += new System.EventHandler(this.passwordTextBox_TextChanged); + // + // cancelButton + // + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1; + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // okButton + // + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.ImageKey = global::TBF.Resources.Strings.String1; + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // userNameTextBox + // + resources.ApplyResources(this.userNameTextBox, "userNameTextBox"); + this.userNameTextBox.Name = "userNameTextBox"; + this.userNameTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.userNameTextBox_KeyPress); + // + // LoginDlgWithBenchSelection + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.userNameTextBox); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.passwordTextBox); + this.Controls.Add(this.testBenchComboBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "LoginDlgWithBenchSelection"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox userNameTextBox; + private System.Windows.Forms.TextBox passwordTextBox; + private System.Windows.Forms.ComboBox testBenchComboBox; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button okButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/LoginDlgWithBenchSelection.resx b/TestBenchFramework/LoginDlgWithBenchSelection.resx new file mode 100644 index 000000000..f44b0b6fe --- /dev/null +++ b/TestBenchFramework/LoginDlgWithBenchSelection.resx @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + User name + + + + 402, 102 + + + 105, 28 + + + 285, 48 + + + Cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + LoginDlgWithBenchSelection + + + label1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 5 + + + $this + + + 96, 15 + + + 61, 13 + + + $this + + + 96, 67 + + + label3 + + + True + + + + CenterScreen + + + $this + + + 8, 70 + + + 7 + + + 96, 41 + + + userNameTextBox + + + 1 + + + 58, 13 + + + 4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 3 + + + 6, 13 + + + 6 + + + 53, 13 + + + testBenchComboBox + + + 168, 20 + + + 105, 28 + + + $this + + + 168, 21 + + + 0 + + + 168, 20 + + + 2 + + + 285, 14 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Test bench + + + okButton + + + $this + + + 1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 3 + + + True + + + label2 + + + $this + + + 4 + + + cancelButton + + + 8, 17 + + + User login + + + passwordTextBox + + + Password + + + 2 + + + 8, 44 + + + 7 + + + OK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + True + + + de + + \ No newline at end of file diff --git a/TestBenchFramework/LoginDlgWithBenchSelection.sk.resx b/TestBenchFramework/LoginDlgWithBenchSelection.sk.resx new file mode 100644 index 000000000..07b0af6b5 --- /dev/null +++ b/TestBenchFramework/LoginDlgWithBenchSelection.sk.resx @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 95, 13 + + + Meno používateľa + + + 34, 13 + + + Heslo + + + 97, 13 + + + Testovacia stanica + + + 109, 67 + + + 109, 41 + + + Zrušíť + + + Prihlásiť sa + + + 109, 15 + + + Prihlásenie + + \ No newline at end of file diff --git a/TestBenchFramework/MainWnd.Designer.cs b/TestBenchFramework/MainWnd.Designer.cs new file mode 100644 index 000000000..36c42af1b --- /dev/null +++ b/TestBenchFramework/MainWnd.Designer.cs @@ -0,0 +1,578 @@ +namespace TBF +{ + partial class MainWnd + { + /// + /// 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) + { + try + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + catch(System.Exception) + { + } + } + + #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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWnd)); + this.verticalSplitContainer = new System.Windows.Forms.SplitContainer(); + this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer(); + this.progressGroupBox = new System.Windows.Forms.GroupBox(); + this.mainProgressBar = new System.Windows.Forms.ProgressBar(); + this.activityGroupBox = new System.Windows.Forms.GroupBox(); + this.activityLabel = new System.Windows.Forms.Label(); + this.procedureGroupBox = new System.Windows.Forms.GroupBox(); + this.procedureComboBox = new System.Windows.Forms.ComboBox(); + this.mainTabControl = new System.Windows.Forms.TabControl(); + this.homeTabPage = new System.Windows.Forms.TabPage(); + this.ctrlBrdComponent = new ControlCom2VB.ControlCom2panel(); + this.processTabPage = new System.Windows.Forms.TabPage(); + this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl(); + this.measurementTabPage = new System.Windows.Forms.TabPage(); + this.MeasurementTabPageCtrl = new TBF.Screens.MeasurementTabPageCtrl(); + this.insertTabPage = new System.Windows.Forms.TabPage(); + this.picturesTabPage = new System.Windows.Forms.TabPage(); + this.picturesTabPageCtrl1 = new TBF.Screens.PicturesTabPageCtrl(); + this.resultsTabPage = new System.Windows.Forms.TabPage(); + this.resultsTabPageCtrl = new TBF.Screens.ResultsTabPageCtrl(); + this.logsTabPage = new System.Windows.Forms.TabPage(); + this.logsTabPageCtrl = new TBF.Screens.LogsTabPageCtrl(); + this.rightHorizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.progressFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.userInfoStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.activityStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.benchTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.benchComponentsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.benchPathsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.benchTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.benchMetrologyTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.homeTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.measurementTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.resultsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.logsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.usersTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.localSettingsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.databaseSettingsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.passwortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutTSMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.proceduresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.picturesTSMItem = new System.Windows.Forms.ToolStripMenuItem(); + this.resultsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.verticalSplitContainer)).BeginInit(); + this.verticalSplitContainer.Panel1.SuspendLayout(); + this.verticalSplitContainer.Panel2.SuspendLayout(); + this.verticalSplitContainer.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.horizontalSplitContainer)).BeginInit(); + this.horizontalSplitContainer.Panel1.SuspendLayout(); + this.horizontalSplitContainer.Panel2.SuspendLayout(); + this.horizontalSplitContainer.SuspendLayout(); + this.progressGroupBox.SuspendLayout(); + this.activityGroupBox.SuspendLayout(); + this.procedureGroupBox.SuspendLayout(); + this.mainTabControl.SuspendLayout(); + this.homeTabPage.SuspendLayout(); + this.processTabPage.SuspendLayout(); + this.measurementTabPage.SuspendLayout(); + this.picturesTabPage.SuspendLayout(); + this.resultsTabPage.SuspendLayout(); + this.logsTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).BeginInit(); + this.rightHorizSplitContainer.Panel1.SuspendLayout(); + this.rightHorizSplitContainer.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.mainMenuStrip.SuspendLayout(); + this.SuspendLayout(); + // + // verticalSplitContainer + // + resources.ApplyResources(this.verticalSplitContainer, "verticalSplitContainer"); + this.verticalSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.verticalSplitContainer.Name = "verticalSplitContainer"; + // + // verticalSplitContainer.Panel1 + // + this.verticalSplitContainer.Panel1.Controls.Add(this.horizontalSplitContainer); + // + // verticalSplitContainer.Panel2 + // + this.verticalSplitContainer.Panel2.Controls.Add(this.rightHorizSplitContainer); + // + // horizontalSplitContainer + // + resources.ApplyResources(this.horizontalSplitContainer, "horizontalSplitContainer"); + this.horizontalSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.horizontalSplitContainer.Name = "horizontalSplitContainer"; + // + // horizontalSplitContainer.Panel1 + // + this.horizontalSplitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control; + this.horizontalSplitContainer.Panel1.Controls.Add(this.progressGroupBox); + this.horizontalSplitContainer.Panel1.Controls.Add(this.procedureGroupBox); + this.horizontalSplitContainer.Panel1.Controls.Add(this.activityGroupBox); + // + // horizontalSplitContainer.Panel2 + // + this.horizontalSplitContainer.Panel2.Controls.Add(this.mainTabControl); + // + // progressGroupBox + // + this.progressGroupBox.Controls.Add(this.mainProgressBar); + resources.ApplyResources(this.progressGroupBox, "progressGroupBox"); + this.progressGroupBox.Name = "progressGroupBox"; + this.progressGroupBox.TabStop = false; + // + // mainProgressBar + // + resources.ApplyResources(this.mainProgressBar, "mainProgressBar"); + this.mainProgressBar.Name = "mainProgressBar"; + // + // activityGroupBox + // + this.activityGroupBox.Controls.Add(this.activityLabel); + resources.ApplyResources(this.activityGroupBox, "activityGroupBox"); + this.activityGroupBox.Name = "activityGroupBox"; + this.activityGroupBox.TabStop = false; + // + // activityLabel + // + resources.ApplyResources(this.activityLabel, "activityLabel"); + this.activityLabel.Name = "activityLabel"; + // + // procedureGroupBox + // + this.procedureGroupBox.Controls.Add(this.procedureComboBox); + resources.ApplyResources(this.procedureGroupBox, "procedureGroupBox"); + this.procedureGroupBox.Name = "procedureGroupBox"; + this.procedureGroupBox.TabStop = false; + // + // procedureComboBox + // + resources.ApplyResources(this.procedureComboBox, "procedureComboBox"); + this.procedureComboBox.FormattingEnabled = true; + this.procedureComboBox.Name = "procedureComboBox"; + this.procedureComboBox.SelectedIndexChanged += new System.EventHandler(this.procedureComboBox_SelectedIndexChanged); + // + // mainTabControl + // + this.mainTabControl.Controls.Add(this.homeTabPage); + this.mainTabControl.Controls.Add(this.processTabPage); + this.mainTabControl.Controls.Add(this.measurementTabPage); + this.mainTabControl.Controls.Add(this.insertTabPage); + this.mainTabControl.Controls.Add(this.picturesTabPage); + this.mainTabControl.Controls.Add(this.resultsTabPage); + this.mainTabControl.Controls.Add(this.logsTabPage); + resources.ApplyResources(this.mainTabControl, "mainTabControl"); + this.mainTabControl.Name = "mainTabControl"; + this.mainTabControl.SelectedIndex = 0; + this.mainTabControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + // + // homeTabPage + // + this.homeTabPage.BackColor = System.Drawing.SystemColors.Control; + this.homeTabPage.Controls.Add(this.ctrlBrdComponent); + resources.ApplyResources(this.homeTabPage, "homeTabPage"); + this.homeTabPage.Name = "homeTabPage"; + // + // ctrlBrdComponent + // + this.ctrlBrdComponent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + resources.ApplyResources(this.ctrlBrdComponent, "ctrlBrdComponent"); + this.ctrlBrdComponent.Name = "ctrlBrdComponent"; + // + // processTabPage + // + this.processTabPage.Controls.Add(this.processTabPageCtrl); + resources.ApplyResources(this.processTabPage, "processTabPage"); + this.processTabPage.Name = "processTabPage"; + this.processTabPage.UseVisualStyleBackColor = true; + // + // processTabPageCtrl + // + this.processTabPageCtrl.BackColor = System.Drawing.SystemColors.Control; + resources.ApplyResources(this.processTabPageCtrl, "processTabPageCtrl"); + this.processTabPageCtrl.Name = "processTabPageCtrl"; + // + // measurementTabPage + // + this.measurementTabPage.Controls.Add(this.MeasurementTabPageCtrl); + resources.ApplyResources(this.measurementTabPage, "measurementTabPage"); + this.measurementTabPage.Name = "measurementTabPage"; + this.measurementTabPage.UseVisualStyleBackColor = true; + // + // MeasurementTabPageCtrl + // + this.MeasurementTabPageCtrl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(180)))), ((int)(((byte)(200))))); + resources.ApplyResources(this.MeasurementTabPageCtrl, "MeasurementTabPageCtrl"); + this.MeasurementTabPageCtrl.Name = "MeasurementTabPageCtrl"; + // + // insertTabPage + // + this.insertTabPage.BackColor = System.Drawing.Color.Silver; + resources.ApplyResources(this.insertTabPage, "insertTabPage"); + this.insertTabPage.Name = "insertTabPage"; + // + // picturesTabPage + // + this.picturesTabPage.Controls.Add(this.picturesTabPageCtrl1); + resources.ApplyResources(this.picturesTabPage, "picturesTabPage"); + this.picturesTabPage.Name = "picturesTabPage"; + this.picturesTabPage.UseVisualStyleBackColor = true; + // + // picturesTabPageCtrl1 + // + this.picturesTabPageCtrl1.BackColor = System.Drawing.Color.Silver; + resources.ApplyResources(this.picturesTabPageCtrl1, "picturesTabPageCtrl1"); + this.picturesTabPageCtrl1.Name = "picturesTabPageCtrl1"; + // + // resultsTabPage + // + this.resultsTabPage.Controls.Add(this.resultsTabPageCtrl); + resources.ApplyResources(this.resultsTabPage, "resultsTabPage"); + this.resultsTabPage.Name = "resultsTabPage"; + this.resultsTabPage.UseVisualStyleBackColor = true; + // + // resultsTabPageCtrl + // + this.resultsTabPageCtrl.BackColor = System.Drawing.SystemColors.Control; + resources.ApplyResources(this.resultsTabPageCtrl, "resultsTabPageCtrl"); + this.resultsTabPageCtrl.Name = "resultsTabPageCtrl"; + // + // logsTabPage + // + this.logsTabPage.Controls.Add(this.logsTabPageCtrl); + resources.ApplyResources(this.logsTabPage, "logsTabPage"); + this.logsTabPage.Name = "logsTabPage"; + this.logsTabPage.UseVisualStyleBackColor = true; + // + // logsTabPageCtrl + // + this.logsTabPageCtrl.BackColor = System.Drawing.SystemColors.Control; + resources.ApplyResources(this.logsTabPageCtrl, "logsTabPageCtrl"); + this.logsTabPageCtrl.Name = "logsTabPageCtrl"; + // + // rightHorizSplitContainer + // + resources.ApplyResources(this.rightHorizSplitContainer, "rightHorizSplitContainer"); + this.rightHorizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.rightHorizSplitContainer.Name = "rightHorizSplitContainer"; + // + // rightHorizSplitContainer.Panel1 + // + this.rightHorizSplitContainer.Panel1.Controls.Add(this.progressFlowLayoutPanel); + this.rightHorizSplitContainer.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.rightHorizSplitContainer_SplitterMoved); + // + // progressFlowLayoutPanel + // + resources.ApplyResources(this.progressFlowLayoutPanel, "progressFlowLayoutPanel"); + this.progressFlowLayoutPanel.BackColor = System.Drawing.SystemColors.Control; + this.progressFlowLayoutPanel.Name = "progressFlowLayoutPanel"; + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.userInfoStatusLabel, + this.activityStatusLabel}); + resources.ApplyResources(this.statusStrip1, "statusStrip1"); + this.statusStrip1.Name = "statusStrip1"; + // + // userInfoStatusLabel + // + this.userInfoStatusLabel.Name = "userInfoStatusLabel"; + resources.ApplyResources(this.userInfoStatusLabel, "userInfoStatusLabel"); + // + // activityStatusLabel + // + this.activityStatusLabel.Name = "activityStatusLabel"; + resources.ApplyResources(this.activityStatusLabel, "activityStatusLabel"); + // + // benchTSMenuItem + // + this.benchTSMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.benchComponentsTSMenuItem, + this.benchPathsTSMenuItem, + this.benchTransitionsToolStripMenuItem, + this.benchMetrologyTSMenuItem, + this.toolStripSeparator1, + this.exitToolStripMenuItem}); + this.benchTSMenuItem.Name = "benchTSMenuItem"; + resources.ApplyResources(this.benchTSMenuItem, "benchTSMenuItem"); + // + // benchComponentsTSMenuItem + // + this.benchComponentsTSMenuItem.Name = "benchComponentsTSMenuItem"; + resources.ApplyResources(this.benchComponentsTSMenuItem, "benchComponentsTSMenuItem"); + this.benchComponentsTSMenuItem.Click += new System.EventHandler(this.benchComponentsTSMItem_Click); + // + // benchPathsTSMenuItem + // + this.benchPathsTSMenuItem.Name = "benchPathsTSMenuItem"; + resources.ApplyResources(this.benchPathsTSMenuItem, "benchPathsTSMenuItem"); + this.benchPathsTSMenuItem.Click += new System.EventHandler(this.benchPathsTSMItem_Click); + // + // benchTransitionsToolStripMenuItem + // + this.benchTransitionsToolStripMenuItem.Name = "benchTransitionsToolStripMenuItem"; + resources.ApplyResources(this.benchTransitionsToolStripMenuItem, "benchTransitionsToolStripMenuItem"); + this.benchTransitionsToolStripMenuItem.Click += new System.EventHandler(this.benchTransitionsTSMItem_Click); + // + // benchMetrologyTSMenuItem + // + this.benchMetrologyTSMenuItem.Name = "benchMetrologyTSMenuItem"; + resources.ApplyResources(this.benchMetrologyTSMenuItem, "benchMetrologyTSMenuItem"); + this.benchMetrologyTSMenuItem.Click += new System.EventHandler(this.benchMetrologyTSMItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + resources.ApplyResources(this.exitToolStripMenuItem, "exitToolStripMenuItem"); + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // homeTSMenuItem + // + this.homeTSMenuItem.Name = "homeTSMenuItem"; + resources.ApplyResources(this.homeTSMenuItem, "homeTSMenuItem"); + this.homeTSMenuItem.Click += new System.EventHandler(this.homeTSMenuItem_Click); + // + // measurementTSMenuItem + // + this.measurementTSMenuItem.Name = "measurementTSMenuItem"; + resources.ApplyResources(this.measurementTSMenuItem, "measurementTSMenuItem"); + this.measurementTSMenuItem.Click += new System.EventHandler(this.measurementTSMenuItem_Click); + // + // resultsTSMenuItem + // + this.resultsTSMenuItem.Name = "resultsTSMenuItem"; + resources.ApplyResources(this.resultsTSMenuItem, "resultsTSMenuItem"); + // + // logsTSMenuItem + // + this.logsTSMenuItem.Name = "logsTSMenuItem"; + resources.ApplyResources(this.logsTSMenuItem, "logsTSMenuItem"); + this.logsTSMenuItem.Click += new System.EventHandler(this.logsTSMenuItem_Click); + // + // editTSMenuItem + // + this.editTSMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.usersTSMenuItem, + this.localSettingsTSMenuItem, + this.databaseSettingsTSMenuItem, + this.passwortToolStripMenuItem}); + this.editTSMenuItem.Name = "editTSMenuItem"; + resources.ApplyResources(this.editTSMenuItem, "editTSMenuItem"); + // + // usersTSMenuItem + // + this.usersTSMenuItem.Name = "usersTSMenuItem"; + resources.ApplyResources(this.usersTSMenuItem, "usersTSMenuItem"); + this.usersTSMenuItem.Click += new System.EventHandler(this.usersTSMItem_Click); + // + // localSettingsTSMenuItem + // + this.localSettingsTSMenuItem.Name = "localSettingsTSMenuItem"; + resources.ApplyResources(this.localSettingsTSMenuItem, "localSettingsTSMenuItem"); + this.localSettingsTSMenuItem.Click += new System.EventHandler(this.localSettingsTSMItem_Click); + // + // databaseSettingsTSMenuItem + // + this.databaseSettingsTSMenuItem.Name = "databaseSettingsTSMenuItem"; + resources.ApplyResources(this.databaseSettingsTSMenuItem, "databaseSettingsTSMenuItem"); + this.databaseSettingsTSMenuItem.Click += new System.EventHandler(this.databaseSettingsTSMItem_Click); + // + // passwortToolStripMenuItem + // + this.passwortToolStripMenuItem.Name = "passwortToolStripMenuItem"; + resources.ApplyResources(this.passwortToolStripMenuItem, "passwortToolStripMenuItem"); + // + // helpTSMenuItem + // + this.helpTSMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aboutTSMenuItem}); + this.helpTSMenuItem.Name = "helpTSMenuItem"; + resources.ApplyResources(this.helpTSMenuItem, "helpTSMenuItem"); + // + // aboutTSMenuItem + // + this.aboutTSMenuItem.Name = "aboutTSMenuItem"; + resources.ApplyResources(this.aboutTSMenuItem, "aboutTSMenuItem"); + this.aboutTSMenuItem.Click += new System.EventHandler(this.aboutTSMItem_Click); + // + // mainMenuStrip + // + this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.benchTSMenuItem, + this.proceduresToolStripMenuItem, + this.homeTSMenuItem, + this.processToolStripMenuItem, + this.measurementTSMenuItem, + this.picturesTSMItem, + this.resultsToolStripMenuItem, + this.logsTSMenuItem, + this.editTSMenuItem, + this.helpTSMenuItem}); + resources.ApplyResources(this.mainMenuStrip, "mainMenuStrip"); + this.mainMenuStrip.Name = "mainMenuStrip"; + // + // proceduresToolStripMenuItem + // + this.proceduresToolStripMenuItem.Name = "proceduresToolStripMenuItem"; + resources.ApplyResources(this.proceduresToolStripMenuItem, "proceduresToolStripMenuItem"); + this.proceduresToolStripMenuItem.Click += new System.EventHandler(this.proceduresTSMItem_Click); + // + // processToolStripMenuItem + // + this.processToolStripMenuItem.Name = "processToolStripMenuItem"; + resources.ApplyResources(this.processToolStripMenuItem, "processToolStripMenuItem"); + this.processToolStripMenuItem.Click += new System.EventHandler(this.processTSMenuItem_Click); + // + // picturesTSMItem + // + this.picturesTSMItem.Name = "picturesTSMItem"; + resources.ApplyResources(this.picturesTSMItem, "picturesTSMItem"); + this.picturesTSMItem.Click += new System.EventHandler(this.picturesTSMItem_Click); + // + // resultsToolStripMenuItem + // + this.resultsToolStripMenuItem.Name = "resultsToolStripMenuItem"; + resources.ApplyResources(this.resultsToolStripMenuItem, "resultsToolStripMenuItem"); + this.resultsToolStripMenuItem.Click += new System.EventHandler(this.resultsTSMenuItem_Click); + // + // MainWnd + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.verticalSplitContainer); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.mainMenuStrip); + this.KeyPreview = true; + this.MainMenuStrip = this.mainMenuStrip; + this.Name = "MainWnd"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWnd_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainWnd_FormClosed); + this.Load += new System.EventHandler(this.MainWnd_Load); + this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainWnd_KeyPress); + this.verticalSplitContainer.Panel1.ResumeLayout(false); + this.verticalSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.verticalSplitContainer)).EndInit(); + this.verticalSplitContainer.ResumeLayout(false); + this.horizontalSplitContainer.Panel1.ResumeLayout(false); + this.horizontalSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizontalSplitContainer)).EndInit(); + this.horizontalSplitContainer.ResumeLayout(false); + this.progressGroupBox.ResumeLayout(false); + this.activityGroupBox.ResumeLayout(false); + this.activityGroupBox.PerformLayout(); + this.procedureGroupBox.ResumeLayout(false); + this.mainTabControl.ResumeLayout(false); + this.homeTabPage.ResumeLayout(false); + this.processTabPage.ResumeLayout(false); + this.measurementTabPage.ResumeLayout(false); + this.picturesTabPage.ResumeLayout(false); + this.resultsTabPage.ResumeLayout(false); + this.logsTabPage.ResumeLayout(false); + this.rightHorizSplitContainer.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).EndInit(); + this.rightHorizSplitContainer.ResumeLayout(false); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.mainMenuStrip.ResumeLayout(false); + this.mainMenuStrip.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TabControl mainTabControl; + private System.Windows.Forms.TabPage homeTabPage; + private System.Windows.Forms.TabPage measurementTabPage; + private System.Windows.Forms.TabPage insertTabPage; + private System.Windows.Forms.TabPage resultsTabPage; + private System.Windows.Forms.TabPage logsTabPage; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel userInfoStatusLabel; + private System.Windows.Forms.ToolStripStatusLabel activityStatusLabel; + public Screens.MeasurementTabPageCtrl MeasurementTabPageCtrl; + private Screens.ResultsTabPageCtrl resultsTabPageCtrl; + private Screens.LogsTabPageCtrl logsTabPageCtrl; + +#if DN100 + private ControlCom2VB.ControlCom2panel ctrlBrdComponent; +#elif MUNICH + private ControlComponent3Munich.UserControl1 ctrlBrdComponent; +#elif FUZHOU150 + private ControlComponent3Munich.UserControl1 ctrlBrdComponent; +#endif + + private System.Windows.Forms.ToolStripMenuItem benchTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem homeTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem measurementTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem resultsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem logsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem editTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem usersTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem localSettingsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem databaseSettingsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem passwortToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutTSMenuItem; + private System.Windows.Forms.MenuStrip mainMenuStrip; + private System.Windows.Forms.ToolStripMenuItem benchComponentsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem benchPathsTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem benchMetrologyTSMenuItem; + private System.Windows.Forms.ToolStripMenuItem proceduresToolStripMenuItem; + private System.Windows.Forms.SplitContainer verticalSplitContainer; + private System.Windows.Forms.SplitContainer horizontalSplitContainer; + private System.Windows.Forms.ToolStripMenuItem processToolStripMenuItem; + private System.Windows.Forms.TabPage processTabPage; + private Screens.ProcessTabPageCtrl processTabPageCtrl; + private System.Windows.Forms.ToolStripMenuItem resultsToolStripMenuItem; + private System.Windows.Forms.SplitContainer rightHorizSplitContainer; + private System.Windows.Forms.FlowLayoutPanel progressFlowLayoutPanel; + private System.Windows.Forms.GroupBox progressGroupBox; + private System.Windows.Forms.ProgressBar mainProgressBar; + private System.Windows.Forms.GroupBox activityGroupBox; + private System.Windows.Forms.Label activityLabel; + private System.Windows.Forms.GroupBox procedureGroupBox; + private System.Windows.Forms.ComboBox procedureComboBox; + private System.Windows.Forms.ToolStripMenuItem benchTransitionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem picturesTSMItem; + private System.Windows.Forms.TabPage picturesTabPage; + private Screens.PicturesTabPageCtrl picturesTabPageCtrl1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + } +} + diff --git a/TestBenchFramework/MainWnd.cs b/TestBenchFramework/MainWnd.cs new file mode 100644 index 000000000..6748f2329 --- /dev/null +++ b/TestBenchFramework/MainWnd.cs @@ -0,0 +1,408 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using log4net; +using TBF.Entities; +using TBF.UiBridge; +using TBF.Resources; + +namespace TBF +{ + public partial class MainWnd : Form + { + static readonly ILog log = LogManager.GetLogger(typeof(MainWnd)); + + public UiControls.BenchControlPanel BenchControlPanel; + public string ProcedureName; + public Entities.Procedure CurrentProcedure; + + /// + /// This dialog is shown when emergency stop is activated + /// + TBF.Forms.EmergencyStopForm emergencyStopModelessDlg; + + bool benchInitializationFailed; + TestProgressControls testProgressControls; + + /// + /// Set when procedures are updated while the ProceduresComboBox is disabled (i.e. during a test). + /// Reset when the ProceduresComboBox list of items is successfully reloaded in ReloadProcedures(). + /// This flag is tested when ProcedureComboBox is being enabled in OnButtonsEtc(), + /// optionaly ReloadProcedures() is called. + /// + public bool ProceduresUpdated = false; + + /// + /// MainTabPage ID-s + /// The order of TabPages in this enum must be the same as the order + /// of their additions into the mainTabControl in MainWnd.Designer.cs + /// TODO: Find a better way + /// + public enum MainTabPageId + { + Invalid = -1, + Hydraulics = 0, + Process, + Measurement, + Insert, + Pictures, + Results, + Logs, + TabPagesCount + } + + /// + /// Event handlers switching between tab pages + /// + private void homeTSMenuItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Hydraulics); } + private void processTSMenuItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Process); } + private void measurementTSMenuItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Measurement); } + private void picturesTSMItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Pictures); } + private void resultsTSMenuItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Results); } + private void logsTSMenuItem_Click(object sender, EventArgs e) { mainTabControl.SelectTab((int)MainTabPageId.Logs); } + + /// + /// Constructor + /// + public MainWnd() + { + InitializeComponent(); + + Text = "Test Bench Framework - " + Program.CurrentBench.BenchName + + (Program.CurrentBench.IsRealBench ? "" : Strings._offline); + + usersTSMenuItem.Visible = User.CurrentUser.IsMemberOf(Grp.GID.Administrators) || + User.CurrentUser.IsMemberOf(Grp.GID.HeadOfLab); + + benchInitializationFailed = false; + /// + if (Program.CurrentBench.IsRealBench) + { + try + { + BenchControl.StateMachine.InitializeBoardEtc(ctrlBrdComponent); + testProgressControls = new TestProgressControls(progressFlowLayoutPanel); + } + catch (Exception exc) + { + benchInitializationFailed = true; + log.Fatal("Failed to initialize a test bench component", exc); + MessageBox.Show(exc.Message, Strings.Error, System.Windows.Forms.MessageBoxButtons.OK, + System.Windows.Forms.MessageBoxIcon.Exclamation); + } + } + } + + void Localize() + { + procedureGroupBox.Text = Strings.Procedure; + activityGroupBox.Text = Strings.Activity; + progressGroupBox.Text = Strings.Progress; + } + + /// + /// Initializes this window and its controls + /// + private void MainWnd_Load(object sender, EventArgs e) + { + Localize(); + + if (Program.CurrentBench.IsRealBench && !benchInitializationFailed) + { + try + { + BenchControl.StateMachine.InitializeDevices(); + + //emergencyStopModelessDlg = new TBF.Forms.EmergencyStopForm(); + //emergencyStopModelessDlg.Show(); + + Bridge.ButtonsEtcHandler += delegate(object sndr, ButtonsEtcEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnButtonsEtc), sndr, args); + } + else OnButtonsEtc(sndr, args); + }; + + Bridge.ActivityHandler += delegate(object sndr, UiBridge.ActivityEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnActivity), sndr, args); + } + else OnActivity(sndr, args); + }; + + Bridge.StateChangedHandler += delegate(object sndr, UiBridge.StateChangedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnStateChanged), sndr, args); + } + else OnStateChanged(sndr, args); + }; + + Bridge.TestProgressHandler += delegate(object sndr, UiBridge.TestProgressEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestProgress), sndr, args); + } + else OnTestProgress(sndr, args); + }; + + Bridge.ProcedureSelectedHandler += delegate(object sndr, UiBridge.ProcedureSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnProcedureSelected), sndr, args); + } + else OnProcedureSelected(sndr, args); + }; + } + catch (Exception exc) + { + benchInitializationFailed = true; + log.Fatal("Failed to initialize a test bench component", exc); + MessageBox.Show(exc.Message, Strings.Error, System.Windows.Forms.MessageBoxButtons.OK, + System.Windows.Forms.MessageBoxIcon.Exclamation); + } + } + + procedureComboBox.Text = Program.LocalSettings.LastProcedureName; + ProcedureName = Program.LocalSettings.LastProcedureName; + rightHorizSplitContainer.SplitterDistance = Program.LocalSettings.RightPaneHorizSplitterDistance; + + /// Text boxes for data input, with border and white background + CustomStyle.Set(0, DockStyle.Fill, Color.White, BorderStyle.FixedSingle, false, + new System.Drawing.Font("Verdana", 10.5F, FontStyle.Regular, GraphicsUnit.Point, (byte)(238))); + + // Read only text boxes (labels), its background matches the window background + + /// Measurement + CustomStyle.Set(1, DockStyle.Fill, Color.FromArgb(150, 180, 200), BorderStyle.None, true, + new System.Drawing.Font("Verdana", 10.5F, FontStyle.Regular, GraphicsUnit.Point, (byte)(238))); + + /// Not used + CustomStyle.Set(2, DockStyle.Fill, Color.OliveDrab, BorderStyle.None, true, + new System.Drawing.Font("Verdana", 10.5F, FontStyle.Regular, GraphicsUnit.Point, (byte)(238))); + + /// Procedure + CustomStyle.Set(3, DockStyle.Fill, Color.FromArgb(200, 200, 150), BorderStyle.None, true, + new System.Drawing.Font("Verdana", 10.5F, FontStyle.Regular, GraphicsUnit.Point, (byte)(238))); + + /// Initialize bench control user interface(s) + /// Initialize bench control user interface(s) + BenchControlPanel = new TBF.UiControls.BenchControlPanel(); + BenchControlPanel.BackColor = System.Drawing.Color.LightGray; + new System.ComponentModel.ComponentResourceManager(typeof(MainWnd)).ApplyResources(BenchControlPanel, "benchControlPanel"); + BenchControlPanel.Name = "benchControlPanel"; + rightHorizSplitContainer.Panel2.Controls.Add(BenchControlPanel); + ReloadProcedures(); + + /// Select the initial tab page + mainTabControl.SelectTab((int)MainTabPageId.Hydraulics); + UpdateUser(); + + if (Program.CurrentBench.IsRealBench) + { + if (!benchInitializationFailed) + { + BenchControl.StateMachine.Start(); + log.Info("Test bench started"); + } + else + { + BenchControlPanel.OnButtonsEtc(null, new ButtonsEtcEventArgs(TBF.UiBridge.ButtonsEtc.None)); + MessageBox.Show(Strings.Bench_is_not_running, + Strings.Warning, + System.Windows.Forms.MessageBoxButtons.OK, + System.Windows.Forms.MessageBoxIcon.Exclamation); + } + } + } + + /// + /// Pass any pressed keys to the Bench control panel. + /// Note that MainWnd.KeyPreview must be set to true. + /// + private void MainWnd_KeyPress(object sender, KeyPressEventArgs e) + { + if (BenchControlPanel != null && BenchControlPanel.ProcessKey(e.KeyChar)) + { + e.Handled = true; + } + } + + /// + /// Invoked from the UiBridge to update the activity label. + /// + void OnActivity(object sender, UiBridge.ActivityEventArgs args) + { + activityLabel.Text = args.Activity; + } + + /// + /// Invoked from the UiBridge to update the current state status bar item. + /// + void OnStateChanged(object sender, StateChangedEventArgs args) + { + activityStatusLabel.Text = args.StateChangedMsg; + } + + void OnTestProgress(object sender, UiBridge.TestProgressEventArgs args) + { + mainProgressBar.Value = (int)(100.499f * args.OveralProgress); + } + + void OnProcedureSelected(object sender, UiBridge.ProcedureSelectedEventArgs args) + { + mainProgressBar.Value = 0; + } + + void OnButtonsEtc(object sender, UiBridge.ButtonsEtcEventArgs args) + { + if (((args.Flags & ButtonsEtc.ShowBenchEmpty) != 0) || + ((args.Flags & ButtonsEtc.ShowBenchFilled) != 0)) + { + return; + } + + procedureComboBox.Enabled = ((args.Flags & UiBridge.ButtonsEtc.ProcedureCmbBoxEn) != 0); + + if (procedureComboBox.Enabled && ProceduresUpdated) + { + ReloadProcedures(); + } + } + + public void UpdateUser() + { + userInfoStatusLabel.Text = Strings.User_ + Entities.User.CurrentUser.Name + " , "; + } + + /// + /// Stop the bench when program closes + /// + /// + /// + private void MainWnd_FormClosed(object sender, FormClosedEventArgs e) + { + //BenchControl.StateMachine.Stop(); + } + + private void benchComponentsTSMItem_Click(object s, EventArgs e) { new ComponentsManagerDlg().ShowDialog(); } + private void benchPathsTSMItem_Click(object s, EventArgs e) { new PathsDlg().ShowDialog(); } + private void benchTransitionsTSMItem_Click(object s, EventArgs e) { new TransitionsDlg().ShowDialog(); } + private void benchMetrologyTSMItem_Click(object s, EventArgs e) { new MetrologyDlg().ShowDialog(); } + private void proceduresTSMItem_Click(object s, EventArgs e) { new ProceduresDlg().ShowDialog(); } + private void localSettingsTSMItem_Click(object s, EventArgs e) { new PreferencesDlg().ShowDialog(); } + private void databaseSettingsTSMItem_Click(object s, EventArgs e) { new BenchesDlg().ShowDialog(); } + private void usersTSMItem_Click(object s, EventArgs e) { new Forms.EditUsers().ShowDialog(); } + private void aboutTSMItem_Click(object s, EventArgs e) { new Forms.AboutDlg("1.0", "07.01.2014").ShowDialog(); } + + /// + /// Read the database and re-initialize procedureComboBox items. + /// Try to preserve the original selection. + /// + public void ReloadProcedures() + { + if (procedureComboBox.Enabled) + { + string oriProcName = procedureComboBox.Text; + + IList procedures = FluentCommon.CreateSession(Database.Procedures) + .CreateQuery("FROM Procedure ORDER BY ItemNr") + .List(); + + procedureComboBox.Items.Clear(); + foreach (var proc in procedures) procedureComboBox.Items.Add(proc.Name); + + if (procedureComboBox.Items.Contains(oriProcName)) + { + procedureComboBox.Text = oriProcName; + ProcedureName = oriProcName; + } + else if (procedures.Count > 0) + { + procedureComboBox.Text = procedures[0].Name; + ProcedureName = procedures[0].Name; + } + else + { + procedureComboBox.Text = string.Empty; + ProcedureName = null; + } + + ProceduresUpdated = false; + + BenchControlPanel.ReloadTests(); + } + else + { + ProceduresUpdated = true; + } + } + + private void procedureComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + ProcedureName = procedureComboBox.Text; + BenchControlPanel.ReloadTests(); + if (CurrentProcedure != null && testProgressControls != null) + { + testProgressControls.ProcedureSelectedInUI(this, new UiBridge.ProcedureSelectedEventArgs(CurrentProcedure)); + } + if (!string.IsNullOrEmpty(ProcedureName)) + { + Program.LocalSettings.LastProcedureName = ProcedureName; + Program.LocalSettings.Save(); + } + } + + private void rightHorizSplitContainer_SplitterMoved(object sender, SplitterEventArgs e) + { + Program.LocalSettings.RightPaneHorizSplitterDistance = rightHorizSplitContainer.SplitterDistance; + Program.LocalSettings.Save(); + } + + private void MainWnd_FormClosing(object sender, FormClosingEventArgs e) + { + if (DialogResult == DialogResult.None) + { + exitToolStripMenuItem_Click(sender, e); + } + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + bool oriEmgStopState = false; + if (emergencyStopModelessDlg != null) + { + oriEmgStopState = emergencyStopModelessDlg.Visible; + emergencyStopModelessDlg.Visible = false; + } + + if (DialogResult.Yes == MessageBox.Show("Do you want to exit the Test Bench Framework?", "Closing the program", + MessageBoxButtons.YesNo, MessageBoxIcon.Question)) + { + BenchControl.StateMachine.Stop(); + UiBridge.Bridge.OnEmergencyStopChanged(this, UiBridge.EmergencyStopEventArgs.State.CloseForm); + new Forms.ClosingProgram().ShowDialog(); + DialogResult = DialogResult.OK; + Close(); + return; + } + else if (e is FormClosingEventArgs) + { + (e as FormClosingEventArgs).Cancel = true; + } + + if (emergencyStopModelessDlg != null) emergencyStopModelessDlg.Visible = oriEmgStopState; + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/MainWnd.de.resx b/TestBenchFramework/MainWnd.de.resx new file mode 100644 index 000000000..bc36c1826 --- /dev/null +++ b/TestBenchFramework/MainWnd.de.resx @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 1020, 562 + + + 1020, 666 + + + 230, 666 + + + 1254, 666 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 1012, 553 + + + 0, 690 + + + 73, 17 + + + User : admin + + + + No + + + 132, 17 + + + Please start a procedure + + + 70, 20 + + + Prüfstand + + + 152, 22 + + + Komponenten + + + 152, 22 + + + Pfade + + + 152, 22 + + + Übergänge + + + 152, 22 + + + Metrologie + + + 149, 6 + + + 152, 22 + + + Beenden + + + 122, 20 + + + Schema-Diagramm + + + 67, 20 + + + Messung + + + 75, 20 + + + Ergebnisse + + + 73, 20 + + + Protokolle + + + 79, 20 + + + Verwaltung + + + 131, 22 + + + Benutzer + + + 131, 22 + + + Sprache + + + 131, 22 + + + Datenbank + + + 131, 22 + + + Passwort + + + Hilfe + + + 99, 22 + + + Über + + + 75, 20 + + + Prüfungen + + + 49, 20 + + + Bilder + + + 70, 20 + + + Ergebnise + + + 1254, 712 + + \ No newline at end of file diff --git a/TestBenchFramework/MainWnd.resx b/TestBenchFramework/MainWnd.resx new file mode 100644 index 000000000..8dc8dfac2 --- /dev/null +++ b/TestBenchFramework/MainWnd.resx @@ -0,0 +1,1203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Fill + + + + True + + + + 0, 24 + + + Fill + + + True + + + 0, 0 + + + Horizontal + + + NoControl + + + 6, 25 + + + 237, 33 + + + 0 + + + mainProgressBar + + + System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + progressGroupBox + + + 0 + + + Verdana, 12pt + + + 767, 15 + + + 249, 68 + + + 19 + + + Progress + + + progressGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer.Panel1 + + + 0 + + + False + + + Verdana, 15.75pt + + + 8, 25 + + + 244, 33 + + + 6 + + + procedureComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + procedureGroupBox + + + 0 + + + Verdana, 12pt + + + 503, 15 + + + 258, 68 + + + 17 + + + Procedure + + + procedureGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer.Panel1 + + + 1 + + + True + + + Verdana, 15.75pt + + + NoControl + + + 6, 28 + + + 0, 25 + + + 0 + + + activityLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + activityGroupBox + + + 0 + + + Verdana, 12pt + + + 12, 15 + + + 485, 68 + + + 18 + + + Activity + + + activityGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer.Panel1 + + + 2 + + + horizontalSplitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer + + + 0 + + + Fill + + + 0, 0 + + + 1012, 543 + + + 1 + + + ctrlBrdComponent + + + ControlCom2VB.ControlCom2panel, ControlCom2VB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + homeTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 29 + + + Hydraulics + + + homeTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 0 + + + Fill + + + Microsoft Sans Serif, 8.25pt + + + 0, 0 + + + 4, 4, 4, 4 + + + 1012, 543 + + + 1 + + + processTabPageCtrl + + + TBF.Screens.ProcessTabPageCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + processTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 30 + + + Process + + + processTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 1 + + + Fill + + + Verdana, 11.25pt + + + 0, 0 + + + 4, 4, 4, 4 + + + 1012, 543 + + + 0 + + + MeasurementTabPageCtrl + + + TBF.Screens.MeasurementTabPageCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + measurementTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 25 + + + Measurement + + + measurementTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 2 + + + 4, 5 + + + 1012, 543 + + + 22 + + + Insert + + + insertTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 3 + + + Fill + + + Microsoft Sans Serif, 8.25pt + + + 0, 0 + + + 1012, 543 + + + 0 + + + picturesTabPageCtrl1 + + + TBF.Screens.PicturesTabPageCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + picturesTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 31 + + + Pictures + + + picturesTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 4 + + + Fill + + + Microsoft Sans Serif, 8.25pt + + + 0, 0 + + + 4, 4, 4, 4 + + + 1012, 543 + + + 0 + + + resultsTabPageCtrl + + + TBF.Screens.ResultsTabPageCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + resultsTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 15 + + + Results + + + resultsTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 5 + + + Fill + + + Microsoft Sans Serif, 8.25pt + + + 0, 0 + + + 4, 4, 4, 4 + + + 1012, 543 + + + 0 + + + logsTabPageCtrl + + + TBF.Screens.LogsTabPageCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + logsTabPage + + + 0 + + + 4, 5 + + + 1012, 543 + + + 21 + + + Logs + + + logsTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainTabControl + + + 6 + + + Fill + + + 0, 1 + + + 0, 0 + + + 1020, 552 + + + 1 + + + mainTabControl + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer.Panel2 + + + 0 + + + horizontalSplitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + horizontalSplitContainer + + + 1 + + + 1020, 656 + + + 100 + + + 2 + + + horizontalSplitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + verticalSplitContainer.Panel1 + + + 0 + + + verticalSplitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + verticalSplitContainer + + + 0 + + + Fill + + + 0, 0 + + + Horizontal + + + True + + + Fill + + + TopDown + + + 0, 0 + + + 230, 240 + + + 1 + + + False + + + progressFlowLayoutPanel + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightHorizSplitContainer.Panel1 + + + 0 + + + rightHorizSplitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightHorizSplitContainer + + + 0 + + + rightHorizSplitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightHorizSplitContainer + + + 1 + + + 230, 656 + + + 240 + + + 0 + + + rightHorizSplitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + verticalSplitContainer.Panel2 + + + 0 + + + verticalSplitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + verticalSplitContainer + + + 1 + + + 1254, 656 + + + 1020 + + + 3 + + + verticalSplitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 152, 17 + + + 0, 17 + + + 0, 17 + + + 0, 680 + + + 1254, 22 + + + 2 + + + statusStrip1 + + + statusStrip1 + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 143, 22 + + + Components + + + 143, 22 + + + Paths + + + 143, 22 + + + Transitions + + + 143, 22 + + + Metrology + + + 140, 6 + + + 143, 22 + + + Exit + + + 52, 20 + + + Bench + + + 52, 20 + + + Home + + + 92, 20 + + + Measurement + + + 56, 20 + + + Results + + + 44, 20 + + + Logs + + + 126, 22 + + + Users + + + 126, 22 + + + Language + + + 126, 22 + + + Database + + + 126, 22 + + + Password + + + 61, 20 + + + Settings + + + 107, 22 + + + About + + + 44, 20 + + + Help + + + 17, 17 + + + 78, 20 + + + Procedures + + + 59, 20 + + + Process + + + 61, 20 + + + Pictures + + + 56, 20 + + + Results + + + 0, 0 + + + 1254, 24 + + + 0 + + + mainMenuStrip + + + mainMenuStrip + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + 25 + + + 6, 13 + + + 1254, 702 + + + Test Bench Framework + + + userInfoStatusLabel + + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + activityStatusLabel + + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + benchTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + benchComponentsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + benchPathsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + benchTransitionsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + benchMetrologyTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripSeparator1 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + exitToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + homeTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + measurementTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + resultsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + logsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + editTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + usersTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + localSettingsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + databaseSettingsTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + passwortToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + helpTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + aboutTSMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + proceduresToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + processToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + picturesTSMItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + resultsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + MainWnd + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Mappings/BenchPathMap.cs b/TestBenchFramework/Mappings/BenchPathMap.cs new file mode 100644 index 000000000..e5a6eb473 --- /dev/null +++ b/TestBenchFramework/Mappings/BenchPathMap.cs @@ -0,0 +1,27 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class BenchPathMap : ClassMap + { + public BenchPathMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.TempIn); + Map(x => x.TempOut); + Map(x => x.PressIn); + Map(x => x.PressOut); + Map(x => x.ValvesOpen) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + Map(x => x.ValvesClose) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + } + } +} diff --git a/TestBenchFramework/Mappings/ComponentMap.cs b/TestBenchFramework/Mappings/ComponentMap.cs new file mode 100644 index 000000000..90082dfbf --- /dev/null +++ b/TestBenchFramework/Mappings/ComponentMap.cs @@ -0,0 +1,25 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class ComponentMap : ClassMap + { + public ComponentMap() + { + Id(x => x.Id); + Map(x => x.Name); + Map(x => x.ClassName); + Map(x => x.ParentName); + Map(x => x.ItemNr); + Map(x => x.Mode); + Map(x => x.Logging); + Map(x => x.Parameters) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + HasMany(x => x.Corrections) + .OrderBy("Measurement") + .Cascade.All(); + } + } +} diff --git a/TestBenchFramework/Mappings/ComponentProcedureMap.cs b/TestBenchFramework/Mappings/ComponentProcedureMap.cs new file mode 100644 index 000000000..12409f4b4 --- /dev/null +++ b/TestBenchFramework/Mappings/ComponentProcedureMap.cs @@ -0,0 +1,19 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class ComponentProcedureMap : ClassMap + { + public ComponentProcedureMap() + { + Id(x => x.Id); + Map(x => x.CmpntName); + Map(x => x.Parameters) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + + References(x => x.Procedure); + } + } +} diff --git a/TestBenchFramework/Mappings/ComponentTestMap.cs b/TestBenchFramework/Mappings/ComponentTestMap.cs new file mode 100644 index 000000000..2b50393d9 --- /dev/null +++ b/TestBenchFramework/Mappings/ComponentTestMap.cs @@ -0,0 +1,19 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class ComponentTestMap : ClassMap + { + public ComponentTestMap() + { + Id(x => x.Id); + Map(x => x.CmpntName); + Map(x => x.Parameters) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + + References(x => x.Test); + } + } +} diff --git a/TestBenchFramework/Mappings/FeedingPathMap.cs b/TestBenchFramework/Mappings/FeedingPathMap.cs new file mode 100644 index 000000000..c58a5ad7a --- /dev/null +++ b/TestBenchFramework/Mappings/FeedingPathMap.cs @@ -0,0 +1,24 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class FeedingPathMap : ClassMap + { + public FeedingPathMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.Pump); + Map(x => x.ValvesOpen) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + Map(x => x.ValvesClose) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + } + } +} diff --git a/TestBenchFramework/Mappings/GroupMap.cs b/TestBenchFramework/Mappings/GroupMap.cs new file mode 100644 index 000000000..17436f8b3 --- /dev/null +++ b/TestBenchFramework/Mappings/GroupMap.cs @@ -0,0 +1,14 @@ +using FluentNHibernate.Mapping; + +namespace TBF.Mappings +{ + class GroupMap : ClassMap + { + public GroupMap() + { + Id(x => x.Id); + Map(x => x.Gid); + Map(x => x.Name); + } + } +} diff --git a/TestBenchFramework/Mappings/MeasurementCorrectionMap.cs b/TestBenchFramework/Mappings/MeasurementCorrectionMap.cs new file mode 100644 index 000000000..42529581e --- /dev/null +++ b/TestBenchFramework/Mappings/MeasurementCorrectionMap.cs @@ -0,0 +1,15 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class MeasurementCorrectionMap : ClassMap + { + public MeasurementCorrectionMap() + { + Id(x => x.Id); + Map(x => x.Measurement); + Map(x => x.Correction); + } + } +} diff --git a/TestBenchFramework/Mappings/MeterTestResultMap.cs b/TestBenchFramework/Mappings/MeterTestResultMap.cs new file mode 100644 index 000000000..a4ddd0417 --- /dev/null +++ b/TestBenchFramework/Mappings/MeterTestResultMap.cs @@ -0,0 +1,23 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class MeterTestResultMap : ClassMap + { + public MeterTestResultMap() + { + Id(x => x.Id); + References(x => x.TestResult); + Map(x => x.SerialNr); + Map(x => x.VolumeStart); + Map(x => x.VolumeEnd); + Map(x => x.VolumeMeter); + Map(x => x.VolumeRef); + Map(x => x.VolumeErrorPct); + Map(x => x.PulsesMeter); + Map(x => x.PulsesMaster); + Map(x => x.Time); + } + } +} diff --git a/TestBenchFramework/Mappings/MetersPathMap.cs b/TestBenchFramework/Mappings/MetersPathMap.cs new file mode 100644 index 000000000..b6672eb9d --- /dev/null +++ b/TestBenchFramework/Mappings/MetersPathMap.cs @@ -0,0 +1,39 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class MetersPathMap : ClassMap + { + public MetersPathMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.Sensor1); +#pragma warning disable + if (Program.WMsCount >= 2) Map(x => x.Sensor2); + if (Program.WMsCount >= 3) Map(x => x.Sensor3); + if (Program.WMsCount >= 4) Map(x => x.Sensor4); + if (Program.WMsCount >= 5) Map(x => x.Sensor5); + if (Program.WMsCount >= 6) Map(x => x.Sensor6); + if (Program.WMsCount >= 7) Map(x => x.Sensor7); + if (Program.WMsCount >= 8) Map(x => x.Sensor8); + if (Program.WMsCount >= 9) Map(x => x.Sensor9); + if (Program.WMsCount >= 10) Map(x => x.Sensor10); + if (Program.WMsCount >= 11) Map(x => x.Sensor11); + if (Program.WMsCount >= 12) Map(x => x.Sensor12); + if (Program.WMsCount >= 13) Map(x => x.Sensor13); + if (Program.WMsCount >= 14) Map(x => x.Sensor14); + if (Program.WMsCount >= 15) Map(x => x.Sensor15); + if (Program.WMsCount >= 16) Map(x => x.Sensor16); + if (Program.WMsCount >= 17) Map(x => x.Sensor17); + if (Program.WMsCount >= 18) Map(x => x.Sensor18); + if (Program.WMsCount >= 19) Map(x => x.Sensor19); + if (Program.WMsCount >= 20) Map(x => x.Sensor20); +#pragma warning restore + } + } +} diff --git a/TestBenchFramework/Mappings/OutputPathMap.cs b/TestBenchFramework/Mappings/OutputPathMap.cs new file mode 100644 index 000000000..5930b5eae --- /dev/null +++ b/TestBenchFramework/Mappings/OutputPathMap.cs @@ -0,0 +1,29 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class OutputPathMap : ClassMap + { + public OutputPathMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.RegulValve); + Map(x => x.FlowMeter); + Map(x => x.Diverter); + Map(x => x.TempDiv); + Map(x => x.Balance); + Map(x => x.EmptyTankValve); + Map(x => x.ValvesOpen) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + Map(x => x.ValvesClose) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + } + } +} diff --git a/TestBenchFramework/Mappings/ProcedureMap.cs b/TestBenchFramework/Mappings/ProcedureMap.cs new file mode 100644 index 000000000..b2e2c7bb8 --- /dev/null +++ b/TestBenchFramework/Mappings/ProcedureMap.cs @@ -0,0 +1,34 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class ProcedureMap : ClassMap + { + public ProcedureMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Description); + Map(x => x.CreationUser); + Map(x => x.CreationTime); + Map(x => x.LastChgUser); + Map(x => x.LastChgTime); + Map(x => x.LongDescription); + Map(x => x.Watermeters); + Map(x => x.DataEntry); + Map(x => x.ResultsPrinter); + Map(x => x.ResultsWriter); + Map(x => x.TransitionStart); + Map(x => x.TransitionEnd); + ////Map(x => x.MetrologicalClass); + ////HasOne(x => x.WMType); + HasMany(x => x.MoreParams) + .Cascade.All(); + HasMany(x => x.Tests) + .OrderBy("ItemNr") + .Cascade.All(); + } + } +} diff --git a/TestBenchFramework/Mappings/TestMap.cs b/TestBenchFramework/Mappings/TestMap.cs new file mode 100644 index 000000000..199eac46b --- /dev/null +++ b/TestBenchFramework/Mappings/TestMap.cs @@ -0,0 +1,36 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class TestMap : ClassMap + { + public TestMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.Volume); + Map(x => x.TstTime); + Map(x => x.Repeats); + Map(x => x.Emptying); + Map(x => x.Zeroing); + Map(x => x.Method); + Map(x => x.ErrLimLo); + Map(x => x.ErrLimHi); + Map(x => x.TolerRed); /// ??? + Map(x => x.RedType); /// ??? + Map(x => x.FeedingPath); + Map(x => x.BenchPath); + Map(x => x.OutputPath); + Map(x => x.MetersPath); + Map(x => x.TransitionStart); + Map(x => x.TransitionEnd); + HasMany(x => x.MoreParams) + .Cascade.All(); + References(x => x.Procedure); + } + } +} diff --git a/TestBenchFramework/Mappings/TestResultMap.cs b/TestBenchFramework/Mappings/TestResultMap.cs new file mode 100644 index 000000000..9a90142c8 --- /dev/null +++ b/TestBenchFramework/Mappings/TestResultMap.cs @@ -0,0 +1,93 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class TestResultMap : ClassMap + { + public TestResultMap() + { + Id(x => x.Id); + Map(x => x.Name); + HasMany(x => x.Meters) + .Cascade.All(); + HasMany(x => x.CombinedMeters) + .Cascade.All(); + + Map(x => x.TestName); + Map(x => x.Qfrom); + Map(x => x.Qto); + Map(x => x.Volume); + Map(x => x.TstTime); + Map(x => x.Repeats); + Map(x => x.Emptying); + Map(x => x.Zeroing); + Map(x => x.Method); + Map(x => x.ErrLimLo); + Map(x => x.ErrLimHi); + + Map(x => x.FeedingPath) + .CustomType("StringClob") + .CustomSqlType("varchar(4000)"); + Map(x => x.BenchPath) + .CustomType("StringClob") + .CustomSqlType("varchar(4000)"); + Map(x => x.OutputPath) + .CustomType("StringClob") + .CustomSqlType("varchar(4000)"); + Map(x => x.MetersPath) + .CustomType("StringClob") + .CustomSqlType("varchar(4000)"); + + Map(x => x.TimeStart); + Map(x => x.TimeEnd); + Map(x => x.RepetitionNr); + Map(x => x.AmbientTempAve); + Map(x => x.AmbientPressAve); + Map(x => x.AmbientHumiAve); + Map(x => x.PressInAvrg); + Map(x => x.PressInStart); + Map(x => x.PressInEnd); + Map(x => x.PressOutAvrg); + Map(x => x.PressOutStart); + Map(x => x.PressOutEnd); + Map(x => x.TempInAvrg); + Map(x => x.TempInStart); + Map(x => x.TempInEnd); + Map(x => x.TempOutAvrg); + Map(x => x.TempOutStart); + Map(x => x.TempOutEnd); + Map(x => x.TempDivAvrg); + Map(x => x.TempDivStart); + Map(x => x.TempDivEnd); + Map(x => x.MassStartRaw); + Map(x => x.MassStart); + Map(x => x.MassEndRaw); + Map(x => x.MassEnd); + Map(x => x.MassDiff); + Map(x => x.DensityIn); + Map(x => x.DensityOut); + Map(x => x.DensityDiv); + Map(x => x.FlowMass); /// from conventional true value + Map(x => x.FlowVolume); /// from conventional true value + Map(x => x.VolumeCTV); /// volume conventional true value + Map(x => x.VolumeMaster); /// volume from the master flow meter + Map(x => x.Time); /// measurement time in seconds + Map(x => x.ErrorMaster); + Map(x => x.PulsesMaster); + Map(x => x.ConstMaster); /// Pulses per liter master flow meter + Map(x => x.TimeDivStart0); + Map(x => x.TimeDivStart1); + Map(x => x.TimeDivStart2); + Map(x => x.TimeDivStart3); + Map(x => x.TimeDivStart4); + Map(x => x.TimeDivStart5); + Map(x => x.TimeDivEnd0); + Map(x => x.TimeDivEnd1); + Map(x => x.TimeDivEnd2); + Map(x => x.TimeDivEnd3); + Map(x => x.TimeDivEnd4); + Map(x => x.TimeDivEnd5); + } + } +} diff --git a/TestBenchFramework/Mappings/TransitionSequenceMap.cs b/TestBenchFramework/Mappings/TransitionSequenceMap.cs new file mode 100644 index 000000000..22b5f3f34 --- /dev/null +++ b/TestBenchFramework/Mappings/TransitionSequenceMap.cs @@ -0,0 +1,19 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class TransitionSequenceMap : ClassMap + { + public TransitionSequenceMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Name); + Map(x => x.Description); + HasMany(x => x.TransitionSteps) + .OrderBy("ItemNr") + .Cascade.All(); + } + } +} diff --git a/TestBenchFramework/Mappings/TransitionStepMap.cs b/TestBenchFramework/Mappings/TransitionStepMap.cs new file mode 100644 index 000000000..f729c5422 --- /dev/null +++ b/TestBenchFramework/Mappings/TransitionStepMap.cs @@ -0,0 +1,24 @@ +using FluentNHibernate.Mapping; +using TBF.Entities; + +namespace TBF.Mappings +{ + class TransitionStepMap : ClassMap + { + public TransitionStepMap() + { + Id(x => x.Id); + Map(x => x.ItemNr); + Map(x => x.Duration); + Map(x => x.ValvesOpen) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + Map(x => x.ValvesClose) + .CustomType("StringClob") + .CustomSqlType("varchar(8000)"); + Map(x => x.RegulValvesPct); + + References(x => x.TransitionSequence); + } + } +} diff --git a/TestBenchFramework/Mappings/UserMap.cs b/TestBenchFramework/Mappings/UserMap.cs new file mode 100644 index 000000000..84c0721ad --- /dev/null +++ b/TestBenchFramework/Mappings/UserMap.cs @@ -0,0 +1,18 @@ +using FluentNHibernate.Mapping; + +namespace TBF.Mappings +{ + class UserMap : ClassMap + { + public UserMap() + { + Id(x => x.Id); + Map(x => x.Name); + Map(x => x.Password); + Map(x => x.Description); + Map(x => x.LastPwChange); + HasMany(x => x.Groups) + .Cascade.All(); + } + } +} diff --git a/TestBenchFramework/Mappings/WMTypeMap.cs b/TestBenchFramework/Mappings/WMTypeMap.cs new file mode 100644 index 000000000..8f567a9f2 --- /dev/null +++ b/TestBenchFramework/Mappings/WMTypeMap.cs @@ -0,0 +1,17 @@ +using FluentNHibernate.Mapping; + +namespace TBF.Mappings +{ + class WMTypeMap : ClassMap + { + public WMTypeMap() + { + Id(x => x.Id); + Map(x => x.CreateTime); + Map(x => x.CreateUserName); + Map(x => x.CreateDescription); + Map(x => x.Name); + Map(x => x.PulseRate); + } + } +} diff --git a/TestBenchFramework/Mappings/WatermeterMap.cs b/TestBenchFramework/Mappings/WatermeterMap.cs new file mode 100644 index 000000000..73255819a --- /dev/null +++ b/TestBenchFramework/Mappings/WatermeterMap.cs @@ -0,0 +1,16 @@ +using FluentNHibernate.Mapping; + +namespace TBF.Mappings +{ + class WatermeterMap : ClassMap + { + public WatermeterMap() + { + Id(x => x.Id); + Map(x => x.Serial); + // HasOne(x => x.WMType) + // .Cascade.All(); + References(x => x.WMType); + } + } +} diff --git a/TestBenchFramework/MetrologyDlg.Designer.cs b/TestBenchFramework/MetrologyDlg.Designer.cs new file mode 100644 index 000000000..4d9d70406 --- /dev/null +++ b/TestBenchFramework/MetrologyDlg.Designer.cs @@ -0,0 +1,100 @@ +namespace TBF +{ + partial class MetrologyDlg + { + /// + /// 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 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.splitContainer = new System.Windows.Forms.SplitContainer(); + this.metrologyTabControl = new System.Windows.Forms.TabControl(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.Controls.Add(this.metrologyTabControl); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.sharedButtons); + this.splitContainer.Size = new System.Drawing.Size(965, 344); + this.splitContainer.SplitterDistance = 863; + this.splitContainer.TabIndex = 0; + // + // metrologyTabControl + // + this.metrologyTabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.metrologyTabControl.ItemSize = new System.Drawing.Size(60, 30); + this.metrologyTabControl.Location = new System.Drawing.Point(0, 0); + this.metrologyTabControl.Name = "metrologyTabControl"; + this.metrologyTabControl.SelectedIndex = 0; + this.metrologyTabControl.Size = new System.Drawing.Size(863, 344); + this.metrologyTabControl.TabIndex = 0; + this.metrologyTabControl.SelectedIndexChanged += new System.EventHandler(this.metrologyTabControl_SelectedIndexChanged); + // + // sharedButtons + // + this.sharedButtons.Location = new System.Drawing.Point(-2, 0); + this.sharedButtons.Name = "sharedButtons"; + this.sharedButtons.Size = new System.Drawing.Size(100, 400); + this.sharedButtons.TabIndex = 0; + // + // MetrologyDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(965, 344); + this.Controls.Add(this.splitContainer); + this.Name = "MetrologyDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Metrology"; + this.Load += new System.EventHandler(this.MetrologyDlg_Load); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.TabControl metrologyTabControl; + private UiControls.SharedButtons sharedButtons; + } +} \ No newline at end of file diff --git a/TestBenchFramework/MetrologyDlg.cs b/TestBenchFramework/MetrologyDlg.cs new file mode 100644 index 000000000..6bdaeee6d --- /dev/null +++ b/TestBenchFramework/MetrologyDlg.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using NHibernate; +using log4net; +using TBF.UiControls; +using TBF.BenchControl; +using TBF.Resources; + +namespace TBF +{ + public partial class MetrologyDlg : Form, IParentOfListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlg)); + + public IList cmpntEntities; + + ISession session; + + public MetrologyDlg() + { + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove; + sharedButtons.Unlocked += unlockButton_Click; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + } + + private void MetrologyDlg_Load(object sender, EventArgs e) + { + Text = Strings.Metrology; + + int balancesCount = 0; + int flowMetersCount = 0; + int pressMetersCount = 0; + + session = FluentCommon.CreateSession(Database.Bench); + cmpntEntities = session.CreateQuery("FROM Component ORDER BY ItemNr") + .List(); + + foreach (var cmpnt in cmpntEntities) + { + BenchControl.Generic.IComponentFactory factory = TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName); + + if (factory is BenchControl.MettlerToledo.BalanceFactory || + factory is BenchControl.MettlerToledo.BalanceNewFactory) + { + balancesCount++; + TabPage tabPage = new TabPage(" " + Strings.Balance + " " + balancesCount.ToString() + " "); + MetrologyDlgBalanceTab uiControl = new MetrologyDlgBalanceTab(); + uiControl.MeterEntity = cmpnt; + uiControl.Dock = DockStyle.Fill; + tabPage.Tag = uiControl; + tabPage.Controls.Add(uiControl); + metrologyTabControl.TabPages.Add(tabPage); + } + if (factory is BenchControl.Elde.FlowMeter.FlowMeterFactory) + { + flowMetersCount++; + TabPage tabPage = new TabPage(" " + Strings.Reference + " " + flowMetersCount.ToString() + " "); + MetrologyDlgFlowMeterTab uiControl = new MetrologyDlgFlowMeterTab(); + uiControl.MeterEntity = cmpnt; + uiControl.Dock = DockStyle.Fill; + tabPage.Tag = uiControl; + tabPage.Controls.Add(uiControl); + metrologyTabControl.TabPages.Add(tabPage); + } + if (factory is BenchControl.Elde.PressureMeter.PressureMeterFactory) + { + pressMetersCount++; + TabPage tabPage = new TabPage(" " + Strings.Pressure_meter + pressMetersCount.ToString() + " "); + MetrologyDlgPressMeterTab uiControl = new MetrologyDlgPressMeterTab(); + uiControl.MeterEntity = cmpnt; + uiControl.Dock = DockStyle.Fill; + tabPage.Tag = uiControl; + tabPage.Controls.Add(uiControl); + metrologyTabControl.TabPages.Add(tabPage); + } + } + } + + private void unlockButton_Click(object sender, EventArgs e) + { + foreach (TabPage tabPage in metrologyTabControl.TabPages) + { + (tabPage.Tag as IMetrologyDlgTab).Unlock(); + } + } + + private void okButton_Click(object sender, EventArgs e) + { + foreach (TabPage tabPage in metrologyTabControl.TabPages) + { + IMetrologyDlgTab tab = tabPage.Tag as IMetrologyDlgTab; + tab.OkBtnClicked(); + FluentCommon.SaveToDb(session, tab.MeterEntity); + foreach (var entity in tab.ToBeRemoved) FluentCommon.DeleteFromDb(session, entity); + } + DialogResult = DialogResult.OK; + Close(); + } + + private void cancelButton_Click(object sender, EventArgs e) + { + foreach (TabPage tabPage in metrologyTabControl.TabPages) + { + (tabPage.Tag as IMetrologyDlgTab).CancelBtnClicked(); + } + DialogResult = DialogResult.Cancel; + Close(); + } + + private void addButton_Click(object sender, EventArgs e) + { + (metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).AddOne(); + } + + private void removeButton_Click(object sender, EventArgs e) + { + (metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).RemoveSelected(); + } + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove); + } + else + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + } + } + + private void metrologyTabControl_SelectedIndexChanged(object sender, EventArgs e) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove); + } + } +} diff --git a/TestBenchFramework/MetrologyDlg.resx b/TestBenchFramework/MetrologyDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/MetrologyDlg.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/TestBenchFramework/PathsDlg.Designer.cs b/TestBenchFramework/PathsDlg.Designer.cs new file mode 100644 index 000000000..612523edd --- /dev/null +++ b/TestBenchFramework/PathsDlg.Designer.cs @@ -0,0 +1,190 @@ +namespace TBF +{ + partial class PathsDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PathsDlg)); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.pathsTabControl = new System.Windows.Forms.TabControl(); + this.feedingTabPage = new System.Windows.Forms.TabPage(); + this.pathsFeedingCtrl = new TBF.UiControls.PathsFeedingCtrl(); + this.benchTabPage = new System.Windows.Forms.TabPage(); + this.pathsBenchCtrl = new TBF.UiControls.PathsBenchCtrl(); + this.outputTabPage = new System.Windows.Forms.TabPage(); + this.pathsOutputCtrl = new TBF.UiControls.PathsOutputCtrl(); + this.metersTabPage = new System.Windows.Forms.TabPage(); + this.pathsMetersCtrl = new TBF.UiControls.PathsMetersCtrl(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.pathsTabControl.SuspendLayout(); + this.feedingTabPage.SuspendLayout(); + this.benchTabPage.SuspendLayout(); + this.outputTabPage.SuspendLayout(); + this.metersTabPage.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + resources.ApplyResources(this.splitContainer, "splitContainer"); + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.Controls.Add(this.pathsTabControl); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.sharedButtons); + // + // pathsTabControl + // + this.pathsTabControl.Controls.Add(this.feedingTabPage); + this.pathsTabControl.Controls.Add(this.benchTabPage); + this.pathsTabControl.Controls.Add(this.outputTabPage); + this.pathsTabControl.Controls.Add(this.metersTabPage); + resources.ApplyResources(this.pathsTabControl, "pathsTabControl"); + this.pathsTabControl.Name = "pathsTabControl"; + this.pathsTabControl.SelectedIndex = 0; + this.pathsTabControl.SelectedIndexChanged += new System.EventHandler(this.pathsTabControl_SelectedIndexChanged); + // + // feedingTabPage + // + this.feedingTabPage.Controls.Add(this.pathsFeedingCtrl); + resources.ApplyResources(this.feedingTabPage, "feedingTabPage"); + this.feedingTabPage.Name = "feedingTabPage"; + this.feedingTabPage.UseVisualStyleBackColor = true; + // + // pathsFeedingCtrl + // + resources.ApplyResources(this.pathsFeedingCtrl, "pathsFeedingCtrl"); + this.pathsFeedingCtrl.DoubleClickActivation = false; + this.pathsFeedingCtrl.FullRowSelect = true; + this.pathsFeedingCtrl.GridLines = true; + this.pathsFeedingCtrl.Name = "pathsFeedingCtrl"; + this.pathsFeedingCtrl.UseCompatibleStateImageBehavior = false; + this.pathsFeedingCtrl.View = System.Windows.Forms.View.Details; + this.pathsFeedingCtrl.SelectedIndexChanged += new System.EventHandler(this.SelectedIndexChanged); + // + // benchTabPage + // + this.benchTabPage.Controls.Add(this.pathsBenchCtrl); + resources.ApplyResources(this.benchTabPage, "benchTabPage"); + this.benchTabPage.Name = "benchTabPage"; + this.benchTabPage.UseVisualStyleBackColor = true; + // + // pathsBenchCtrl + // + resources.ApplyResources(this.pathsBenchCtrl, "pathsBenchCtrl"); + this.pathsBenchCtrl.DoubleClickActivation = false; + this.pathsBenchCtrl.FullRowSelect = true; + this.pathsBenchCtrl.GridLines = true; + this.pathsBenchCtrl.Name = "pathsBenchCtrl"; + this.pathsBenchCtrl.UseCompatibleStateImageBehavior = false; + this.pathsBenchCtrl.View = System.Windows.Forms.View.Details; + this.pathsBenchCtrl.SelectedIndexChanged += new System.EventHandler(this.SelectedIndexChanged); + // + // outputTabPage + // + this.outputTabPage.Controls.Add(this.pathsOutputCtrl); + resources.ApplyResources(this.outputTabPage, "outputTabPage"); + this.outputTabPage.Name = "outputTabPage"; + this.outputTabPage.UseVisualStyleBackColor = true; + // + // pathsOutputCtrl + // + resources.ApplyResources(this.pathsOutputCtrl, "pathsOutputCtrl"); + this.pathsOutputCtrl.DoubleClickActivation = false; + this.pathsOutputCtrl.FullRowSelect = true; + this.pathsOutputCtrl.GridLines = true; + this.pathsOutputCtrl.Name = "pathsOutputCtrl"; + this.pathsOutputCtrl.UseCompatibleStateImageBehavior = false; + this.pathsOutputCtrl.View = System.Windows.Forms.View.Details; + this.pathsOutputCtrl.SelectedIndexChanged += new System.EventHandler(this.SelectedIndexChanged); + // + // metersTabPage + // + this.metersTabPage.Controls.Add(this.pathsMetersCtrl); + resources.ApplyResources(this.metersTabPage, "metersTabPage"); + this.metersTabPage.Name = "metersTabPage"; + this.metersTabPage.UseVisualStyleBackColor = true; + // + // pathsMetersCtrl + // + resources.ApplyResources(this.pathsMetersCtrl, "pathsMetersCtrl"); + this.pathsMetersCtrl.DoubleClickActivation = false; + this.pathsMetersCtrl.FullRowSelect = true; + this.pathsMetersCtrl.GridLines = true; + this.pathsMetersCtrl.Name = "pathsMetersCtrl"; + this.pathsMetersCtrl.UseCompatibleStateImageBehavior = false; + this.pathsMetersCtrl.View = System.Windows.Forms.View.Details; + this.pathsMetersCtrl.SelectedIndexChanged += new System.EventHandler(this.SelectedIndexChanged); + // + // sharedButtons + // + resources.ApplyResources(this.sharedButtons, "sharedButtons"); + this.sharedButtons.Name = "sharedButtons"; + // + // PathsDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer); + this.Name = "PathsDlg"; + this.Load += new System.EventHandler(this.PathsDlg_Load); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.pathsTabControl.ResumeLayout(false); + this.feedingTabPage.ResumeLayout(false); + this.benchTabPage.ResumeLayout(false); + this.outputTabPage.ResumeLayout(false); + this.metersTabPage.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.TabControl pathsTabControl; + private System.Windows.Forms.TabPage feedingTabPage; + private System.Windows.Forms.TabPage benchTabPage; + private System.Windows.Forms.TabPage outputTabPage; + private System.Windows.Forms.TabPage metersTabPage; + private UiControls.SharedButtons sharedButtons; + private UiControls.PathsFeedingCtrl pathsFeedingCtrl; + private UiControls.PathsBenchCtrl pathsBenchCtrl; + private UiControls.PathsOutputCtrl pathsOutputCtrl; + private UiControls.PathsMetersCtrl pathsMetersCtrl; + } +} \ No newline at end of file diff --git a/TestBenchFramework/PathsDlg.cs b/TestBenchFramework/PathsDlg.cs new file mode 100644 index 000000000..233d97212 --- /dev/null +++ b/TestBenchFramework/PathsDlg.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using NHibernate; +using log4net; +using TBF.UiControls; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF +{ + public partial class PathsDlg : Form, IParentOfListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(PathsDlg)); + + enum PathsDlgTabs + { + Feeding, + Bench, + Output, + Meters, + } + + /// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi + public readonly int Dpi; + public const int Dpi100pct = 96; + + public IList TbfComponents; + public IList Valves; + public ISession Session; /// One common DB session passed also to the controls inside tab pages + + public PathsDlg() + { + /// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi. + Dpi = (int)this.CreateGraphics().DpiX; + + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove | + SharedButtons.Buttons.Up | SharedButtons.Buttons.Down; + sharedButtons.Unlocked += Unlocked; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + sharedButtons.UpClicked += upButton_Click; + sharedButtons.DownClicked += downButton_Click; + + /// Load the list of components from the database + TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(FluentCommon.CreateSession(Database.Bench)); + + /// Find all master valves + Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents); + + /// Create the database session for paths + Session = FluentCommon.CreateSession(Database.Procedures); + + pathsTabControl.TabPages[(int)PathsDlgTabs.Feeding].Tag = pathsFeedingCtrl; + pathsTabControl.TabPages[(int)PathsDlgTabs.Bench].Tag = pathsBenchCtrl; + pathsTabControl.TabPages[(int)PathsDlgTabs.Output].Tag = pathsOutputCtrl; + pathsTabControl.TabPages[(int)PathsDlgTabs.Meters].Tag = pathsMetersCtrl; + + // Requires 'Session' to be created + pathsFeedingCtrl.Initialize(this, pathsTabControl.TabPages[(int)PathsDlgTabs.Feeding]); + pathsBenchCtrl.Initialize(this, pathsTabControl.TabPages[(int)PathsDlgTabs.Bench]); + pathsOutputCtrl.Initialize(this, pathsTabControl.TabPages[(int)PathsDlgTabs.Output]); + pathsMetersCtrl.Initialize(this, pathsTabControl.TabPages[(int)PathsDlgTabs.Meters]); + } + + private void PathsDlg_Load(object sender, EventArgs e) + { + } + + private void Unlocked(object sender, EventArgs e) + { + foreach (TabPage tab in pathsTabControl.TabPages) + { + (tab.Tag as ITabWithListViewEx).Unlock(); + } + } + + private void okButton_Click(object sender, EventArgs e) + { + foreach (TabPage tab in pathsTabControl.TabPages) + { + (tab.Tag as ITabWithListViewEx).OkBtnClicked(); + } + DialogResult = DialogResult.OK; + Close(); + } + + private void cancelButton_Click(object sender, EventArgs e) + { + foreach (TabPage tab in pathsTabControl.TabPages) + { + (tab.Tag as ITabWithListViewEx).CancelBtnClicked(); + } + DialogResult = DialogResult.Cancel; + Close(); + } + + private void addButton_Click(object sender, EventArgs e) + { + (pathsTabControl.SelectedTab.Tag as ITabWithListViewEx).AddOne(); + } + + private void removeButton_Click(object sender, EventArgs e) + { + (pathsTabControl.SelectedTab.Tag as ITabWithListViewEx).RemoveSelected(); + } + + private void upButton_Click(object sender, EventArgs e) + { + (pathsTabControl.SelectedTab.Tag as ITabWithListViewEx).MoveUpSelected(); + } + + private void downButton_Click(object sender, EventArgs e) + { + (pathsTabControl.SelectedTab.Tag as ITabWithListViewEx).MoveDownSelected(); + } + + /// + /// Common part for three xxxListViewEx_SelectedIndexChanged event handlers + /// + /// + void SelectedIndexChanged(object sender, EventArgs e) + { + ListViewEx listViewEx = sender as ListViewEx; + if (listViewEx.SelectedItems.Count != 1) + { + /// No item selected + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (listViewEx.Items.Count == 1) + { + /// One (the first and the last) item selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + /// The first of many items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + /// The last of many items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up); + sharedButtons.DisableButtons(SharedButtons.Buttons.Down); + } + else + { + /// One of middle items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + + /// + /// Tab page changed - item is unselected + /// + private void pathsTabControl_SelectedIndexChanged(object sender, EventArgs e) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + } +} diff --git a/TestBenchFramework/PathsDlg.de.resx b/TestBenchFramework/PathsDlg.de.resx new file mode 100644 index 000000000..71b5d6fe8 --- /dev/null +++ b/TestBenchFramework/PathsDlg.de.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Speisung + + + Bank + + + Ausgabe + + + Messsensoren + + + Pfade + + \ No newline at end of file diff --git a/TestBenchFramework/PathsDlg.resx b/TestBenchFramework/PathsDlg.resx new file mode 100644 index 000000000..71161813e --- /dev/null +++ b/TestBenchFramework/PathsDlg.resx @@ -0,0 +1,450 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Fill + + + + True + + + + 0, 0 + + + Fill + + + 3, 3 + + + 825, 271 + + + 0 + + + pathsFeedingCtrl + + + TBF.UiControls.PathsFeedingCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + feedingTabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 831, 277 + + + 0 + + + Feeding + + + feedingTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pathsTabControl + + + 0 + + + Fill + + + 3, 3 + + + 825, 271 + + + 0 + + + pathsBenchCtrl + + + TBF.UiControls.PathsBenchCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + benchTabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 831, 277 + + + 1 + + + Bench + + + benchTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pathsTabControl + + + 1 + + + Fill + + + 3, 3 + + + 825, 271 + + + 0 + + + pathsOutputCtrl + + + TBF.UiControls.PathsOutputCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + outputTabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 831, 277 + + + 2 + + + Output + + + outputTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pathsTabControl + + + 2 + + + Fill + + + 0, 0 + + + 831, 277 + + + 0 + + + pathsMetersCtrl + + + TBF.UiControls.PathsMetersCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + metersTabPage + + + 0 + + + 4, 34 + + + 831, 277 + + + 3 + + + Sensors + + + metersTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pathsTabControl + + + 3 + + + Fill + + + 42, 30 + + + 0, 0 + + + 839, 315 + + + 0 + + + pathsTabControl + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 0 + + + splitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 0 + + + -2, 0 + + + 100, 521 + + + 0 + + + sharedButtons + + + TBF.UiControls.SharedButtons, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 0 + + + splitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 1 + + + 941, 315 + + + 839 + + + 0 + + + splitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + de + + + True + + + 6, 13 + + + 941, 315 + + + CenterParent + + + Bench - Paths + + + PathsDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/PreferencesDlg.Designer.cs b/TestBenchFramework/PreferencesDlg.Designer.cs new file mode 100644 index 000000000..23065b940 --- /dev/null +++ b/TestBenchFramework/PreferencesDlg.Designer.cs @@ -0,0 +1,90 @@ +namespace TBF +{ + partial class PreferencesDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesDlg)); + this.languageLabel = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.languageListBox = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // languageLabel + // + resources.ApplyResources(this.languageLabel, "languageLabel"); + this.languageLabel.Name = "languageLabel"; + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // languageListBox + // + this.languageListBox.FormattingEnabled = true; + resources.ApplyResources(this.languageListBox, "languageListBox"); + this.languageListBox.Name = "languageListBox"; + this.languageListBox.SelectedIndexChanged += new System.EventHandler(this.languageListBox_SelectedIndexChanged); + // + // PreferencesDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.languageListBox); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.languageLabel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "PreferencesDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label languageLabel; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.ListBox languageListBox; + } +} \ No newline at end of file diff --git a/TestBenchFramework/PreferencesDlg.cs b/TestBenchFramework/PreferencesDlg.cs new file mode 100644 index 000000000..8628f20a2 --- /dev/null +++ b/TestBenchFramework/PreferencesDlg.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.Globalization; +using TBF.Resources; + +namespace TBF +{ + /// + /// Dialog to edit local settings that specify UI preferences, language, etc. (S1.1) + /// + public partial class PreferencesDlg : Form + { + // Local copy of 'local settings' initialized to Program.localSettings. + // Dialog modifies this copy and updates Program.localSettings just + // when 'OK' is pressed. + LocalSettings localSettings; + + public PreferencesDlg() + { + localSettings = new LocalSettings(); + localSettings.Assign(Program.LocalSettings); + + InitializeComponent(); + + // Initialize the list box with langauges + for (int i = 0; i < (int)LocalSettings.Languages.Count; i++) + { + languageListBox.Items.Add(((LocalSettings.Languages)i).ToString()); + } + languageListBox.Text = localSettings.Language; + } + + private void languageListBox_SelectedIndexChanged(object sender, EventArgs e) + { + localSettings.Language = ((LocalSettings.Languages)languageListBox.SelectedIndex).ToString(); + } + + /// + /// Update setting, return DialogResult.OK + /// + /// Not used + /// Not used + private void okButton_Click(object sender, EventArgs e) + { + Program.LocalSettings.Assign(localSettings); // Update 'global' local settings + DialogResult = DialogResult.OK; + Close(); + + System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(localSettings.Language); + DialogResult response = MessageBox.Show(Strings.Restart_To_Apply_Changes); + return; + } + + /// + /// Throw away changes, return DialogResult.Cancel + /// + /// Not used + /// Not used + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/PreferencesDlg.de.resx b/TestBenchFramework/PreferencesDlg.de.resx new file mode 100644 index 000000000..b1a0304b9 --- /dev/null +++ b/TestBenchFramework/PreferencesDlg.de.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 12, 13 + + + 47, 13 + + + Sprache + + + 271, 13 + + + &OK + + + 271, 52 + + + &Abbrechen + + + 89, 13 + + + Sprache wählen + + \ No newline at end of file diff --git a/TestBenchFramework/PreferencesDlg.resx b/TestBenchFramework/PreferencesDlg.resx new file mode 100644 index 000000000..adb65a187 --- /dev/null +++ b/TestBenchFramework/PreferencesDlg.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + True + + + + 25, 13 + + + 55, 13 + + + 0 + + + Language + + + languageLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 271, 11 + + + 105, 28 + + + 10 + + + OK + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 271, 45 + + + 105, 28 + + + 9 + + + Cancel + + + cancelButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 102, 12 + + + 143, 69 + + + 11 + + + languageListBox + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + de + + + True + + + 6, 13 + + + 388, 92 + + + + CenterParent + + + Language + + + PreferencesDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/ProcedureDlg.Designer.cs b/TestBenchFramework/ProcedureDlg.Designer.cs new file mode 100644 index 000000000..505f2ccc6 --- /dev/null +++ b/TestBenchFramework/ProcedureDlg.Designer.cs @@ -0,0 +1,464 @@ +namespace TBF +{ + partial class ProcedureDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProcedureDlg)); + this.mainSplitContainer = new System.Windows.Forms.SplitContainer(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.generalTabPage = new System.Windows.Forms.TabPage(); + this.transitionEndComboBox = new System.Windows.Forms.ComboBox(); + this.transitionEndLabel = new System.Windows.Forms.Label(); + this.transitionStartComboBox = new System.Windows.Forms.ComboBox(); + this.transitionStartLabel = new System.Windows.Forms.Label(); + this.resultsWriterComboBox = new System.Windows.Forms.ComboBox(); + this.resultsPrinterComboBox = new System.Windows.Forms.ComboBox(); + this.dataEntryComboBox = new System.Windows.Forms.ComboBox(); + this.resultsWriterLabel = new System.Windows.Forms.Label(); + this.resultsPrinterLabel = new System.Windows.Forms.Label(); + this.dataEntryLabel = new System.Windows.Forms.Label(); + this.notesTextBox = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.watermetersTextBox = new System.Windows.Forms.TextBox(); + this.watermetersLabel = new System.Windows.Forms.Label(); + this.lastChangedOnTextBox = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.lastChangedByTextBox = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.createdOnTextBox = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); + this.createdByTextBox = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.descriptionTextBox = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.procNameTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.historyTabPage = new System.Windows.Forms.TabPage(); + this.historyListViewEx = new TBF.UiControls.ListViewEx(); + this.changedByClmnHdr = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.dateClmnHdr = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.descriptionClmnHdr = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.metrology1TabPage = new System.Windows.Forms.TabPage(); + this.metrology1ListViewEx = new TBF.UiControls.ListViewEx(); + this.metrology2TabPage = new System.Windows.Forms.TabPage(); + this.metrology2ListViewEx = new TBF.UiControls.ListViewEx(); + this.processTabPage = new System.Windows.Forms.TabPage(); + this.processListViewEx = new TBF.UiControls.ListViewEx(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit(); + this.mainSplitContainer.Panel1.SuspendLayout(); + this.mainSplitContainer.Panel2.SuspendLayout(); + this.mainSplitContainer.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.generalTabPage.SuspendLayout(); + this.historyTabPage.SuspendLayout(); + this.metrology1TabPage.SuspendLayout(); + this.metrology2TabPage.SuspendLayout(); + this.processTabPage.SuspendLayout(); + this.SuspendLayout(); + // + // mainSplitContainer + // + resources.ApplyResources(this.mainSplitContainer, "mainSplitContainer"); + this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.mainSplitContainer.Name = "mainSplitContainer"; + // + // mainSplitContainer.Panel1 + // + this.mainSplitContainer.Panel1.Controls.Add(this.tabControl); + // + // mainSplitContainer.Panel2 + // + this.mainSplitContainer.Panel2.Controls.Add(this.sharedButtons); + // + // tabControl + // + this.tabControl.Controls.Add(this.generalTabPage); + this.tabControl.Controls.Add(this.historyTabPage); + this.tabControl.Controls.Add(this.metrology1TabPage); + this.tabControl.Controls.Add(this.metrology2TabPage); + this.tabControl.Controls.Add(this.processTabPage); + resources.ApplyResources(this.tabControl, "tabControl"); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); + // + // generalTabPage + // + this.generalTabPage.Controls.Add(this.transitionEndComboBox); + this.generalTabPage.Controls.Add(this.transitionEndLabel); + this.generalTabPage.Controls.Add(this.transitionStartComboBox); + this.generalTabPage.Controls.Add(this.transitionStartLabel); + this.generalTabPage.Controls.Add(this.resultsWriterComboBox); + this.generalTabPage.Controls.Add(this.resultsPrinterComboBox); + this.generalTabPage.Controls.Add(this.dataEntryComboBox); + this.generalTabPage.Controls.Add(this.resultsWriterLabel); + this.generalTabPage.Controls.Add(this.resultsPrinterLabel); + this.generalTabPage.Controls.Add(this.dataEntryLabel); + this.generalTabPage.Controls.Add(this.notesTextBox); + this.generalTabPage.Controls.Add(this.label18); + this.generalTabPage.Controls.Add(this.watermetersTextBox); + this.generalTabPage.Controls.Add(this.watermetersLabel); + this.generalTabPage.Controls.Add(this.lastChangedOnTextBox); + this.generalTabPage.Controls.Add(this.label15); + this.generalTabPage.Controls.Add(this.lastChangedByTextBox); + this.generalTabPage.Controls.Add(this.label16); + this.generalTabPage.Controls.Add(this.createdOnTextBox); + this.generalTabPage.Controls.Add(this.label14); + this.generalTabPage.Controls.Add(this.createdByTextBox); + this.generalTabPage.Controls.Add(this.label13); + this.generalTabPage.Controls.Add(this.descriptionTextBox); + this.generalTabPage.Controls.Add(this.label12); + this.generalTabPage.Controls.Add(this.procNameTextBox); + this.generalTabPage.Controls.Add(this.label1); + this.generalTabPage.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.generalTabPage, "generalTabPage"); + this.generalTabPage.Name = "generalTabPage"; + this.generalTabPage.ToolTipText = global::TBF.Resources.Strings.String1; + this.generalTabPage.UseVisualStyleBackColor = true; + // + // transitionEndComboBox + // + this.transitionEndComboBox.FormattingEnabled = true; + resources.ApplyResources(this.transitionEndComboBox, "transitionEndComboBox"); + this.transitionEndComboBox.Name = "transitionEndComboBox"; + // + // transitionEndLabel + // + resources.ApplyResources(this.transitionEndLabel, "transitionEndLabel"); + this.transitionEndLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.transitionEndLabel.Name = "transitionEndLabel"; + // + // transitionStartComboBox + // + this.transitionStartComboBox.FormattingEnabled = true; + resources.ApplyResources(this.transitionStartComboBox, "transitionStartComboBox"); + this.transitionStartComboBox.Name = "transitionStartComboBox"; + // + // transitionStartLabel + // + resources.ApplyResources(this.transitionStartLabel, "transitionStartLabel"); + this.transitionStartLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.transitionStartLabel.Name = "transitionStartLabel"; + // + // resultsWriterComboBox + // + this.resultsWriterComboBox.FormattingEnabled = true; + resources.ApplyResources(this.resultsWriterComboBox, "resultsWriterComboBox"); + this.resultsWriterComboBox.Name = "resultsWriterComboBox"; + // + // resultsPrinterComboBox + // + this.resultsPrinterComboBox.FormattingEnabled = true; + resources.ApplyResources(this.resultsPrinterComboBox, "resultsPrinterComboBox"); + this.resultsPrinterComboBox.Name = "resultsPrinterComboBox"; + // + // dataEntryComboBox + // + this.dataEntryComboBox.FormattingEnabled = true; + resources.ApplyResources(this.dataEntryComboBox, "dataEntryComboBox"); + this.dataEntryComboBox.Name = "dataEntryComboBox"; + // + // resultsWriterLabel + // + resources.ApplyResources(this.resultsWriterLabel, "resultsWriterLabel"); + this.resultsWriterLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.resultsWriterLabel.Name = "resultsWriterLabel"; + // + // resultsPrinterLabel + // + resources.ApplyResources(this.resultsPrinterLabel, "resultsPrinterLabel"); + this.resultsPrinterLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.resultsPrinterLabel.Name = "resultsPrinterLabel"; + // + // dataEntryLabel + // + resources.ApplyResources(this.dataEntryLabel, "dataEntryLabel"); + this.dataEntryLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.dataEntryLabel.Name = "dataEntryLabel"; + // + // notesTextBox + // + resources.ApplyResources(this.notesTextBox, "notesTextBox"); + this.notesTextBox.Name = "notesTextBox"; + // + // label18 + // + resources.ApplyResources(this.label18, "label18"); + this.label18.ImageKey = global::TBF.Resources.Strings.String1; + this.label18.Name = "label18"; + // + // watermetersTextBox + // + resources.ApplyResources(this.watermetersTextBox, "watermetersTextBox"); + this.watermetersTextBox.Name = "watermetersTextBox"; + // + // watermetersLabel + // + resources.ApplyResources(this.watermetersLabel, "watermetersLabel"); + this.watermetersLabel.ImageKey = global::TBF.Resources.Strings.String1; + this.watermetersLabel.Name = "watermetersLabel"; + // + // lastChangedOnTextBox + // + resources.ApplyResources(this.lastChangedOnTextBox, "lastChangedOnTextBox"); + this.lastChangedOnTextBox.Name = "lastChangedOnTextBox"; + // + // label15 + // + resources.ApplyResources(this.label15, "label15"); + this.label15.ImageKey = global::TBF.Resources.Strings.String1; + this.label15.Name = "label15"; + // + // lastChangedByTextBox + // + resources.ApplyResources(this.lastChangedByTextBox, "lastChangedByTextBox"); + this.lastChangedByTextBox.Name = "lastChangedByTextBox"; + // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.ImageKey = global::TBF.Resources.Strings.String1; + this.label16.Name = "label16"; + // + // createdOnTextBox + // + resources.ApplyResources(this.createdOnTextBox, "createdOnTextBox"); + this.createdOnTextBox.Name = "createdOnTextBox"; + // + // label14 + // + resources.ApplyResources(this.label14, "label14"); + this.label14.ImageKey = global::TBF.Resources.Strings.String1; + this.label14.Name = "label14"; + // + // createdByTextBox + // + resources.ApplyResources(this.createdByTextBox, "createdByTextBox"); + this.createdByTextBox.Name = "createdByTextBox"; + // + // label13 + // + resources.ApplyResources(this.label13, "label13"); + this.label13.ImageKey = global::TBF.Resources.Strings.String1; + this.label13.Name = "label13"; + // + // descriptionTextBox + // + resources.ApplyResources(this.descriptionTextBox, "descriptionTextBox"); + this.descriptionTextBox.Name = "descriptionTextBox"; + // + // label12 + // + resources.ApplyResources(this.label12, "label12"); + this.label12.ImageKey = global::TBF.Resources.Strings.String1; + this.label12.Name = "label12"; + // + // procNameTextBox + // + resources.ApplyResources(this.procNameTextBox, "procNameTextBox"); + this.procNameTextBox.Name = "procNameTextBox"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ImageKey = global::TBF.Resources.Strings.String1; + this.label1.Name = "label1"; + // + // historyTabPage + // + this.historyTabPage.Controls.Add(this.historyListViewEx); + this.historyTabPage.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.historyTabPage, "historyTabPage"); + this.historyTabPage.Name = "historyTabPage"; + this.historyTabPage.ToolTipText = global::TBF.Resources.Strings.String1; + this.historyTabPage.UseVisualStyleBackColor = true; + // + // historyListViewEx + // + this.historyListViewEx.AllowColumnReorder = true; + this.historyListViewEx.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.changedByClmnHdr, + this.dateClmnHdr, + this.descriptionClmnHdr}); + resources.ApplyResources(this.historyListViewEx, "historyListViewEx"); + this.historyListViewEx.DoubleClickActivation = false; + this.historyListViewEx.FullRowSelect = true; + this.historyListViewEx.GridLines = true; + this.historyListViewEx.Name = "historyListViewEx"; + this.historyListViewEx.UseCompatibleStateImageBehavior = false; + this.historyListViewEx.View = System.Windows.Forms.View.Details; + // + // changedByClmnHdr + // + resources.ApplyResources(this.changedByClmnHdr, "changedByClmnHdr"); + // + // dateClmnHdr + // + resources.ApplyResources(this.dateClmnHdr, "dateClmnHdr"); + // + // descriptionClmnHdr + // + resources.ApplyResources(this.descriptionClmnHdr, "descriptionClmnHdr"); + // + // metrology1TabPage + // + this.metrology1TabPage.Controls.Add(this.metrology1ListViewEx); + this.metrology1TabPage.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.metrology1TabPage, "metrology1TabPage"); + this.metrology1TabPage.Name = "metrology1TabPage"; + this.metrology1TabPage.ToolTipText = global::TBF.Resources.Strings.String1; + this.metrology1TabPage.UseVisualStyleBackColor = true; + // + // metrology1ListViewEx + // + this.metrology1ListViewEx.AllowColumnReorder = true; + resources.ApplyResources(this.metrology1ListViewEx, "metrology1ListViewEx"); + this.metrology1ListViewEx.DoubleClickActivation = false; + this.metrology1ListViewEx.FullRowSelect = true; + this.metrology1ListViewEx.GridLines = true; + this.metrology1ListViewEx.Name = "metrology1ListViewEx"; + this.metrology1ListViewEx.UseCompatibleStateImageBehavior = false; + this.metrology1ListViewEx.View = System.Windows.Forms.View.Details; + this.metrology1ListViewEx.SelectedIndexChanged += new System.EventHandler(this.metrology1ListViewEx_SelectedIndexChanged); + // + // metrology2TabPage + // + this.metrology2TabPage.Controls.Add(this.metrology2ListViewEx); + this.metrology2TabPage.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.metrology2TabPage, "metrology2TabPage"); + this.metrology2TabPage.Name = "metrology2TabPage"; + this.metrology2TabPage.ToolTipText = global::TBF.Resources.Strings.String1; + this.metrology2TabPage.UseVisualStyleBackColor = true; + // + // metrology2ListViewEx + // + this.metrology2ListViewEx.AllowColumnReorder = true; + resources.ApplyResources(this.metrology2ListViewEx, "metrology2ListViewEx"); + this.metrology2ListViewEx.DoubleClickActivation = false; + this.metrology2ListViewEx.FullRowSelect = true; + this.metrology2ListViewEx.GridLines = true; + this.metrology2ListViewEx.Name = "metrology2ListViewEx"; + this.metrology2ListViewEx.UseCompatibleStateImageBehavior = false; + this.metrology2ListViewEx.View = System.Windows.Forms.View.Details; + this.metrology2ListViewEx.SelectedIndexChanged += new System.EventHandler(this.metrology2ListViewEx_SelectedIndexChanged); + // + // processTabPage + // + this.processTabPage.Controls.Add(this.processListViewEx); + this.processTabPage.ImageKey = global::TBF.Resources.Strings.String1; + resources.ApplyResources(this.processTabPage, "processTabPage"); + this.processTabPage.Name = "processTabPage"; + this.processTabPage.ToolTipText = global::TBF.Resources.Strings.String1; + this.processTabPage.UseVisualStyleBackColor = true; + // + // processListViewEx + // + this.processListViewEx.AllowColumnReorder = true; + resources.ApplyResources(this.processListViewEx, "processListViewEx"); + this.processListViewEx.DoubleClickActivation = false; + this.processListViewEx.FullRowSelect = true; + this.processListViewEx.GridLines = true; + this.processListViewEx.Name = "processListViewEx"; + this.processListViewEx.UseCompatibleStateImageBehavior = false; + this.processListViewEx.View = System.Windows.Forms.View.Details; + this.processListViewEx.SelectedIndexChanged += new System.EventHandler(this.processListViewEx_SelectedIndexChanged); + // + // sharedButtons + // + resources.ApplyResources(this.sharedButtons, "sharedButtons"); + this.sharedButtons.Name = "sharedButtons"; + // + // ProcedureDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.mainSplitContainer); + this.Name = "ProcedureDlg"; + this.Load += new System.EventHandler(this.ProcedureDlg_Load); + this.mainSplitContainer.Panel1.ResumeLayout(false); + this.mainSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).EndInit(); + this.mainSplitContainer.ResumeLayout(false); + this.tabControl.ResumeLayout(false); + this.generalTabPage.ResumeLayout(false); + this.generalTabPage.PerformLayout(); + this.historyTabPage.ResumeLayout(false); + this.metrology1TabPage.ResumeLayout(false); + this.metrology2TabPage.ResumeLayout(false); + this.processTabPage.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer mainSplitContainer; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage historyTabPage; + private UiControls.ListViewEx historyListViewEx; + private System.Windows.Forms.ColumnHeader changedByClmnHdr; + private System.Windows.Forms.ColumnHeader dateClmnHdr; + private System.Windows.Forms.ColumnHeader descriptionClmnHdr; + private System.Windows.Forms.TabPage metrology1TabPage; + private UiControls.ListViewEx metrology1ListViewEx; + private System.Windows.Forms.TabPage metrology2TabPage; + private UiControls.ListViewEx metrology2ListViewEx; + private System.Windows.Forms.TabPage processTabPage; + private UiControls.ListViewEx processListViewEx; + private UiControls.SharedButtons sharedButtons; + private System.Windows.Forms.TabPage generalTabPage; + private System.Windows.Forms.ComboBox resultsWriterComboBox; + private System.Windows.Forms.ComboBox resultsPrinterComboBox; + private System.Windows.Forms.ComboBox dataEntryComboBox; + private System.Windows.Forms.Label resultsWriterLabel; + private System.Windows.Forms.Label resultsPrinterLabel; + private System.Windows.Forms.Label dataEntryLabel; + private System.Windows.Forms.TextBox notesTextBox; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.TextBox watermetersTextBox; + private System.Windows.Forms.Label watermetersLabel; + private System.Windows.Forms.TextBox lastChangedOnTextBox; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.TextBox lastChangedByTextBox; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.TextBox createdOnTextBox; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.TextBox createdByTextBox; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox descriptionTextBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox procNameTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox transitionEndComboBox; + private System.Windows.Forms.Label transitionEndLabel; + private System.Windows.Forms.ComboBox transitionStartComboBox; + private System.Windows.Forms.Label transitionStartLabel; + + } +} \ No newline at end of file diff --git a/TestBenchFramework/ProcedureDlg.cs b/TestBenchFramework/ProcedureDlg.cs new file mode 100644 index 000000000..b3a8df3f3 --- /dev/null +++ b/TestBenchFramework/ProcedureDlg.cs @@ -0,0 +1,1084 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using log4net; + +using TBF.BenchControl.Generic; +using TBF.BenchControl.GenericDevices; +using TBF.Entities; +using TBF.Resources; +using TBF.UiControls; + +namespace TBF +{ + public partial class ProcedureDlg : Form, IParentOfListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(ProcedureDlg)); + + /// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi + public readonly int Dpi; + public const int Dpi100pct = 96; + + /// + /// Procedure to be updated by this dialog. + /// Set by the constructor or updated by the parent after creation and before loading. + /// + public Entities.Procedure LoadedProcedure; + + /// Auxiliary public lists used also by user controls in tab pages + public IList TbfComponents; + public IList Valves; + public IList RegulValves; + public IList TestMethods; + public IList UsedTestMethods; + ComboBox methodCBox; + + /// Auxiliary private lists + IList feedingPaths; + IList benchPaths; + IList outputPaths; + IList metersPaths; + IList transitionSequences; + + IList testParamsCtrls; + IList procedureParamsCtrls; + + bool unlocked; + + public ProcedureDlg() + { + /// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi. + Dpi = (int)this.CreateGraphics().DpiX; + + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove | + SharedButtons.Buttons.Up | SharedButtons.Buttons.Down; + sharedButtons.Unlocked += Unlocked; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + sharedButtons.UpClicked += upButton_Click; + sharedButtons.DownClicked += downButton_Click; + + /// ListViewEx-es configuration + metrology1ListViewEx.SubItemClicked += new SubItemEventHandler(metrology1ListViewEx_SubItemClicked); + metrology1ListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(metrology1ListViewEx_SubItemEndEditing); + + metrology2ListViewEx.SubItemClicked += new SubItemEventHandler(metrology2ListViewEx_SubItemClicked); + metrology2ListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(metrology2ListViewEx_SubItemEndEditing); + + processListViewEx.SubItemClicked += new SubItemEventHandler(processListViewEx_SubItemClicked); + processListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(processListViewEx_SubItemEndEditing); + } + + public ProcedureDlg(Entities.Procedure procedure) + : this() + { + if (procedure == null) throw new ArgumentNullException("procedure"); + + LoadedProcedure = procedure; + + /// Prepare a list of components and a list of all valves in the test bench + using (NHibernate.ISession session = FluentCommon.CreateSession(Database.Bench)) + { + TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(session); + Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents); + RegulValves = new List(); + TestMethods = new List(); + foreach (var cmpnt in TbfComponents) + { + if (cmpnt is IRegulValve) RegulValves.Add(cmpnt as IRegulValve); + if (cmpnt is ITestMethod) TestMethods.Add(cmpnt as ITestMethod); + if (cmpnt is IDataEntry) dataEntryComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IResultsPrinter) resultsPrinterComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IResultsWriter) resultsWriterComboBox.Items.Add(cmpnt.Cfg.Name); + } + } + + /// Loads paths, this must be done before PrepareMetrology12AndProcessTabs() call + using (NHibernate.ISession session = FluentCommon.CreateSession(Database.Procedures)) + { + feedingPaths = session.CreateQuery("FROM FeedingPath").List(); + benchPaths = session.CreateQuery("FROM BenchPath").List(); + outputPaths = session.CreateQuery("FROM OutputPath").List(); + metersPaths = session.CreateQuery("FROM MetersPath").List(); + transitionSequences = session.CreateQuery("FROM TransitionSequence").List(); + } + + transitionStartComboBox.Items.Add("---"); + transitionEndComboBox.Items.Add("---"); + foreach (var trans in transitionSequences) + { + transitionStartComboBox.Items.Add(trans.Name); + transitionEndComboBox.Items.Add(trans.Name); + } + + /// Find all test methods used in this procedure + UsedTestMethods = new List(); + foreach (var test in LoadedProcedure.Tests) + { + ITestMethod method = BenchControl.TbfComponents.FindComponent(test.Method, TbfComponents) as ITestMethod; + if (method != null && !UsedTestMethods.Contains(method)) UsedTestMethods.Add(method); + } + + /// Create a tab with a TestParamsCtrl control for each used test method + testParamsCtrls = new List(); + foreach (var method in UsedTestMethods) + { + if (method.Cfg.Factory.HasTestParams) + { + TabPage nwTab = new TabPage(method.Cfg.Name); + TestParamsCtrl testParamsCtrl = new TestParamsCtrl(this, method, true); + testParamsCtrls.Add(testParamsCtrl); + nwTab.Controls.Add(testParamsCtrl); + this.tabControl.TabPages.Add(nwTab); + } + } + + /// Prepare a list of all meters paths used in this procedure (in any test) + IList usedMPaths = new List(); + foreach (var test in LoadedProcedure.Tests) + { + if (test.MetersPath != null && !usedMPaths.Contains(test.MetersPath)) usedMPaths.Add(test.MetersPath); + } + + /// Create an empty list of ProcedureParamsCtrl controls. + procedureParamsCtrls = new List(); + + /// Create a control for the water meters and add it to the list. + IList waterMeters = new List(); + foreach (var cmpnt in TbfComponents) + { + if (cmpnt is IWaterMeter) waterMeters.Add(cmpnt); + } + TabPage newTab = new TabPage(Strings.Water_meters); + ProcedureParamsCtrl procedureParamsCtrl = new ProcedureParamsCtrl(this, waterMeters, false); + procedureParamsCtrls.Add(procedureParamsCtrl); + newTab.Controls.Add(procedureParamsCtrl); + this.tabControl.TabPages.Add(newTab); + + /// Create controls for each sensors path used in this procedure. + /// Initialize it with its components (sensors or cameras) and add it to the list. + foreach (var usedPathName in usedMPaths) + { + Entities.MetersPath usedPath = null; + try { usedPath = metersPaths.First(x => (x.Name == usedPathName)); } + catch { } + if (usedPath != null) + { + IList cmpntsInMPath = new List(); + for (int i = 0; i < Program.WMsCount; i++) + { + IComponent sensor = TbfComponents.FirstOrDefault(x => (x.Cfg.Name.Equals(usedPath.GetSensor(i)))); + cmpntsInMPath.Add(sensor); + } + + TabPage nwTab = new TabPage(usedPathName); + ProcedureParamsCtrl procParamsCtrl = new ProcedureParamsCtrl(this, cmpntsInMPath, true); + procedureParamsCtrls.Add(procParamsCtrl); + nwTab.Controls.Add(procParamsCtrl); + this.tabControl.TabPages.Add(nwTab); + } + } + + /// Create a control for the printed protocol. + IComponent printer = BenchControl.TbfComponents.FindComponent(LoadedProcedure.ResultsPrinter, TbfComponents); + if (printer != null) + { + IList printers = new List(); + printers.Add(printer); + newTab = new TabPage(Strings.Printer); + procedureParamsCtrl = new ProcedureParamsCtrl(this, printers, false); + procedureParamsCtrls.Add(procedureParamsCtrl); + newTab.Controls.Add(procedureParamsCtrl); + this.tabControl.TabPages.Add(newTab); + } + + /// Create a control for another component with Test parameters which was not handled yet + foreach (var cmpnt in TbfComponents) + { + if (cmpnt.Cfg.Factory.HasTestParams && !(cmpnt is ITestMethod)) + { + newTab = new TabPage(cmpnt.Cfg.Name); + TestParamsCtrl testParamsCtrl = new TestParamsCtrl(this, cmpnt, true); + testParamsCtrls.Add(testParamsCtrl); + newTab.Controls.Add(testParamsCtrl); + this.tabControl.TabPages.Add(newTab); + } + } + } + + private void ProcedureDlg_Load(object sender, EventArgs e) + { + if (LoadedProcedure == null) return; /// return in case the dialog is open in the designer + + /// Create LisViewEx columns and edit controls for 'Metrology1', 'Metrology2' and 'Process' tabs + PrepareMetrology12AndProcessTabs(); + + /// Disable controls in General tab + procNameTextBox.Enabled = false; + descriptionTextBox.Enabled = false; + watermetersTextBox.Enabled = false; + dataEntryComboBox.Enabled = false; + resultsPrinterComboBox.Enabled = false; + resultsWriterComboBox.Enabled = false; + transitionStartComboBox.Enabled = false; + transitionEndComboBox.Enabled = false; + notesTextBox.Enabled = false; + + /// Make some controls readonly + createdByTextBox.ReadOnly = true; + createdOnTextBox.ReadOnly = true; + lastChangedByTextBox.ReadOnly = true; + lastChangedOnTextBox.ReadOnly = true; + + /// Now refresh the content of the dialog + foreach (var ctrl in testParamsCtrls) + { + ctrl.Initialize(); + } + foreach (var ctrl in procedureParamsCtrls) + { + ctrl.Initialize(); + } + RefreshAllTabs(); + } + + void RefreshAllTabs() + { + RefreshGeneralTab(); + RefreshMetrology12AndProcessTabs(); + } + + + #region General + + void RefreshGeneralTab() + { + procNameTextBox.Text = LoadedProcedure.Name; + Text = string.Format("{0} '{1}'", Strings.Procedure, LoadedProcedure.Name); + + descriptionTextBox.Text = LoadedProcedure.Description; + createdByTextBox.Text = LoadedProcedure.CreationUser; + createdOnTextBox.Text = LoadedProcedure.CreationTime.ToShortDateString(); + lastChangedByTextBox.Text = LoadedProcedure.LastChgUser; + if (LoadedProcedure.LastChgTime > LoadedProcedure.CreationTime) + { + lastChangedOnTextBox.Text = LoadedProcedure.LastChgTime.ToShortDateString(); + } + notesTextBox.Text = LoadedProcedure.LongDescription; + dataEntryComboBox.Text = LoadedProcedure.DataEntry; + resultsPrinterComboBox.Text = LoadedProcedure.ResultsPrinter; + resultsWriterComboBox.Text = LoadedProcedure.ResultsWriter; + transitionStartComboBox.Text = string.IsNullOrEmpty(LoadedProcedure.TransitionStart) ? "---" : LoadedProcedure.TransitionStart; + transitionEndComboBox.Text = string.IsNullOrEmpty(LoadedProcedure.TransitionEnd) ? "---" : LoadedProcedure.TransitionEnd; + } + + void UpdateFromGeneralTab() + { + LoadedProcedure.Name = procNameTextBox.Text; + Text = string.Format("{0} '{1}'", Strings.Procedure, LoadedProcedure.Name); + + LoadedProcedure.Description = descriptionTextBox.Text; + LoadedProcedure.LastChgUser = User.CurrentUser.Name; + LoadedProcedure.LastChgTime = DateTime.Now; + LoadedProcedure.LongDescription = notesTextBox.Text; + LoadedProcedure.Watermeters = watermetersTextBox.Text; + float ppl; + if (dataEntryComboBox.Items.Contains(dataEntryComboBox.Text)) { LoadedProcedure.DataEntry = dataEntryComboBox.Text; } + if (resultsPrinterComboBox.Items.Contains(resultsPrinterComboBox.Text)) { LoadedProcedure.ResultsPrinter = resultsPrinterComboBox.Text; } + if (resultsWriterComboBox.Items.Contains(resultsWriterComboBox.Text)) { LoadedProcedure.ResultsWriter = resultsWriterComboBox.Text; } + if (transitionStartComboBox.Items.Contains(transitionStartComboBox.Text)) + { + LoadedProcedure.TransitionStart = transitionStartComboBox.Text.Equals("---") ? string.Empty : transitionStartComboBox.Text; + } + if (transitionEndComboBox.Items.Contains(transitionEndComboBox.Text)) + { + LoadedProcedure.TransitionEnd = transitionEndComboBox.Text.Equals("---") ? string.Empty : transitionEndComboBox.Text; + } + } + + #endregion + + #region Metrology12 and Process + + Control[] metrology1Editors; + Control[] metrology2Editors; + Control[] processEditors; + + void PrepareMetrology12AndProcessTabs() + { + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_chdr, Width = 70 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_from_m3h, Width = 80 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_to_m3h, Width = 80 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Volume_ltr_chdr, Width = 70 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_time_s_chdr, Width = 70 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Repeats_nr_chdr, Width = 80 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Emptying_chdr, Width = 60 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Zeroing_chdr, Width = 50 }); + metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Method_chdr, Width = 150 }); + //metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_set_method_chdr, Width = 100 }); + //metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Method1_chdr, Width = 100 }); + //metrology1ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Method2_chdr, Width = 110 }); + + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_chdr, Width = 70 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_from_m3h, Width = 80 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_to_m3h, Width = 80 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Err_limit_neg_pct_chdr, Width = 100 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Err_limit_pos_pct_chdr, Width = 100 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Tol_red_pct_chdr, Width = 80 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Red_type_chdr, Width = 80 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Err_cor_neg_pct_chdr, Width = 90 }); + metrology2ListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Err_cor_pos_pct_chdr, Width = 90 }); + + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_chdr, Width = 70 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_from_m3h, Width = 80 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Q_to_m3h, Width = 80 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Feeding_chdr, Width = 90 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Bench_chdr, Width = 90 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Output_chdr, Width = 90 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Sensors_chdr, Width = 90 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.TransitionStart_chdr, Width = 100 }); + processListViewEx.Columns.Add(new ColumnHeader { Text = Strings.TransitionEnd_chdr, Width = 100 }); + + ComboBox yesNo1CBox = new ComboBox(); + yesNo1CBox.Items.Add(Strings.yes); + yesNo1CBox.Items.Add(Strings.no); + + ComboBox yesNo2CBox = new ComboBox(); + yesNo2CBox.Items.Add(Strings.yes); + yesNo2CBox.Items.Add(Strings.no); + + methodCBox = new ComboBox(); + foreach (var m in TestMethods) methodCBox.Items.Add(m.Cfg.Name); + + //ComboBox qmethod = new ComboBox(); + //for (Entities.QSetMethod method = 0; method < Entities.QSetMethod.Count; method++) qmethod.Items.Add(method.ToString()); + //ComboBox method1 = new ComboBox(); + //for (Entities.TestMethod method = 0; method < Entities.TestMethod.Count; method++) method1.Items.Add(method.ToString()); + //ComboBox method2 = new ComboBox(); + //for (Entities.TestMethod2 method = 0; method < Entities.TestMethod2.Count; method++) method2.Items.Add(method.ToString()); + + metrology1Editors = new Control[] + { + new TextBox(), /// 0 test name + new TextBox(), /// 1 Qfrom + new TextBox(), /// 2 Qto + new TextBox(), /// 3 Volume + new TextBox(), /// 4 Test time + new TextBox(), /// 5 Repeats # + yesNo1CBox, /// 6 Emptying + yesNo2CBox, /// 7 Zeroing + methodCBox, + }; + + metrology2Editors = new Control[] + { + new TextBox(), /// 0 test name + new TextBox(), /// 1 Qfrom + new TextBox(), /// 2 Qto + new TextBox(), /// 3 Err.Lim. - + new TextBox(), /// 4 Err.Lim. + + new TextBox(), /// 5 Tol.Red. + new ComboBox(), /// 6 Red.Type + }; + + processEditors = new Control[] + { + new TextBox(), /// 0 test name + new TextBox(), /// 1 Qfrom + new TextBox(), /// 2 Qto + new ComboBox(), /// 3 Feeding + new ComboBox(), /// 4 Table + new ComboBox(), /// 5 Output + new ComboBox(), /// 6 Meters + new ComboBox(), /// 7 TransitionStart + new ComboBox(), /// 8 TransitionEnd + }; + + foreach (var ctrl in metrology1Editors) metrology1TabPage.Controls.Add(ctrl); + foreach (var ctrl in metrology2Editors) metrology2TabPage.Controls.Add(ctrl); + foreach (var ctrl in processEditors) processTabPage.Controls.Add(ctrl); + + foreach (var path in feedingPaths) ((ComboBox)processEditors[3]).Items.Add(path.Name); + foreach (var path in benchPaths) ((ComboBox)processEditors[4]).Items.Add(path.Name); + foreach (var path in outputPaths) ((ComboBox)processEditors[5]).Items.Add(path.Name); + foreach (var path in metersPaths) ((ComboBox)processEditors[6]).Items.Add(path.Name); + + ((ComboBox)processEditors[7]).Items.Add("---"); + ((ComboBox)processEditors[8]).Items.Add("---"); + foreach (var trans in transitionSequences) + { + ((ComboBox)processEditors[7]).Items.Add(trans.Name); + ((ComboBox)processEditors[8]).Items.Add(trans.Name); + } + } + + void RefreshMetrology12AndProcessTabs() + { + metrology1ListViewEx.Items.Clear(); + metrology2ListViewEx.Items.Clear(); + processListViewEx.Items.Clear(); + foreach (var test in LoadedProcedure.Tests) AddToMetrology12AndProcessTab(test); + foreach (var ctrl in testParamsCtrls) ctrl.RedrawAll(); + foreach (var ctrl in procedureParamsCtrls) ctrl.RedrawAll(); + } + + void AddToMetrology12AndProcessTab(Test test) + { + ListViewItem lviMetrlg1 = new ListViewItem(test.Name); /// + ListViewItem lviMetrlg2 = new ListViewItem(test.Name); /// SubItem 0 + ListViewItem lviProcess = new ListViewItem(test.Name); /// + lviMetrlg1.Tag = test; + lviMetrlg2.Tag = test; + lviProcess.Tag = test; + + lviMetrlg1.SubItems.Add(test.Qfrom.ToString()); /// + lviMetrlg2.SubItems.Add(test.Qfrom.ToString()); /// SubItem 1 + lviProcess.SubItems.Add(test.Qfrom.ToString()); /// + + lviMetrlg1.SubItems.Add(test.Qto.ToString()); /// + lviMetrlg2.SubItems.Add(test.Qto.ToString()); /// SubItem 2 + lviProcess.SubItems.Add(test.Qto.ToString()); /// + + lviMetrlg1.SubItems.Add(test.Volume.ToString()); /// SubItem 3 + lviMetrlg1.SubItems.Add(test.TstTime.ToString()); /// SubItem 4 + lviMetrlg1.SubItems.Add(test.Repeats.ToString()); /// SubItem 5 + lviMetrlg1.SubItems.Add(test.Emptying ? Strings.yes : Strings.no); /// SubItem 6 + lviMetrlg1.SubItems.Add(test.Zeroing ? Strings.yes : Strings.no); /// SubItem 7 + lviMetrlg1.SubItems.Add((test.Method != null) ? test.Method.ToString() : string.Empty); /// SubItem 8 + + lviMetrlg2.SubItems.Add(test.ErrLimLo.ToString()); /// SubItem 3 + lviMetrlg2.SubItems.Add(test.ErrLimHi.ToString()); /// SubItem 4 + lviMetrlg2.SubItems.Add(test.TolerRed.ToString()); /// SubItem 5 + lviMetrlg2.SubItems.Add(test.RedType.ToString()); /// SubItem 6 + + lviProcess.SubItems.Add(test.FeedingPath); /// SubItem 3 + lviProcess.SubItems.Add(test.BenchPath); /// SubItem 4 + lviProcess.SubItems.Add(test.OutputPath); /// SubItem 5 + lviProcess.SubItems.Add(test.MetersPath); /// SubItem 6 + lviProcess.SubItems.Add(string.IsNullOrEmpty(test.TransitionStart) ? "---" : test.TransitionStart); /// SubItem 7 + lviProcess.SubItems.Add(string.IsNullOrEmpty(test.TransitionEnd) ? "---" : test.TransitionEnd); /// SubItem 8 + + metrology1ListViewEx.Items.Add(lviMetrlg1); + metrology2ListViewEx.Items.Add(lviMetrlg2); + processListViewEx.Items.Add(lviProcess); + } + + void UpdateFromMetrology1Tab() + { + for (int i = 0; i < metrology1ListViewEx.Items.Count; i++) + { + ListViewItem lvi = metrology1ListViewEx.Items[i]; + Entities.Test entity = (Entities.Test)lvi.Tag; + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[1].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[2].Text, out Qto); + entity.Qto = Qto; + + float volume; + allOk &= Utils.TryParseUFloat(lvi.SubItems[3].Text, out volume); + entity.Volume = volume; + + float testTime; + allOk &= Utils.TryParseUFloat(lvi.SubItems[4].Text, out testTime); + entity.TstTime = testTime; + + int repeats; + allOk &= int.TryParse(lvi.SubItems[5].Text, out repeats); + entity.Repeats = repeats; + + if (lvi.SubItems[6].Text.Equals(Strings.yes)) entity.Emptying = true; + else if (lvi.SubItems[6].Text.Equals(Strings.no)) entity.Emptying = false; + + if (lvi.SubItems[7].Text.Equals(Strings.yes)) entity.Zeroing = true; + else if (lvi.SubItems[7].Text.Equals(Strings.no)) entity.Zeroing = false; + + if (methodCBox.Items.Contains(lvi.SubItems[8].Text)) + { + entity.Method = lvi.SubItems[8].Text; + } + } + } + + void UpdateFromMetrology2Tab() + { + for (int i = 0; i < metrology2ListViewEx.Items.Count; i++) + { + ListViewItem lvi = metrology2ListViewEx.Items[i]; + Entities.Test entity = (Entities.Test)lvi.Tag; + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[1].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[2].Text, out Qto); + entity.Qto = Qto; + + float errLimLo; + allOk &= Utils.TryParseSFloat(lvi.SubItems[3].Text, out errLimLo); + entity.ErrLimLo = errLimLo; + + float errLimHi; + allOk &= Utils.TryParseSFloat(lvi.SubItems[4].Text, out errLimHi); + entity.ErrLimHi = errLimHi; + } + } + + void UpdateFromProcessTab() + { + for (int i = 0; i < processListViewEx.Items.Count; i++) + { + ListViewItem lvi = processListViewEx.Items[i]; + Entities.Test entity = (Entities.Test)lvi.Tag; + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[1].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[2].Text, out Qto); + entity.Qto = Qto; + + if ((processEditors[3] as ComboBox).Items.Contains(lvi.SubItems[3].Text)) entity.FeedingPath= lvi.SubItems[3].Text; + if ((processEditors[4] as ComboBox).Items.Contains(lvi.SubItems[4].Text)) entity.BenchPath = lvi.SubItems[4].Text; + if ((processEditors[5] as ComboBox).Items.Contains(lvi.SubItems[5].Text)) entity.OutputPath = lvi.SubItems[5].Text; + if ((processEditors[6] as ComboBox).Items.Contains(lvi.SubItems[6].Text)) entity.MetersPath = lvi.SubItems[6].Text; + if ((processEditors[7] as ComboBox).Items.Contains(lvi.SubItems[7].Text)) + { + entity.TransitionStart = lvi.SubItems[7].Text.Equals("---") ? string.Empty : lvi.SubItems[7].Text; + } + if ((processEditors[8] as ComboBox).Items.Contains(lvi.SubItems[8].Text)) + { + entity.TransitionEnd = lvi.SubItems[8].Text.Equals("---") ? string.Empty : lvi.SubItems[8].Text; + } + } + } + + private void metrology1ListViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!unlocked || e.SubItem >= metrology1Editors.Length) return; + metrology1ListViewEx.StartEditing(metrology1Editors[e.SubItem], e.Item, e.SubItem); + } + + private void metrology1ListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + if (e.SubItem != 1 && e.SubItem != 2 && e.SubItem != 3 && e.SubItem != 4) return; + + float Qfrom = 1.0f; + float Qto = 1.0f; + float volume = 0.0f; + float testTime = 0.0f; + + bool calculateVolume = false; + bool calculateTime = false; + bool allOk = true; + + if (e.SubItem == 1 && Utils.TryParseUFloat(e.DisplayText, out Qfrom)) + { + allOk &= Utils.TryParseUFloat(e.Item.SubItems[2].Text, out Qto); + allOk &= Utils.TryParseUFloat(e.Item.SubItems[3].Text, out volume); + if (allOk) calculateTime = true; + } + else if (e.SubItem == 2 && Utils.TryParseUFloat(e.DisplayText, out Qto)) + { + allOk &= Utils.TryParseUFloat(e.Item.SubItems[1].Text, out Qfrom); + allOk &= Utils.TryParseUFloat(e.Item.SubItems[3].Text, out volume); + if (allOk) calculateTime = true; + } + else if (e.SubItem == 3 && Utils.TryParseUFloat(e.DisplayText, out volume)) + { + allOk &= Utils.TryParseUFloat(e.Item.SubItems[1].Text, out Qfrom); + allOk &= Utils.TryParseUFloat(e.Item.SubItems[2].Text, out Qto); + if (allOk) calculateTime = true; + } + else if (e.SubItem == 4 && Utils.TryParseUFloat(e.DisplayText, out testTime)) + { + allOk &= Utils.TryParseUFloat(e.Item.SubItems[1].Text, out Qfrom); + allOk &= Utils.TryParseUFloat(e.Item.SubItems[2].Text, out Qto); + if (allOk) calculateVolume = true; + } + + float Qave_lps = (Qfrom + Qto) / 7.2f; + if (calculateTime) + { + testTime = volume / Qave_lps; + e.Item.SubItems[4].Text = testTime.ToString(); + } + else if (calculateVolume) + { + volume = testTime * Qave_lps; + e.Item.SubItems[3].Text = volume.ToString(); + } + else + { + e.DisplayText = e.Item.SubItems[e.SubItem].Text; + e.Cancel = true; + } + } + + private void metrology2ListViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!unlocked || e.SubItem >= metrology2Editors.Length) return; + metrology2ListViewEx.StartEditing(metrology2Editors[e.SubItem], e.Item, e.SubItem); + } + + private void metrology2ListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + private void processListViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!unlocked || e.SubItem >= processEditors.Length) return; + processListViewEx.StartEditing(processEditors[e.SubItem], e.Item, e.SubItem); + } + + private void processListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + if ((e.SubItem == 3 && !(processEditors[3] as ComboBox).Items.Contains(e.DisplayText)) || + (e.SubItem == 4 && !(processEditors[4] as ComboBox).Items.Contains(e.DisplayText)) || + (e.SubItem == 5 && !(processEditors[5] as ComboBox).Items.Contains(e.DisplayText)) || + (e.SubItem == 6 && !(processEditors[6] as ComboBox).Items.Contains(e.DisplayText)) || + (e.SubItem == 7 && !(processEditors[7] as ComboBox).Items.Contains(e.DisplayText)) || + (e.SubItem == 8 && !(processEditors[8] as ComboBox).Items.Contains(e.DisplayText))) + { + e.DisplayText = e.Item.SubItems[e.SubItem].Text; + e.Cancel = true; + } + } + + #endregion + + + private void Unlocked(object sender, EventArgs e) + { + unlocked = true; + if (testParamsCtrls != null) foreach (var ctrl in testParamsCtrls) ctrl.Unlock(); + if (procedureParamsCtrls != null) foreach (var ctrl in procedureParamsCtrls) ctrl.Unlock(); + + procNameTextBox.Enabled = true; + descriptionTextBox.Enabled = true; + watermetersTextBox.Enabled = true; + dataEntryComboBox.Enabled = true; + resultsPrinterComboBox.Enabled = true; + resultsWriterComboBox.Enabled = true; + transitionStartComboBox.Enabled = true; + transitionEndComboBox.Enabled = true; + notesTextBox.Enabled = true; + + ListViewEx listViewEx; + + switch (selectedTab) + { + case ProcedureTabs.Metrology1: + listViewEx = metrology1ListViewEx; + break; + case ProcedureTabs.Metrology2: + listViewEx = metrology2ListViewEx; + break; + case ProcedureTabs.Process: + listViewEx = processListViewEx; + break; + default: + return; + } + + if (listViewEx.SelectedItems.Count == 1) + { + int ix = listViewEx.SelectedIndices[0]; + listViewEx.Focus(); + listViewEx.Items[ix].Selected = true; + listViewEx.Items[ix].EnsureVisible(); + } + } + + private void okButton_Click(object sender, EventArgs e) + { + switch (selectedTab) + { + case ProcedureTabs.General: UpdateFromGeneralTab(); break; + case ProcedureTabs.Metrology1: UpdateFromMetrology1Tab(); break; + case ProcedureTabs.Metrology2: UpdateFromMetrology2Tab(); break; + case ProcedureTabs.Process: UpdateFromProcessTab(); break; + } + + foreach (var ctrl in testParamsCtrls) ctrl.UpdateAll(); + foreach (var ctrl in procedureParamsCtrls) ctrl.UpdateAll(); + + DialogResult = DialogResult.OK; + Close(); + return; + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + + #region Tab switching + + enum ProcedureTabs + { + General, + History, + Metrology1, + Metrology2, + Process, + PurgeStart, + PurgeEnd + } + + ProcedureTabs selectedTab = ProcedureTabs.General; + + private void tabControl_SelectedIndexChanged(object sender, EventArgs e) + { + switch (selectedTab) + { + case ProcedureTabs.General: UpdateFromGeneralTab(); break; + case ProcedureTabs.Metrology1: UpdateFromMetrology1Tab(); break; + case ProcedureTabs.Metrology2: UpdateFromMetrology2Tab(); break; + case ProcedureTabs.Process: UpdateFromProcessTab(); break; + } + + selectedTab = (ProcedureTabs)tabControl.SelectedIndex; + + sharedButtons.SetEnabled(SharedButtons.Buttons.Add, + selectedTab == ProcedureTabs.Metrology1 || + selectedTab == ProcedureTabs.Metrology2 || + selectedTab == ProcedureTabs.Process || + selectedTab == ProcedureTabs.PurgeStart || + selectedTab == ProcedureTabs.PurgeEnd); + + //bool removeBtnEnabled = (selectedTab != ProcedureTabs.General && + // selectedTab != ProcedureTabs.History && + // selectedTab != ProcedureTabs.Calibration); + + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove); + + RefreshAllTabs(); + } + + #endregion + + #region 'Add', 'Remove', 'Up' and 'Down' + + private void addButton_Click(object sender, EventArgs e) + { + ListViewEx listViewEx; + + switch (selectedTab) + { + case ProcedureTabs.Metrology1: listViewEx = metrology1ListViewEx; break; + case ProcedureTabs.Metrology2: listViewEx = metrology2ListViewEx; break; + case ProcedureTabs.Process: listViewEx = processListViewEx; break; + + default: return; + } + + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_test_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in LoadedProcedure.Tests) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + + /// Add a test + Test test = new Test(newName, listViewEx.Items.Count, LoadedProcedure); + + /// Run a create new test wizard + TestWizard.FlowSelection flowDlg = new TestWizard.FlowSelection(test); + TestWizard.MethodSelection methodDlg = new TestWizard.MethodSelection(test, TestMethods, metersPaths); + TestWizard.VolumeAndErrorSelection volumeDlg = new TestWizard.VolumeAndErrorSelection(test); + //TestWizard.SensorsSelection sensorsDlg = new TestWizard.SensorsSelection(test); + + flowLabel: + switch (flowDlg.ShowDialog()) + { + case DialogResult.Cancel: return; + } + + methodLabel: + switch (methodDlg.ShowDialog()) + { + case DialogResult.Cancel: return; + case DialogResult.Retry: goto flowLabel; + } + + switch (volumeDlg.ShowDialog()) + { + case DialogResult.Cancel: return; + case DialogResult.Retry: goto methodLabel; + } + + /// Set few other parameters + test.Repeats = 1; + test.TolerRed = 0.2f; + + /// Depending on the chosen Q select the paths + float Qaver = (test.Qfrom + test.Qto) / 2.0f; + foreach (var path in feedingPaths) + { + if ((path.Qfrom <= Qaver) && (Qaver <= path.Qto)) + { + test.FeedingPath = path.Name; + break; + } + } + foreach (var path in benchPaths) + { + if ((path.Qfrom <= Qaver) && (Qaver <= path.Qto)) + { + test.BenchPath = path.Name; + break; + } + } + foreach (var path in outputPaths) + { + if ((path.Qfrom <= Qaver) && (Qaver <= path.Qto)) + { + test.OutputPath = path.Name; + break; + } + } + + LoadedProcedure.Tests.Add(test); + AddToMetrology12AndProcessTab(test); + foreach (var ctrl in testParamsCtrls) + { + ctrl.AddOne(test); + } + + listViewEx.Focus(); + listViewEx.SelectedItems.Clear(); + listViewEx.Items[listViewEx.Items.Count - 1].Selected = true; + listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible(); + } + + private void removeButton_Click(object sender, EventArgs e) + { + ListViewEx listViewEx; + + switch (selectedTab) + { + case ProcedureTabs.Metrology1: + UpdateFromMetrology1Tab(); + listViewEx = metrology1ListViewEx; + break; + + case ProcedureTabs.Metrology2: + UpdateFromMetrology2Tab(); + listViewEx = metrology2ListViewEx; + break; + + case ProcedureTabs.Process: + UpdateFromProcessTab(); + listViewEx = processListViewEx; + break; + + default: return; + } + + /// Check the selected index validity + if (listViewEx.SelectedItems.Count != 1) return; + int removeItemNr = listViewEx.SelectedIndices[0]; + + /// Remove the selected test + Entities.Test toBeDeleted = LoadedProcedure.Tests[removeItemNr]; + LoadedProcedure.Tests.Remove(toBeDeleted); + for (int i = removeItemNr; i < LoadedProcedure.Tests.Count; i++) LoadedProcedure.Tests[i].ItemNr--; + + RefreshMetrology12AndProcessTabs(); + foreach (var ctrl in testParamsCtrls) ctrl.RedrawAll(); + + if (removeItemNr < listViewEx.Items.Count) + { + listViewEx.Focus(); + listViewEx.Items[removeItemNr].Selected = true; + listViewEx.Items[removeItemNr].EnsureVisible(); + } + else + { + UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + + private void upButton_Click(object sender, EventArgs e) + { + ListViewEx listViewEx; + + switch (selectedTab) + { + case ProcedureTabs.Metrology1: + UpdateFromMetrology1Tab(); + listViewEx = metrology1ListViewEx; + break; + + case ProcedureTabs.Metrology2: + UpdateFromMetrology2Tab(); + listViewEx = metrology2ListViewEx; + break; + + case ProcedureTabs.Process: + UpdateFromProcessTab(); + listViewEx = processListViewEx; + break; + + default: return; + } + + /// Check the selected index validity + if (listViewEx.SelectedItems.Count != 1) return; + int ix = listViewEx.SelectedIndices[0]; + if (ix <= 0 || ix >= listViewEx.Items.Count) return; + + /// Swap two items (move the selected item up) + Entities.Test test1 = LoadedProcedure.Tests[ix - 1]; + Entities.Test test2 = LoadedProcedure.Tests[ix]; + test1.ItemNr++; + test2.ItemNr--; + LoadedProcedure.Tests.RemoveAt(ix); + LoadedProcedure.Tests.Insert(ix - 1, test2); + + RefreshMetrology12AndProcessTabs(); + + listViewEx.Focus(); + listViewEx.Items[ix - 1].Selected = true; + listViewEx.Items[ix - 1].EnsureVisible(); + } + + private void downButton_Click(object sender, EventArgs e) + { + ListViewEx listViewEx; + + switch (selectedTab) + { + case ProcedureTabs.Metrology1: + UpdateFromMetrology1Tab(); + listViewEx = metrology1ListViewEx; + break; + + case ProcedureTabs.Metrology2: + UpdateFromMetrology2Tab(); + listViewEx = metrology2ListViewEx; + break; + + case ProcedureTabs.Process: + UpdateFromProcessTab(); + listViewEx = processListViewEx; + break; + + default: return; + } + + /// Check the selected index validity + if (listViewEx.SelectedItems.Count != 1) return; + int ix = listViewEx.SelectedIndices[0]; + if (ix < 0 || ix >= listViewEx.Items.Count - 1) return; + + /// Swap two items (move the selected item down) + Entities.Test test1 = LoadedProcedure.Tests[ix]; + Entities.Test test2 = LoadedProcedure.Tests[ix + 1]; + test1.ItemNr++; + test2.ItemNr--; + LoadedProcedure.Tests.RemoveAt(ix + 1); + LoadedProcedure.Tests.Insert(ix, test2); + + RefreshMetrology12AndProcessTabs(); + + listViewEx.Focus(); + listViewEx.Items[ix + 1].Selected = true; + listViewEx.Items[ix + 1].EnsureVisible(); + } + + #endregion + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.First) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.Last) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up); + sharedButtons.DisableButtons(SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + + private void metrology1ListViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged(sender, e); + } + + private void metrology2ListViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged(sender, e); + } + + private void processListViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged(sender, e); + } + + /// + /// Common part for three xxxListViewEx_SelectedIndexChanged event handlers + /// + /// + void SelectedIndexChanged(object sender, EventArgs e) + { + ListViewEx listViewEx = sender as ListViewEx; + if (listViewEx.SelectedItems.Count != 1) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + else if (listViewEx.Items.Count == 1) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.First); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.Last); + } + else + { + UpdateButtonStates(SharedButtons.SelectedItemPos.Middle); + } + } + } +} diff --git a/TestBenchFramework/ProcedureDlg.de.resx b/TestBenchFramework/ProcedureDlg.de.resx new file mode 100644 index 000000000..e5fdb4910 --- /dev/null +++ b/TestBenchFramework/ProcedureDlg.de.resx @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 931, 409 + + + 1034, 409 + + + 923, 371 + + + Allgemein + + + 139, 325 + + + 24, 330 + + + 139, 295 + + + 24, 300 + + + 139, 264 + + + 139, 233 + + + 139, 203 + + + 24, 267 + + + 24, 236 + + + 24, 206 + + + 348, 205 + + + 317, 141 + + + 281, 208 + + + 61, 13 + + + Bemerkung + + + 139, 162 + + + 526, 20 + + + 24, 165 + + + 348, 120 + + + 38, 13 + + + Datum + + + 140, 121 + + + 102, 13 + + + letzte Änderung von + + + 348, 87 + + + 38, 13 + + + Datum + + + 62, 13 + + + Errstellt von + + + 526, 20 + + + 92, 13 + + + Kurzbeschreibung + + + 75, 13 + + + Prüfungsname + + + 923, 406 + + + Änderungen + + + 917, 400 + + + Benutzername + + + Datum + + + Kurzbeschreibung + + + 923, 406 + + + Metrologie I. + + + 917, 400 + + + 923, 406 + + + Metrologie II. + + + 917, 400 + + + 923, 406 + + + Prozess + + + 917, 400 + + + + 3, 3, 3, 3 + + + 923, 406 + + + Spülung - Start + + + 3, 3 + + + 917, 400 + + + 923, 406 + + + Spülung - Ende + + + 923, 406 + + + 1034, 409 + + + Prüfung + + \ No newline at end of file diff --git a/TestBenchFramework/ProcedureDlg.resx b/TestBenchFramework/ProcedureDlg.resx new file mode 100644 index 000000000..c52523c49 --- /dev/null +++ b/TestBenchFramework/ProcedureDlg.resx @@ -0,0 +1,1176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Fill + + + + True + + + + 0, 0 + + + 139, 313 + + + 121, 21 + + + 29 + + + transitionEndComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 0 + + + True + + + NoControl + + + 24, 318 + + + 63, 13 + + + 28 + + + Purge - End + + + transitionEndLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 1 + + + 139, 283 + + + 121, 21 + + + 27 + + + transitionStartComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 2 + + + True + + + NoControl + + + 24, 288 + + + 71, 13 + + + 26 + + + Purge - Begin + + + transitionStartLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 3 + + + 139, 253 + + + 121, 21 + + + 25 + + + resultsWriterComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 4 + + + 139, 222 + + + 121, 21 + + + 24 + + + resultsPrinterComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 5 + + + 139, 191 + + + 121, 21 + + + 23 + + + dataEntryComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 6 + + + True + + + NoControl + + + 24, 258 + + + 70, 13 + + + 22 + + + Results writer + + + resultsWriterLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 7 + + + True + + + NoControl + + + 24, 227 + + + 74, 13 + + + 21 + + + Results printer + + + resultsPrinterLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 8 + + + True + + + NoControl + + + 25, 194 + + + 57, 13 + + + 20 + + + Data Entry + + + dataEntryLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 9 + + + 344, 191 + + + True + + + 317, 143 + + + 17 + + + notesTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 10 + + + True + + + NoControl + + + 291, 194 + + + 35, 13 + + + 16 + + + Notes + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 11 + + + 139, 156 + + + 522, 20 + + + 15 + + + watermetersTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 12 + + + True + + + NoControl + + + 24, 159 + + + 94, 13 + + + 14 + + + Meter types tested + + + watermetersLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 13 + + + 344, 120 + + + 97, 20 + + + 13 + + + lastChangedOnTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 14 + + + True + + + NoControl + + + 291, 123 + + + 30, 13 + + + 12 + + + Date + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 15 + + + 139, 120 + + + 121, 20 + + + 11 + + + lastChangedByTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 16 + + + True + + + NoControl + + + 24, 123 + + + 86, 13 + + + 10 + + + Last changed by + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 17 + + + 344, 87 + + + 97, 20 + + + 9 + + + createdOnTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 18 + + + True + + + NoControl + + + 291, 90 + + + 30, 13 + + + 8 + + + Date + + + label14 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 19 + + + 139, 87 + + + 121, 20 + + + 7 + + + createdByTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 20 + + + True + + + NoControl + + + 24, 90 + + + 58, 13 + + + 6 + + + Created by + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 21 + + + 139, 53 + + + 522, 20 + + + 5 + + + descriptionTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 22 + + + True + + + NoControl + + + 24, 56 + + + 86, 13 + + + 4 + + + Short description + + + label12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 23 + + + 139, 21 + + + 217, 20 + + + 3 + + + procNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 24 + + + True + + + NoControl + + + 24, 24 + + + 85, 13 + + + 2 + + + Procedure name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + generalTabPage + + + 25 + + + 4, 34 + + + 3, 3, 3, 3 + + + 923, 352 + + + 0 + + + General + + + generalTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl + + + 0 + + + Changed by + + + 80 + + + Date + + + Description + + + 400 + + + Fill + + + 3, 3 + + + 917, 346 + + + 0 + + + historyListViewEx + + + TBF.UiControls.ListViewEx, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + historyTabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 923, 352 + + + 1 + + + History of Changes + + + historyTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl + + + 1 + + + Fill + + + 3, 3 + + + 917, 346 + + + 0 + + + metrology1ListViewEx + + + TBF.UiControls.ListViewEx, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + metrology1TabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 923, 352 + + + 2 + + + Metrology I. + + + metrology1TabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl + + + 2 + + + Fill + + + 3, 3 + + + 917, 346 + + + 0 + + + metrology2ListViewEx + + + TBF.UiControls.ListViewEx, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + metrology2TabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 923, 352 + + + 3 + + + Metrology II. + + + metrology2TabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl + + + 3 + + + Fill + + + 3, 3 + + + 917, 346 + + + 0 + + + processListViewEx + + + TBF.UiControls.ListViewEx, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + processTabPage + + + 0 + + + 4, 34 + + + 3, 3, 3, 3 + + + 923, 352 + + + 4 + + + Process + + + processTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl + + + 4 + + + Fill + + + 58, 30 + + + 0, 0 + + + 931, 390 + + + 1 + + + tabControl + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer.Panel1 + + + 0 + + + mainSplitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer + + + 0 + + + -1, 0 + + + 100, 400 + + + 0 + + + sharedButtons + + + TBF.UiControls.SharedButtons, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + mainSplitContainer.Panel2 + + + 0 + + + mainSplitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer + + + 1 + + + 1034, 390 + + + 931 + + + 1 + + + mainSplitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 1034, 390 + + + CenterParent + + + Procedure + + + changedByClmnHdr + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dateClmnHdr + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + descriptionClmnHdr + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ProcedureDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/ProceduresDlg.Designer.cs b/TestBenchFramework/ProceduresDlg.Designer.cs new file mode 100644 index 000000000..cb3ed815f --- /dev/null +++ b/TestBenchFramework/ProceduresDlg.Designer.cs @@ -0,0 +1,103 @@ +namespace TBF +{ + partial class ProceduresDlg + { + /// + /// 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 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.splitContainer = new System.Windows.Forms.SplitContainer(); + this.proceduresCtrl = new TBF.UiControls.ProceduresCtrl(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.Controls.Add(this.proceduresCtrl); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.sharedButtons); + this.splitContainer.Size = new System.Drawing.Size(517, 402); + this.splitContainer.SplitterDistance = 412; + this.splitContainer.TabIndex = 0; + // + // proceduresCtrl + // + this.proceduresCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.proceduresCtrl.DoubleClickActivation = false; + this.proceduresCtrl.FullRowSelect = true; + this.proceduresCtrl.GridLines = true; + this.proceduresCtrl.Location = new System.Drawing.Point(0, 0); + this.proceduresCtrl.Name = "proceduresCtrl"; + this.proceduresCtrl.Size = new System.Drawing.Size(412, 402); + this.proceduresCtrl.TabIndex = 0; + this.proceduresCtrl.UseCompatibleStateImageBehavior = false; + this.proceduresCtrl.View = System.Windows.Forms.View.Details; + this.proceduresCtrl.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.proceduresCtrl_MouseDoubleClick); + // + // sharedButtons + // + this.sharedButtons.Location = new System.Drawing.Point(1, 0); + this.sharedButtons.Name = "sharedButtons"; + this.sharedButtons.Size = new System.Drawing.Size(100, 521); + this.sharedButtons.TabIndex = 0; + // + // ProceduresDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(517, 402); + this.Controls.Add(this.splitContainer); + this.Name = "ProceduresDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ProceduresDlg"; + this.Load += new System.EventHandler(this.ProceduresDlg_Load); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private UiControls.SharedButtons sharedButtons; + private UiControls.ProceduresCtrl proceduresCtrl; + } +} \ No newline at end of file diff --git a/TestBenchFramework/ProceduresDlg.cs b/TestBenchFramework/ProceduresDlg.cs new file mode 100644 index 000000000..6bb2f5f64 --- /dev/null +++ b/TestBenchFramework/ProceduresDlg.cs @@ -0,0 +1,153 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.Resources; +using TBF.UiControls; + +namespace TBF +{ + public partial class ProceduresDlg : Form + { + static readonly ILog log = LogManager.GetLogger(typeof(ProceduresDlg)); + + /// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi + public readonly int Dpi; + public const int Dpi100pct = 96; + + bool unlocked; + + public ProceduresDlg() + { + /// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi. + Dpi = (int)this.CreateGraphics().DpiX; + + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove | + SharedButtons.Buttons.Up | SharedButtons.Buttons.Down | + SharedButtons.Buttons.Edit | SharedButtons.Buttons.Copy; + + sharedButtons.Unlocked += Unlocked; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + sharedButtons.UpClicked += upButton_Click; + sharedButtons.DownClicked += downButton_Click; + sharedButtons.EditClicked += proceduresCtrl.editButton_Click; + sharedButtons.CopyClicked += proceduresCtrl.copyButton_Click; + } + + private void ProceduresDlg_Load(object sender, EventArgs e) + { + Text = Strings.Procedures; + proceduresCtrl.Initialize(this, splitContainer.Panel1); + } + + /// + /// Called from ProceduresCtrl when item editing is completed with OK. + /// Authorisation occurs in the editted ProcedureDlg dialog. + /// + public void Unlock() + { + sharedButtons.UnlockButtons(); + unlocked = true; + proceduresCtrl.Unlock(); + } + + /// + /// Called from sharedButtons when user clicks 'Unlock' button an is authorised. + /// + private void Unlocked(object sender, EventArgs e) + { + unlocked = true; + proceduresCtrl.Unlock(); + } + + private void okButton_Click(object sender, EventArgs e) + { + proceduresCtrl.OkBtnClicked(); + DialogResult = DialogResult.OK; + Close(); + } + + private void cancelButton_Click(object sender, EventArgs e) + { + proceduresCtrl.CancelBtnClicked(); + DialogResult = DialogResult.Cancel; + Close(); + } + + private void addButton_Click(object sender, EventArgs e) + { + proceduresCtrl.AddOne(); + } + + private void removeButton_Click(object sender, EventArgs e) + { + proceduresCtrl.RemoveSelected(); + } + + private void upButton_Click(object sender, EventArgs e) + { + proceduresCtrl.MoveUpSelected(); + } + + private void downButton_Click(object sender, EventArgs e) + { + proceduresCtrl.MoveDownSelected(); + } + + private void proceduresCtrl_MouseDoubleClick(object sender, MouseEventArgs e) + { + proceduresCtrl.editButton_Click(sender, e); + } + + /// + /// Common part for three xxxListViewEx_SelectedIndexChanged event handlers + /// + /// + void SelectedIndexChanged(object sender, EventArgs e) + { + ListViewEx listViewEx = sender as ListViewEx; + if (listViewEx.SelectedItems.Count != 1) + { + /// No item selected + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (listViewEx.Items.Count == 1) + { + /// One (the first and the last) item selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + /// The first of many items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + /// The last of many items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up); + sharedButtons.DisableButtons(SharedButtons.Buttons.Down); + } + else + { + /// One of middle items selected + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + } +} diff --git a/TestBenchFramework/ProceduresDlg.resx b/TestBenchFramework/ProceduresDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/ProceduresDlg.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/TestBenchFramework/Program.cs b/TestBenchFramework/Program.cs new file mode 100644 index 000000000..1fa6ff890 --- /dev/null +++ b/TestBenchFramework/Program.cs @@ -0,0 +1,247 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Windows.Forms; +using log4net; +using TBF.Resources; +using TBF.Forms; +using TBF.ErrorHandler; + +using NHibernate; + +namespace TBF +{ + public class Program + { + public const string AdminUsername = "admin"; + public const string AdminPassword = "staratura"; + + public const string HomeDir = "C:\\Tbf\\"; /// Contains subdirectories Results, Logs, Images, ... + + /// log4net + static readonly ILog log = LogManager.GetLogger(typeof(Program)); + const string log4netConfigFName = "log4netConfig.xml"; + + /// Local settings + public static LocalSettings LocalSettings = new LocalSettings(); + public const string LocalSettingsFileName = "config.xml"; + + /// Database related: This object reference is set after a successful user login + public static DatabaseSettings CurrentBench; + const string SQLiteDbFName = "SQLite.db"; + +#if (DN100 || MUNICH) + public const int WMsCount = 3; +#else + public const int WMsCount = 6; +#endif + + /// + /// Selected procedure data + /// - before the main program window is open, objects referenced by this variable + /// are loaded from the database. + /// - user interface displays data stored in objects referenced by this variable. + /// When user modifies procedure settings and confirms changes (choses to save them), + /// data referenced by this variable are updated and written to the database. + /// - when users starts a test procedure, state machine creates its own copy + /// of procedure data and uses them for the test. Changes of 'SelectedProcedure' + /// done during the test do not have any influence on the currently running test. + /// + public static Entities.Procedure SelectedProcedure = null; + + /// + /// Main window object. + /// + public static MainWnd MainWnd; + + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + /// Local program configuration directory including the trailing backslash + string locAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + + Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar; + + /// Check whether local application data directory exists. + /// If not, create it and copy the initial configuration to this directory. + /// This is done only once after a clean program installation on the first program start-up + try + { + if (!Directory.Exists(locAppDataDir)) + { + Directory.CreateDirectory(locAppDataDir); + Environment.CurrentDirectory = locAppDataDir; + + string sampleConfig = Application.StartupPath + Path.DirectorySeparatorChar + "SampleConfig" + Path.DirectorySeparatorChar; + if (File.Exists(sampleConfig + LocalSettingsFileName)) { File.Copy(sampleConfig + LocalSettingsFileName, LocalSettingsFileName); } + if (File.Exists(sampleConfig + log4netConfigFName)) { File.Copy(sampleConfig + log4netConfigFName, log4netConfigFName); } + if (File.Exists(sampleConfig + SQLiteDbFName)) { File.Copy(sampleConfig + SQLiteDbFName, SQLiteDbFName); } + + File.SetAttributes(LocalSettingsFileName, FileAttributes.Normal); + File.SetAttributes(log4netConfigFName, FileAttributes.Normal); + File.SetAttributes(SQLiteDbFName, FileAttributes.Normal); + } + else + { + Environment.CurrentDirectory = locAppDataDir; + } + } + catch (Exception e) + { + log.Error("A problem when creating the local application data directory and preparing the initial configuration", e); + return; + } + + /// Configue and start logging + log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(locAppDataDir + log4netConfigFName)); + log.Info("Entering application."); + + /// Load the local settings + if (Program.LocalSettings == null) return; /// Fatal error + LocalSettings.Load(); + + System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(LocalSettings.Language); + + /// This belongs to Application.Run(new MainWnd()) ... + /// and should be executed before opening 'loginDlg' + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + /// Ensure that there is at least one bench in the configuration + while (Program.LocalSettings.testBenches.GetLength(0) == 0) + { + log.Warn("No test benches in the local configuration -> display an appropriate dialog."); + + /// Ask what to do, ask for the password, open 'DatabaseSetingsDlg' and continue on OK + if (new Forms.NoBenchOrDatabaseDlg { Message = Strings.NoBenchMsg }.ShowDialog() != DialogResult.OK || + new Forms.EnterPasswordDlg { Password = AdminPassword }.ShowDialog() == DialogResult.Cancel || + new BenchesDlg().ShowDialog() == DialogResult.Cancel) + { + return; /// Exit program + } + + log.Warn("Loading the local settings again."); + LocalSettings.Load(); + } + + /// User login + bool retryLogin = true; /// true = stay in a login loop + do { + LoginDlgWithBenchSelection loginDlgBenchSelection; + if (LocalSettings.LastBenchName != null) + { + loginDlgBenchSelection = new LoginDlgWithBenchSelection(LocalSettings.LastBenchName); + } + else + { + loginDlgBenchSelection = new LoginDlgWithBenchSelection(); + } + DialogResult dr = loginDlgBenchSelection.ShowDialog(); + + if (dr == DialogResult.Cancel) + { + return; /// Login canceled --> Exit application + } + else + { + for (int i = 0; i < LocalSettings.BenchesCount; i++) + { + if (LocalSettings.TestBenches[i].BenchName == loginDlgBenchSelection.BenchName) + { + Entities.User loadedUser = null; + try + { + bool authorized = false; + + /// Load user from the UsersAndGroupsDB database + loadedUser = Entities.User.LoadUserByName(loginDlgBenchSelection.User, + LocalSettings.TestBenches[i].UsersDBSettings); + if (loadedUser != null) + { + authorized = loadedUser.Authorize(loginDlgBenchSelection.User, loginDlgBenchSelection.Password); + } + + if (authorized) + { + log.InfoFormat("Password accepted, bench '{0}' parameters loaded.", LocalSettings.TestBenches[i].BenchName); + + /// Copy the selected bench settings to CurrentBench. + /// Clone() guarantees that current bench settings wont be modified + /// when user modifies the database settings in DatabaseSettingsDlg. + CurrentBench = (DatabaseSettings)LocalSettings.TestBenches[i].Clone(); + + /// Save the selection to local settings + LocalSettings.LastBenchName = CurrentBench.BenchName; + + retryLogin = false; + break; + } + + if (retryLogin) + { + /// Close Fluent NHibernate + MessageBox.Show(Strings.Invalid_user_password_or_bench, Strings.Error, MessageBoxButtons.OK); + } + } + catch (Exception e) + { + /// Database connect failed, ask what to do + switch ((new Forms.NoBenchOrDatabaseDlg { Message = Strings.NoDatabaseMsg, ShowRetry = true }).ShowDialog()) + { + case DialogResult.Abort: return; /// Exit program + case DialogResult.Retry: break; /// Retry the loop + default: + /// Open 'DatabaseSetingsDlg' and retry DB connect on OK + if (new Forms.EnterPasswordDlg { Password = AdminPassword } + .ShowDialog() == DialogResult.Cancel || + new BenchesDlg().ShowDialog() == DialogResult.Cancel) + { + return; /// Exit program + } + LocalSettings.Load(); + break; /// Retry the loop + } + } + } // if benchname is OK + } // for all benches in local settings loop + } // not Canceled + } //do + while (retryLogin); + + /// + /// Load the last procedure or create a new, default one + /// + if (LocalSettings.LastProcedureName != null) + { + IList listOfProcedures = FluentCommon.CreateSession(Database.Procedures) + .CreateQuery("FROM Procedure WHERE Name = :procName") + .SetParameter("procName", LocalSettings.LastProcedureName) + .List(); + + if (listOfProcedures.Count == 1) + { + log.InfoFormat("Pre-selecting the procedure {0}", LocalSettings.LastProcedureName); + SelectedProcedure = listOfProcedures[0]; + } + } + + /// Open the main application window + log.Info("Creating the main window"); + MainWnd = new MainWnd(); + log.Info("Opening the main window"); + Application.Run(MainWnd); + + /// Save local settings + log.Info("The main window was closed, saving the local parameters"); + LocalSettings.Save(); + + /// Close Fluent NHibernate + /// Todo + + log.Info("Exiting application."); + } + } +} \ No newline at end of file diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..17f275f55 --- /dev/null +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("TestBenchFramework")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Sensus")] +[assembly: AssemblyProduct("TestBenchFramework")] +[assembly: AssemblyCopyright("Copyright © 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("2c13538e-15ee-48b2-af0f-2c95afb67186")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TestBenchFramework/Properties/DataSources/TestBenchFramework.Entities.Pressure.datasource b/TestBenchFramework/Properties/DataSources/TestBenchFramework.Entities.Pressure.datasource new file mode 100644 index 000000000..f2df087bc --- /dev/null +++ b/TestBenchFramework/Properties/DataSources/TestBenchFramework.Entities.Pressure.datasource @@ -0,0 +1,10 @@ + + + + TBF.Entities.Pressure, TestBenchFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/TestBenchFramework/Properties/Resources.Designer.cs b/TestBenchFramework/Properties/Resources.Designer.cs new file mode 100644 index 000000000..c7bf3ebac --- /dev/null +++ b/TestBenchFramework/Properties/Resources.Designer.cs @@ -0,0 +1,113 @@ +//------------------------------------------------------------------------------ +// +// 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 TBF.Properties { + using System; + + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TBF.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; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Headpic { + get { + object obj = ResourceManager.GetObject("Headpic", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap sensus_logo { + get { + object obj = ResourceManager.GetObject("sensus_logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap TestFailedImage { + get { + object obj = ResourceManager.GetObject("TestFailedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap TestNotDoneImage { + get { + object obj = ResourceManager.GetObject("TestNotDoneImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap TestPassedImage { + get { + object obj = ResourceManager.GetObject("TestPassedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/TestBenchFramework/Properties/Resources.resx b/TestBenchFramework/Properties/Resources.resx new file mode 100644 index 000000000..561300c8d --- /dev/null +++ b/TestBenchFramework/Properties/Resources.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\sensus-logo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\TestFailedImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\TestNotDoneImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\TestPassedImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Headpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/TestBenchFramework/Properties/Settings.Designer.cs b/TestBenchFramework/Properties/Settings.Designer.cs new file mode 100644 index 000000000..088683a2f --- /dev/null +++ b/TestBenchFramework/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1008 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace TBF.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/TestBenchFramework/Properties/Settings.settings b/TestBenchFramework/Properties/Settings.settings new file mode 100644 index 000000000..39645652a --- /dev/null +++ b/TestBenchFramework/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/TestBenchFramework/Resources/Headpic.png b/TestBenchFramework/Resources/Headpic.png new file mode 100644 index 000000000..003fb997c Binary files /dev/null and b/TestBenchFramework/Resources/Headpic.png differ diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs new file mode 100644 index 000000000..addc52895 --- /dev/null +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -0,0 +1,2145 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace TBF.Resources { + using System; + + + /// + /// 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 Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TBF.Resources.Strings", typeof(Strings).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; + } + } + + /// + /// Looks up a localized string similar to <none>. + /// + internal static string _none_ { + get { + return ResourceManager.GetString("_none_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (offline). + /// + internal static string _offline { + get { + return ResourceManager.GetString("_offline", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Activity. + /// + internal static string Activity { + get { + return ResourceManager.GetString("Activity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Add >. + /// + internal static string Add { + get { + return ResourceManager.GetString("Add", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add. + /// + internal static string AddBtnText { + get { + return ResourceManager.GetString("AddBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Administrator. + /// + internal static string Administrator { + get { + return ResourceManager.GetString("Administrator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Approval info.. + /// + internal static string Approval_info { + get { + return ResourceManager.GetString("Approval_info", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arrangements of tested meters. + /// + internal static string Arrangement_of_meters { + get { + return ResourceManager.GetString("Arrangement_of_meters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arrangement of tests. + /// + internal static string Arrangement_of_tests { + get { + return ResourceManager.GetString("Arrangement_of_tests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Available results:. + /// + internal static string Available_results { + get { + return ResourceManager.GetString("Available_results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to < Back. + /// + internal static string BackBtnText { + get { + return ResourceManager.GetString("BackBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Balance. + /// + internal static string Balance { + get { + return ResourceManager.GetString("Balance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bench. + /// + internal static string Bench_chdr { + get { + return ResourceManager.GetString("Bench_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench is not running, however you can change the settings to resolve the problem.. + /// + internal static string Bench_is_not_running { + get { + return ResourceManager.GetString("Bench_is_not_running", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench name conflict, use another name please. + /// + internal static string Bench_name_conflict_Use_another_name_pls { + get { + return ResourceManager.GetString("Bench_name_conflict_Use_another_name_pls", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bench parameters. + /// + internal static string Bench_parameters { + get { + return ResourceManager.GetString("Bench_parameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calibration Specialist. + /// + internal static string Calibration_Specialist { + get { + return ResourceManager.GetString("Calibration_Specialist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + internal static string CancelBtnText { + get { + return ResourceManager.GetString("CancelBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear results. + /// + internal static string Clear_results { + get { + return ResourceManager.GetString("Clear_results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear. + /// + internal static string ClearBtnText { + get { + return ResourceManager.GetString("ClearBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to close. + /// + internal static string close { + get { + return ResourceManager.GetString("close", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close emptying valve. + /// + internal static string Close_emptying_valve { + get { + return ResourceManager.GetString("Close_emptying_valve", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close. + /// + internal static string CloseBtnText { + get { + return ResourceManager.GetString("CloseBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Combined meters. + /// + internal static string Combined_meters { + get { + return ResourceManager.GetString("Combined_meters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Component. + /// + internal static string Component { + get { + return ResourceManager.GetString("Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration. + /// + internal static string Configuration { + get { + return ResourceManager.GetString("Configuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configure. + /// + internal static string Configure { + get { + return ResourceManager.GetString("Configure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configure test benches (password required). + /// + internal static string ConfigureDatabaseText { + get { + return ResourceManager.GetString("ConfigureDatabaseText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirmation. + /// + internal static string Confirmation { + get { + return ResourceManager.GetString("Confirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connection string. + /// + internal static string Connection_string { + get { + return ResourceManager.GetString("Connection_string", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy. + /// + internal static string CopyBtnText { + get { + return ResourceManager.GetString("CopyBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Corrected. + /// + internal static string Corrected { + get { + return ResourceManager.GetString("Corrected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Correction [g]. + /// + internal static string Correction_g { + get { + return ResourceManager.GetString("Correction_g", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Correction [l/h]. + /// + internal static string Correction_lph { + get { + return ResourceManager.GetString("Correction_lph", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Correction [mbar]. + /// + internal static string Correction_mbar { + get { + return ResourceManager.GetString("Correction_mbar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create DB. + /// + internal static string Create_DB { + get { + return ResourceManager.GetString("Create_DB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Database type. + /// + internal static string Database_type { + get { + return ResourceManager.GetString("Database_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The database was successfully created!. + /// + internal static string DB_was_successfully_created { + get { + return ResourceManager.GetString("DB_was_successfully_created", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The database will be overwritten. + /// + internal static string DB_will_be_overwritten { + get { + return ResourceManager.GetString("DB_will_be_overwritten", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Description. + /// + internal static string DescriptionColHdr { + get { + return ResourceManager.GetString("DescriptionColHdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Detection completed. + /// + internal static string Detection_completed { + get { + return ResourceManager.GetString("Detection_completed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Detection threshold [%]. + /// + internal static string DetectionThresholdPct { + get { + return ResourceManager.GetString("DetectionThresholdPct", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Diverter. + /// + internal static string Diverter { + get { + return ResourceManager.GetString("Diverter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you want to proceed?. + /// + internal static string Do_you_want_to_proceed { + get { + return ResourceManager.GetString("Do_you_want_to_proceed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you want to save the procedure?. + /// + internal static string Do_you_want_to_save_the_procedure { + get { + return ResourceManager.GetString("Do_you_want_to_save_the_procedure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Down. + /// + internal static string DownBtnText { + get { + return ResourceManager.GetString("DownBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duration [s]. + /// + internal static string Duration_s { + get { + return ResourceManager.GetString("Duration_s", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edit. + /// + internal static string EditBtnText { + get { + return ResourceManager.GetString("EditBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Emergency STOP. + /// + internal static string Emergency_STOP { + get { + return ResourceManager.GetString("Emergency_STOP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Emptying. + /// + internal static string Emptying_chdr { + get { + return ResourceManager.GetString("Emptying_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Emptying ({0}: step {1}/{2}). + /// + internal static string Emptying_i_n { + get { + return ResourceManager.GetString("Emptying_i_n", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Emptying the tank. + /// + internal static string Emptying_tank { + get { + return ResourceManager.GetString("Emptying_tank", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Emptying valve. + /// + internal static string Emptying_valve { + get { + return ResourceManager.GetString("Emptying_valve", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter password. + /// + internal static string Enter_password { + get { + return ResourceManager.GetString("Enter_password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Err. cor. - [%]. + /// + internal static string Err_cor_neg_pct_chdr { + get { + return ResourceManager.GetString("Err_cor_neg_pct_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Err. cor. +[%]. + /// + internal static string Err_cor_pos_pct_chdr { + get { + return ResourceManager.GetString("Err_cor_pos_pct_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Err. Limit - [%]. + /// + internal static string Err_limit_neg_pct_chdr { + get { + return ResourceManager.GetString("Err_limit_neg_pct_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Err. Limit + [%]. + /// + internal static string Err_limit_pos_pct_chdr { + get { + return ResourceManager.GetString("Err_limit_pos_pct_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error. + /// + internal static string Error { + get { + return ResourceManager.GetString("Error", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error loading users from the database:. + /// + internal static string Error_loading_users_from_the_database { + get { + return ResourceManager.GetString("Error_loading_users_from_the_database", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error while creating the database. Reason: . + /// + internal static string Error_while_creating_DB_Reason { + get { + return ResourceManager.GetString("Error_while_creating_DB_Reason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exit. + /// + internal static string ExitBtnText { + get { + return ResourceManager.GetString("ExitBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOK. + /// + internal static string Failed { + get { + return ResourceManager.GetString("Failed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to create a sample database:. + /// + internal static string Failed_to_create_a_sample_database { + get { + return ResourceManager.GetString("Failed_to_create_a_sample_database", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to export the database:. + /// + internal static string Failed_to_export_the_database { + get { + return ResourceManager.GetString("Failed_to_export_the_database", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Feeding. + /// + internal static string Feeding_chdr { + get { + return ResourceManager.GetString("Feeding_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fill the test bench with water?. + /// + internal static string Fill_with_water { + get { + return ResourceManager.GetString("Fill_with_water", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finish. + /// + internal static string FinishBtnText { + get { + return ResourceManager.GetString("FinishBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Flow [m3/h]. + /// + internal static string Flow_m3h { + get { + return ResourceManager.GetString("Flow_m3h", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Flow Selection. + /// + internal static string Flow_selection { + get { + return ResourceManager.GetString("Flow_selection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Get mass of water in the tank. + /// + internal static string Get_mass_of_water_in_the_tank { + get { + return ResourceManager.GetString("Get_mass_of_water_in_the_tank", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Head of Lab. + /// + internal static string Head_of_Lab { + get { + return ResourceManager.GetString("Head_of_Lab", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Horizontally. + /// + internal static string Horizontally { + get { + return ResourceManager.GetString("Horizontally", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignore. + /// + internal static string Ignore { + get { + return ResourceManager.GetString("Ignore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid password. + /// + internal static string Invalid_password { + get { + return ResourceManager.GetString("Invalid_password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid user, password, or bench. + /// + internal static string Invalid_user_password_or_bench { + get { + return ResourceManager.GetString("Invalid_user_password_or_bench", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid username or password. + /// + internal static string Invalid_username_or_password { + get { + return ResourceManager.GetString("Invalid_username_or_password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Loading the procedure. + /// + internal static string Loading_the_procedure { + get { + return ResourceManager.GetString("Loading_the_procedure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lock. + /// + internal static string LockBtnText { + get { + return ResourceManager.GetString("LockBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logging. + /// + internal static string Logging { + get { + return ResourceManager.GetString("Logging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maintenance Specialist. + /// + internal static string Maintenance_Specialist { + get { + return ResourceManager.GetString("Maintenance_Specialist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Make tank empty. + /// + internal static string Make_tank_empty { + get { + return ResourceManager.GetString("Make_tank_empty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mass [kg]. + /// + internal static string Mass_kg { + get { + return ResourceManager.GetString("Mass_kg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (max. _X_ alphanumeric characters). + /// + internal static string MaxChars { + get { + return ResourceManager.GetString("MaxChars", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Measure the mass. + /// + internal static string Measure_the_mass { + get { + return ResourceManager.GetString("Measure_the_mass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Measured. + /// + internal static string Measured { + get { + return ResourceManager.GetString("Measured", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Measuring the weight. + /// + internal static string Measuring_the_weight { + get { + return ResourceManager.GetString("Measuring_the_weight", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test method. + /// + internal static string Method_chdr { + get { + return ResourceManager.GetString("Method_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test method selection. + /// + internal static string Method_selection { + get { + return ResourceManager.GetString("Method_selection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Metrological class. + /// + internal static string Metrological_class { + get { + return ResourceManager.GetString("Metrological_class", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Metrologist. + /// + internal static string Metrologist { + get { + return ResourceManager.GetString("Metrologist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Metrology. + /// + internal static string Metrology { + get { + return ResourceManager.GetString("Metrology", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mode. + /// + internal static string Mode { + get { + return ResourceManager.GetString("Mode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name. + /// + internal static string Name { + get { + return ResourceManager.GetString("Name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PBench. + /// + internal static string New_bench_path_name { + get { + return ResourceManager.GetString("New_bench_path_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PFeed. + /// + internal static string New_feeding_path_name { + get { + return ResourceManager.GetString("New_feeding_path_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Copy. + /// + internal static string New_name_copy { + get { + return ResourceManager.GetString("New_name_copy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PQ. + /// + internal static string New_output_path_name { + get { + return ResourceManager.GetString("New_output_path_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Procedure. + /// + internal static string New_procedure_name { + get { + return ResourceManager.GetString("New_procedure_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PSens. + /// + internal static string New_sensors_path_name { + get { + return ResourceManager.GetString("New_sensors_path_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test. + /// + internal static string New_test_name { + get { + return ResourceManager.GetString("New_test_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New transition name. + /// + internal static string New_transition_name { + get { + return ResourceManager.GetString("New_transition_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Tab. + /// + internal static string NewTabBtnText { + get { + return ResourceManager.GetString("NewTabBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Next >. + /// + internal static string NextBtnText { + get { + return ResourceManager.GetString("NextBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to no. + /// + internal static string no { + get { + return ResourceManager.GetString("no", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No test bench in the program configuration.. + /// + internal static string NoBenchMsg { + get { + return ResourceManager.GetString("NoBenchMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + internal static string NoBtn { + get { + return ResourceManager.GetString("NoBtn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot connect to the database.. + /// + internal static string NoDatabaseMsg { + get { + return ResourceManager.GetString("NoDatabaseMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <nothing to configure>. + /// + internal static string nothing_to_configure { + get { + return ResourceManager.GetString("nothing_to_configure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Notification. + /// + internal static string Notification { + get { + return ResourceManager.GetString("Notification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nr.. + /// + internal static string Nr { + get { + return ResourceManager.GetString("Nr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + internal static string OkBtnText { + get { + return ResourceManager.GetString("OkBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to open. + /// + internal static string open { + get { + return ResourceManager.GetString("open", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Output. + /// + internal static string Output_chdr { + get { + return ResourceManager.GetString("Output_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to P in. + /// + internal static string P_in { + get { + return ResourceManager.GetString("P_in", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to P out. + /// + internal static string P_out { + get { + return ResourceManager.GetString("P_out", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameters. + /// + internal static string Parameters { + get { + return ResourceManager.GetString("Parameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent. + /// + internal static string Parent { + get { + return ResourceManager.GetString("Parent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + internal static string Passed { + get { + return ResourceManager.GetString("Passed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password. + /// + internal static string Password { + get { + return ResourceManager.GetString("Password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please change the following settings:. + /// + internal static string Please_change_the_following_settings { + get { + return ResourceManager.GetString("Please_change_the_following_settings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please select a cycle, a_test or empty. + /// + internal static string Please_select_a_cycle_a_test_or_empty { + get { + return ResourceManager.GetString("Please_select_a_cycle_a_test_or_empty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please select a procedure. + /// + internal static string Please_select_a_procedure { + get { + return ResourceManager.GetString("Please_select_a_procedure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please select a test. + /// + internal static string Please_select_a_test { + get { + return ResourceManager.GetString("Please_select_a_test", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please, select a test bench. + /// + internal static string PLs_select_testbench { + get { + return ResourceManager.GetString("PLs_select_testbench", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Power [%]. + /// + internal static string PowerPct { + get { + return ResourceManager.GetString("PowerPct", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pressure [bar]. + /// + internal static string Pressure_bar { + get { + return ResourceManager.GetString("Pressure_bar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pressure meter. + /// + internal static string Pressure_meter { + get { + return ResourceManager.GetString("Pressure_meter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Printer. + /// + internal static string Printer { + get { + return ResourceManager.GetString("Printer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Procedure. + /// + internal static string Procedure { + get { + return ResourceManager.GetString("Procedure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Procedures. + /// + internal static string Procedures { + get { + return ResourceManager.GetString("Procedures", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Producer. + /// + internal static string Producer { + get { + return ResourceManager.GetString("Producer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Progress. + /// + internal static string Progress { + get { + return ResourceManager.GetString("Progress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Properties. + /// + internal static string Properties { + get { + return ResourceManager.GetString("Properties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pulses per liter. + /// + internal static string PulsesPerLtr { + get { + return ResourceManager.GetString("PulsesPerLtr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pump. + /// + internal static string Pump { + get { + return ResourceManager.GetString("Pump", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purging. + /// + internal static string Purging { + get { + return ResourceManager.GetString("Purging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purging ({0}: step {1}/{2}). + /// + internal static string Purging_i_n { + get { + return ResourceManager.GetString("Purging_i_n", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q from [l/h]. + /// + internal static string Q_from_lph { + get { + return ResourceManager.GetString("Q_from_lph", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q from [m3/h]. + /// + internal static string Q_from_m3h { + get { + return ResourceManager.GetString("Q_from_m3h", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q-Set Method. + /// + internal static string Q_set_method_chdr { + get { + return ResourceManager.GetString("Q_set_method_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q to [l/h]. + /// + internal static string Q_to_lph { + get { + return ResourceManager.GetString("Q_to_lph", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q to [m3/h]. + /// + internal static string Q_to_m3h { + get { + return ResourceManager.GetString("Q_to_m3h", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Qn. + /// + internal static string Qn { + get { + return ResourceManager.GetString("Qn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Question. + /// + internal static string Question { + get { + return ResourceManager.GetString("Question", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rate of change [%]. + /// + internal static string RateOfChangePct { + get { + return ResourceManager.GetString("RateOfChangePct", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ready. + /// + internal static string Ready { + get { + return ResourceManager.GetString("Ready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Red. type. + /// + internal static string Red_type_chdr { + get { + return ResourceManager.GetString("Red_type_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reference. + /// + internal static string Reference { + get { + return ResourceManager.GetString("Reference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reg. valve. + /// + internal static string Reg_valve { + get { + return ResourceManager.GetString("Reg_valve", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Relative Q from. + /// + internal static string RelativeQfrom { + get { + return ResourceManager.GetString("RelativeQfrom", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Relative Q to. + /// + internal static string RelativeQto { + get { + return ResourceManager.GetString("RelativeQto", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to < &Remove. + /// + internal static string Remove { + get { + return ResourceManager.GetString("Remove", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to << R&emove all. + /// + internal static string Remove_all { + get { + return ResourceManager.GetString("Remove_all", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove. + /// + internal static string RemoveBtnText { + get { + return ResourceManager.GetString("RemoveBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Tab. + /// + internal static string RemoveTabBtnText { + get { + return ResourceManager.GetString("RemoveTabBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rename Tab. + /// + internal static string RenameTabBtnText { + get { + return ResourceManager.GetString("RenameTabBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repeats nr.. + /// + internal static string Repeats_nr_chdr { + get { + return ResourceManager.GetString("Repeats_nr_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must restart to apply these changes. + /// + internal static string Restart_To_Apply_Changes { + get { + return ResourceManager.GetString("Restart_To_Apply_Changes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Retry connection to the database. + /// + internal static string RetryDatabaseText { + get { + return ResourceManager.GetString("RetryDatabaseText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ROI Detection in Progress. + /// + internal static string ROI_Detection_in_Progress { + get { + return ResourceManager.GetString("ROI_Detection_in_Progress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected results:. + /// + internal static string Selected_results { + get { + return ResourceManager.GetString("Selected_results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sensor . + /// + internal static string Sensor_ { + get { + return ResourceManager.GetString("Sensor_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sensors. + /// + internal static string Sensors { + get { + return ResourceManager.GetString("Sensors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sensors. + /// + internal static string Sensors_chdr { + get { + return ResourceManager.GetString("Sensors_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set flow. + /// + internal static string Set_flow { + get { + return ResourceManager.GetString("Set_flow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set route. + /// + internal static string Set_route { + get { + return ResourceManager.GetString("Set_route", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting the flow. + /// + internal static string Setting_the_flow { + get { + return ResourceManager.GetString("Setting_the_flow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start the pump. + /// + internal static string Start_the_pump { + get { + return ResourceManager.GetString("Start_the_pump", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start the test. + /// + internal static string Start_the_test { + get { + return ResourceManager.GetString("Start_the_test", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting the cameras. + /// + internal static string Starting_the_cameras { + get { + return ResourceManager.GetString("Starting_the_cameras", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop the pump. + /// + internal static string Stop_the_pump { + get { + return ResourceManager.GetString("Stop_the_pump", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop the test. + /// + internal static string Stop_the_test { + get { + return ResourceManager.GetString("Stop_the_test", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping. + /// + internal static string Stopping { + get { + return ResourceManager.GetString("Stopping", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string String1 { + get { + return ResourceManager.GetString("String1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Switching flow detection. + /// + internal static string Switching_flow_detection { + get { + return ResourceManager.GetString("Switching_flow_detection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T div.. + /// + internal static string T_div { + get { + return ResourceManager.GetString("T_div", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T in. + /// + internal static string T_in { + get { + return ResourceManager.GetString("T_in", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T out. + /// + internal static string T_out { + get { + return ResourceManager.GetString("T_out", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target Q [m3/h]. + /// + internal static string TargetQ { + get { + return ResourceManager.GetString("TargetQ", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tarring. + /// + internal static string Tarring { + get { + return ResourceManager.GetString("Tarring", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test. + /// + internal static string Test { + get { + return ResourceManager.GetString("Test", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench. + /// + internal static string Test_bench { + get { + return ResourceManager.GetString("Test_bench", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test Bench Components Configuration. + /// + internal static string Test_Bench_Components_Configuration { + get { + return ResourceManager.GetString("Test_Bench_Components_Configuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test Bench Databases Specification. + /// + internal static string Test_Bench_Databases_Specification { + get { + return ResourceManager.GetString("Test_Bench_Databases_Specification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench is controlled by this computer. + /// + internal static string Test_bench_is_controlled_by_this_computer { + get { + return ResourceManager.GetString("Test_bench_is_controlled_by_this_computer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench name. + /// + internal static string Test_bench_name { + get { + return ResourceManager.GetString("Test_bench_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test bench number. + /// + internal static string Test_bench_number { + get { + return ResourceManager.GetString("Test_bench_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test. + /// + internal static string Test_chdr { + get { + return ResourceManager.GetString("Test_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test completed. + /// + internal static string Test_completed { + get { + return ResourceManager.GetString("Test_completed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test connection. + /// + internal static string Test_connection { + get { + return ResourceManager.GetString("Test_connection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test in progress. + /// + internal static string Test_in_progress { + get { + return ResourceManager.GetString("Test_in_progress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test. + /// + internal static string Test_measured_corrected { + get { + return ResourceManager.GetString("Test_measured_corrected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test method. + /// + internal static string Test_method { + get { + return ResourceManager.GetString("Test_method", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test name. + /// + internal static string Test_name { + get { + return ResourceManager.GetString("Test_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test preparation. + /// + internal static string Test_preparation { + get { + return ResourceManager.GetString("Test_preparation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test start ({0}: step {1}/{2}). + /// + internal static string Test_start_sequence_i_n { + get { + return ResourceManager.GetString("Test_start_sequence_i_n", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test stop ({0}: step {1}/{2}). + /// + internal static string Test_stop_sequence_i_n { + get { + return ResourceManager.GetString("Test_stop_sequence_i_n", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test time [s]. + /// + internal static string Test_time_s_chdr { + get { + return ResourceManager.GetString("Test_time_s_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tester. + /// + internal static string Tester { + get { + return ResourceManager.GetString("Tester", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap testFailedImage { + get { + object obj = ResourceManager.GetObject("testFailedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Testing Specialist. + /// + internal static string Testing_Specialist { + get { + return ResourceManager.GetString("Testing_Specialist", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap testNotDoneImage { + get { + object obj = ResourceManager.GetObject("testNotDoneImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap testPassedImage { + get { + object obj = ResourceManager.GetObject("testPassedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Tests are columns. + /// + internal static string Tests_are_columns { + get { + return ResourceManager.GetString("Tests_are_columns", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tests are rows. + /// + internal static string Tests_are_rows { + get { + return ResourceManager.GetString("Tests_are_rows", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Toler. red. [%]. + /// + internal static string Tol_red_pct_chdr { + get { + return ResourceManager.GetString("Tol_red_pct_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transition - End. + /// + internal static string TransitionEnd_chdr { + get { + return ResourceManager.GetString("TransitionEnd_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transitions. + /// + internal static string Transitions { + get { + return ResourceManager.GetString("Transitions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transition - Start. + /// + internal static string TransitionStart_chdr { + get { + return ResourceManager.GetString("TransitionStart_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + internal static string Type { + get { + return ResourceManager.GetString("Type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unhandled error occured in . + /// + internal static string Unhandled_error_occured_in_ { + get { + return ResourceManager.GetString("Unhandled_error_occured_in_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unlock. + /// + internal static string UnlockBtnText { + get { + return ResourceManager.GetString("UnlockBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Up. + /// + internal static string UpBtnText { + get { + return ResourceManager.GetString("UpBtnText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User : . + /// + internal static string User_ { + get { + return ResourceManager.GetString("User_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User Login. + /// + internal static string User_Login { + get { + return ResourceManager.GetString("User_Login", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name. + /// + internal static string User_name { + get { + return ResourceManager.GetString("User_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Username. + /// + internal static string Username { + get { + return ResourceManager.GetString("Username", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This Username has already been taken. Please choose another one.. + /// + internal static string Username_taken { + get { + return ResourceManager.GetString("Username_taken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Users and groups. + /// + internal static string Users_and_groups { + get { + return ResourceManager.GetString("Users_and_groups", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Version. + /// + internal static string Version { + get { + return ResourceManager.GetString("Version", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vertically. + /// + internal static string Vertically { + get { + return ResourceManager.GetString("Vertically", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Volume and error limit selection. + /// + internal static string Volume_and_error_selection { + get { + return ResourceManager.GetString("Volume_and_error_selection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Volume [l]. + /// + internal static string Volume_ltr_chdr { + get { + return ResourceManager.GetString("Volume_ltr_chdr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Warning. + /// + internal static string Warning { + get { + return ResourceManager.GetString("Warning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Water meter data. + /// + internal static string Water_meter_data { + get { + return ResourceManager.GetString("Water_meter_data", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Water meter types. + /// + internal static string Water_meter_types { + get { + return ResourceManager.GetString("Water_meter_types", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Water meters. + /// + internal static string Water_meters { + get { + return ResourceManager.GetString("Water_meters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to yes. + /// + internal static string yes { + get { + return ResourceManager.GetString("yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + internal static string YesBtn { + get { + return ResourceManager.GetString("YesBtn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zeroing. + /// + internal static string Zeroing_chdr { + get { + return ResourceManager.GetString("Zeroing_chdr", resourceCulture); + } + } + } +} diff --git a/TestBenchFramework/Resources/Strings.de.Designer.cs b/TestBenchFramework/Resources/Strings.de.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/TestBenchFramework/Resources/Strings.de.resx b/TestBenchFramework/Resources/Strings.de.resx new file mode 100644 index 000000000..7f35f2551 --- /dev/null +++ b/TestBenchFramework/Resources/Strings.de.resx @@ -0,0 +1,738 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Fehler + + + Fehler beim Laden der Benutzer aus der Datenbank. + + + Fehler beim Erzeugen der Bespiel-Ddaten. + + + Fehler beim Exportieren der Datenbank. + + + Ungueltiger Benutzername, Passwort oder Prüfstand + + + Passwort + + + Bitte wählen Sie einen Prüfstand aus. + + + Bitte starten Sie die Anwendung erneut um die Änderungen zu übernehmen. + + + Prüfstandsdaten + + + Benutzername + + + Warnung + + + (maximal _X_ alphanumerische Zeichen) + + + Dieser Benutzername ist bereits vergeben. Bitte wählen Sie einen anderen. + + + geschl. + + + Klappe + + + Beh.Leeren + + + Name + + + offen + + + Pumpe + + + P ein. + + + P aus. + + + Q von + + + Q bis + + + IDM + + + Reg.Ventil + + + Waage + + + Messs. + + + T Klappe + + + T ein. + + + T aus. + + + Drucksensor + + + Dauer [s] + + + Nein + + + ja + + + PBank + + + PS + + + PQ + + + Prüfung + + + PMess + + + Prüfpunkt + + + - Kopie + + + Benutzername + + + Anmelden + + + Neu + + + Abbrechen + + + Kopieren + + + Abwärts + + + Bearbeiten + + + OK + + + Löschen + + + Aufwärts + + + Beenden + + + Ändern + + + Beschreibung + + + Prüfung + + + Prüfvorlagen + + + Prüfpunkt + + + Prüfstrecke + + + Leeren + + + Fehl. Korr.- [%] + + + Fehl. Korr.+ [%] + + + Fehlergrenze - [%] + + + Fehlergrenze + [%] + + + Eingang + + + Prüfenvahren + + + Regelstrecke + + + Q von [l/h] + + + Q von [m3/h] + + + Q-Set Methode + + + Q bis [l/h] + + + Q bis [m3/h] + + + Reduktionsart + + + Wiederh. Nr. + + + Abtastsysteme + + + Prüfpunkt + + + Tol. Abzug [%] + + + Volumen [l] + + + Nullstellen + + + Dauer [s] + + + Metr.Daten + + + Benutzer : + + + Die Prüfstation läuft nicht. Sie können die Einstellungen ändern, um das Problem zu löschen. + + + Der Prüfstationsname ist ungültig. Bitte wählen Sie einen anderen Namen. + + + Prüfstation konfigurieren (Passwort erforderlich) + + + Bestätigung + + + korrigiert + + + Korrektur [g] + + + Korrektur [l/h] + + + Korrektur [mbar] + + + Die Datenbank wurde erfolgreich erstellt. + + + Die vorhandene Datenbank wird überschrieben. + + + Möchten Sie fortfahren? + + + Möchten Sie den Prüfvorgang speichern? + + + Passwort eingeben. + + + Fehler beim Erzeugen der Datenbank. + + + Beenden + + + Durchfluss [m³/h] + + + Ungültiges Passwort + + + Ungültiger Benutzername oder Passwort + + + Abschließen + + + Masse [kg] + + + Gemessen + + + Es ist keine Prüfstation in der Programmkonfiguration definiert. + + + Datenbankverbindung konnte nicht hergestellt werden. + + + Benachrichtigung + + + Nr. + + + Bitte ändern Sie die folgenden Einstellungen: + + + Druck [bar] + + + Eigenschaften + + + Datenbankverbindung wiederherstellen + + + Es trat ein unbehandelter Fehler auf in + + + (Getrennt) + + + Administrator + + + Kalibriertechniker + + + Laborleiter + + + Wartungstechniker + + + Messtechniker + + + Prüfer + + + Prüftechniker + + + schließe das Leeren-Ventil + + + Ermittle das Gewicht des Wassers im Tank + + + Ignorieren + + + Laden des Prüfvorgangs + + + Tank leeren + + + wiegen + + + Wählen Sie einen Prüfvorgang + + + Bitte wählen Sie eine Prüfung aus. + + + Befüllen + + + Fertig + + + setze Durchfluss + + + Setze Route + + + Starte die Pumpe + + + Starte die Prüfung + + + am stoppen + + + Stoppe die Pumpe + + + Stoppe die Prüfung + + + Tara setzen + + + Prüfung läuft + + + Prüfvorlage + + + < Zurück + + + Weiter > + + + <kein> + + + Messsensoren + + + Prüfenvahren + + + Ergebnise leeren + + + Konfigurieren + + + Arrangement_of_meters + + + Arrangement_of_tests + + + Horizontal + + + Prüfpunkte sind Spalten + + + Prüfpunkte sind Zeilen + + + Vertikal + + + Konfiguration + + + NiO + + + iO + + + Leeren + + + Tank entleeren + + + Wiegen + + + Prüfdurchfluss anfahren + + + Prüfpunkt fertiggestellt + + + Prüfpunktvorbereitung + + + Prüfstand befüllen ({0}/{1}) + + + Prüfstand leeren ({0}/{1}) + + + Beenden + + + Umschaltpunkt suchen + + + Aktivität + + + Verlauf + + + Ende + + + Ziel Q [m3/h] + + + Zulassungszeichen + + + Metr. Klasse + + + Hersteller + + + Zählers + + + Drucker + + + Version + + + Prüfstand Nr. + + + <nothing to configure> + + + Füllen mit Wasser ? + + + Nein + + + Frage + + + Ja + + + Prüfstand Parameter + + + Verbindungszeichenfolge + + + Datenbank erzeugen + + + Datenbank Typ + + + Prüfstand wird von diesem Computer gesteuert + + + Prüfstandsname + + + Teste Verbindung + + + Benutzer und Gruppen + + + Wasserzähler Daten + + + Wasserzähler Typen + + + Protokoll + + + Modus + + + Parameter + + + übergeordnete Komponente + + + Type + + + Prüfstandskomponenten Konfiguration + + + Übergänge + + + Komponente + + + Schwellwert [%] + + + Impulse pro Liter + + + Änderungsrate [%] + + + Relatives Q von + + + Relatives Q bis + + + Ubergang - Ende + + + Ubergang - Start + + \ No newline at end of file diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx new file mode 100644 index 000000000..1cdf7db64 --- /dev/null +++ b/TestBenchFramework/Resources/Strings.resx @@ -0,0 +1,814 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Confirmation + + + Do you want to save the procedure? + + + Error + + + Error loading users from the database: + + + Failed to create a sample database: + + + Failed to export the database: + + + Invalid user, password, or bench + + + Password + + + Please, select a test bench + + + You must restart to apply these changes + + + Test bench + + + User name + + + Warning + + + (max. _X_ alphanumeric characters) + + + This Username has already been taken. Please choose another one. + + + close + + + Diverter + + + Emptying valve + + + Name + + + open + + + Pump + + + P in + + + P out + + + Q from [m3/h] + + + Q to [m3/h] + + + Reference + + + Reg. valve + + + Balance + + + Sensor + + + T div. + + + T in + + + T out + + + Pressure meter + + + Duration [s] + + + no + + + yes + + + PBench + + + PFeed + + + PQ + + + Procedure + + + PSens + + + Test + + + - Copy + + + Correction [g] + + + Nr. + + + Mass [kg] + + + Add + + + Cancel + + + Close + + + Lock + + + Remove + + + Unlock + + + OK + + + Correction [l/h] + + + Correction [mbar] + + + Flow [m3/h] + + + Pressure [bar] + + + Invalid username or password + + + Username + + + User Login + + + Copy + + + Down + + + Edit + + + Up + + + Cannot connect to the database. + + + Configure test benches (password required) + + + Exit + + + Retry connection to the database + + + Enter password + + + Invalid password + + + Test bench name conflict, use another name please + + + The database was successfully created! + + + The database will be overwritten + + + Do you want to proceed? + + + Notification + + + No test bench in the program configuration. + + + Description + + + Procedures + + + Procedure + + + Test + + + Corrected + + + Measured + + + Test + + + Test bench is not running, however you can change the settings to resolve the problem. + + + Volume [l] + + + Emptying + + + Q-Set Method + + + Repeats nr. + + + Test + + + Zeroing + + + Bench + + + Err. cor. - [%] + + + Err. cor. +[%] + + + Err. Limit - [%] + + + Err. Limit + [%] + + + Feeding + + + Output + + + Q from [l/h] + + + Q to [l/h] + + + Red. type + + + Sensors + + + Toler. red. [%] + + + Test time [s] + + + Error while creating the database. Reason: + + + Metrology + + + Please change the following settings: + + + Properties + + + Unhandled error occured in + + + User : + + + (offline) + + + Administrator + + + Calibration Specialist + + + Head of Lab + + + Maintenance Specialist + + + Metrologist + + + Tester + + + Testing Specialist + + + Close emptying valve + + + Get mass of water in the tank + + + Ignore + + + Loading the procedure + + + Make tank empty + + + Measure the mass + + + Please select a procedure + + + Please select a test + + + Purging + + + Ready + + + Set flow + + + Set route + + + Start the pump + + + Start the test + + + Stopping + + + Stop the pump + + + Stop the test + + + Tarring + + + Test in progress + + + < Back + + + Finish + + + Next > + + + Flow Selection + + + Test name + + + Test method + + + Relative Q from + + + Relative Q to + + + Target Q [m3/h] + + + Combined meters + + + Detection threshold [%] + + + Rate of change [%] + + + Pulses per liter + + + Component + + + <none> + + + Test method selection + + + Sensors + + + Test method + + + Volume and error limit selection + + + + testFailedImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + testNotDoneImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + testPassedImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Clear results + + + Configure + + + Arrangements of tested meters + + + Arrangement of tests + + + Horizontally + + + Tests are columns + + + Tests are rows + + + Vertically + + + Configuration + + + NOK + + + OK + + + Clear + + + Emptying the tank + + + Measuring the weight + + + Setting the flow + + + Test completed + + + Test preparation + + + Purging ({0}: step {1}/{2}) + + + Emptying ({0}: step {1}/{2}) + + + Switching flow detection + + + Activity + + + Progress + + + + + + Please select a cycle, a_test or empty + + + Approval info. + + + Metrological class + + + Producer + + + Qn + + + Water meters + + + Printer + + + Version + + + Test bench number + + + <nothing to configure> + + + Fill the test bench with water? + + + No + + + Question + + + Yes + + + Bench parameters + + + Connection string + + + Create DB + + + Database type + + + Test Bench Databases Specification + + + Test bench is controlled by this computer + + + Test bench name + + + Test connection + + + Users and groups + + + Water meter data + + + Water meter types + + + Logging + + + Mode + + + Parameters + + + Parent + + + Type + + + Test Bench Components Configuration + + + Transitions + + + New Tab + + + Remove Tab + + + Rename Tab + + + New transition name + + + Power [%] + + + ROI Detection in Progress + + + Detection completed + + + Emergency STOP + + + Transition - End + + + Transition - Start + + + Starting the cameras + + + Test start ({0}: step {1}/{2}) + + + Test stop ({0}: step {1}/{2}) + + + &Add > + + + Available results: + + + < &Remove + + + << R&emove all + + + Selected results: + + \ No newline at end of file diff --git a/TestBenchFramework/Resources/Strings.sk.resx b/TestBenchFramework/Resources/Strings.sk.resx new file mode 100644 index 000000000..43d4b6faa --- /dev/null +++ b/TestBenchFramework/Resources/Strings.sk.resx @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + zavri + + + Klapka + + + Vypúšťací ventil + + + Chyba + + + Nepodarilo sa načítať používateľov z databázy: + + + Nepodarilo sa vytvoriť vzorovú databázu: + + + Nepodarilo sa exportovať databázu: + + + Neplatný používateľ, heslo alebo meno stanice + + + Názov + + + otvor + + + Heslo + + + Čerpadlo + + + P vst. + + + P výst. + + + Q od + + + Q do + + + Etalón + + + Reg. ventil + + + Aby sa zmenilo nastavenie jazyka musíte preštartovať program. + + + Váha + + + Senzor + + + Testovacia stanica + + + T kl. + + + T vst. + + + T výst. + + + Meno používateľa + + + Tlakomer + + + Doba [s] + + + nie + + + áno + + + PStol + + + PNapaj. + + + PQ + + + Procedúra + + + PSens + + + Test + + + - kópia + + + Parametre stanice + + + Reťazec na vytvorenie spojenia + + + Vytvor DB + + + Typ databázy + + + Procedúry + + + Specifikácia databáz stanice + + + Stanica je riadená týmto počítačom + + + Názov stanice + + + Test spojenia + + + Používatelia a skupiny + + + Water meter data + + + Typy vodomerov + + + Logovanie + + + Režim + + + Parametre + + + Nadradený komponent + + + + + + Typ + + + Konfigurácia komponentov stanice + + \ No newline at end of file diff --git a/TestBenchFramework/Resources/TestFailedImage.png b/TestBenchFramework/Resources/TestFailedImage.png new file mode 100644 index 000000000..efe0770a1 Binary files /dev/null and b/TestBenchFramework/Resources/TestFailedImage.png differ diff --git a/TestBenchFramework/Resources/TestNotDoneImage.png b/TestBenchFramework/Resources/TestNotDoneImage.png new file mode 100644 index 000000000..1a42b7e55 Binary files /dev/null and b/TestBenchFramework/Resources/TestNotDoneImage.png differ diff --git a/TestBenchFramework/Resources/TestPassedImage.png b/TestBenchFramework/Resources/TestPassedImage.png new file mode 100644 index 000000000..5441ae6b4 Binary files /dev/null and b/TestBenchFramework/Resources/TestPassedImage.png differ diff --git a/TestBenchFramework/Resources/sensus-logo.png b/TestBenchFramework/Resources/sensus-logo.png new file mode 100644 index 000000000..7e98708a5 Binary files /dev/null and b/TestBenchFramework/Resources/sensus-logo.png differ diff --git a/TestBenchFramework/SampleConfig/SQLite.db b/TestBenchFramework/SampleConfig/SQLite.db new file mode 100644 index 000000000..cf4a96c48 Binary files /dev/null and b/TestBenchFramework/SampleConfig/SQLite.db differ diff --git a/TestBenchFramework/SampleConfig/config.xml b/TestBenchFramework/SampleConfig/config.xml new file mode 100644 index 000000000..12ac3a8b8 --- /dev/null +++ b/TestBenchFramework/SampleConfig/config.xml @@ -0,0 +1,55 @@ + + + en + + + TestBench-SQLite + true + + SQLite + SQLite.db + + + SQLite + SQLite.db + + + SQLite + SQLite.db + + + SQLite + SQLite.db + + + SQLite + SQLite.db + + + + TestBench-MySQL + true + + MySql + SERVER=localhost; DATABASE=sensor; UID=root; PASSWORD=; + + + MySql + SERVER=localhost; DATABASE=sensor; UID=root; PASSWORD=; + + + MySql + SERVER=localhost; DATABASE=sensor; UID=root; PASSWORD=; + + + MySql + SERVER=localhost; DATABASE=sensor; UID=root; PASSWORD=; + + + MySql + SERVER=localhost; DATABASE=sensor; UID=root; PASSWORD=; + + + + TestBench-SQLite + \ No newline at end of file diff --git a/TestBenchFramework/SampleConfig/fuzhou150.sql b/TestBenchFramework/SampleConfig/fuzhou150.sql new file mode 100644 index 000000000..9696e17cb --- /dev/null +++ b/TestBenchFramework/SampleConfig/fuzhou150.sql @@ -0,0 +1,742 @@ +-- phpMyAdmin SQL Dump +-- version 3.4.5 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Mar 16, 2014 at 05:28 PM +-- Server version: 5.5.16 +-- PHP Version: 5.3.8 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `fuzhou150` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `benchpath` +-- + +CREATE TABLE IF NOT EXISTS `benchpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `TempIn` varchar(255) DEFAULT NULL, + `TempOut` varchar(255) DEFAULT NULL, + `PressIn` varchar(255) DEFAULT NULL, + `PressOut` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; + +-- +-- Dumping data for table `benchpath` +-- + +INSERT INTO `benchpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `TempIn`, `TempOut`, `PressIn`, `PressOut`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 0, '', 0, 0, '---', '---', '---', '---', '', 'VL12;VM1;VM2;VM3'), +(2, 1, 'Bench-all', 0, 400, 'T1', 'T2', 'D1', 'D2', 'VL12', 'VM1;VM2;VM3'), +(3, 2, 'Bench-WM1', 0, 400, 'T1', 'T2', 'D1', 'D2', 'VL12;VM2;VM3', 'VM1'), +(4, 3, 'Bench-WM2', 0, 400, 'T1', 'T2', 'D1', 'D2', 'VL12;VM1;VM3', 'VM2'), +(5, 4, 'Bench-WM3', 0, 400, 'T1', 'T2', 'D1', 'D2', 'VL12;VM1;VM2', 'VM3'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `component` +-- + +CREATE TABLE IF NOT EXISTS `component` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `ClassName` varchar(255) DEFAULT NULL, + `ParentName` varchar(255) DEFAULT NULL, + `ItemNr` int(11) DEFAULT NULL, + `Mode` varchar(255) DEFAULT NULL, + `Logging` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=83 ; + +-- +-- Dumping data for table `component` +-- + +INSERT INTO `component` (`Id`, `Name`, `ClassName`, `ParentName`, `ItemNr`, `Mode`, `Logging`, `Parameters`) VALUES +(1, 'CB', 'ControlBoard', NULL, 0, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(2, 'W1', 'MettlerToledoBalanceSN', NULL, 1, 'Normal', 'Off', '\r\n\r\n 3\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 3000\r\n'), +(3, 'W2', 'MettlerToledoBalanceSN', NULL, 2, 'Normal', 'Off', '\r\n\r\n 4\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 150\r\n'), +(4, 'Ambient', 'Greco Ambient', NULL, 3, 'Normal', 'Off', '\r\n\r\n 9\r\n 19200\r\n None\r\n 8\r\n One\r\n None\r\n'), +(5, 'Camera1', 'IdcCamera', NULL, 4, 'Simulate', 'Off', '\r\n\r\n 21\r\n 57600\r\n 0.5\r\n'), +(6, 'Camera2', 'IdcCamera', NULL, 5, 'Simulate', 'Off', '\r\n\r\n 22\r\n 57600\r\n 0.5\r\n'), +(7, 'Camera3', 'IdcCamera', NULL, 6, 'Simulate', 'Off', '\r\n\r\n 23\r\n 57600\r\n 0.5\r\n'), +(8, 'Camera4', 'IdcCamera', NULL, 7, 'Simulate', 'Off', '\r\n\r\n 24\r\n 57600\r\n 0.5\r\n'), +(9, 'Camera5', 'IdcCamera', NULL, 8, 'Simulate', 'Off', '\r\n\r\n 25\r\n 57600\r\n 0.5\r\n'), +(10, 'Camera6', 'IdcCamera', NULL, 9, 'Simulate', 'Off', '\r\n\r\n 26\r\n 57600\r\n 0.5\r\n'), +(11, 'I1', 'FlowMeter', 'CB', 10, 'Normal', 'Off', '\r\n\r\n 1\r\n 350\r\n'), +(12, 'I2', 'FlowMeter', 'CB', 11, 'Normal', 'Off', '\r\n\r\n 2\r\n 50\r\n'), +(13, 'I3', 'FlowMeter', 'CB', 12, 'Normal', 'Off', '\r\n\r\n 3\r\n 7\r\n'), +(14, 'I4', 'FlowMeter', 'CB', 13, 'Normal', 'Off', '\r\n\r\n 4\r\n 0.5\r\n'), +(15, 'VIR1', 'RegulationValve', 'CB', 14, 'Normal', 'Off', '\r\n\r\n 1\r\n 100\r\n 500\r\n 20\r\n'), +(16, 'VIR2', 'RegulationValve', 'CB', 15, 'Normal', 'Off', '\r\n\r\n 2\r\n 100\r\n 500\r\n 20\r\n'), +(17, 'VIR3', 'RegulationValve', 'CB', 16, 'Normal', 'Off', '\r\n\r\n 3\r\n 100\r\n 500\r\n 20\r\n'), +(18, 'VIR41', 'RegulationValve', 'CB', 17, 'Normal', 'Off', '\r\n\r\n 4\r\n 100\r\n 500\r\n 20\r\n'), +(19, 'VIR42', 'RegulationValve', 'CB', 18, 'Normal', 'Off', '\r\n\r\n 5\r\n 100\r\n 500\r\n 20\r\n'), +(20, 'T1', 'TempMeter', 'CB', 19, 'Normal', 'Off', '\r\n\r\n 0\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(21, 'T2', 'TempMeter', 'CB', 20, 'Normal', 'Off', '\r\n\r\n 1\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(22, 'T3', 'TempMeter', 'CB', 21, 'Normal', 'Off', '\r\n\r\n 2\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(23, 'T4', 'TempMeter', 'CB', 22, 'Normal', 'Off', '\r\n\r\n 3\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(24, 'T5', 'TempMeter', 'CB', 23, 'Normal', 'Off', '\r\n\r\n 4\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(25, 'T6', 'TempMeter', 'CB', 24, 'Normal', 'Off', '\r\n\r\n 5\r\n -21.0116\r\n 0.0017727\r\n 6.8422E-10\r\n -7.40415E-16\r\n 0\r\n'), +(26, 'D1', 'PressureMeter', 'CB', 25, 'Normal', 'Off', '\r\n\r\n 0\r\n 98\r\n'), +(27, 'D2', 'PressureMeter', 'CB', 26, 'Normal', 'Off', '\r\n\r\n 1\r\n 99\r\n'), +(28, 'Div1', 'Diverter', 'CB', 27, 'Normal', 'Off', '\r\n\r\n 34\r\n'), +(29, 'Div2', 'Diverter', 'CB', 28, 'Normal', 'Off', '\r\n\r\n 35\r\n'), +(30, 'Div3', 'Diverter', 'CB', 29, 'Normal', 'Off', '\r\n\r\n 36\r\n'), +(31, 'VL11', 'Valve', 'CB', 30, 'Normal', 'Off', '\r\n\r\n 2\r\n \r\n false\r\n 0\r\n 0\r\n'), +(32, 'VL13', 'Valve', 'CB', 31, 'Normal', 'Off', '\r\n\r\n 3\r\n \r\n false\r\n 0\r\n 0\r\n'), +(33, 'VL4', 'Valve', 'CB', 32, 'Normal', 'Off', '\r\n\r\n 4\r\n \r\n false\r\n 0\r\n 0\r\n'), +(34, 'VZ6', 'Valve', 'CB', 33, 'Normal', 'Off', '\r\n\r\n 5\r\n \r\n false\r\n 0\r\n 0\r\n'), +(35, 'VZ7', 'Valve', 'CB', 34, 'Normal', 'Off', '\r\n\r\n 6\r\n \r\n false\r\n 0\r\n 0\r\n'), +(36, 'VP5', 'Valve', 'CB', 35, 'Normal', 'Off', '\r\n\r\n 7\r\n \r\n false\r\n 0\r\n 0\r\n'), +(37, 'VP6', 'Valve', 'CB', 36, 'Normal', 'Off', '\r\n\r\n 8\r\n \r\n false\r\n 0\r\n 0\r\n'), +(38, 'VL12', 'Valve', 'CB', 37, 'Normal', 'Off', '\r\n\r\n 9\r\n \r\n false\r\n 0\r\n 0\r\n'), +(39, 'VZ14', 'Valve', 'CB', 38, 'Normal', 'Off', '\r\n\r\n 10\r\n \r\n false\r\n 0\r\n 0\r\n'), +(40, 'VI11', 'Valve', 'CB', 39, 'Normal', 'Off', '\r\n\r\n 11\r\n \r\n false\r\n 0\r\n 0\r\n'), +(41, 'VI12', 'Valve', 'CB', 40, 'Normal', 'Off', '\r\n\r\n 12\r\n \r\n false\r\n 0\r\n 0\r\n'), +(42, 'VI13', 'Valve', 'CB', 41, 'Normal', 'Off', '\r\n\r\n 13\r\n \r\n false\r\n 0\r\n 0\r\n'), +(43, 'VI21', 'Valve', 'CB', 42, 'Normal', 'Off', '\r\n\r\n 14\r\n \r\n false\r\n 0\r\n 0\r\n'), +(44, 'VI22', 'Valve', 'CB', 43, 'Normal', 'Off', '\r\n\r\n 15\r\n VI21\r\n false\r\n 0\r\n 0\r\n'), +(45, 'VI2p', 'Valve', 'CB', 44, 'Normal', 'Off', '\r\n\r\n 16\r\n \r\n false\r\n 0\r\n 0\r\n'), +(46, 'VI31', 'Valve', 'CB', 45, 'Normal', 'Off', '\r\n\r\n 17\r\n \r\n false\r\n 0\r\n 0\r\n'), +(47, 'VI32', 'Valve', 'CB', 46, 'Normal', 'Off', '\r\n\r\n 18\r\n VI31\r\n false\r\n 0\r\n 0\r\n'), +(48, 'VI3p', 'Valve', 'CB', 47, 'Normal', 'Off', '\r\n\r\n 19\r\n \r\n false\r\n 0\r\n 0\r\n'), +(49, 'VI41', 'Valve', 'CB', 48, 'Normal', 'Off', '\r\n\r\n 20\r\n \r\n false\r\n 0\r\n 0\r\n'), +(50, 'VI42', 'Valve', 'CB', 49, 'Normal', 'Off', '\r\n\r\n 21\r\n \r\n false\r\n 0\r\n 0\r\n'), +(51, 'VI43', 'Valve', 'CB', 50, 'Normal', 'Off', '\r\n\r\n 22\r\n \r\n false\r\n 0\r\n 0\r\n'), +(52, 'VI4p', 'Valve', 'CB', 51, 'Normal', 'Off', '\r\n\r\n 23\r\n \r\n false\r\n 0\r\n 0\r\n'), +(53, 'VB1', 'Valve', 'CB', 52, 'Normal', 'Off', '\r\n\r\n 24\r\n \r\n false\r\n 0\r\n 0\r\n'), +(54, 'VB1a', 'Valve', 'CB', 53, 'Normal', 'Off', '\r\n\r\n 25\r\n VB1\r\n false\r\n -2\r\n 2\r\n'), +(55, 'VB2', 'Valve', 'CB', 54, 'Normal', 'Off', '\r\n\r\n 26\r\n \r\n false\r\n 0\r\n 0\r\n'), +(56, 'VB2a', 'Valve', 'CB', 55, 'Normal', 'Off', '\r\n\r\n 27\r\n VB2\r\n false\r\n -2\r\n 2\r\n'), +(57, 'VM1', 'Valve', 'CB', 56, 'Normal', 'Off', '\r\n\r\n 28\r\n \r\n false\r\n 0\r\n 0\r\n'), +(58, 'VM2', 'Valve', 'CB', 57, 'Normal', 'Off', '\r\n\r\n 29\r\n \r\n false\r\n 0\r\n 0\r\n'), +(59, 'VM3', 'Valve', 'CB', 58, 'Normal', 'Off', '\r\n\r\n 30\r\n \r\n false\r\n 0\r\n 0\r\n'), +(60, 'Pump1', 'Pump', 'CB', 59, 'Normal', 'Off', '\r\n\r\n 32\r\n \r\n false\r\n'), +(61, 'Pump2', 'Pump', 'CB', 60, 'Normal', 'Off', '\r\n\r\n 37\r\n \r\n false\r\n'), +(62, 'Pump3', 'Pump', 'CB', 61, 'Normal', 'Off', '\r\n\r\n 38\r\n \r\n false\r\n'), +(63, 'Pump4', 'Pump', 'CB', 62, 'Normal', 'Off', '\r\n\r\n 33\r\n \r\n false\r\n'), +(64, 'Pump5', 'Pump', 'CB', 63, 'Normal', 'Off', '\r\n\r\n 39\r\n \r\n false\r\n'), +(65, 'Bench-ID', 'Bench-ID', NULL, 64, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(66, 'Results2Printer', 'BasicResultsPrinter', NULL, 65, 'Normal', 'Off', '\r\n'), +(67, 'Results2Disk', 'BasicResultsWriter', NULL, 66, 'Normal', 'Off', '\r\n'), +(68, 'FlyingStartMassCollection', 'Flying-Start-Collection', NULL, 67, 'Normal', 'Off', '\r\n'), +(69, 'CombinedMeters', 'CombinedMeters', NULL, 68, 'Normal', 'Off', '\r\n'), +(70, 'CombinedWithDetection', 'CombinedWithDetection', NULL, 69, 'Normal', 'Off', '\r\n'), +(71, 'Sick1', 'RegisterReader', 'CB', 70, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(72, 'Sick2', 'RegisterReader', 'CB', 71, 'Normal', 'Off', '\r\n\r\n 2\r\n'), +(73, 'Sick3', 'RegisterReader', 'CB', 72, 'Normal', 'Off', '\r\n\r\n 3\r\n'), +(74, 'Sick4', 'RegisterReader', 'CB', 73, 'Normal', 'Off', '\r\n\r\n 4\r\n'), +(75, 'Sick5', 'RegisterReader', 'CB', 74, 'Normal', 'Off', '\r\n\r\n 5\r\n'), +(76, 'Sick6', 'RegisterReader', 'CB', 75, 'Normal', 'Off', '\r\n\r\n 6\r\n'), +(77, 'WaterMeter1', 'WaterMeter', NULL, 76, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(78, 'WaterMeter2', 'WaterMeter', NULL, 77, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(79, 'WaterMeter3', 'WaterMeter', NULL, 78, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(80, 'WaterMeter4', 'WaterMeter', NULL, 79, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(81, 'WaterMeter5', 'WaterMeter', NULL, 80, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(82, 'WaterMeter6', 'WaterMeter', NULL, 81, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `componentprocedure` +-- + +CREATE TABLE IF NOT EXISTS `componentprocedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ; + +-- +-- Dumping data for table `componentprocedure` +-- + +INSERT INTO `componentprocedure` (`Id`, `CmpntName`, `Parameters`, `Procedure_id`) VALUES +(1, 'WaterMeter1', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(2, 'WaterMeter2', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(3, 'WaterMeter3', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(4, 'WaterMeter4', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(5, 'WaterMeter5', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(6, 'WaterMeter6', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(7, 'Sick1', '\r\n\r\n 5\r\n', 1), +(8, 'Sick2', '\r\n\r\n 5\r\n', 1), +(9, 'Sick3', '\r\n\r\n 5\r\n', 1), +(10, 'Sick4', '\r\n\r\n 5\r\n', 1), +(11, 'Sick5', '\r\n\r\n 5\r\n', 1), +(12, 'Sick6', '\r\n\r\n 5\r\n', 1), +(25, 'Camera1', NULL, 1), +(26, 'Camera2', NULL, 1), +(27, 'Camera3', NULL, 1), +(28, 'Camera4', NULL, 1), +(29, 'Camera5', NULL, 1), +(30, 'Camera6', NULL, 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `componenttest` +-- + +CREATE TABLE IF NOT EXISTS `componenttest` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `componenttest` +-- + +INSERT INTO `componenttest` (`Id`, `CmpntName`, `Parameters`, `Test_id`) VALUES +(1, 'CombinedWithDetection', '\r\n\r\n 3\r\n -0.4\r\n -0.2\r\n 0.05\r\n 0.25\r\n', 1), +(2, 'CombinedWithDetection', '\r\n\r\n 3\r\n -0.4\r\n -0.2\r\n 0.05\r\n 0.25\r\n', 2); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `feedingpath` +-- + +CREATE TABLE IF NOT EXISTS `feedingpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Pump` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `feedingpath` +-- + +INSERT INTO `feedingpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Pump`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 0, '', 0, 0, '---', '', 'VL11;VL13;VL4;VZ6;VZ7;Pump1;Pump2;Pump3;Pump4;Pump5'), +(2, 1, 'Feed-0-10', 0.1, 10, 'Pump4', 'VL13;VZ6;Pump4', 'VL11;VL4;VZ7;Pump1;Pump2;Pump3;Pump5'), +(3, 2, 'Feed-10-60', 10, 60, 'Pump3', 'VL11;Pump3', 'VL13;VL4;VZ6;VZ7;Pump1;Pump2;Pump4;Pump5'), +(4, 3, 'Feed-60-200', 60, 200, 'Pump1', 'VL11;Pump1', 'VL13;VL4;VZ6;VZ7;Pump2;Pump3;Pump4;Pump5'), +(5, 4, 'Feed-200-350', 200, 350, 'Pump1', 'VL11;Pump1;Pump2', 'VL13;VL4;VZ6;VZ7;Pump3;Pump4;Pump5'), +(6, 5, 'Feed-tower', 0, 0, 'Pump5', 'VL13;VL4;Pump5', 'VL11;VZ6;VZ7;Pump1;Pump2;Pump3;Pump4'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `group` +-- + +CREATE TABLE IF NOT EXISTS `group` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Gid` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `User_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `User_id` (`User_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Dumping data for table `group` +-- + +INSERT INTO `group` (`Id`, `Gid`, `Name`, `User_id`) VALUES +(1, 0, 'Tester', 1), +(2, 1, 'Testing Specialist', 1), +(3, 2, 'Head of Lab', 1), +(4, 3, 'Maintenance Specialist', 1), +(5, 4, 'Metrologist', 1), +(6, 5, 'Calibration Specialist', 1), +(7, 6, 'Administrator', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `measurementcorrection` +-- + +CREATE TABLE IF NOT EXISTS `measurementcorrection` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Measurement` float DEFAULT NULL, + `Correction` float DEFAULT NULL, + `Component_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Component_id` (`Component_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `meterspath` +-- + +CREATE TABLE IF NOT EXISTS `meterspath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Sensor1` varchar(255) DEFAULT NULL, + `Sensor2` varchar(255) DEFAULT NULL, + `Sensor3` varchar(255) DEFAULT NULL, + `Sensor4` varchar(255) DEFAULT NULL, + `Sensor5` varchar(255) DEFAULT NULL, + `Sensor6` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `meterspath` +-- + +INSERT INTO `meterspath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Sensor1`, `Sensor2`, `Sensor3`, `Sensor4`, `Sensor5`, `Sensor6`) VALUES +(1, 0, 'Sicks', 0, 350, 'Sick1', 'Sick2', 'Sick3', 'Sick4', 'Sick5', 'Sick6'), +(2, 1, 'Cameras', 0, 350, 'Camera1', 'Camera2', 'Camera3', 'Camera4', 'Camera5', 'Camera6'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `metertestresult` +-- + +CREATE TABLE IF NOT EXISTS `metertestresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `SerialNr` varchar(255) DEFAULT NULL, + `VolumeStart` float DEFAULT NULL, + `VolumeEnd` float DEFAULT NULL, + `VolumeMeter` float DEFAULT NULL, + `VolumeRef` float DEFAULT NULL, + `VolumeErrorPct` float DEFAULT NULL, + `PulsesMeter` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `TestResult_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `TestResult_id` (`TestResult_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `metertestresult` +-- + +INSERT INTO `metertestresult` (`Id`, `SerialNr`, `VolumeStart`, `VolumeEnd`, `VolumeMeter`, `VolumeRef`, `VolumeErrorPct`, `PulsesMeter`, `PulsesMaster`, `Time`, `TestResult_id`) VALUES +(1, 'wm1', 0, 0, 1, 48.7303, -97.9479, 5, 7222, 40.898, 1), +(2, 'wm2', 0, 0, 0, 0, -100, 0, 0, 40.898, 1), +(3, 'wm3', 0, 0, 0, 0, -100, 0, 0, 40.898, 1), +(4, 'wm4', 0, 0, 0, 0, -100, 0, 0, 40.898, 1), +(5, 'wm5', 0, 0, 0, 0, -100, 0, 0, 40.898, 1), +(6, 'wm6', 0, 0, 0, 0, -100, 0, 0, 40.898, 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `outputpath` +-- + +CREATE TABLE IF NOT EXISTS `outputpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `RegulValve` varchar(255) DEFAULT NULL, + `FlowMeter` varchar(255) DEFAULT NULL, + `Diverter` varchar(255) DEFAULT NULL, + `TempDiv` varchar(255) DEFAULT NULL, + `Balance` varchar(255) DEFAULT NULL, + `EmptyTankValve` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Dumping data for table `outputpath` +-- + +INSERT INTO `outputpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `RegulValve`, `FlowMeter`, `Diverter`, `TempDiv`, `Balance`, `EmptyTankValve`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 0, '', 0, 0, '---', '---', '---', '---', '---', '---', '', 'VI11;VI12;VI13;VI21;VI2p;VI31;VI3p;VI41;VI42;VI43;VI4p'), +(2, 1, 'PQ-0-0.16', 0, 0.16, 'VIR42', 'I4', 'Div3', 'T5', 'W2', 'VB2', 'VI41;VI42', 'VI11;VI12;VI13;VI21;VI31;VI43'), +(3, 2, 'PQ-0.16-0.37', 0.16, 0.37, 'VIR41', 'I4', 'Div3', 'T5', 'W2', 'VB2', 'VI41;VI43', 'VI11;VI12;VI13;VI21;VI31;VI42'), +(4, 3, 'PQ-0.37-4', 0.37, 4, 'VIR3', 'I3', 'Div2', 'T4', 'W2', 'VB2', 'VI31', 'VI11;VI12;VI13;VI21;VI41;VI42;VI43'), +(5, 4, 'PQ-4-40', 4, 40, 'VIR2', 'I2', 'Div1', 'T3', 'W1', 'VB1', 'VI13;VI21', 'VI11;VI12;VI31;VI41;VI42;VI43'), +(6, 5, 'PQ-40-250', 40, 250, 'VIR1', 'I1', 'Div1', 'T3', 'W1', 'VB1', 'VI11;VI13', 'VI12;VI21;VI31;VI41;VI42;VI43'), +(7, 6, 'PQ-250-350', 250, 350, 'VIR1', 'I1', 'Div1', 'T3', 'W1', 'VB1', 'VI11;VI12;VI13', 'VI21;VI31;VI41;VI42;VI43'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `procedure` +-- + +CREATE TABLE IF NOT EXISTS `procedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `CreationUser` varchar(255) DEFAULT NULL, + `CreationTime` datetime DEFAULT NULL, + `LastChgUser` varchar(255) DEFAULT NULL, + `LastChgTime` datetime DEFAULT NULL, + `LongDescription` varchar(255) DEFAULT NULL, + `Watermeters` varchar(255) DEFAULT NULL, + `DataEntry` varchar(255) DEFAULT NULL, + `ResultsPrinter` varchar(255) DEFAULT NULL, + `ResultsWriter` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `procedure` +-- + +INSERT INTO `procedure` (`Id`, `ItemNr`, `Name`, `Description`, `CreationUser`, `CreationTime`, `LastChgUser`, `LastChgTime`, `LongDescription`, `Watermeters`, `DataEntry`, `ResultsPrinter`, `ResultsWriter`) VALUES +(1, 0, 'MTK3', '', 'admin', '2014-03-12 08:11:05', 'admin', '2014-03-13 19:58:42', '', '', NULL, 'Results2Printer', 'Results2Disk'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `purgeend` +-- + +CREATE TABLE IF NOT EXISTS `purgeend` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `purgestart` +-- + +CREATE TABLE IF NOT EXISTS `purgestart` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `purgestart` +-- + +INSERT INTO `purgestart` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `Procedure_id`) VALUES +(1, 0, 5, 'VL13', '', '0;0;0;0;0', 1), +(2, 1, 6, '', 'VL4', '0;0;0;0;0', 1), +(3, 2, 7, '', '', '0;0;0;0;0', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `test` +-- + +CREATE TABLE IF NOT EXISTS `test` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Volume` float DEFAULT NULL, + `TstTime` float DEFAULT NULL, + `Repeats` int(11) DEFAULT NULL, + `Emptying` tinyint(1) DEFAULT NULL, + `Zeroing` tinyint(1) DEFAULT NULL, + `Method` varchar(255) DEFAULT NULL, + `ErrLimLo` float DEFAULT NULL, + `ErrLimHi` float DEFAULT NULL, + `TolerRed` double DEFAULT NULL, + `RedType` varchar(255) DEFAULT NULL, + `FeedingPath` varchar(255) DEFAULT NULL, + `BenchPath` varchar(255) DEFAULT NULL, + `OutputPath` varchar(255) DEFAULT NULL, + `MetersPath` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `test` +-- + +INSERT INTO `test` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `TolerRed`, `RedType`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `Procedure_id`) VALUES +(1, 0, 'QA1', 3, 3.3, 52.5, 60, 1, 0, 0, 'FlyingStartMassCollection', -5, 5, 0.20000000298023224, 'Fix', 'Feed-10-60', 'Bench-all', 'PQ-0.37-4', 'Sicks', 1), +(2, 1, 'QA2', 5, 5.5, 58.3333, 40, 1, 0, 0, 'FlyingStartMassCollection', -2, 2, 0.20000000298023224, 'Fix', 'Feed-10-60', 'Bench-all', 'PQ-4-40', 'Sicks', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `testresult` +-- + +CREATE TABLE IF NOT EXISTS `testresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `TestName` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Volume` float DEFAULT NULL, + `TstTime` float DEFAULT NULL, + `Repeats` int(11) DEFAULT NULL, + `Emptying` tinyint(1) DEFAULT NULL, + `Zeroing` tinyint(1) DEFAULT NULL, + `Method` varchar(255) DEFAULT NULL, + `ErrLimLo` float DEFAULT NULL, + `ErrLimHi` float DEFAULT NULL, + `FeedingPath` varchar(4000) DEFAULT NULL, + `BenchPath` varchar(4000) DEFAULT NULL, + `OutputPath` varchar(4000) DEFAULT NULL, + `MetersPath` varchar(4000) DEFAULT NULL, + `TimeStart` datetime DEFAULT NULL, + `TimeEnd` datetime DEFAULT NULL, + `RepetitionNr` int(11) DEFAULT NULL, + `AmbientTempAve` float DEFAULT NULL, + `AmbientPressAve` float DEFAULT NULL, + `AmbientHumiAve` float DEFAULT NULL, + `PressInAvrg` float DEFAULT NULL, + `PressInStart` float DEFAULT NULL, + `PressInEnd` float DEFAULT NULL, + `PressOutAvrg` float DEFAULT NULL, + `PressOutStart` float DEFAULT NULL, + `PressOutEnd` float DEFAULT NULL, + `TempInAvrg` float DEFAULT NULL, + `TempInStart` float DEFAULT NULL, + `TempInEnd` float DEFAULT NULL, + `TempOutAvrg` float DEFAULT NULL, + `TempOutStart` float DEFAULT NULL, + `TempOutEnd` float DEFAULT NULL, + `TempDivAvrg` float DEFAULT NULL, + `TempDivStart` float DEFAULT NULL, + `TempDivEnd` float DEFAULT NULL, + `MassStartRaw` float DEFAULT NULL, + `MassStart` float DEFAULT NULL, + `MassEndRaw` float DEFAULT NULL, + `MassEnd` float DEFAULT NULL, + `MassDiff` float DEFAULT NULL, + `DensityIn` float DEFAULT NULL, + `DensityOut` float DEFAULT NULL, + `DensityDiv` float DEFAULT NULL, + `FlowMass` float DEFAULT NULL, + `FlowVolume` float DEFAULT NULL, + `VolumeCTV` float DEFAULT NULL, + `VolumeMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `ErrorMaster` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `ConstMaster` float DEFAULT NULL, + `TimeDivStart0` float DEFAULT NULL, + `TimeDivStart1` float DEFAULT NULL, + `TimeDivStart2` float DEFAULT NULL, + `TimeDivStart3` float DEFAULT NULL, + `TimeDivStart4` float DEFAULT NULL, + `TimeDivStart5` float DEFAULT NULL, + `TimeDivEnd0` float DEFAULT NULL, + `TimeDivEnd1` float DEFAULT NULL, + `TimeDivEnd2` float DEFAULT NULL, + `TimeDivEnd3` float DEFAULT NULL, + `TimeDivEnd4` float DEFAULT NULL, + `TimeDivEnd5` float DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Dumping data for table `testresult` +-- + +INSERT INTO `testresult` (`Id`, `Name`, `TestName`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`) VALUES +(1, 'QA2', 'QA2', 5, 5.5, 58.3333, 40, 1, 0, 0, 'FlyingStartMassCollection', -2, 2, 'Feed-10-60', 'Bench-all', 'PQ-4-40', 'Sicks', '2014-03-13 20:10:51', '2014-03-13 20:11:43', 1, 24.74, 987.95, 27.78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.9, 1.9, 57.75, 57.75, 55.85, 999.843, 999.843, 999.843, 4916.13, 5065.65, 55.9163, 57.5486, 40.898, 2.91916, 8287, 0.00674747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `transitionsequence` +-- + +CREATE TABLE IF NOT EXISTS `transitionsequence` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `transitionstep` +-- + +CREATE TABLE IF NOT EXISTS `transitionstep` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT NULL, + `TransitionSequence_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `TransitionSequence_id` (`TransitionSequence_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `Password` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `LastPwChange` datetime DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`Id`, `Name`, `Password`, `Description`, `LastPwChange`) VALUES +(1, 'admin', 'af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909', 'Administrator', '2014-03-07 21:01:44'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `watermeter` +-- + +CREATE TABLE IF NOT EXISTS `watermeter` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Serial` varchar(255) DEFAULT NULL, + `WMType_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `WMType_id` (`WMType_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `wmtype` +-- + +CREATE TABLE IF NOT EXISTS `wmtype` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CreateTime` datetime DEFAULT NULL, + `CreateUserName` varchar(255) DEFAULT NULL, + `CreateDescription` varchar(255) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `PulseRate` float DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `componentprocedure` +-- +ALTER TABLE `componentprocedure` + ADD CONSTRAINT `FKA4EE67E2C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `componenttest` +-- +ALTER TABLE `componenttest` + ADD CONSTRAINT `FK4933B35E048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Constraints for table `group` +-- +ALTER TABLE `group` + ADD CONSTRAINT `FKFBBA8E27F90D2266` FOREIGN KEY (`User_id`) REFERENCES `user` (`Id`); + +-- +-- Constraints for table `measurementcorrection` +-- +ALTER TABLE `measurementcorrection` + ADD CONSTRAINT `FK2E70F3322F02977E` FOREIGN KEY (`Component_id`) REFERENCES `component` (`Id`); + +-- +-- Constraints for table `metertestresult` +-- +ALTER TABLE `metertestresult` + ADD CONSTRAINT `FK1CE41B064BD6C9B6` FOREIGN KEY (`TestResult_id`) REFERENCES `testresult` (`Id`); + +-- +-- Constraints for table `purgeend` +-- +ALTER TABLE `purgeend` + ADD CONSTRAINT `FK14832B1AC1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `purgestart` +-- +ALTER TABLE `purgestart` + ADD CONSTRAINT `FKDC8627F9C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `test` +-- +ALTER TABLE `test` + ADD CONSTRAINT `FKCC127866C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `transitionstep` +-- +ALTER TABLE `transitionstep` + ADD CONSTRAINT `FK5F10122DC1B62014` FOREIGN KEY (`TransitionSequence_id`) REFERENCES `transitionsequence` (`Id`); + +-- +-- Constraints for table `watermeter` +-- +ALTER TABLE `watermeter` + ADD CONSTRAINT `FKA968A8E699BF9B30` FOREIGN KEY (`WMType_id`) REFERENCES `wmtype` (`Id`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/TestBenchFramework/SampleConfig/gwz-1-new.sql b/TestBenchFramework/SampleConfig/gwz-1-new.sql new file mode 100644 index 000000000..e2bb8e307 --- /dev/null +++ b/TestBenchFramework/SampleConfig/gwz-1-new.sql @@ -0,0 +1,1754 @@ +-- phpMyAdmin SQL Dump +-- version 3.4.5 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Mar 09, 2014 at 10:17 PM +-- Server version: 5.5.16 +-- PHP Version: 5.3.8 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `gwz-1` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `benchpath` +-- + +CREATE TABLE IF NOT EXISTS `benchpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `TempIn` varchar(255) DEFAULT NULL, + `TempOut` varchar(255) DEFAULT NULL, + `PressIn` varchar(255) DEFAULT NULL, + `PressOut` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; + +-- +-- Dumping data for table `benchpath` +-- + +INSERT INTO `benchpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `TempIn`, `TempOut`, `PressIn`, `PressOut`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PBank1', 0.01, 0.03, 'T1', 'T2', 'Druck1', 'Druck2', 'VL13;VL12', ''), +(2, 2, 'PBank2', 0.03, 250, 'T1', 'T2', 'Druck1', 'Druck2', 'VL11;VL12;VI12', ''), +(3, 3, 'PBank3', 0.02, 12, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22', 'VM1;VM2;VM3;VM4'), +(4, 4, 'PBank4', 0.02, 15, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM2;VM3', 'VM1;VM4'), +(5, 5, 'PBank5', 0.02, 18, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM1;VM3', 'VM2;VM4'), +(6, 6, 'PBank6', 0.02, 18, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM1;VM2', 'VM3;VM4'), +(7, 7, 'PBank7', 0.02, 5, 'T5', 'T2', 'Druck3', 'Druck4', 'VL21', ''), +(8, 0, '', 0, 0, '---', '---', '---', '---', '', ''); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `component` +-- + +CREATE TABLE IF NOT EXISTS `component` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `ClassName` varchar(255) DEFAULT NULL, + `ParentName` varchar(255) DEFAULT NULL, + `ItemNr` int(11) DEFAULT NULL, + `Mode` varchar(255) DEFAULT NULL, + `Logging` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=75 ; + +-- +-- Dumping data for table `component` +-- + +INSERT INTO `component` (`Id`, `Name`, `ClassName`, `ParentName`, `ItemNr`, `Mode`, `Logging`, `Parameters`) VALUES +(1, 'CB', 'ControlBoard', NULL, 0, 'Simulate', 'Off', '\r\n\r\n 1\r\n'), +(2, 'W1', 'MettlerToledoBalanceSN', NULL, 1, 'Simulate', 'Off', '\r\n\r\n 11\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 3000\r\n'), +(3, 'W2', 'MettlerToledoBalanceSN', NULL, 2, 'Simulate', 'Off', '\r\n\r\n 10\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 150\r\n'), +(4, 'Luft', 'Greco Ambient', NULL, 3, 'Simulate', 'Off', '\r\n\r\n 6\r\n 19200\r\n None\r\n 8\r\n One\r\n None\r\n'), +(5, 'I1', 'FlowMeter', 'CB', 4, 'Normal', 'Off', '\r\n\r\n 1\r\n 200\r\n'), +(6, 'I2', 'FlowMeter', 'CB', 5, 'Normal', 'Off', '\r\n\r\n 2\r\n 20\r\n'), +(7, 'I3', 'FlowMeter', 'CB', 6, 'Normal', 'Off', '\r\n\r\n 3\r\n 3\r\n'), +(8, 'I4', 'FlowMeter', 'CB', 7, 'Normal', 'Off', '\r\n\r\n 4\r\n 0.25\r\n'), +(9, 'Druck1', 'PressureMeter', 'CB', 8, 'Normal', 'Off', '\r\n\r\n 0\r\n 78\r\n'), +(10, 'Druck2', 'PressureMeter', 'CB', 9, 'Normal', 'Off', '\r\n\r\n 1\r\n 81\r\n'), +(11, 'Druck3', 'PressureMeter', 'CB', 10, 'Normal', 'Off', '\r\n\r\n 2\r\n 11\r\n'), +(12, 'Druck4', 'PressureMeter', 'CB', 11, 'Normal', 'Off', '\r\n\r\n 3\r\n 82\r\n'), +(13, 'T1', 'TempMeter', 'CB', 12, 'Normal', 'Off', '\r\n\r\n 0\r\n -20.14631\r\n 0.00177572737\r\n 7.601795E-10\r\n -1.237E-15\r\n 0\r\n'), +(14, 'T2', 'TempMeter', 'CB', 13, 'Normal', 'Off', '\r\n\r\n 1\r\n -20.13342\r\n 0.001777626\r\n 7.41529E-10\r\n -1.066678E-15\r\n 0\r\n'), +(15, 'T3', 'TempMeter', 'CB', 14, 'Normal', 'Off', '\r\n\r\n 2\r\n -20.138031\r\n 0.00177645753\r\n 7.68710429E-10\r\n -1.307915E-15\r\n 0\r\n'), +(16, 'T4', 'TempMeter', 'CB', 15, 'Normal', 'Off', '\r\n\r\n 3\r\n -20.1234074\r\n 0.00177655893\r\n 7.53911156E-10\r\n 1.13868757E-15\r\n 0\r\n'), +(17, 'T5', 'TempMeter', 'CB', 16, 'Normal', 'Off', '\r\n\r\n 4\r\n -20.0712757\r\n 0.00177105656\r\n 9.751451E-10\r\n -3.51362E-15\r\n 0\r\n'), +(18, 'RV1', 'RegulationValve', 'CB', 17, 'Normal', 'Off', '\r\n\r\n 1\r\n 100\r\n 500\r\n 10\r\n'), +(19, 'RV2', 'RegulationValve', 'CB', 18, 'Normal', 'Off', '\r\n\r\n 2\r\n 100\r\n 500\r\n 3\r\n'), +(20, 'RV3', 'RegulationValve', 'CB', 19, 'Normal', 'Off', '\r\n\r\n 3\r\n 100\r\n 500\r\n 10\r\n'), +(21, 'RV4', 'RegulationValve', 'CB', 20, 'Normal', 'Off', '\r\n\r\n 4\r\n 100\r\n 500\r\n 30\r\n'), +(22, 'RV5', 'RegulationValve', 'CB', 21, 'Normal', 'Off', '\r\n\r\n 5\r\n 100\r\n 500\r\n 10\r\n'), +(23, 'DIV1', 'Diverter', 'CB', 22, 'Normal', 'Off', '\r\n\r\n 34\r\n'), +(24, 'DIV2', 'Diverter', 'CB', 23, 'Normal', 'Off', '\r\n\r\n 35\r\n'), +(25, 'DIV3', 'Diverter', 'CB', 24, 'Normal', 'Off', '\r\n\r\n 36\r\n'), +(26, 'VL11', 'Valve', 'CB', 25, 'Normal', 'Off', '\r\n\r\n 0\r\n \r\n false\r\n'), +(27, 'VL13', 'Valve', 'CB', 26, 'Normal', 'Off', '\r\n\r\n 1\r\n \r\n false\r\n'), +(28, 'VL21', 'Valve', 'CB', 27, 'Normal', 'Off', '\r\n\r\n 2\r\n \r\n false\r\n'), +(29, 'VL23', 'Valve', 'CB', 28, 'Normal', 'Off', '\r\n\r\n 3\r\n \r\n false\r\n'), +(30, 'VZ1', 'Valve', 'CB', 29, 'Normal', 'Off', '\r\n\r\n 4\r\n \r\n false\r\n'), +(31, 'VP2', 'Valve', 'CB', 30, 'Normal', 'Off', '\r\n\r\n 5\r\n \r\n false\r\n'), +(32, 'VP4', 'Valve', 'CB', 31, 'Normal', 'Off', '\r\n\r\n 6\r\n \r\n false\r\n'), +(33, 'VP5', 'Valve', 'CB', 32, 'Normal', 'Off', '\r\n\r\n 7\r\n \r\n false\r\n'), +(34, 'VP6', 'Valve', 'CB', 33, 'Normal', 'Off', '\r\n\r\n 8\r\n \r\n false\r\n'), +(35, 'VL12', 'Valve', 'CB', 34, 'Normal', 'Off', '\r\n\r\n 9\r\n \r\n false\r\n'), +(36, 'VL22', 'Valve', 'CB', 35, 'Normal', 'Off', '\r\n\r\n 10\r\n \r\n false\r\n'), +(37, 'VI11', 'Valve', 'CB', 36, 'Normal', 'Off', '\r\n\r\n 11\r\n \r\n false\r\n'), +(38, 'VI12', 'Valve', 'CB', 37, 'Normal', 'Off', '\r\n\r\n 12\r\n \r\n false\r\n'), +(39, 'VI13', 'Valve', 'CB', 38, 'Normal', 'Off', '\r\n\r\n 13\r\n \r\n false\r\n'), +(40, 'VI21', 'Valve', 'CB', 39, 'Normal', 'Off', '\r\n\r\n 14\r\n \r\n false\r\n'), +(41, 'VI22', 'Valve', 'CB', 40, 'Normal', 'Off', '\r\n\r\n 15\r\n \r\n false\r\n'), +(42, 'VI2P', 'Valve', 'CB', 41, 'Normal', 'Off', '\r\n\r\n 16\r\n \r\n false\r\n'), +(43, 'VI31', 'Valve', 'CB', 42, 'Normal', 'Off', '\r\n\r\n 17\r\n \r\n false\r\n'), +(44, 'VI32', 'Valve', 'CB', 43, 'Normal', 'Off', '\r\n\r\n 18\r\n \r\n false\r\n'), +(45, 'VI3P', 'Valve', 'CB', 44, 'Normal', 'Off', '\r\n\r\n 19\r\n \r\n false\r\n'), +(46, 'VI41', 'Valve', 'CB', 45, 'Normal', 'Off', '\r\n\r\n 20\r\n \r\n false\r\n'), +(47, 'VI42', 'Valve', 'CB', 46, 'Normal', 'Off', '\r\n\r\n 21\r\n \r\n false\r\n'), +(48, 'VI43', 'Valve', 'CB', 47, 'Normal', 'Off', '\r\n\r\n 22\r\n \r\n false\r\n'), +(49, 'VI4P', 'Valve', 'CB', 48, 'Normal', 'Off', '\r\n\r\n 23\r\n \r\n false\r\n'), +(50, 'VB1', 'Valve', 'CB', 49, 'Normal', 'Off', '\r\n\r\n 24\r\n \r\n false\r\n'), +(51, 'VB1a', 'Valve', 'CB', 50, 'Normal', 'Off', '\r\n\r\n 25\r\n VB1\r\n false\r\n -2\r\n 2\r\n'), +(52, 'VB2', 'Valve', 'CB', 51, 'Normal', 'Off', '\r\n\r\n 26\r\n \r\n false\r\n'), +(53, 'VB2a', 'Valve', 'CB', 52, 'Normal', 'Off', '\r\n\r\n 27\r\n VB2\r\n false\r\n -2\r\n 2\r\n'), +(54, 'VM1', 'Valve', 'CB', 53, 'Normal', 'Off', '\r\n\r\n 28\r\n \r\n false\r\n'), +(55, 'VM2', 'Valve', 'CB', 54, 'Normal', 'Off', '\r\n\r\n 29\r\n \r\n false\r\n'), +(56, 'VM3', 'Valve', 'CB', 55, 'Normal', 'Off', '\r\n\r\n 30\r\n \r\n false\r\n'), +(57, 'VM4', 'Valve', 'CB', 56, 'Normal', 'Off', '\r\n\r\n 31\r\n \r\n false\r\n'), +(58, 'Pumpe1', 'Pump', 'CB', 57, 'Normal', 'Off', '\r\n\r\n 32\r\n \r\n false\r\n'), +(59, 'Block', 'Valve', 'CB', 58, 'Normal', 'Off', '\r\n\r\n 33\r\n \r\n false\r\n'), +(60, 'VZ8', 'Valve', 'CB', 59, 'Normal', 'Off', '\r\n\r\n 37\r\n \r\n false\r\n'), +(61, 'Sick1', 'RegisterReader', 'CB', 60, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(62, 'Sick2', 'RegisterReader', 'CB', 61, 'Normal', 'Off', '\r\n\r\n 2\r\n'), +(63, 'Sick3', 'RegisterReader', 'CB', 62, 'Normal', 'Off', '\r\n\r\n 3\r\n'), +(64, 'Kamera', 'IdcCamera', NULL, 63, 'Simulate', 'Off', '\r\n\r\n 20\r\n 57600\r\n 0.5\r\n'), +(65, 'Fliegender Start-Stopp', 'Flying-Start-Collection', NULL, 64, 'Normal', 'Off', '\r\n'), +(66, 'Verbund', 'CombinedMeters', NULL, 65, 'Normal', 'Off', '\r\n'), +(67, 'Basic Results', 'BasicResultsWriter', NULL, 66, 'Normal', 'Off', '\r\n'), +(68, 'Advanced Results', 'ResultsPrinter4Munich', NULL, 67, 'Normal', 'Off', '\r\n'), +(69, 'Verbund-steig-fall', 'CombinedWithDetection', NULL, 68, 'Normal', 'Off', '\r\n'), +(70, 'Pruefstand-ID', 'Bench-ID', NULL, 69, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(71, 'Zähler 1', 'WaterMeter', NULL, 70, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(72, 'Zähler 2', 'WaterMeter', NULL, 71, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(73, 'Zähler 3', 'WaterMeter', NULL, 72, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(74, 'Dateneingabe', 'DataEntryForm-Munich', NULL, 73, 'Normal', 'Off', '\r\n\r\n Protokoll Werkprüfung\r\n Protokoll 2<--\r\n Protokoll 3<--\r\n'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `componentprocedure` +-- + +CREATE TABLE IF NOT EXISTS `componentprocedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=29 ; + +-- +-- Dumping data for table `componentprocedure` +-- + +INSERT INTO `componentprocedure` (`Id`, `CmpntName`, `Parameters`, `Procedure_id`) VALUES +(1, 'Sick1', '\r\n\r\n 1\r\n', 15), +(2, 'Sick2', '\r\n\r\n 36.4\r\n', 15), +(3, 'Sick3', '\r\n\r\n 1\r\n', 15), +(10, 'Sick1', '\r\n\r\n 1\r\n', 17), +(11, 'Sick2', '\r\n\r\n 36.4\r\n', 17), +(12, 'Sick3', '\r\n\r\n 1\r\n', 17), +(16, 'Sick1', '\r\n\r\n 1\r\n', 18), +(17, 'Sick2', '\r\n\r\n 36.4\r\n', 18), +(18, 'Sick3', '\r\n\r\n 1\r\n', 18), +(22, 'Sick1', '\r\n\r\n 1\r\n', 21), +(23, 'Sick2', '\r\n\r\n 36.4\r\n', 21), +(24, 'Sick3', '\r\n\r\n 1\r\n', 21), +(25, 'Zähler 1', '\r\n\r\n Elster\r\n 15\r\n D97 / 6.132.41\r\n B\r\n', 15), +(26, 'Zähler 2', '\r\n\r\n Elster\r\n 2.5\r\n D82 / 6.131.42\r\n A\r\n', 15), +(27, 'Zähler 3', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 15), +(28, 'Advanced Results', '\r\n\r\n 4/13\r\n Verbund\r\n 81793\r\n 2014\r\n', 15); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `componenttest` +-- + +CREATE TABLE IF NOT EXISTS `componenttest` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ; + +-- +-- Dumping data for table `componenttest` +-- + +INSERT INTO `componenttest` (`Id`, `CmpntName`, `Parameters`, `Test_id`) VALUES +(9, 'Verbund mit Det.', '\r\n\r\n 4\r\n 5\r\n -0.7\r\n -0.5\r\n 0.05\r\n 0.1\r\n', 36), +(10, 'Verbund-steig-fall', '\r\n\r\n 3\r\n -0.3\r\n -0.1\r\n 0.1\r\n 0.25\r\n', 35), +(11, 'Verbund-steig-fall', '\r\n\r\n 1\r\n 0.05\r\n 0.15\r\n 0.1\r\n 2\r\n', 36), +(16, 'Verbund-steig-fall', '\r\n\r\n 3\r\n -0.2\r\n 0\r\n 0.05\r\n 0.25\r\n', 41), +(17, 'Verbund-steig-fall', '\r\n\r\n 1\r\n 0\r\n 0.2\r\n 0.05\r\n 0.25\r\n', 42), +(20, 'Verbund-steig-fall', '\r\n\r\n 3\r\n -0.3\r\n -0.1\r\n 0.1\r\n 0.25\r\n', 45), +(21, 'Verbund-steig-fall', '\r\n\r\n 1\r\n 0.05\r\n 0.15\r\n 0.1\r\n 2\r\n', 46), +(24, 'Verbund-steig-fall', '\r\n\r\n 3\r\n -0.3\r\n -0.1\r\n 0.1\r\n 0.25\r\n', 49), +(25, 'Verbund-steig-fall', '\r\n\r\n 1\r\n 0.05\r\n 0.15\r\n 0.1\r\n 2\r\n', 50); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `feedingpath` +-- + +CREATE TABLE IF NOT EXISTS `feedingpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Pump` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `feedingpath` +-- + +INSERT INTO `feedingpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Pump`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PS1', 0.01, 0.03, '---', 'VZ1', ''), +(2, 3, 'PS2', 0.03, 250, '---', 'VZ1', ''), +(3, 2, 'PS3', 0.01, 5, 'Pumpe1', 'VP2', ''), +(4, 0, '', 0, 0, '---', 'VZ1', 'VL11;VL13;VL21;VL23;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI3P;VI41;VI42;VI43;VI4P;VB1;VB1a;VB2;VB2a;VM1;VM2;VM3;VM4;Pumpe1;Block;VZ8'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `group` +-- + +CREATE TABLE IF NOT EXISTS `group` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Gid` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `User_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `User_id` (`User_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Dumping data for table `group` +-- + +INSERT INTO `group` (`Id`, `Gid`, `Name`, `User_id`) VALUES +(1, 0, 'Testers', 2), +(2, 1, 'Testing Specialists', 1), +(3, 2, 'Head Of Lab', 1), +(4, 3, 'Maintenance Specialists', 1), +(5, 4, 'Metrologists', 1), +(6, 5, 'Calibration Specialists', 1), +(7, 6, 'Administrators', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `measurementcorrection` +-- + +CREATE TABLE IF NOT EXISTS `measurementcorrection` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Measurement` float DEFAULT NULL, + `Correction` float DEFAULT NULL, + `Component_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Component_id` (`Component_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `meterspath` +-- + +CREATE TABLE IF NOT EXISTS `meterspath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Sensor1` varchar(255) DEFAULT NULL, + `Sensor2` varchar(255) DEFAULT NULL, + `Sensor3` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Dumping data for table `meterspath` +-- + +INSERT INTO `meterspath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Sensor1`, `Sensor2`, `Sensor3`) VALUES +(1, 0, 'PMess1', 0.01, 300, 'Sick1', 'Sick2', 'Sick3'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `metertestresult` +-- + +CREATE TABLE IF NOT EXISTS `metertestresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `SerialNr` varchar(255) DEFAULT NULL, + `VolumeStart` float DEFAULT NULL, + `VolumeEnd` float DEFAULT NULL, + `VolumeMeter` float DEFAULT NULL, + `VolumeRef` float DEFAULT NULL, + `VolumeErrorPct` float DEFAULT NULL, + `PulsesMeter` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `TestResult_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `TestResult_id` (`TestResult_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=706 ; + +-- +-- Dumping data for table `metertestresult` +-- + +INSERT INTO `metertestresult` (`Id`, `SerialNr`, `VolumeStart`, `VolumeEnd`, `VolumeMeter`, `VolumeRef`, `VolumeErrorPct`, `PulsesMeter`, `PulsesMaster`, `Time`, `TestResult_id`) VALUES +(1, 'wm1', 0, 0, 142, 200.256, -29.0907, 142, 72051, 45.712, 1), +(2, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.712, 1), +(3, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.712, 1), +(4, 'wm1', 0, 0, 362, 59.9706, 503.629, 362, 143864, 104.98, 2), +(5, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.98, 2), +(6, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.98, 2), +(7, 'wm1', 0, 0, 141, 200.27, -29.5951, 141, 72046, 45.705, 3), +(8, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.705, 3), +(9, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.705, 3), +(10, 'wm1', 0, 0, 361, 60.1188, 500.478, 361, 143933, 104.919, 4), +(11, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.919, 4), +(12, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.919, 4), +(13, 'wm1', 0, 0, 141, 200.38, -29.6335, 141, 72078, 45.707, 5), +(14, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.707, 5), +(15, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.707, 5), +(16, 'wm1', 0, 0, 362, 60.0895, 502.435, 362, 143850, 104.938, 6), +(17, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.938, 6), +(18, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.938, 6), +(19, 'wm1', 0, 0, 5.6, 199.069, -97.1869, 56, 71576, 45.673, 7), +(20, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.673, 7), +(21, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.673, 7), +(25, 'wm1', 0, 0, 1.9, 190.598, -99.0031, 19, 68552, 45.822, 8), +(26, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.822, 8), +(27, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.822, 8), +(28, 'wm1', 0, 0, 1.9, 190.521, -99.0027, 19, 68543, 45.956, 9), +(29, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.956, 9), +(30, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.956, 9), +(31, 'wm1', 0, 0, 190, 190.39, -0.204866, 19, 68517, 45.988, 10), +(32, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.988, 10), +(33, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.988, 10), +(34, 'wm1', 0, 0, 190, 190.643, -0.337179, 19, 68558, 45.839, 11), +(35, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.839, 11), +(36, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.839, 11), +(37, 'wm1', 0, 0, 50, 39.8137, 25.5851, 5, 119374, 99.47, 12), +(38, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.47, 12), +(39, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.47, 12), +(40, 'wm1', 0, 0, 190, 190.549, -0.288296, 19, 68558, 45.834, 13), +(41, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.834, 13), +(42, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.834, 13), +(43, 'wm1', 0, 0, 50, 42.4429, 17.8054, 5, 119438, 99.653, 14), +(44, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.653, 14), +(45, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.653, 14), +(46, 'wm1', 0, 0, 190, 190.532, -0.279457, 19, 68518, 45.838, 15), +(47, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.838, 15), +(48, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.838, 15), +(49, 'wm1', 0, 0, 50, 42.5645, 17.4688, 5, 119409, 99.689, 16), +(50, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.689, 16), +(51, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.689, 16), +(52, 'wm1', 0, 0, 190, 190.678, -0.355387, 19, 68569, 45.876, 17), +(53, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.876, 17), +(54, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.876, 17), +(55, 'wm1', 0, 0, 190, 190.508, -0.266501, 19, 68525, 45.844, 18), +(56, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.844, 18), +(57, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.844, 18), +(58, 'wm1', 0, 0, 200, 200.696, -0.346793, 20, 72203, 45.812, 19), +(59, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.812, 19), +(60, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.812, 19), +(61, 'wm1', 0, 0, 190, 190.62, -0.32514, 19, 68555, 45.85, 20), +(62, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.85, 20), +(63, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.85, 20), +(64, 'wm1', 0, 0, 190, 190.701, -0.36741, 19, 68578, 45.85, 21), +(65, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.85, 21), +(66, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.85, 21), +(67, 'wm1', 0, 0, 190, 191.073, -0.561429, 19, 68623, 45.841, 22), +(68, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.841, 22), +(69, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.841, 22), +(70, 'wm1', 0, 0, 190, 190.796, -0.416979, 19, 68502, 45.864, 23), +(71, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.864, 23), +(72, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.864, 23), +(73, 'wm1', 0, 0, 190, 190.875, -0.458495, 19, 68548, 45.842, 24), +(74, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.842, 24), +(75, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.842, 24), +(76, 'wm1', 0, 0, 190, 190.967, -0.506622, 19, 68554, 45.847, 25), +(77, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.847, 25), +(78, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.847, 25), +(79, 'wm1', 0, 0, 190, 190.841, -0.4405, 19, 68537, 45.837, 26), +(80, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.837, 26), +(81, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.837, 26), +(82, 'wm1', 0, 0, 50, 50.0062, -0.0123505, 5, 119527, 99.841, 27), +(83, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.841, 27), +(84, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.841, 27), +(85, 'wm1', 0, 0, 50, 50.0312, -0.0623848, 5, 119563, 99.871, 28), +(86, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.871, 28), +(87, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.871, 28), +(88, 'wm1', 0, 0, 50, -113.154, -100, 5, 119370, 87.146, 29), +(89, 'wm2', 0, 0, 0, 0, -100, 0, 0, 87.146, 29), +(90, 'wm3', 0, 0, 0, 0, -100, 0, 0, 87.146, 29), +(91, 'wm1', 0, 0, 0, 19.0219, -100, 8, 6841, 64.05, 30), +(92, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.05, 30), +(93, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.05, 30), +(94, 'wm1', 0, 0, 0, 14.8243, -100, 3, 5327, 64.246, 31), +(95, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.246, 31), +(96, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.246, 31), +(97, 'wm1', 0, 0, 0, 14.7066, -100, 3, 5276, 64.346, 32), +(98, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.346, 32), +(99, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.346, 32), +(100, 'wm1', 0, 0, 0, 17.0307, -100, 4, 6120, 64.316, 33), +(101, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.316, 33), +(102, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.316, 33), +(103, 'wm1', 0, 0, 0, 14.9433, -100, 5, 5361, 64.328, 34), +(104, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.328, 34), +(105, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.328, 34), +(106, 'wm1', 0, 0, 0, 35.6131, -100, 34, 12773, 71.015, 35), +(107, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.015, 35), +(108, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.015, 35), +(109, 'wm1', 0, 0, 0, 37.8982, -100, 33, 13603, 71.007, 36), +(110, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.007, 36), +(111, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.007, 36), +(112, 'wm1', 0, 0, 0, 39.3708, -100, 28, 14121, 71.024, 37), +(113, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.024, 37), +(114, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.024, 37), +(115, 'wm1', 0, 0, 0, 38.3891, -100, 29, 13768, 71.021, 38), +(116, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.021, 38), +(117, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.021, 38), +(118, 'wm1', 0, 0, 0, 39.7502, -100, 32, 14268, 71.013, 39), +(119, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.013, 39), +(120, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.013, 39), +(121, 'wm1', 0, 0, 0, 59.1279, -100, 42, 21226, 69.587, 40), +(122, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.587, 40), +(123, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.587, 40), +(124, 'wm1', 0, 0, 0, 58.214, -100, 42, 20898, 69.564, 41), +(125, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.564, 41), +(126, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.564, 41), +(127, 'wm1', 0, 0, 0, 59.3587, -100, 43, 21309, 69.548, 42), +(128, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.548, 42), +(129, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.548, 42), +(130, 'wm1', 0, 0, 0, 58.2055, -100, 46, 20895, 69.524, 43), +(131, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.524, 43), +(132, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.524, 43), +(133, 'wm1', 0, 0, 0, 59.1874, -100, 43, 21230, 69.545, 44), +(134, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.545, 44), +(135, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.545, 44), +(136, 'wm1', 0, 0, 0, 79.3873, -100, 59, 28489, 69.226, 45), +(137, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.226, 45), +(138, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.226, 45), +(139, 'wm1', 0, 0, 0, 79.5877, -100, 54, 28566, 69.211, 46), +(140, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.211, 46), +(141, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.211, 46), +(142, 'wm1', 0, 0, 0, 78.178, -100, 57, 28060, 69.281, 47), +(143, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.281, 47), +(144, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.281, 47), +(145, 'wm1', 0, 0, 0, 79.4592, -100, 55, 28520, 69.18, 48), +(146, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.18, 48), +(147, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.18, 48), +(148, 'wm1', 0, 0, 0, 79.4478, -100, 60, 28510, 69.189, 49), +(149, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.189, 49), +(150, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.189, 49), +(151, 'wm1', 0, 0, 0, 119.112, -100, 85, 42785, 72.154, 50), +(152, 'wm2', 0, 0, 0, 0, -100, 0, 0, 72.154, 50), +(153, 'wm3', 0, 0, 0, 0, -100, 0, 0, 72.154, 50), +(154, 'wm1', 0, 0, 0, 119.29, -100, 85, 42845, 71.198, 51), +(155, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.198, 51), +(156, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.198, 51), +(157, 'wm1', 0, 0, 0, 119.209, -100, 86, 42822, 71.207, 52), +(158, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.207, 52), +(159, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.207, 52), +(160, 'wm1', 0, 0, 0, 119.434, -100, 87, 42891, 71.225, 53), +(161, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.225, 53), +(162, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.225, 53), +(163, 'wm1', 0, 0, 0, 119.206, -100, 87, 42826, 71.469, 54), +(164, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.469, 54), +(165, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.469, 54), +(166, 'wm1', 0, 0, 1410, 200.559, 603.034, 141, 7203, 44.567, 55), +(167, 'wm2', 0, 0, 0, 0, -100, 0, 0, 44.567, 55), +(168, 'wm3', 0, 0, 0, 0, -100, 0, 0, 44.567, 55), +(169, 'wm1', 0, 0, 1410, 200.571, 602.991, 141, 72032, 45.788, 56), +(170, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.788, 56), +(171, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.788, 56), +(172, 'wm1', 0, 0, 1400, 187.698, 645.881, 140, 71532, 45.616, 57), +(173, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.616, 57), +(174, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.616, 57), +(175, 'wm1', 0, 0, 1430, 186.342, 667.405, 143, 72077, 45.594, 58), +(176, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.594, 58), +(177, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.594, 58), +(178, 'wm1', 0, 0, 1420, 186.346, 662.024, 142, 72081, 45.602, 59), +(179, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.602, 59), +(180, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.602, 59), +(181, 'wm1', 0, 0, 1430, 200.703, 612.496, 143, 72079, 45.59, 60), +(182, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.59, 60), +(183, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.59, 60), +(184, 'wm1', 0, 0, 0, 989.503, -100, 705, 359760, 227.074, 61), +(185, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.074, 61), +(186, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.074, 61), +(187, 'wm1', 0, 0, 0, 1001.3, -100, 705, 359717, 227.025, 62), +(188, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.025, 62), +(189, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.025, 62), +(190, 'wm1', 0, 0, 0, 1002.82, -100, 705, 360253, 227.033, 63), +(191, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.033, 63), +(192, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.033, 63), +(193, 'wm1', 0, 0, 0, 1001.29, -100, 704, 359646, 227.044, 64), +(194, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.044, 64), +(195, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.044, 64), +(196, 'wm1', 0, 0, 0, 1002.58, -100, 705, 360167, 227.036, 65), +(197, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.036, 65), +(198, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.036, 65), +(199, 'wm1', 0, 0, 0, 1001.43, -100, 704, 359748, 227.023, 66), +(200, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.023, 66), +(201, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.023, 66), +(202, 'wm1', 0, 0, 1000, 1001.3, -0.130122, 704, 359716, 227.032, 67), +(203, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.032, 67), +(204, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.032, 67), +(205, 'wm1', 0, 0, 1001.42, 1002.83, -0.140678, 705, 360271, 227.041, 68), +(206, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.041, 68), +(207, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.041, 68), +(208, 'wm1', 0, 0, 1000, 1001.36, -0.135966, 704, 359725, 227.076, 69), +(209, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.076, 69), +(210, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.076, 69), +(211, 'wm1', 0, 0, 1000, 1001.25, -0.125136, 704, 359693, 227.051, 70), +(212, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.051, 70), +(213, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.051, 70), +(214, 'wm1', 0, 0, 1000, 1001.2, -0.119632, 704, 359685, 227.011, 71), +(215, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.011, 71), +(216, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.011, 71), +(217, 'wm1', 0, 0, 99.4318, 98.3085, 1.14262, 70, 235168, 348.14, 72), +(218, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.14, 72), +(219, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.14, 72), +(220, 'wm1', 0, 0, 99.4318, 98.2879, 1.16382, 70, 235024, 347.978, 73), +(221, 'wm2', 0, 0, 0, 0, -100, 0, 0, 347.978, 73), +(222, 'wm3', 0, 0, 0, 0, -100, 0, 0, 347.978, 73), +(223, 'wm1', 0, 0, 100.852, 99.8041, 1.05024, 71, 238677, 347.982, 74), +(224, 'wm2', 0, 0, 0, 0, -100, 0, 0, 347.982, 74), +(225, 'wm3', 0, 0, 0, 0, -100, 0, 0, 347.982, 74), +(226, 'wm1', 0, 0, 113.636, 98.5252, 15.3374, 80, 235575, 348.083, 75), +(227, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.083, 75), +(228, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.083, 75), +(229, 'wm1', 0, 0, 166.193, 99.9431, 66.2878, 117, 238973, 348.062, 76), +(230, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.062, 76), +(231, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.062, 76), +(232, 'wm1', 0, 0, 1410, 200.627, 602.798, 141, 72052, 45.611, 77), +(233, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.611, 77), +(234, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.611, 77), +(235, 'wm1', 0, 0, 1000, 1001.49, -0.149094, 704, 359781, 227.05, 78), +(236, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.05, 78), +(237, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.05, 78), +(238, 'wm1', 0, 0, 1000, 1001.43, -0.142637, 704, 359761, 227.05, 79), +(239, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.05, 79), +(240, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.05, 79), +(241, 'wm1', 0, 0, 1002.84, 1001.4, 0.143683, 706, 359700, 227.053, 80), +(242, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.053, 80), +(243, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.053, 80), +(244, 'wm1', 0, 0, 1000, 1001.56, -0.155696, 704, 359828, 227.003, 81), +(245, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.003, 81), +(246, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.003, 81), +(247, 'wm1', 0, 0, 1000, 1001.35, -0.135193, 704, 359701, 227.042, 82), +(248, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.042, 82), +(249, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.042, 82), +(250, 'wm1', 0, 0, 99.4318, 98.314, 1.13703, 70, 235067, 349.559, 83), +(251, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.559, 83), +(252, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.559, 83), +(253, 'wm1', 0, 0, 99.4318, 98.2718, 1.18042, 70, 234977, 349.421, 84), +(254, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.421, 84), +(255, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.421, 84), +(256, 'wm1', 0, 0, 100.852, 99.7588, 1.09611, 71, 238564, 349.376, 85), +(257, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.376, 85), +(258, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.376, 85), +(259, 'wm1', 0, 0, 99.4318, 98.4383, 1.00923, 70, 235362, 349.416, 86), +(260, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.416, 86), +(261, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.416, 86), +(262, 'wm1', 0, 0, 100.852, 99.8505, 1.00323, 71, 238786, 349.366, 87), +(263, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.366, 87), +(264, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.366, 87), +(265, 'wm1', 0, 0, 1065.34, 0, -100, 750, 360027, 227.383, 88), +(266, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.383, 88), +(267, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.383, 88), +(268, 'wm1', 0, 0, 1410, 200.609, 602.86, 141, 72048, 45.529, 89), +(269, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.529, 89), +(270, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.529, 89), +(271, 'wm1', 0, 0, 1420, 199.108, 613.18, 142, 71515, 45.508, 90), +(272, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.508, 90), +(273, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.508, 90), +(274, 'wm1', 0, 0, 1420, 200.65, 607.699, 142, 72044, 45.525, 91), +(275, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.525, 91), +(276, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.525, 91), +(277, 'wm1', 0, 0, 1420, 200.581, 607.943, 142, 72038, 45.531, 92), +(278, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.531, 92), +(279, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.531, 92), +(280, 'wm1', 0, 0, 1400, 199.228, 602.713, 140, 71552, 45.516, 93), +(281, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.516, 93), +(282, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.516, 93), +(283, 'wm1', 0, 0, 1800, 200.088, 799.605, 180, 71883, 51.546, 94), +(284, 'wm2', 0, 0, 13620, 201.24, 6668.03, 1362, 72297, 51.546, 94), +(285, 'wm3', 0, 0, 0, 0, -100, 0, 0, 51.546, 94), +(286, 'wm1', 0, 0, 1803.5, 201.596, 0, 179, 71845, 47.865, 95), +(287, 'wm2', 0, 0, 0, 201.596, 0, 1424, 72366, 47.865, 95), +(288, NULL, 0, 0, 1803.5, 201.596, -100, 0, 0, 47.865, 95), +(289, 'wm1', 0, 0, 543.097, 602.379, 0, 542, 215922, 153.747, 96), +(290, 'wm2', 0, 0, 59.7737, 602.379, 0, 4029, 216302, 153.747, 96), +(291, NULL, 0, 0, 602.871, 602.379, -100, 0, 0, 153.747, 96), +(292, 'wm1', 0, 0, 161.217, 200.829, 0, 160, 71536, 228.42, 97), +(293, 'wm2', 0, 0, 40.1069, 200.829, 0, 2703, 72051, 228.42, 97), +(294, NULL, 0, 0, 201.324, 200.829, -100, 0, 0, 228.42, 97), +(295, 'wm1', 0, 0, 539.861, 602.315, 0, 539, 216039, 143.349, 98), +(296, 'wm2', 0, 0, 62.3862, 602.315, 0, 4205, 216322, 143.349, 98), +(297, NULL, 0, 0, 602.247, 602.315, -100, 0, 0, 143.349, 98), +(298, 'wm1', 0, 0, 162.342, 200.79, 0, 161, 71484, 228.798, 99), +(299, 'wm2', 0, 0, 39.6096, 200.79, 0, 2669, 72038, 228.798, 99), +(300, NULL, 0, 0, 201.952, 200.79, -100, 0, 0, 228.798, 99), +(301, 'wm1', 0, 0, 0, 100.469, 0, 0, 16776800, 306.062, 100), +(302, 'wm2', 0, 0, 99.1319, 100.469, 0, 6683, 240176, 306.062, 100), +(303, NULL, 0, 0, 99.1319, 100.469, -100, 0, 0, 306.062, 100), +(304, 'wm1', 0, 0, 64.0209, 100.63, 0, 63, 236649, 125.141, 101), +(305, 'wm2', 0, 0, 37.3474, 100.63, 0, 2517, 240385, 125.141, 101), +(306, NULL, 0, 0, 101.368, 100.63, -100, 0, 0, 125.141, 101), +(307, 'wm1', 0, 0, 540.281, 602.188, 0, 539, 215872, 143.575, 102), +(308, 'wm2', 0, 0, 61.8944, 602.188, 0, 4172, 216331, 143.575, 102), +(309, NULL, 0, 0, 602.175, 602.188, -100, 0, 0, 143.575, 102), +(310, 'wm1', 0, 0, 160.017, 200.86, 0, 159, 71622, 229.251, 103), +(311, 'wm2', 0, 0, 39.8327, 200.86, 0, 2684, 72037, 229.251, 103), +(312, NULL, 0, 0, 199.849, 200.86, -100, 0, 0, 229.251, 103), +(313, 'wm1', 0, 0, 0, 100.438, 0, 0, 16776900, 338.589, 104), +(314, 'wm2', 0, 0, 99.0655, 100.438, 0, 6678, 240137, 338.589, 104), +(315, NULL, 0, 0, 99.0655, 100.438, -100, 0, 0, 338.589, 104), +(316, 'wm1', 0, 0, 63.1665, 100.639, 0, 62, 236049, 124.339, 105), +(317, 'wm2', 0, 0, 37.3833, 100.639, 0, 2519, 240351, 124.339, 105), +(318, NULL, 0, 0, 100.55, 100.639, -100, 0, 0, 124.339, 105), +(319, 'wm1', 0, 0, 539.968, 602.378, 0, 539, 215998, 143.511, 106), +(320, 'wm2', 0, 0, 62.1642, 602.378, 0, 4191, 216374, 143.511, 106), +(321, NULL, 0, 0, 602.132, 602.378, -100, 0, 0, 143.511, 106), +(322, 'wm1', 0, 0, 160.774, 200.842, 0, 160, 71733, 229.662, 107), +(323, 'wm2', 0, 0, 40.1103, 200.842, 0, 2703, 72045, 229.662, 107), +(324, NULL, 0, 0, 200.884, 200.842, -100, 0, 0, 229.662, 107), +(325, 'wm1', 0, 0, 541.727, 602.268, 0, 540, 215697, 142.272, 108), +(326, 'wm2', 0, 0, 61.7283, 602.268, 0, 4161, 216343, 142.272, 108), +(327, NULL, 0, 0, 603.456, 602.268, -100, 0, 0, 142.272, 108), +(328, 'wm1', 0, 0, 161.883, 200.809, 0, 161, 71688, 227.334, 109), +(329, 'wm2', 0, 0, 39.8706, 200.809, 0, 2687, 72050, 227.334, 109), +(330, NULL, 0, 0, 201.753, 200.809, -100, 0, 0, 227.334, 109), +(331, 'wm1', 0, 0, 0, 100.452, 0, 0, 16777200, 303.052, 110), +(332, 'wm2', 0, 0, 99.1244, 100.452, 0, 6683, 240196, 303.052, 110), +(333, NULL, 0, 0, 99.1244, 100.452, -100, 0, 0, 303.052, 110), +(334, 'wm1', 0, 0, 59.9333, 100.63, 0, 59, 236755, 123.913, 111), +(335, 'wm2', 0, 0, 39.6961, 100.63, 0, 2676, 240465, 123.913, 111), +(336, NULL, 0, 0, 99.6293, 100.63, -100, 0, 0, 123.913, 111), +(337, 'wm1', 0, 0, 557.026, 601.566, 0, 556, 215744, 141.812, 112), +(338, 'wm2', 0, 0, 44.2035, 601.566, 0, 2980, 216121, 141.812, 112), +(339, NULL, 0, 0, 601.229, 601.566, -100, 0, 0, 141.812, 112), +(340, 'wm1', 0, 0, 540.17, 573.441, 0, 539, 215673, 141.843, 113), +(341, 'wm2', 0, 0, 61.4893, 573.441, 0, 4145, 216103, 141.843, 113), +(342, NULL, 0, 0, 601.659, 573.441, -100, 0, 0, 141.843, 113), +(343, 'wm1', 0, 0, 163.388, 200.576, 0, 163, 71857, 227.385, 114), +(344, 'wm2', 0, 0, 38.3645, 200.576, 0, 2586, 72011, 227.385, 114), +(345, NULL, 0, 0, 201.752, 200.576, -100, 0, 0, 227.385, 114), +(346, 'wm1', 0, 0, 0, 100.307, 0, 0, 16777100, 327.749, 115), +(347, 'wm2', 0, 0, 99.0589, 100.307, 0, 6678, 240098, 327.749, 115), +(348, NULL, 0, 0, 99.0589, 100.307, -100, 0, 0, 327.749, 115), +(349, 'wm1', 0, 0, 52.1295, 100.396, 0, 52, 239733, 124.195, 116), +(350, 'wm2', 0, 0, 47.3139, 100.396, 0, 3189, 240255, 124.195, 116), +(351, NULL, 0, 0, 99.4434, 100.396, -100, 0, 0, 124.195, 116), +(352, 'wm1', 0, 0, 557.773, 601.589, 0, 556, 215452, 142.352, 117), +(353, 'wm2', 0, 0, 44.6397, 601.589, 0, 3009, 216089, 142.352, 117), +(354, NULL, 0, 0, 602.413, 601.589, -100, 0, 0, 142.352, 117), +(355, 'wm1', 0, 0, 164.399, 200.602, 0, 163, 71416, 228.639, 118), +(356, 'wm2', 0, 0, 34.6523, 200.602, 0, 2335, 71988, 228.639, 118), +(357, NULL, 0, 0, 199.051, 200.602, -100, 0, 0, 228.639, 118), +(358, 'wm1', 0, 0, 0, 100.3, 0, 0, 16776800, 334.338, 119), +(359, 'wm2', 0, 0, 98.9856, 100.3, 0, 6673, 240094, 334.338, 119), +(360, NULL, 0, 0, 98.9856, 100.3, -100, 0, 0, 334.338, 119), +(361, 'wm1', 0, 0, 55.8177, 100.388, 0, 55, 236818, 122.406, 120), +(362, 'wm2', 0, 0, 43.7202, 100.388, 0, 2946, 240200, 122.406, 120), +(363, NULL, 0, 0, 99.538, 100.388, -100, 0, 0, 122.406, 120), +(364, 'wm1', 0, 0, 556.23, 601.44, 0, 555, 215658, 143.394, 121), +(365, 'wm2', 0, 0, 44.9828, 601.44, 0, 3032, 216077, 143.394, 121), +(366, NULL, 0, 0, 601.213, 601.44, -100, 0, 0, 143.394, 121), +(367, 'wm1', 0, 0, 163.633, 200.636, 0, 162, 71310, 227.823, 122), +(368, 'wm2', 0, 0, 35.0535, 200.636, 0, 2362, 71987, 227.823, 122), +(369, NULL, 0, 0, 198.687, 200.636, -100, 0, 0, 227.823, 122), +(370, 'wm1', 0, 0, 72.6003, 100.304, 0, 71, 234833, 327.562, 123), +(371, 'wm2', 0, 0, 26.5379, 100.304, 0, 1788, 239960, 327.562, 123), +(372, NULL, 0, 0, 99.1382, 100.304, -100, 0, 0, 327.562, 123), +(373, 'wm1', 0, 0, 58.5186, 100.385, 0, 57, 234099, 123.939, 124), +(374, 'wm2', 0, 0, 41.0619, 100.385, 0, 2767, 240208, 123.939, 124), +(375, NULL, 0, 0, 99.5805, 100.385, -100, 0, 0, 123.939, 124), +(376, 'wm1', 0, 0, 75.3241, 99.9558, 0, 73, 232934, 140.349, 125), +(377, 'wm2', 0, 0, 2666.08, 99.9558, 0, 2665, 240253, 140.349, 125), +(378, NULL, 0, 0, 2741.4, 99.9558, 2642.61, 0, 0, 140.349, 125), +(379, 'wm1', 0, 0, 489.792, 504.357, 0, 488, 17970, 45.555, 126), +(380, 'wm2', 0, 0, 462.179, 504.357, 0, 462, 18029, 45.555, 126), +(381, NULL, 0, 0, 951.972, 504.357, 88.7494, 0, 0, 45.555, 126), +(382, 'wm1', 0, 0, 82.0731, -0.00400604, 0, 72, 210923, 141.941, 127), +(383, 'wm2', 0, 0, 675.712, -0.00400604, 0, 601, 213848, 141.941, 127), +(384, NULL, 0, 0, 757.785, -0.00400604, 100, 0, 0, 141.941, 127), +(385, 'wm1', 0, 0, 98.6875, 100.371, 0, 97, 236187, 138.923, 128), +(386, 'wm2', 0, 0, 545.886, 100.371, 0, 544, 239466, 138.923, 128), +(387, NULL, 0, 0, 644.573, 100.371, 542.19, 0, 0, 138.923, 128), +(388, 'wm1', 0, 0, 490.496, 504.323, 0, 489, 17979, 47.722, 129), +(389, 'wm2', 0, 0, 449.746, 504.323, 0, 448, 17964, 47.722, 129), +(390, NULL, 0, 0, 940.242, 504.323, 86.4366, 0, 0, 47.722, 129), +(391, 'wm1', 0, 0, 74.2185, 100.377, 0, 73, 236351, 139.708, 130), +(392, 'wm2', 0, 0, 26.0858, 100.377, 0, 949, 240164, 139.708, 130), +(393, NULL, 0, 0, 100.304, 100.377, -0.0721921, 0, 0, 139.708, 130), +(394, 'wm1', 0, 0, 75.1074, 100.372, 0, 74, 236753, 139.606, 131), +(395, 'wm2', 0, 0, 24.9824, 100.372, 0, 909, 240201, 139.606, 131), +(396, NULL, 0, 0, 100.09, 100.372, -0.281415, 0, 0, 139.606, 131), +(397, 'wm1', 0, 0, 492.546, 503.6, 0, 492, 18012, 50.305, 132), +(398, 'wm2', 0, 0, 12.0006, 503.6, 0, 436, 17998, 50.305, 132), +(399, NULL, 0, 0, 504.547, 503.6, 0.18799, 0, 0, 50.305, 132), +(400, 'wm1', 0, 0, 77.6625, 100.363, 0, 77, 238250, 137.485, 133), +(401, 'wm2', 0, 0, 25.5386, 100.363, 0, 928, 239885, 137.485, 133), +(402, NULL, 0, 0, 103.201, 100.363, 2.82741, 0, 0, 137.485, 133), +(403, 'wm1', 0, 0, 75.623, 100.359, 0, 74, 235132, 141.199, 134), +(404, 'wm2', 0, 0, 24.7192, 100.359, 0, 899, 240081, 141.199, 134), +(405, NULL, 0, 0, 100.342, 100.359, -0.0170743, 0, 0, 141.199, 134), +(406, 'wm1', 0, 0, 75.605, 100.366, 0, 74, 235192, 141.235, 135), +(407, 'wm2', 0, 0, 24.7174, 100.366, 0, 899, 240102, 141.235, 135), +(408, NULL, 0, 0, 100.322, 100.366, -0.0431846, 0, 0, 141.235, 135), +(409, 'wm1', 0, 0, 75.5147, 100.362, 0, 74, 235473, 141.167, 136), +(410, 'wm2', 0, 0, 24.7436, 100.362, 0, 900, 240115, 141.167, 136), +(411, NULL, 0, 0, 100.258, 100.362, -0.103241, 0, 0, 141.167, 136), +(412, 'wm1', 0, 0, 75.4228, 100.36, 0, 74, 235758, 141.205, 137), +(413, 'wm2', 0, 0, 24.708, 100.36, 0, 898, 239925, 141.205, 137), +(414, NULL, 0, 0, 100.131, 100.36, -0.228191, 0, 0, 141.205, 137), +(415, 'wm1', 0, 0, 491.526, 504.026, 0, 490, 17979, 45.287, 138), +(416, 'wm2', 0, 0, 12.6683, 504.026, 0, 460, 17991, 45.287, 138), +(417, NULL, 0, 0, 504.194, 504.026, 0.0334405, 0, 0, 45.287, 138), +(418, 'wm1', 0, 0, 489.815, 503.921, 0, 489, 18000, 53.029, 139), +(419, 'wm2', 0, 0, 11.188, 503.921, 0, 406, 17975, 53.029, 139), +(420, NULL, 0, 0, 501.003, 503.921, -0.578981, 0, 0, 53.029, 139), +(421, 'wm1', 0, 0, 488.217, 504.187, 0, 488, 18028, 46.504, 140), +(422, 'wm2', 0, 0, 13.5857, 504.187, 0, 494, 18017, 46.504, 140), +(423, NULL, 0, 0, 501.802, 504.187, -0.47295, 0, 0, 46.504, 140), +(424, 'wm1', 0, 0, 492.708, 0, 0, 492, 18073, 46.696, 141), +(425, 'wm2', 0, 0, 13.5107, 0, 0, 491, 18070, 46.696, 141), +(426, NULL, 0, 0, 506.218, 0, 100, 0, 0, 46.696, 141), +(427, 'wm1', 0, 0, 487.947, 504.17, 0, 487, 18001, 46.473, 142), +(428, 'wm2', 0, 0, 13.513, 504.17, 0, 491, 18004, 46.473, 142), +(429, NULL, 0, 0, 501.46, 504.17, -0.537467, 0, 0, 46.473, 142), +(430, 'wm1', 0, 0, 74.6587, 100.373, 0, 74, 238169, 141.214, 143), +(431, 'wm2', 0, 0, 25.5406, 100.373, 0, 928, 239855, 141.214, 143), +(432, NULL, 0, 0, 100.199, 100.373, -0.172598, 0, 0, 141.214, 143), +(433, 'wm1', 0, 0, 74.9823, 100.358, 0, 74, 237145, 141.271, 144), +(434, 'wm2', 0, 0, 25.4422, 100.358, 0, 925, 240009, 141.271, 144), +(435, NULL, 0, 0, 100.424, 100.358, 0.066253, 0, 0, 141.271, 144), +(436, 'wm1', 0, 0, 74.3745, 100.363, 0, 73, 235854, 139.594, 145), +(437, 'wm2', 0, 0, 26.0476, 100.363, 0, 947, 240008, 139.594, 145), +(438, NULL, 0, 0, 100.422, 100.363, 0.058488, 0, 0, 139.594, 145), +(439, 'wm1', 0, 0, 74.6596, 100.368, 0, 74, 238170, 139.621, 146), +(440, 'wm2', 0, 0, 26.0331, 100.368, 0, 947, 240140, 139.621, 146), +(441, NULL, 0, 0, 100.693, 100.368, 0.323303, 0, 0, 139.621, 146), +(442, 'wm1', 0, 0, 73.2231, 100.381, 0, 72, 236290, 136.57, 147), +(443, 'wm2', 0, 0, 26.7173, 100.381, 0, 971, 239931, 136.57, 147), +(444, NULL, 0, 0, 99.9404, 100.381, -0.438539, 0, 0, 136.57, 147), +(445, 'wm1', 0, 0, 78.0386, 100.37, 0, 76, 234015, 141.259, 148), +(446, 'wm2', 0, 0, 25.6718, 100.37, 0, 933, 239918, 141.259, 148), +(447, NULL, 0, 0, 103.71, 100.37, 3.32821, 0, 0, 141.259, 148), +(448, 'wm1', 0, 0, 74.6587, 100.375, 0, 74, 238173, 141.35, 149), +(449, 'wm2', 0, 0, 25.6336, 100.375, 0, 932, 240019, 141.35, 149), +(450, NULL, 0, 0, 100.292, 100.375, -0.0825531, 0, 0, 141.35, 149), +(451, 'wm1', 0, 0, 492.365, 504.625, 0, 491, 17980, 52.841, 150), +(452, 'wm2', 0, 0, 11.25, 504.625, 0, 409, 18008, 52.841, 150), +(453, NULL, 0, 0, 503.615, 504.625, -0.200126, 0, 0, 52.841, 150), +(454, 'wm1', 0, 0, 491.381, 504.69, 0, 491, 18021, 46.735, 151), +(455, 'wm2', 0, 0, 13.7752, 504.69, 0, 501, 18020, 46.735, 151), +(456, NULL, 0, 0, 505.157, 504.69, 0.0923647, 0, 0, 46.735, 151), +(457, 'wm1', 0, 0, 27.5599, 50.1737, 0, 13, 56655, 188.906, 152), +(458, 'wm2', 0, 0, 49.5245, 50.1737, 0, 1802, 120062, 188.906, 152), +(459, NULL, 0, 0, 77.0843, 50.1737, 53.6348, 0, 0, 188.906, 152), +(460, 'wm1', 0, 0, 0, 50.1733, 0, 0, 16759000, 115.456, 153), +(461, 'wm2', 0, 0, 49.7609, 50.1733, 0, 1810, 120090, 115.456, 153), +(462, NULL, 0, 0, 49.7609, 50.1733, -0.821942, 0, 0, 115.456, 153), +(466, 'wm1', 0, 0, 0, 50.1685, 0, 0, 16759600, 99.018, 154), +(467, 'wm2', 0, 0, 49.7571, 50.1685, 0, 1810, 120133, 99.018, 154), +(468, NULL, 0, 0, 49.7571, 50.1685, -0.820005, 0, 0, 99.018, 154), +(469, 'wm1', 0, 0, 0, 50.1626, 0, 0, 16658100, 96.306, 155), +(470, 'wm2', 0, 0, 50.0808, 50.1626, 0, 1822, 120151, 96.306, 155), +(471, NULL, 0, 0, 50.0808, 50.1626, -0.163181, 0, 0, 96.306, 155), +(472, 'wm1', 0, 0, 49.905, 50.1651, 0, 49, 117977, 131.275, 156), +(473, 'wm2', 0, 0, 0.871778, 50.1651, 0, 30, 113595, 131.275, 156), +(474, NULL, 0, 0, 50.7768, 50.1651, 1.21934, 0, 0, 131.275, 156), +(475, 'wm1', 0, 0, 0, 50.1782, 0, 0, 16775900, 98.471, 157), +(476, 'wm2', 0, 0, 49.8067, 50.1782, 0, 1812, 120144, 98.471, 157), +(477, NULL, 0, 0, 49.8067, 50.1782, -0.740387, 0, 0, 98.471, 157), +(478, 'wm1', 0, 0, 47.7762, 50.1848, 0, 47, 118256, 99.223, 158), +(479, 'wm2', 0, 0, 6.77178, 50.1848, 0, 245, 119481, 99.223, 158), +(480, NULL, 0, 0, 54.548, 50.1848, 8.69418, 0, 0, 99.223, 158), +(481, 'wm1', 0, 0, 74.1062, 100.354, 0, 73, 236704, 140.713, 159), +(482, 'wm2', 0, 0, 26.1197, 100.354, 0, 950, 240100, 140.713, 159), +(483, NULL, 0, 0, 100.226, 100.354, -0.127919, 0, 0, 140.713, 159), +(484, 'wm1', 0, 0, 74.2084, 100.374, 0, 73, 236381, 140.877, 160), +(485, 'wm2', 0, 0, 26.1285, 100.374, 0, 950, 240022, 140.877, 160), +(486, NULL, 0, 0, 100.337, 100.374, -0.0366976, 0, 0, 140.877, 160), +(487, 'wm1', 0, 0, 74.1989, 100.373, 0, 74, 239647, 140.826, 161), +(488, 'wm2', 0, 0, 26.1314, 100.373, 0, 951, 240245, 140.826, 161), +(489, NULL, 0, 0, 100.33, 100.373, -0.0427862, 0, 0, 140.826, 161), +(490, 'wm1', 0, 0, 74.1353, 100.376, 0, 73, 236615, 140.842, 162), +(491, 'wm2', 0, 0, 26.0834, 100.376, 0, 949, 240185, 140.842, 162), +(492, NULL, 0, 0, 100.219, 100.376, -0.157146, 0, 0, 140.842, 162), +(493, 'wm1', 0, 0, 74.2927, 100.37, 0, 73, 236113, 140.91, 163), +(494, 'wm2', 0, 0, 26.0364, 100.37, 0, 947, 240110, 140.91, 163), +(495, NULL, 0, 0, 100.329, 100.37, -0.0412443, 0, 0, 140.91, 163), +(496, 'wm1', 0, 0, 495.357, 504.056, 0, 495, 18025, 42.394, 164), +(497, 'wm2', 0, 0, 13.6965, 504.056, 0, 498, 18018, 42.394, 164), +(498, NULL, 0, 0, 509.053, 504.056, 0.991396, 0, 0, 42.394, 164), +(499, 'wm1', 0, 0, 498.714, 503.279, 0, 497, 17976, 42.413, 165), +(500, 'wm2', 0, 0, 13.6895, 503.279, 0, 497, 17991, 42.413, 165), +(501, NULL, 0, 0, 512.404, 503.279, 1.81312, 0, 0, 42.413, 165), +(502, 'wm1', 0, 0, 490.305, 503.794, 0, 489, 17991, 42.458, 166), +(503, 'wm2', 0, 0, 13.6253, 503.794, 0, 495, 18004, 42.458, 166), +(504, NULL, 0, 0, 503.93, 503.794, 0.0269924, 0, 0, 42.458, 166), +(505, 'wm1', 0, 0, 489.302, 502.942, 0, 488, 17990, 42.43, 167), +(506, 'wm2', 0, 0, 13.6734, 502.942, 0, 496, 17976, 42.43, 167), +(507, NULL, 0, 0, 502.975, 502.942, 0.00666853, 0, 0, 42.43, 167), +(508, 'wm1', 0, 0, 491.288, 503.876, 0, 489, 17955, 42.466, 168), +(509, 'wm2', 0, 0, 13.6536, 503.876, 0, 496, 18003, 42.466, 168), +(510, NULL, 0, 0, 504.941, 503.876, 0.21141, 0, 0, 42.466, 168), +(511, 'wm1', 0, 0, 0, 50.1636, 0, 0, 16751600, 91.977, 169), +(512, 'wm2', 0, 0, 49.8958, 50.1636, 0, 1815, 120147, 91.977, 169), +(513, NULL, 0, 0, 49.8958, 50.1636, -0.533731, 0, 0, 91.977, 169), +(514, 'wm1', 0, 0, 0, 50.1793, 0, 0, 16751600, 91.859, 170), +(515, 'wm2', 0, 0, 49.8929, 50.1793, 0, 1815, 120153, 91.859, 170), +(516, NULL, 0, 0, 49.8929, 50.1793, -0.570654, 0, 0, 91.859, 170), +(517, 'wm1', 0, 0, 0, 50.1736, 0, 0, 16664800, 93.553, 171), +(518, 'wm2', 0, 0, 49.8341, 50.1736, 0, 1812, 120091, 93.553, 171), +(519, NULL, 0, 0, 49.8341, 50.1736, -0.676682, 0, 0, 93.553, 171), +(520, 'wm1', 0, 0, 1.8742, 50.1676, 0, 1, 64147, 92.725, 172), +(521, 'wm2', 0, 0, 49.7989, 50.1676, 0, 1812, 120179, 92.725, 172), +(522, NULL, 0, 0, 51.673, 50.1676, 3.00085, 0, 0, 92.725, 172), +(523, 'wm1', 0, 0, 0, 50.1676, 0, 0, 16767800, 94.104, 173), +(524, 'wm2', 0, 0, 49.8321, 50.1676, 0, 1813, 120158, 94.104, 173), +(525, NULL, 0, 0, 49.8321, 50.1676, -0.668642, 0, 0, 94.104, 173), +(526, 'wm1', 0, 0, 49.2621, 50.1722, 0, 48, 117100, 113.708, 174), +(527, 'wm2', 0, 0, 1.97506, 50.1722, 0, 70, 117016, 113.708, 174), +(528, NULL, 0, 0, 51.2372, 50.1722, 2.12265, 0, 0, 113.708, 174), +(529, 'wm1', 0, 0, 49.5521, 50.1769, 0, 49, 118842, 114.165, 175), +(530, 'wm2', 0, 0, 1.35864, 50.1769, 0, 48, 116646, 114.165, 175), +(531, NULL, 0, 0, 50.9107, 50.1769, 1.46246, 0, 0, 114.165, 175), +(532, 'wm1', 0, 0, 50.3895, 50.1726, 0, 50, 119249, 115.974, 176), +(533, 'wm2', 0, 0, 0.979079, 50.1726, 0, 35, 118025, 115.974, 176), +(534, NULL, 0, 0, 51.3686, 50.1726, 2.38378, 0, 0, 115.974, 176), +(535, 'wm1', 0, 0, 49.9235, 50.1733, 0, 49, 117955, 117.023, 177), +(536, 'wm2', 0, 0, 0.974843, 50.1733, 0, 34, 115151, 117.023, 177), +(537, NULL, 0, 0, 50.8983, 50.1733, 1.445, 0, 0, 117.023, 177), +(538, 'wm1', 0, 0, 49.7678, 50.1693, 0, 49, 118324, 114.351, 178), +(539, 'wm2', 0, 0, 1.42521, 50.1693, 0, 50, 115828, 114.351, 178), +(540, NULL, 0, 0, 51.193, 50.1693, 2.04042, 0, 0, 114.351, 178), +(541, 'wm1', 0, 0, 71.9354, 100.371, 0, 71, 237188, 131.394, 179), +(542, 'wm2', 0, 0, 28.5036, 100.371, 0, 1037, 240190, 131.394, 179), +(543, NULL, 0, 0, 100.439, 100.371, 0.0675517, 0, 0, 131.394, 179), +(544, 'wm1', 0, 0, 73.7589, 100.378, 0, 72, 234559, 139.926, 180), +(545, 'wm2', 0, 0, 26.7775, 100.378, 0, 974, 240116, 139.926, 180), +(546, NULL, 0, 0, 100.536, 100.378, 0.158155, 0, 0, 139.926, 180), +(547, 'wm1', 0, 0, 493.198, 0, 0, 492, 18065, 42.743, 181), +(548, 'wm2', 0, 0, 496.192, 0, 0, 496, 18102, 42.743, 181), +(549, NULL, 0, 0, 989.39, 0, 100, 0, 0, 42.743, 181), +(550, 'wm1', 0, 0, 106.428, 100.47, 0, 106, 35903, 67.678, 182), +(551, 'wm2', 0, 0, 17.4985, 100.47, 0, 16, 32961, 67.678, 182), +(552, NULL, 0, 0, 123.927, 100.47, 23.3465, 0, 0, 67.678, 182), +(553, 'wm1', 0, 0, 0, 50.1727, 0, 0, 16703200, 97.673, 183), +(554, 'wm2', 0, 0, 1811.81, 50.1727, 0, 1811, 120157, 97.673, 183), +(555, NULL, 0, 0, 1811.81, 50.1727, 3511.15, 0, 0, 97.673, 183), +(556, 'wm1', 0, 0, 35.6682, 50.2214, 0, 35, 118063, 65.623, 184), +(557, 'wm2', 0, 0, 536.7, 50.2214, 0, 535, 119936, 65.623, 184), +(558, NULL, 0, 0, 572.368, 50.2214, 1039.69, 0, 0, 65.623, 184), +(559, 'wm1', 0, 0, 591.655, 606.406, 0, 591, 21646, 28.282, 185), +(560, 'wm2', 0, 0, 15.6427, 606.406, 0, 569, 21655, 28.282, 185), +(561, NULL, 0, 0, 607.298, 606.406, 0.147111, 0, 0, 28.282, 185), +(562, 'wm1', 0, 0, 170.954, 200.698, 0, 170, 71668, 94.607, 186), +(563, 'wm2', 0, 0, 29.8979, 200.698, 0, 1087, 71985, 94.607, 186), +(564, NULL, 0, 0, 200.851, 200.698, 0.0762261, 0, 0, 94.607, 186), +(565, 'wm1', 0, 0, 594.796, 604.97, 0, 594, 21643, 28.098, 187), +(566, 'wm2', 0, 0, 14.4853, 604.97, 0, 526, 21620, 28.098, 187), +(567, NULL, 0, 0, 609.281, 604.97, 0.712705, 0, 0, 28.098, 187), +(568, 'wm1', 0, 0, 175.906, 200.643, 0, 175, 71699, 94.872, 188), +(569, 'wm2', 0, 0, 26.9631, 200.643, 0, 980, 71963, 94.872, 188), +(570, NULL, 0, 0, 202.869, 200.643, 1.1091, 0, 0, 94.872, 188), +(571, 'wm1', 0, 0, 0, 100.291, 0, 0, 16635600, 200.285, 189), +(572, 'wm2', 0, 0, 99.5408, 100.291, 0, 3623, 240188, 200.285, 189), +(573, NULL, 0, 0, 99.5408, 100.291, -0.748225, 0, 0, 200.285, 189), +(574, 'wm1', 0, 0, 97.9918, 100.314, 0, 97, 237751, 226.58, 190), +(575, 'wm2', 0, 0, 3.8521, 100.314, 0, 139, 238098, 226.58, 190), +(576, NULL, 0, 0, 101.844, 100.314, 1.52492, 0, 0, 226.58, 190), +(577, 'wm1', 0, 0, 0, 50.1568, 0, 0, 16775500, 98.315, 191), +(578, 'wm2', 0, 0, 49.8346, 50.1568, 0, 1813, 120146, 98.315, 191), +(579, NULL, 0, 0, 49.8346, 50.1568, -0.642228, 0, 0, 98.315, 191), +(580, 'wm1', 0, 0, 49.1247, 50.1749, 0, 49, 119872, 116.002, 192), +(581, 'wm2', 0, 0, 1.79279, 50.1749, 0, 64, 117861, 116.002, 192), +(582, NULL, 0, 0, 50.9175, 50.1749, 1.47987, 0, 0, 116.002, 192), +(583, 'wm1', 0, 0, 72.4993, 100.348, 0, 72, 238634, 141.267, 193), +(584, 'wm2', 0, 0, 27.9995, 100.348, 0, 1019, 240246, 141.267, 193), +(585, NULL, 0, 0, 100.499, 100.348, 0.150386, 0, 0, 141.267, 193), +(586, 'wm1', 0, 0, 494.178, 504.997, 0, 493, 17997, 41.633, 194), +(587, 'wm2', 0, 0, 11.9602, 504.997, 0, 434, 17984, 41.633, 194), +(588, NULL, 0, 0, 506.138, 504.997, 0.226031, 0, 0, 41.633, 194), +(589, 'wm1', 0, 0, 0, 50.1627, 0, 0, 16661200, 97.565, 195), +(590, 'wm2', 0, 0, 49.7392, 50.1627, 0, 1809, 120112, 97.565, 195), +(591, NULL, 0, 0, 49.7392, 50.1627, -0.844329, 0, 0, 97.565, 195), +(592, 'wm1', 0, 0, 49.6052, 50.1735, 0, 48, 116289, 115.859, 196), +(593, 'wm2', 0, 0, 1.43312, 50.1735, 0, 51, 117493, 115.859, 196), +(594, NULL, 0, 0, 51.0384, 50.1735, 1.72377, 0, 0, 115.859, 196), +(595, 'wm1', 0, 0, 0, 100.294, 0, 0, 16640800, 195.803, 197), +(596, 'wm2', 0, 0, 99.5411, 100.294, 0, 3622, 240122, 195.803, 197), +(597, NULL, 0, 0, 99.5411, 100.294, -0.750601, 0, 0, 195.803, 197), +(598, 'wm1', 0, 0, 98.7868, 100.305, 0, 98, 238268, 229.086, 198), +(599, 'wm2', 0, 0, 3.14719, 100.305, 0, 113, 236915, 229.086, 198), +(600, NULL, 0, 0, 101.934, 100.305, 1.62398, 0, 0, 229.086, 198), +(601, 'wm1', 0, 0, 176.134, 200.654, 0, 176, 72017, 94.671, 199), +(602, 'wm2', 0, 0, 29.5001, 200.654, 0, 1073, 72018, 94.671, 199), +(603, NULL, 0, 0, 205.635, 200.654, 2.48213, 0, 0, 94.671, 199), +(604, 'wm1', 0, 0, 591.956, 606.727, 0, 591, 21635, 28.131, 200), +(605, 'wm2', 0, 0, 14.2884, 606.727, 0, 520, 21666, 28.131, 200), +(606, NULL, 0, 0, 606.244, 606.727, -0.0795022, 0, 0, 28.131, 200), +(607, 'wm1', 0, 0, 0, 100.287, 0, 0, 16704700, 209.122, 201), +(608, 'wm2', 0, 0, 99.3867, 100.287, 0, 3617, 240153, 209.122, 201), +(609, NULL, 0, 0, 99.3867, 100.287, -0.897473, 0, 0, 209.122, 201), +(610, 'wm1', 0, 0, 98.913, 100.298, 0, 98, 237960, 233.016, 202), +(611, 'wm2', 0, 0, 3.03071, 100.298, 0, 109, 237308, 233.016, 202), +(612, NULL, 0, 0, 101.944, 100.298, 1.64045, 0, 0, 233.016, 202), +(613, 'wm1', 0, 0, 171.998, 200.67, 0, 171, 71652, 94.471, 203), +(614, 'wm2', 0, 0, 28.5873, 200.67, 0, 1040, 72030, 94.471, 203), +(615, NULL, 0, 0, 200.585, 200.67, -0.0424223, 0, 0, 94.471, 203), +(616, 'wm1', 0, 0, 591.501, 606.742, 0, 590, 21616, 28.114, 204), +(617, 'wm2', 0, 0, 14.2498, 606.742, 0, 518, 21642, 28.114, 204), +(618, NULL, 0, 0, 605.751, 606.742, -0.163396, 0, 0, 28.114, 204), +(619, 'wm1', 0, 0, 0, 100.276, 0, 0, 16652900, 202.784, 205), +(620, 'wm2', 0, 0, 99.4533, 100.276, 0, 3619, 240131, 202.784, 205), +(621, NULL, 0, 0, 99.4533, 100.276, -0.820459, 0, 0, 202.784, 205), +(622, 'wm1', 0, 0, 99.9299, 100.296, 0, 99, 237940, 235.554, 206), +(623, 'wm2', 0, 0, 2.00189, 100.296, 0, 72, 237312, 235.554, 206), +(624, NULL, 0, 0, 101.932, 100.296, 1.63113, 0, 0, 235.554, 206), +(625, 'wm1', 0, 0, 175.047, 200.603, 0, 174, 71640, 94.605, 207), +(626, 'wm2', 0, 0, 29.7242, 200.603, 0, 1081, 72007, 94.605, 207), +(627, NULL, 0, 0, 204.771, 200.603, 2.07753, 0, 0, 94.605, 207), +(628, 'wm1', 0, 0, 592.301, 607.594, 0, 592, 21661, 28.149, 208), +(629, 'wm2', 0, 0, 14.2505, 607.594, 0, 518, 21642, 28.149, 208), +(630, NULL, 0, 0, 606.551, 607.594, -0.171686, 0, 0, 28.149, 208), +(631, 'wm1', 0, 0, 1.40603, 100.278, 0, 1, 170840, 200.653, 209), +(632, 'wm2', 0, 0, 99.6419, 100.278, 0, 3626, 240142, 200.653, 209), +(633, NULL, 0, 0, 101.048, 100.278, 0.768322, 0, 0, 200.653, 209), +(634, 'wm1', 0, 0, 98.8428, 100.299, 0, 98, 238131, 230.112, 210), +(635, 'wm2', 0, 0, 3.03594, 100.299, 0, 109, 236901, 230.112, 210), +(636, NULL, 0, 0, 101.879, 100.299, 1.57492, 0, 0, 230.112, 210), +(637, 'wm1', 0, 0, 170.595, 200.688, 0, 169, 71398, 93.603, 211), +(638, 'wm2', 0, 0, 29.5682, 200.688, 0, 1075, 71986, 93.603, 211), +(639, NULL, 0, 0, 200.164, 200.688, -0.261361, 0, 0, 93.603, 211), +(640, 'wm1', 0, 0, 592.476, 607.612, 0, 591, 21618, 27.98, 212), +(641, 'wm2', 0, 0, 14.2427, 607.612, 0, 517, 21612, 27.98, 212), +(642, NULL, 0, 0, 606.719, 607.612, -0.14703, 0, 0, 27.98, 212), +(643, 'wm1', 0, 0, 0, 100.278, 0, 0, 16591200, 203.845, 213), +(644, 'wm2', 0, 0, 99.4047, 100.278, 0, 3618, 240182, 203.845, 213), +(645, NULL, 0, 0, 99.4047, 100.278, -0.870893, 0, 0, 203.845, 213), +(646, 'wm1', 0, 0, 99.2103, 100.308, 0, 98, 237252, 227.893, 214), +(647, 'wm2', 0, 0, 2.76914, 100.308, 0, 100, 238284, 227.893, 214), +(648, NULL, 0, 0, 101.979, 100.308, 1.66658, 0, 0, 227.893, 214), +(649, 'wm1', 0, 0, 171.026, 200.671, 0, 171, 72060, 93.412, 215), +(650, 'wm2', 0, 0, 28.7562, 200.671, 0, 1046, 72021, 93.412, 215), +(651, NULL, 0, 0, 199.782, 200.671, -0.442676, 0, 0, 93.412, 215), +(652, 'wm1', 0, 0, 592.246, 607.195, 0, 592, 21662, 27.925, 216), +(653, 'wm2', 0, 0, 14.2289, 607.195, 0, 517, 21632, 27.925, 216), +(654, NULL, 0, 0, 606.475, 607.195, -0.118593, 0, 0, 27.925, 216), +(655, 'wm1', 0, 0, 0, 100.326, 0, 0, 16777200, 209.388, 217), +(656, 'wm2', 0, 0, 99.368, 100.326, 0, 3616, 240131, 209.388, 217), +(657, NULL, 0, 0, 99.368, 100.326, -0.95479, 0, 0, 209.388, 217), +(658, 'wm1', 0, 0, 102.572, 100.321, 0, 102, 238857, 210.931, 218), +(659, 'wm2', 0, 0, 1.47127, 100.321, 0, 53, 237712, 210.931, 218), +(660, NULL, 0, 0, 104.043, 100.321, 3.71036, 0, 0, 210.931, 218), +(661, 'wm1', 0, 0, 197.851, 200.303, 0, 197, 71758, 94.603, 219), +(662, 'wm2', 0, 0, 2.05631, 200.303, 0, 74, 71250, 94.603, 219), +(663, NULL, 0, 0, 199.907, 200.303, -0.197736, 0, 0, 94.603, 219), +(664, 'wm1', 0, 0, 591.737, 606.845, 0, 591, 21643, 27.943, 220), +(665, 'wm2', 0, 0, 14.1732, 606.845, 0, 514, 21590, 27.943, 220), +(666, NULL, 0, 0, 605.911, 606.845, -0.154055, 0, 0, 27.943, 220), +(667, 'wm1', 0, 0, 0, 100.3, 0, 0, 16642100, 208.729, 221), +(668, 'wm2', 0, 0, 99.4487, 100.3, 0, 3619, 240136, 208.729, 221), +(669, NULL, 0, 0, 99.4487, 100.3, -0.848394, 0, 0, 208.729, 221), +(670, 'wm1', 0, 0, 1.4469, 100.293, 0, 1, 166020, 194.083, 222), +(671, 'wm2', 0, 0, 99.4679, 100.293, 0, 3620, 240173, 194.083, 222), +(672, NULL, 0, 0, 100.915, 100.293, 0.620384, 0, 0, 194.083, 222), +(673, 'wm1', 0, 0, 95.3968, 100.315, 0, 95, 239196, 211.811, 223), +(674, 'wm2', 0, 0, 6.45348, 100.315, 0, 234, 239268, 211.811, 223), +(675, NULL, 0, 0, 101.85, 100.315, 1.53025, 0, 0, 211.811, 223), +(676, 'wm1', 0, 0, 169.789, 200.655, 0, 169, 71734, 94.481, 224), +(677, 'wm2', 0, 0, 29.878, 200.655, 0, 1087, 72032, 94.481, 224), +(678, NULL, 0, 0, 199.667, 200.655, -0.49205, 0, 0, 94.481, 224), +(679, 'wm1', 0, 0, 592.175, 607.261, 0, 591, 21626, 27.954, 225), +(680, 'wm2', 0, 0, 14.2112, 607.261, 0, 516, 21615, 27.954, 225), +(681, NULL, 0, 0, 606.386, 607.261, -0.144079, 0, 0, 27.954, 225), +(682, 'wm1', 0, 0, 592.641, 605.56, 0, 591, 21610, 27.953, 226), +(683, 'wm2', 0, 0, 14.2564, 605.56, 0, 518, 21631, 27.953, 226), +(684, NULL, 0, 0, 606.897, 605.56, 0.220844, 0, 0, 27.953, 226), +(685, 'wm1', 0, 0, 169.261, 0, 0, 168, 71656, 94.672, 227), +(686, 'wm2', 0, 0, 30.4505, 0, 0, 1107, 72103, 94.672, 227), +(687, NULL, 0, 0, 199.712, 0, 100, 0, 0, 94.672, 227), +(688, 'wm1', 0, 0, 1.61949, 100.281, 0, 1, 148317, 207.996, 228), +(689, 'wm2', 0, 0, 99.4225, 100.281, 0, 3618, 240133, 207.996, 228), +(690, NULL, 0, 0, 101.042, 100.281, 0.758816, 0, 0, 207.996, 228), +(691, 'wm1', 0, 0, 96.0356, 100.317, 0, 96, 240100, 218.832, 229), +(692, 'wm2', 0, 0, 5.76275, 100.317, 0, 209, 239314, 218.832, 229), +(693, NULL, 0, 0, 101.798, 100.317, 1.47672, 0, 0, 218.832, 229), +(694, 'wm1', 0, 0, 592.175, 597.12, 0, 591, 21629, 27.8, 230), +(695, 'wm2', 0, 0, 15.018, 597.12, 0, 546, 21646, 27.8, 230), +(696, NULL, 0, 0, 607.193, 597.12, 1.68695, 0, 0, 27.8, 230), +(697, 'wm1', 0, 0, 194.911, 200.652, 0, 194, 71733, 93.052, 231), +(698, 'wm2', 0, 0, 5.86159, 200.652, 0, 212, 71610, 93.052, 231), +(699, NULL, 0, 0, 200.773, 200.652, 0.0600991, 0, 0, 93.052, 231), +(700, 'wm1', 0, 0, 1.62847, 100.288, 0, 1, 147503, 203.888, 232), +(701, 'wm2', 0, 0, 118.379, 100.288, 0, 4307, 240093, 203.888, 232), +(702, NULL, 0, 0, 120.007, 100.288, 19.6628, 0, 0, 203.888, 232), +(703, 'wm1', 0, 0, 99.5546, 100.301, 0, 99, 238844, 227.927, 233), +(704, 'wm2', 0, 0, 2.34684, 100.301, 0, 84, 236176, 227.927, 233), +(705, NULL, 0, 0, 101.901, 100.301, 1.59609, 0, 0, 227.927, 233); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `outputpath` +-- + +CREATE TABLE IF NOT EXISTS `outputpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `RegulValve` varchar(255) DEFAULT NULL, + `FlowMeter` varchar(255) DEFAULT NULL, + `Diverter` varchar(255) DEFAULT NULL, + `TempDiv` varchar(255) DEFAULT NULL, + `Balance` varchar(255) DEFAULT NULL, + `EmptyTankValve` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Dumping data for table `outputpath` +-- + +INSERT INTO `outputpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `RegulValve`, `FlowMeter`, `Diverter`, `TempDiv`, `Balance`, `EmptyTankValve`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PQ1', 0.01, 0.75, 'RV4', 'I4', 'DIV3', 'T5', 'W2', 'VB2', 'VI41;VI42', ''), +(2, 2, 'PQ2', 0.075, 0.18, 'RV5', 'I4', 'DIV3', 'T5', 'W2', 'VB2', 'VI41;VI43', ''), +(3, 3, 'PQ3', 0.18, 3, 'RV3', 'I3', 'DIV2', 'T3', 'W2', 'VB2', 'VI31;VI32', ''), +(4, 4, 'PQ4', 3, 19, 'RV2', 'I2', 'DIV1', 'T4', 'W1', 'VB1', 'VI13;VI21;VI22', ''), +(5, 5, 'PQ5', 19, 160, 'RV1', 'I1', 'DIV1', 'T4', 'W1', 'VB1', 'VI11;VI13', 'VI12'), +(6, 6, 'PQ6', 160, 210, 'RV1', 'I1', 'DIV1', 'T4', 'W1', 'VB1', 'VI11;VI12;VI13', ''), +(7, 0, '', 0, 0, '---', '---', '---', '---', '---', '---', '', ''); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `procedure` +-- + +CREATE TABLE IF NOT EXISTS `procedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `CreationUser` varchar(255) DEFAULT NULL, + `CreationTime` datetime DEFAULT NULL, + `LastChgUser` varchar(255) DEFAULT NULL, + `LastChgTime` datetime DEFAULT NULL, + `LongDescription` varchar(255) DEFAULT NULL, + `Watermeters` varchar(255) DEFAULT NULL, + `PulsesPerLtr` float DEFAULT '0', + `PulsesPerLtr2` float DEFAULT '0', + `DataEntry` varchar(255) DEFAULT NULL, + `ResultsPrinter` varchar(255) DEFAULT NULL, + `ResultsWriter` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ; + +-- +-- Dumping data for table `procedure` +-- + +INSERT INTO `procedure` (`Id`, `ItemNr`, `Name`, `Description`, `CreationUser`, `CreationTime`, `LastChgUser`, `LastChgTime`, `LongDescription`, `Watermeters`, `PulsesPerLtr`, `PulsesPerLtr2`, `DataEntry`, `ResultsPrinter`, `ResultsWriter`) VALUES +(7, 0, 'Prüfung1', 'test1 meistream50', 'admin', '2014-01-21 08:21:49', 'admin', '2014-01-23 18:09:43', '', '', 0.1, 0, NULL, NULL, NULL), +(8, 1, 'Prüfung2', '', 'admin', '2014-01-21 14:46:58', 'admin', '2014-01-23 14:23:32', '', '', 1, 0, NULL, NULL, NULL), +(10, 2, 'Test 1', 'Karsten Test meistream50', 'admin', '2014-01-22 14:42:31', 'admin', '2014-01-23 14:23:45', '', '', 1, 0, NULL, NULL, NULL), +(11, 3, 'TestIgor', 'flowrates', 'admin', '2014-01-22 15:38:37', 'admin', '2014-01-23 14:23:58', '', '', 0, 0, NULL, NULL, NULL), +(12, 4, 'Prüfung3', 'bigline', 'admin', '2014-01-22 16:55:21', 'admin', '2014-01-23 14:24:30', '', '', 0.1, 0, NULL, NULL, NULL), +(13, 5, 'TEST VERIFICATION', '', 'admin', '2014-01-23 09:20:49', 'admin', '2014-01-23 16:38:55', '', '', 0.704, 0, NULL, NULL, NULL), +(14, 6, 'QN 15 HY', 'Kompakt D92 / 6.131.33', 'admin', '2014-01-24 08:51:59', 'admin', '2014-01-27 13:26:08', '', '', 1, 67.422, NULL, 'Advanced Results', NULL), +(15, 7, 'DN80', 'DN80 Verbundwasserzahler', 'admin', '2014-01-24 13:39:20', 'admin', '2014-02-20 12:08:59', '', '', 0, 0, 'Dateneingabe', 'Advanced Results', NULL), +(17, 0, '89189', 'Hydromete Qn40', 'admin', '2014-02-11 17:52:16', 'admin', '2014-02-12 08:54:30', '', '', 0, 0, NULL, 'Advanced Results', NULL), +(18, 0, '89189 - A', 'QN 40 DN80 Verbundwasserzahler', 'admin', '2014-02-12 09:26:19', 'admin', '2014-02-12 13:52:04', '', '', 0, 0, NULL, 'Advanced Results', NULL), +(19, 10, 'Prüfung4', '', 'admin', '2014-02-12 10:20:56', 'admin', '2014-02-12 10:20:56', NULL, NULL, 0, 0, NULL, NULL, NULL), +(20, 11, 'Prüfung5', '', 'admin', '2014-02-12 10:21:13', 'admin', '2014-02-12 10:21:25', '', '', 0, 0, NULL, NULL, NULL), +(21, 0, '89189 - A - Kopie', 'QN 40 DN80 Verbundwasserzahler', 'admin', '2014-02-12 15:47:50', 'admin', '2014-02-12 17:00:38', '', '', 0, 0, NULL, 'Advanced Results', NULL); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `purgeend` +-- + +CREATE TABLE IF NOT EXISTS `purgeend` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT ';;;;', + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; + +-- +-- Dumping data for table `purgeend` +-- + +INSERT INTO `purgeend` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `Procedure_id`) VALUES +(1, 0, 5, '', '', '10;20;30;40;50', 7), +(2, 0, 5, 'VP5;VP6', '', '0;0;30;0;0', 14), +(3, 1, 25, 'VP5;VP6', '', '0;0;0;0;0', 14), +(4, 2, 5, '', 'VP5', '0;0;0;0;0', 14), +(5, 0, 5, 'VI3P;VB1;VB2', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI41;VI42;VI43;VI4P', '0;0;0;0;0', 18), +(6, 1, 125, 'VP5;VP6', '', '0;0;0;0;0', 18), +(7, 2, 5, '', 'VP5;VP6;VB1;VB2', '0;0;0;0;0', 18), +(8, 0, 5, 'VI3P;VB1;VB2', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI41;VI42;VI43;VI4P', '0;0;0;0;0', 21), +(9, 1, 125, 'VP5;VP6', '', '0;0;0;0;0', 21), +(10, 2, 5, '', 'VP5;VP6;VB1;VB2', '0;0;0;0;0', 21); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `purgestart` +-- + +CREATE TABLE IF NOT EXISTS `purgestart` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT ';;;;', + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=62 ; + +-- +-- Dumping data for table `purgestart` +-- + +INSERT INTO `purgestart` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `Procedure_id`) VALUES +(1, 1, 10, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL21', '50;40;30;20;10', 7), +(2, 0, 10, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL21', '0;0;0;0;0', 7), +(3, 2, 10, 'VL11;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL13;VL21', '0;0;0;0;0', 7), +(4, 3, 5, 'VZ1', 'VL11;VL13;VL21;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', '0;0;0;0;0', 7), +(5, 0, 5, '', '', '0;0;0;0;0', 11), +(6, 0, 20, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '5;5;5;5;5', 13), +(7, 1, 10, 'VL13;VZ1;VL12;VI11;VI12;VI32', 'VL11', '0;0;0;0;0', 13), +(8, 2, 5, 'VL11;VL13;VZ1;VL12;VI11;VI12;VI32', '', '0;0;0;0;0', 13), +(9, 3, 10, 'VL11;VL13;VZ1;VI11;VI12', 'VL12', '0;0;0;0;0', 13), +(10, 4, 25, 'VL11;VL13;VZ1;VL12;VI11;VI12', '', '0;0;0;0;0', 13), +(11, 5, 5, 'VL11;VL13;VZ1;VL12', 'VI11;VI12', '0;0;0;0;0', 13), +(12, 6, 5, '', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VI4P;VB1;VB2', '0;0;0;0;0', 13), +(13, 0, 10, 'VL13', '', '0;0;0;0;0', 15), +(14, 0, 10, 'VL13;VL23;VL12;VI11;VI12;VI13', '', '25;25;25;25;25', 14), +(15, 1, 30, 'VL13', 'VL12;VI11;VI12;VI13', '30;40;40;40;40', 14), +(16, 2, 20, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL13', '15;40;40;40;80', 14), +(17, 3, 15, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(18, 4, 8, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VI11;VI13', '15;60;60;60;80', 14), +(19, 5, 8, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(20, 6, 2, 'VL11;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL12', '15;40;40;40;40', 14), +(21, 7, 28, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(22, 8, 2, 'VL11;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL12', '15;40;40;40;40', 14), +(23, 9, 15, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(24, 10, 5, 'VZ1', 'VL11;VL13;VL21;VL23;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VI4P;VB1;VB2;VM1;VM2;VM3;VM4;Pumpe1;Block', '0;0;0;0;0', 14), +(25, 0, 10, 'VL13;VL12;VI11;VI12;VI13;VB1;VB2', '', '0;0;0;0;0', 17), +(26, 1, 30, 'VL13', 'VL12', '10;10;10;10;0', 17), +(27, 2, 20, 'VL11;VL12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43', 'VL13;VI11;VI12', '0;0;0;0;0', 17), +(28, 3, 15, '', 'VI13', '0;0;0;0;0', 17), +(29, 4, 8, 'VI13', '', '0;0;0;0;0', 17), +(30, 5, 8, '', 'VI21', '0;0;0;0;0', 17), +(31, 6, 2, 'VI21', '', '0;0;0;0;0', 17), +(32, 7, 28, 'VL12', '', '0;0;0;0;0', 17), +(33, 8, 2, '', 'VL12', '0;0;0;0;0', 17), +(34, 9, 15, 'VL11;VL12;VI11;VI12;VI13', '', '0;0;0;0;0', 17), +(35, 10, 2, '', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI3P;VI41;VI42;VI43;VI4P;VB1;VB2', '0;0;0;0;0', 17), +(36, 0, 20, 'VL13;VL12;VI11;VI12;VI13;VB1;VB2', '', '0;0;0;0;0', 18), +(37, 1, 30, '', 'VL12', '0;0;0;0;0', 18), +(38, 2, 20, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43', 'VL13;VI11;VI12', '0;0;0;0;0', 18), +(39, 3, 15, 'VI11;VI12', '', '0;0;0;0;0', 18), +(40, 5, 8, 'VI11', 'VI12', '0;0;0;0;0', 18), +(41, 6, 8, '', '', '0;0;0;0;0', 18), +(42, 7, 2, '', 'VI11;VI12', '0;0;0;0;0', 18), +(43, 8, 28, '', '', '0;0;0;0;0', 18), +(44, 9, 2, '', 'VI21', '0;0;0;0;0', 18), +(45, 10, 15, 'VI11;VI12;VI21', '', '0;0;0;0;0', 18), +(46, 12, 5, '', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI3P;VI41;VI42;VI43;VI4P;VB1;VB2', '0;0;0;0;0', 18), +(47, 4, 5, '', 'VI11', '0;0;0;0;0', 18), +(48, 11, 5, '', 'VI11', '0;0;0;0;0', 18), +(49, 0, 20, 'VL13;VL12;VI11;VI12;VI13;VB1;VB2', '', '0;0;0;0;0', 21), +(50, 1, 30, '', 'VL12', '0;0;0;0;0', 21), +(51, 2, 20, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43', 'VL13;VI11;VI12', '0;0;0;0;0', 21), +(52, 3, 15, 'VI11;VI12', '', '0;0;0;0;0', 21), +(53, 4, 5, '', 'VI11', '0;0;0;0;0', 21), +(54, 5, 8, 'VI11', 'VI12', '0;0;0;0;0', 21), +(55, 6, 8, '', '', '0;0;0;0;0', 21), +(56, 7, 2, '', 'VI11;VI12', '0;0;0;0;0', 21), +(57, 8, 28, '', '', '0;0;0;0;0', 21), +(58, 9, 2, '', 'VI21', '0;0;0;0;0', 21), +(59, 10, 15, 'VI11;VI12;VI21', '', '0;0;0;0;0', 21), +(60, 11, 5, '', 'VI11', '0;0;0;0;0', 21), +(61, 12, 5, '', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI3P;VI41;VI42;VI43;VI4P;VB1;VB2', '0;0;0;0;0', 21); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `test` +-- + +CREATE TABLE IF NOT EXISTS `test` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Volume` float DEFAULT NULL, + `TstTime` float DEFAULT NULL, + `Repeats` int(11) DEFAULT NULL, + `Emptying` tinyint(1) DEFAULT NULL, + `Zeroing` tinyint(1) DEFAULT NULL, + `Method` varchar(255) DEFAULT NULL, + `ErrLimLo` float DEFAULT NULL, + `ErrLimHi` float DEFAULT NULL, + `TolerRed` double DEFAULT NULL, + `RedType` varchar(255) DEFAULT NULL, + `FeedingPath` varchar(255) DEFAULT NULL, + `BenchPath` varchar(255) DEFAULT NULL, + `OutputPath` varchar(255) DEFAULT NULL, + `MetersPath` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=53 ; + +-- +-- Dumping data for table `test` +-- + +INSERT INTO `test` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `TolerRed`, `RedType`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `Procedure_id`) VALUES +(15, 0, 'Qn', 15, 16, 200, 46.4516, 5, 1, 0, 'Verbund', 0, 2, 0, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 7), +(16, 1, 'Qt', 2, 2.2, 60, 102.857, 5, 1, 0, 'Fliegender Start-Stopp', 0, 5, 0, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 7), +(17, 2, 'Qmin', 1, 1.2, 20, 65.4545, 1, 1, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 7), +(18, 0, 'Qmin', 1, 1.1, 30, 102.857, 1, 0, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 8), +(19, 0, 'Qn', 12, 16, 200, 51.4286, 1, 0, 0, 'Fliegender Start-Stopp', 5, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', '', 10), +(20, 1, 'Qt', 2.5, 3.5, 100, 120, 1, 0, 0, 'Fliegender Start-Stopp', 0, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 10), +(21, 0, 'Prüfpunkt1', 1, 1.2, 20, 65.4545, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(22, 1, 'Prüfpunkt2', 2, 2.1, 40, 70.2439, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(23, 2, 'Prüfpunkt3', 3.1, 3.2, 60, 68.5714, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(24, 3, 'Prüfpunkt4', 4.1, 4.3, 80, 68.5714, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(25, 4, 'Prüfpunkt5', 6, 6.1, 120, 71.405, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(26, 0, 'Prüfpunkt1', 15, 17, 200, 45, 4, 0, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 12), +(27, 0, 'Prüfpunkt1', 15, 16, 1000, 232.258, 5, 1, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 13), +(28, 1, 'Prüfpunkt2', 1, 1.1, 100, 342.857, 5, 1, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 13), +(29, 0, 'Qmax', 15, 16, 600, 139.355, 1, 0, 0, 'Verbund', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 14), +(30, 1, 'Qt', 3, 3.2, 200, 232.258, 1, 0, 0, 'Verbund', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 14), +(31, 2, 'Qsteig', 0.9, 1, 100, 378.947, 1, 1, 0, 'Verbund', 0, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 14), +(32, 3, 'Qfall', 2.8, 3, 100, 124.138, 1, 1, 0, 'Verbund', 0, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 14), +(33, 2, 'Q1', 2.4, 2.6, 100, 144, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 15), +(34, 3, 'Q2', 38, 44, 500, 43.9024, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 15), +(35, 0, 'Qsteig', 1, 1.2, 50, 163.636, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 15), +(36, 1, 'Qfall', 2.8, 3, 50, 62.069, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 15), +(41, 2, 'Qsteig', 1, 1.2, 100, 327.273, 1, 1, 0, 'Verbund-steig-fall', 5, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 17), +(42, 3, 'Qfall', 2.8, 3, 100, 124.138, 1, 1, 0, 'Verbund-steig-fall', 5, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 17), +(43, 1, 'Q1', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 17), +(44, 0, 'Q2', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 17), +(45, 0, 'Qsteig', 1, 1.2, 100, 327.273, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 18), +(46, 1, 'Qfall', 2.8, 3, 100, 124.138, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 18), +(47, 2, 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 18), +(48, 3, 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 18), +(49, 2, 'Qsteig', 1, 1.2, 100, 327.273, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 21), +(50, 3, 'Qfall', 2.8, 3, 100, 124.138, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 21), +(51, 1, 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 21), +(52, 0, 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 21); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `testresult` +-- + +CREATE TABLE IF NOT EXISTS `testresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) NOT NULL, + `TestName` varchar(255) NOT NULL, + `Qfrom` float NOT NULL, + `Qto` float NOT NULL, + `Volume` float NOT NULL, + `TstTime` float NOT NULL, + `Repeats` int(11) NOT NULL, + `Emptying` tinyint(4) NOT NULL, + `Zeroing` tinyint(4) NOT NULL, + `Method` varchar(255) NOT NULL, + `ErrLimLo` float NOT NULL, + `ErrLimHi` float NOT NULL, + `FeedingPath` varchar(4000) NOT NULL, + `BenchPath` varchar(4000) NOT NULL, + `OutputPath` varchar(4000) NOT NULL, + `MetersPath` varchar(4000) NOT NULL, + `TimeStart` datetime DEFAULT NULL, + `TimeEnd` datetime DEFAULT NULL, + `RepetitionNr` int(11) DEFAULT NULL, + `AmbientTempAve` float DEFAULT NULL, + `AmbientPressAve` float DEFAULT NULL, + `AmbientHumiAve` float DEFAULT NULL, + `PressInAvrg` float DEFAULT NULL, + `PressInStart` float DEFAULT NULL, + `PressInEnd` float DEFAULT NULL, + `PressOutAvrg` float DEFAULT NULL, + `PressOutStart` float DEFAULT NULL, + `PressOutEnd` float DEFAULT NULL, + `TempInAvrg` float DEFAULT NULL, + `TempInStart` float DEFAULT NULL, + `TempInEnd` float DEFAULT NULL, + `TempOutAvrg` float DEFAULT NULL, + `TempOutStart` float DEFAULT NULL, + `TempOutEnd` float DEFAULT NULL, + `TempDivAvrg` float DEFAULT NULL, + `TempDivStart` float DEFAULT NULL, + `TempDivEnd` float DEFAULT NULL, + `MassStartRaw` float DEFAULT NULL, + `MassStart` float DEFAULT NULL, + `MassEndRaw` float DEFAULT NULL, + `MassEnd` float DEFAULT NULL, + `MassDiff` float DEFAULT NULL, + `DensityIn` float DEFAULT NULL, + `DensityOut` float DEFAULT NULL, + `DensityDiv` float DEFAULT NULL, + `FlowMass` float DEFAULT NULL, + `FlowVolume` float DEFAULT NULL, + `VolumeCTV` float DEFAULT NULL, + `VolumeMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `ErrorMaster` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `ConstMaster` float DEFAULT NULL, + `TimeDivStart0` float DEFAULT NULL, + `TimeDivStart1` float DEFAULT NULL, + `TimeDivStart2` float DEFAULT NULL, + `TimeDivStart3` float DEFAULT NULL, + `TimeDivStart4` float DEFAULT NULL, + `TimeDivStart5` float DEFAULT NULL, + `TimeDivEnd0` float DEFAULT NULL, + `TimeDivEnd1` float DEFAULT NULL, + `TimeDivEnd2` float DEFAULT NULL, + `TimeDivEnd3` float DEFAULT NULL, + `TimeDivEnd4` float DEFAULT NULL, + `TimeDivEnd5` float DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=234 ; + +-- +-- Dumping data for table `testresult` +-- + +INSERT INTO `testresult` (`Id`, `Name`, `TestName`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`, `Test_id`) VALUES +(1, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:41:57', '2014-01-21 17:42:54', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1818, 17.198, 17.17, 17.1656, 17.183, 17.155, 17.2016, 17.227, 17.181, 0.05, 0.05, 201.15, 201.15, 201.1, 1000.35, 1000.35, 1000.34, 15837.4, 15839.2, 201.237, 201.122, 45.712, -0.0570204, 72404, 0.00277936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(2, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:43:11', '2014-01-21 17:45:07', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1555, 17.162, 17.152, 17.1364, 17.144, 17.132, 17.5829, 17.91, 17.487, 0, 0, 60.133, 60.133, 60.133, 1000.35, 1000.35, 1000.27, 2062.1, 2062.55, 60.1737, 60.1463, 104.98, -0.0455428, 144351, 0.000416857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(3, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:49:21', '2014-01-21 17:50:18', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2002, 17.222, 17.183, 17.182, 17.199, 17.168, 17.2144, 17.235, 17.194, 0, 0, 201.133, 201.133, 201.133, 1000.34, 1000.35, 1000.34, 15842.5, 15842, 201.271, 201.128, 45.705, -0.071127, 72406, 0.00277976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(4, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:50:31', '2014-01-21 17:52:28', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1553, 17.168, 17.147, 17.1358, 17.151, 17.128, 17.5125, 17.846, 17.436, 3.26133, 3.26133, 63.514, 63.514, 60.2527, 1000.35, 1000.35, 1000.29, 2067.4, 2063.75, 60.2934, 60.1463, 104.919, -0.244041, 144351, 0.000417686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(5, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:54:04', '2014-01-21 17:55:01', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1507, 17.157, 17.146, 17.1317, 17.139, 17.127, 17.1593, 17.17, 17.147, 0, 0, 201.15, 201.15, 201.15, 1000.35, 1000.35, 1000.35, 15843.1, 15840.9, 201.286, 201.122, 45.707, -0.0812647, 72404, 0.00278004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(6, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-21 17:55:14', '2014-01-21 17:57:12', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1391, 17.141, 17.136, 17.1179, 17.121, 17.115, 17.4528, 17.727, 17.403, 3.363, 3.363, 63.6217, 63.6217, 60.2587, 1000.35, 1000.36, 1000.3, 2067.23, 2063.39, 60.2992, 60.1467, 104.938, -0.252975, 144352, 0.000417723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(7, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 09:13:46', '2014-01-22 09:14:43', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.8708, 19.804, 18.321, 19.4739, 20.842, 18.646, 20.0805, 21.682, 18.94, 0, 0, 201.15, 201.15, 201.15, 1000.03, 999.913, 999.789, 15854.9, 15852.9, 201.375, 201.125, 45.673, -0.123957, 72405, 0.00278123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(8, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 09:30:27', '2014-01-22 09:31:24', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.7432, 17.782, 17.721, 17.7499, 17.793, 17.725, 17.8648, 17.989, 17.775, 0, 0, 201.15, 201.15, 201.15, 1000.25, 1000.24, 1000.22, 15803.3, 15801.1, 201.308, 201.122, 45.822, -0.0923222, 72404, 0.00278034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(9, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 09:44:48', '2014-01-22 09:45:45', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2819, 17.314, 17.248, 17.2901, 17.331, 17.254, 17.3612, 17.457, 17.291, 0, 0, 201.1, 201.1, 201.1, 1000.33, 1000.33, 1000.31, 15753.3, 15754.2, 201.241, 201.111, 45.956, -0.0647607, 72400, 0.00277958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(10, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 09:54:30', '2014-01-22 09:55:27', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1931, 17.237, 17.156, 17.2, 17.254, 17.161, 17.2767, 17.379, 17.212, 0, 0, 201.05, 201.05, 201.05, 1000.34, 1000.34, 1000.33, 15738.5, 15743.9, 201.188, 201.119, 45.988, -0.0341599, 72403, 0.00277873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(11, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:11:13', '2014-01-22 10:12:09', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1765, 17.23, 17.137, 17.1807, 17.234, 17.139, 17.2987, 17.466, 17.189, 0, 0, 201.2, 201.2, 201.2, 1000.35, 1000.35, 1000.33, 15801.4, 15795.3, 201.338, 201.122, 45.839, -0.106966, 72404, 0.00278075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(12, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:12:23', '2014-01-22 10:14:13', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.102, 17.107, 17.104, 17.1125, 17.109, 17.125, 17.6444, 18.254, 17.504, 0, 0, 48.118, 48.118, 48.118, 1000.36, 1000.36, 1000.26, 1741.48, 2177.09, 48.1503, 60.1542, 99.47, 24.9299, 144370, 0.00033352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(13, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:24:14', '2014-01-22 10:25:11', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1366, 17.172, 17.106, 17.1396, 17.197, 17.107, 17.2267, 17.342, 17.155, 0, 0, 201.1, 201.1, 201.1, 1000.35, 1000.35, 1000.34, 15795.3, 15796.8, 201.236, 201.119, 45.834, -0.0579684, 72403, 0.00277939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(14, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:25:25', '2014-01-22 10:27:16', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.0878, 17.087, 17.089, 17.0902, 17.084, 17.103, 17.5711, 18.084, 17.455, 0, 0, 51.2683, 51.2683, 51.2683, 1000.36, 1000.36, 1000.28, 1852.09, 2173.09, 51.3026, 60.1542, 99.653, 17.2537, 144370, 0.000355355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(15, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:31:24', '2014-01-22 10:32:21', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1506, 17.152, 17.161, 17.1276, 17.132, 17.136, 17.1659, 17.207, 17.152, 0, 0, 201.2, 201.2, 201.2, 1000.35, 1000.36, 1000.35, 15801.7, 15795.4, 201.336, 201.119, 45.838, -0.107422, 72403, 0.00278077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(16, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:32:35', '2014-01-22 10:34:26', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1924, 17.174, 17.209, 17.1736, 17.15, 17.195, 17.5562, 17.921, 17.499, 0, 0, 51.4273, 51.4273, 51.4273, 1000.34, 1000.35, 1000.28, 1857.16, 2172.32, 51.4624, 60.1546, 99.689, 16.8903, 144371, 0.00035646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(17, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:40:35', '2014-01-22 10:41:32', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2396, 17.245, 17.237, 17.2284, 17.238, 17.222, 17.2562, 17.276, 17.242, 0, 0, 201.2, 201.2, 201.2, 1000.34, 1000.34, 1000.33, 15788.6, 15782.3, 201.339, 201.119, 45.876, -0.109186, 72403, 0.00278081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(18, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:41:45', '2014-01-22 10:42:42', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2369, 17.24, 17.233, 17.2221, 17.223, 17.22, 17.239, 17.24, 17.24, 0, 0, 201.15, 201.15, 201.15, 1000.34, 1000.34, 1000.34, 15795.7, 15793.3, 201.289, 201.119, 45.844, -0.0842349, 72403, 0.00278012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(19, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:42:55', '2014-01-22 10:43:52', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2012, 17.216, 17.181, 17.1943, 17.21, 17.176, 17.2148, 17.228, 17.202, 0, 0, 201.117, 201.117, 201.117, 1000.34, 1000.34, 1000.34, 15804.2, 15804.6, 201.255, 201.122, 45.812, -0.0658179, 72404, 0.00277961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(20, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:44:05', '2014-01-22 10:45:02', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1431, 17.16, 17.128, 17.1348, 17.153, 17.118, 17.1586, 17.178, 17.141, 0.0166667, 0.0166667, 201.2, 201.2, 201.183, 1000.35, 1000.35, 1000.35, 15796.3, 15791.3, 201.319, 201.119, 45.85, -0.0992674, 72403, 0.00278054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(21, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 10:45:15', '2014-01-22 10:46:12', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1021, 17.114, 17.094, 17.0894, 17.101, 17.079, 17.1112, 17.123, 17.101, 0, 0, 201.2, 201.2, 201.2, 1000.36, 1000.36, 1000.36, 15797.6, 15791.1, 201.334, 201.117, 45.85, -0.108127, 72402, 0.00278078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(22, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:30:40', '2014-01-22 13:31:36', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2618, 17.308, 17.226, 17.3, 17.394, 17.247, 17.6104, 17.992, 17.382, 0, 0, 201.133, 201.133, 201.133, 998.731, 998.724, 998.669, 15795.5, 15794.4, 201.598, 201.119, 45.841, -0.237233, 72403, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(23, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:31:49', '2014-01-22 13:32:45', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1934, 17.202, 17.186, 17.1978, 17.216, 17.184, 17.2435, 17.281, 17.217, 0, 0, 201.2, 201.2, 201.2, 998.743, 998.742, 998.734, 15792.8, 15786.5, 201.661, 201.119, 45.864, -0.268477, 72403, 0.00278526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(24, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:32:58', '2014-01-22 13:33:54', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1658, 17.173, 17.158, 17.1658, 17.176, 17.157, 17.1913, 17.206, 17.18, 0, 0, 201.15, 201.15, 201.15, 998.748, 998.748, 998.743, 15796.4, 15794, 201.61, 201.119, 45.842, -0.243115, 72403, 0.00278455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(25, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:34:07', '2014-01-22 13:35:04', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1447, 17.15, 17.139, 17.1406, 17.147, 17.136, 17.1617, 17.17, 17.155, 0, 0, 201.233, 201.233, 201.233, 998.752, 998.752, 998.749, 15801.3, 15792.5, 201.692, 201.122, 45.847, -0.282612, 72404, 0.00278565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(26, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:35:17', '2014-01-22 13:36:14', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1352, 17.136, 17.137, 17.1284, 17.13, 17.128, 17.1452, 17.147, 17.144, 0, 0, 201.15, 201.15, 201.15, 998.753, 998.754, 998.752, 15798.2, 15796, 201.608, 201.122, 45.837, -0.241088, 72404, 0.00278449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(27, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:36:30', '2014-01-22 13:38:23', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1575, 17.144, 17.166, 17.1557, 17.132, 17.176, 17.8218, 18.699, 17.611, 0, 0, 60.2617, 60.2617, 60.2617, 998.749, 998.75, 998.63, 2172.88, 2168.98, 60.3993, 60.1538, 99.841, -0.406466, 144369, 0.000418367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(28, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:38:37', '2014-01-22 13:40:28', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1742, 17.172, 17.178, 17.1969, 17.185, 17.207, 17.5216, 17.568, 17.487, 0, 0, 60.2737, 60.2737, 60.2737, 998.746, 998.742, 998.685, 2172.65, 2168.35, 60.4117, 60.1542, 99.871, -0.426323, 144370, 0.000418451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(29, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 13:40:41', '2014-01-22 13:44:13', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1814, 17.18, 17.179, 17.2121, 17.208, 17.215, 17.4733, 17.479, 17.469, 0, 0, -119.212, -119.212, -119.212, 998.745, 998.74, 998.693, -4924.63, 2169.62, -119.485, 52.5204, 87.146, 0.1, 126049, -0.000947925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(30, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:02:00', '2014-01-22 16:03:15', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.4985, 17.532, 17.456, 17.7711, 17.797, 17.76, 18.1239, 18.126, 18.063, 0.7, 0.7, 20.75, 20.75, 20.05, 998.689, 998.64, 998.575, 1126.93, 1128.49, 20.098, 20.0778, 64.05, -0.100578, 7228, 0.00278057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(31, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:03:26', '2014-01-22 16:04:41', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.4188, 17.423, 17.399, 17.7271, 17.753, 17.701, 17.9281, 18, 17.874, 20.8, 20.8, 40.8667, 40.8667, 20.0667, 998.703, 998.648, 998.611, 1124.43, 1125.05, 20.1145, 20.0778, 64.246, -0.182746, 7228, 0.00278286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(32, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:04:52', '2014-01-22 16:06:07', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3671, 17.385, 17.358, 17.6452, 17.667, 17.616, 17.8033, 17.841, 17.767, 40.9, 40.9, 61, 61, 20.1, 998.712, 998.662, 998.634, 1124.55, 1123.3, 20.1476, 20.0778, 64.346, -0.34679, 7228, 0.00278744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(33, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:06:18', '2014-01-22 16:07:33', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3574, 17.358, 17.353, 17.5951, 17.61, 17.599, 17.7199, 17.748, 17.698, 61.05, 61.05, 81.1167, 81.1167, 20.0667, 998.714, 998.672, 998.649, 1123.2, 1123.83, 20.1141, 20.0778, 64.316, -0.180379, 7228, 0.0027828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(34, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:07:44', '2014-01-22 16:08:58', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3483, 17.349, 17.343, 17.5803, 17.599, 17.556, 17.6685, 17.682, 17.657, 81.15, 81.15, 101.25, 101.25, 20.1, 998.716, 998.674, 998.658, 1124.86, 1123.62, 20.1474, 20.0778, 64.328, -0.345629, 7228, 0.00278741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(35, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:09:21', '2014-01-22 16:10:43', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3572, 17.356, 17.353, 17.5227, 17.544, 17.525, 17.6173, 17.646, 17.583, 101.25, 101.25, 141.45, 141.45, 40.2, 998.714, 998.685, 998.667, 2037.88, 2035.06, 40.2944, 40.1444, 71.015, -0.372169, 14452, 0.00278815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(36, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:10:54', '2014-01-22 16:12:16', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3371, 17.346, 17.333, 17.4815, 17.521, 17.451, 17.5445, 17.568, 17.519, 141.45, 141.45, 181.617, 181.617, 40.1667, 998.718, 998.692, 998.681, 2036.42, 2035.15, 40.2607, 40.1417, 71.007, -0.295629, 14451, 0.00278601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(37, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:12:27', '2014-01-22 16:13:49', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3189, 17.323, 17.319, 17.4144, 17.429, 17.407, 17.4837, 17.5, 17.469, 181.65, 181.65, 221.85, 221.85, 40.2, 998.721, 998.704, 998.692, 2037.62, 2034.81, 40.2937, 40.1444, 71.024, -0.370349, 14452, 0.0027881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(38, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:14:00', '2014-01-22 16:15:22', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.317, 17.321, 17.313, 17.3955, 17.409, 17.39, 17.4482, 17.459, 17.439, 221.85, 221.85, 262.05, 262.05, 40.2, 998.721, 998.707, 998.698, 2037.71, 2034.75, 40.2935, 40.1417, 71.021, -0.376722, 14451, 0.00278828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(39, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:15:33', '2014-01-22 16:16:55', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3006, 17.309, 17.299, 17.3899, 17.4, 17.385, 17.4324, 17.436, 17.426, 262.1, 262.1, 302.267, 302.267, 40.1667, 998.724, 998.708, 998.701, 2036.25, 2034.98, 40.26, 40.1417, 71.013, -0.293995, 14451, 0.00278597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(40, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:17:15', '2014-01-22 16:18:35', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3041, 17.311, 17.3, 17.3716, 17.393, 17.357, 17.415, 17.427, 17.401, 302.3, 302.3, 362.55, 362.55, 60.25, 998.724, 998.712, 998.704, 3116.96, 3115.38, 60.3898, 60.2194, 69.587, -0.282152, 21679, 0.00278564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(41, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:18:46', '2014-01-22 16:20:06', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.292, 17.295, 17.291, 17.3415, 17.356, 17.331, 17.3764, 17.387, 17.365, 362.6, 362.6, 422.85, 422.85, 60.25, 998.726, 998.717, 998.711, 3117.99, 3116.41, 60.3895, 60.2194, 69.564, -0.281667, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(42, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:20:17', '2014-01-22 16:21:37', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2851, 17.293, 17.278, 17.3302, 17.338, 17.328, 17.3581, 17.362, 17.359, 422.9, 422.9, 483.15, 483.15, 60.25, 998.727, 998.719, 998.714, 3118.71, 3117.13, 60.3894, 60.2194, 69.548, -0.281465, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(43, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:21:48', '2014-01-22 16:23:08', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2673, 17.274, 17.259, 17.3324, 17.329, 17.316, 17.3468, 17.355, 17.342, 483.2, 483.2, 543.45, 543.45, 60.25, 998.73, 998.719, 998.716, 3119.78, 3118.2, 60.3894, 60.2194, 69.524, -0.281453, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(44, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:23:19', '2014-01-22 16:24:39', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2602, 17.263, 17.254, 17.3006, 17.31, 17.297, 17.3294, 17.338, 17.324, 543.45, 543.45, 603.75, 603.75, 60.3, 998.731, 998.724, 998.719, 3121.43, 3117.26, 60.4392, 60.2194, 69.545, -0.363607, 21679, 0.00278791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(45, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:25:00', '2014-01-22 16:26:20', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.248, 17.253, 17.242, 17.288, 17.295, 17.275, 17.3215, 17.324, 17.313, 603.75, 603.75, 684.117, 684.117, 80.3667, 998.733, 998.726, 998.72, 4179.36, 4175.74, 80.5521, 80.2972, 69.226, -0.316373, 28907, 0.00278659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(46, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:26:31', '2014-01-22 16:27:51', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2481, 17.242, 17.243, 17.2722, 17.271, 17.275, 17.3024, 17.31, 17.3, 684.15, 684.15, 764.5, 764.5, 80.3499, 998.733, 998.729, 998.724, 4179.39, 4176.5, 80.535, 80.2944, 69.211, -0.298715, 28906, 0.0027861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(47, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:28:02', '2014-01-22 16:29:22', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2303, 17.236, 17.227, 17.2607, 17.271, 17.254, 17.2948, 17.3, 17.286, 764.55, 764.55, 844.9, 844.9, 80.3501, 998.737, 998.731, 998.725, 4175.18, 4172.28, 80.535, 80.2944, 69.281, -0.298743, 28906, 0.0027861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(48, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:29:33', '2014-01-22 16:30:53', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2214, 17.225, 17.218, 17.2451, 17.25, 17.238, 17.2773, 17.283, 17.273, 844.9, 844.9, 925.25, 925.25, 80.3499, 998.738, 998.734, 998.728, 4181.26, 4178.38, 80.5346, 80.2944, 69.18, -0.298233, 28906, 0.00278609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(49, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:31:04', '2014-01-22 16:32:24', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2209, 17.22, 17.221, 17.2358, 17.239, 17.236, 17.2663, 17.268, 17.263, 925.25, 925.25, 1005.62, 1005.62, 80.3667, 998.738, 998.736, 998.73, 4181.59, 4177.83, 80.5513, 80.2944, 69.189, -0.318895, 28906, 0.00278666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(50, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:32:44', '2014-01-22 16:34:07', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2195, 17.226, 17.212, 17.2277, 17.23, 17.23, 17.2623, 17.265, 17.259, 1005.65, 1005.65, 1126.07, 1126.07, 120.417, 998.738, 998.737, 998.731, 6007.98, 6008.4, 120.693, 120.425, 72.154, -0.222163, 43353, 0.00278396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(51, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:34:18', '2014-01-22 16:35:40', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2095, 17.218, 17.203, 17.22, 17.22, 17.215, 17.2511, 17.255, 17.247, 1126.1, 1126.1, 1246.53, 1246.53, 120.433, 998.74, 998.738, 998.733, 6089.5, 6089.36, 120.71, 120.431, 71.198, -0.231234, 43355, 0.00278422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(52, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:35:51', '2014-01-22 16:37:13', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1967, 17.199, 17.193, 17.2102, 17.214, 17.204, 17.2379, 17.245, 17.234, 1246.55, 1246.55, 1366.97, 1366.97, 120.417, 998.742, 998.74, 998.735, 6087.88, 6088.59, 120.693, 120.431, 71.207, -0.217208, 43355, 0.00278382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(53, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:37:24', '2014-01-22 16:38:46', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1888, 17.19, 17.189, 17.2037, 17.201, 17.192, 17.2271, 17.228, 17.224, 1367, 1367, 1487.45, 1487.45, 120.45, 998.744, 998.741, 998.737, 6088.02, 6087.05, 120.726, 120.431, 71.225, -0.2446, 43355, 0.00278459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(54, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 16:38:58', '2014-01-22 16:40:19', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1873, 17.188, 17.188, 17.19, 17.192, 17.19, 17.2222, 17.224, 17.219, 1487.5, 1487.5, 1607.9, 1607.9, 120.4, 998.744, 998.744, 998.738, 6064.73, 6066.13, 120.676, 120.428, 71.469, -0.205397, 43354, 0.0027835, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(55, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 17:02:12', '2014-01-22 17:03:08', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.0874, 17.097, 17.081, 17.0734, 17.085, 17.065, 17.1019, 17.109, 17.095, 15.1, 15.1, 216.233, 216.233, 201.133, 998.762, 998.764, 998.759, 16247, 16245.2, 201.59, 201.111, 44.567, -0.237371, 7240, 0.0278439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26), +(56, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-22 17:57:43', '2014-01-22 17:58:40', 1, 21.81, 948.212, 29.9233, 0, 0, 0, 0, 0, 0, 17.1047, 17.122, 17.09, 17.0985, 17.122, 17.083, 17.1413, 17.185, 17.114, -17.05, -17.05, 184.1, 184.1, 201.15, 998.759, 998.76, 998.752, 15815.1, 15812.9, 201.607, 201.122, 45.788, -0.240582, 72404, 0.00278448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(57, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 08:44:35', '2014-01-23 08:45:32', 1, 23.45, 950.68, 26.0282, 0, 0, 0, 0, 0, 0, 18.453, 19.041, 18.037, 19.1917, 20.404, 18.331, 20.0359, 21.914, 18.711, 0, 0, 189.483, 189.483, 189.483, 998.513, 998.37, 998.199, 14954, 15872.7, 189.988, 201.125, 45.616, 5.86181, 72405, 0.00262397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(58, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 08:50:09', '2014-01-23 08:51:06', 2, 23.5362, 950.676, 26.7004, 0, 0, 0, 0, 0, 0, 17.6413, 17.64, 17.65, 17.6502, 17.655, 17.655, 17.6828, 17.695, 17.677, 0, 0, 186.75, 186.75, 186.75, 998.663, 998.662, 998.656, 14745.4, 15880.6, 187.193, 201.128, 45.594, 7.44413, 72406, 0.00258532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(59, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 08:55:42', '2014-01-23 08:56:38', 3, 23.62, 950.554, 26.6455, 0, 0, 0, 0, 0, 0, 17.416, 17.47, 17.361, 17.4474, 17.493, 17.395, 17.4955, 17.54, 17.442, 0, 0, 186.75, 186.75, 186.75, 998.704, 998.698, 998.689, 14742.8, 15877.8, 187.186, 201.128, 45.602, 7.44806, 72406, 0.00258523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(60, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 08:56:55', '2014-01-23 08:57:51', 4, 23.623, 950.795, 26.392, 0, 0, 0, 0, 0, 0, 17.2409, 17.284, 17.2, 17.2702, 17.312, 17.222, 17.3208, 17.373, 17.266, -22.55, -22.55, 178.6, 178.6, 201.15, 998.735, 998.73, 998.721, 15883.7, 15882, 201.613, 201.128, 45.59, -0.24084, 72406, 0.00278448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(61, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 09:31:37', '2014-01-23 09:35:35', 1, 23.5322, 951.066, 27.0611, 0, 0, 0, 0, 0, 0, 17.1355, 17.562, 17.05, 17.1693, 17.66, 17.047, 17.2724, 17.93, 17.091, 0, 0, 989.017, 989.017, 989.017, 998.753, 998.747, 998.729, 15679.7, 15871.7, 991.277, 1001.12, 227.074, 0.993456, 360405, 0.00275045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(62, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 09:49:45', '2014-01-23 09:53:43', 1, 23.4289, 951.307, 27.749, 0, 0, 0, 0, 0, 0, 17.0658, 17.192, 17.039, 17.0687, 17.222, 17.031, 17.106, 17.246, 17.054, -0.3, -0.3, 1000.65, 1000.65, 1000.95, 998.765, 998.765, 998.758, 15872.4, 15875.2, 1003.22, 1001.13, 227.025, -0.208551, 360406, 0.00278358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(63, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 09:58:22', '2014-01-23 10:02:20', 1, 23.3655, 951.275, 27.6753, 0, 0, 0, 0, 0, 0, 17.0131, 17.017, 17.007, 17.0014, 17.006, 16.996, 17.0201, 17.025, 17.01, 34.1, 34.1, 1035.08, 1035.08, 1000.98, 998.775, 998.777, 998.773, 15872.3, 15874.6, 1003.24, 1001.12, 227.033, -0.210986, 360405, 0.00278365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(64, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:04:51', '2014-01-23 10:08:49', 2, 23.2715, 951.288, 27.3465, 0, 0, 0, 0, 0, 0, 16.996, 16.998, 16.995, 16.9819, 16.985, 16.981, 17.0011, 17.004, 17.002, 32.9, 32.9, 1034.05, 1034.05, 1001.15, 998.778, 998.78, 998.777, 15874.2, 15873.8, 1003.41, 1001.12, 227.044, -0.227527, 360404, 0.00278411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(65, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:11:24', '2014-01-23 10:15:22', 3, 23.1503, 951.305, 27.0103, 0, 0, 0, 0, 0, 0, 16.9938, 16.995, 16.993, 16.9781, 16.978, 16.98, 16.9963, 16.996, 16.996, 33.15, 33.15, 1034.13, 1034.13, 1000.98, 998.778, 998.781, 998.778, 15872.1, 15874.3, 1003.24, 1001.12, 227.036, -0.210841, 360404, 0.00278365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(66, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:17:57', '2014-01-23 10:21:55', 4, 23.0528, 951.479, 27.0146, 0, 0, 0, 0, 0, 0, 16.9936, 16.993, 16.994, 16.9767, 16.977, 16.977, 16.9958, 16.998, 16.997, 32.85, 32.85, 1033.85, 1033.85, 1001, 998.778, 998.781, 998.778, 15873.3, 15875.3, 1003.25, 1001.12, 227.023, -0.212212, 360405, 0.00278369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(67, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:32:46', '2014-01-23 10:36:44', 1, 22.836, 951.592, 27.534, 0, 0, 0, 0, 0, 0, 16.999, 17, 16.999, 16.9772, 16.978, 16.977, 16.9958, 16.998, 16.994, 33.3, 33.3, 1034.27, 1034.27, 1000.97, 998.777, 998.781, 998.778, 15872.1, 15874.6, 1003.22, 1001.12, 227.032, -0.20891, 360405, 0.00278359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(68, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:39:14', '2014-01-23 10:43:12', 2, 22.7173, 951.711, 27.5574, 0, 0, 0, 0, 0, 0, 17.0003, 16.999, 17.001, 16.9784, 16.977, 16.979, 16.9973, 16.996, 16.998, 32.95, 32.95, 1033.9, 1033.9, 1000.95, 998.777, 998.781, 998.777, 15871.2, 15874, 1003.2, 1001.12, 227.041, -0.207258, 360405, 0.00278355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(69, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:45:43', '2014-01-23 10:49:41', 3, 22.5937, 951.647, 27.4176, 0, 0, 0, 0, 0, 0, 17.0002, 17, 16.999, 16.9784, 16.978, 16.979, 16.9972, 16.997, 16.996, 33.05, 33.05, 1034.05, 1034.05, 1001, 998.777, 998.781, 998.777, 15869.6, 15871.6, 1003.25, 1001.12, 227.076, -0.212249, 360405, 0.00278369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(70, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:52:16', '2014-01-23 10:56:15', 4, 22.526, 951.594, 27.5806, 0, 0, 0, 0, 0, 0, 17.0014, 17.002, 17.003, 16.9788, 16.978, 16.979, 16.9989, 16.997, 16.998, 33, 33, 1033.98, 1033.98, 1000.98, 998.777, 998.781, 998.777, 15871.1, 15873.4, 1003.24, 1001.13, 227.051, -0.210299, 360406, 0.00278363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(71, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 10:58:49', '2014-01-23 11:02:47', 5, 22.4358, 951.725, 27.4002, 0, 0, 0, 0, 0, 0, 17.0043, 17.003, 17.004, 16.981, 16.979, 16.982, 16.9999, 16.997, 17, 33.15, 33.15, 1034.1, 1034.1, 1000.95, 998.776, 998.78, 998.777, 15873.3, 15876.1, 1003.2, 1001.13, 227.011, -0.207021, 360406, 0.00278354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(72, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 11:03:27', '2014-01-23 11:09:25', 1, 22.381, 951.688, 27.6094, 0, 0, 0, 0, 0, 0, 17.0359, 17.014, 17.041, 17.0425, 16.99, 17.078, 17.8152, 18.731, 17.476, -0.0136667, -0.0136667, 100.162, 100.162, 100.175, 998.771, 998.769, 998.632, 1035.88, 1034.83, 100.402, 100.073, 348.14, -0.327396, 240176, 0.000418035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(73, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 11:10:11', '2014-01-23 11:16:10', 2, 22.3575, 951.648, 27.5311, 0, 0, 0, 0, 0, 0, 17.0517, 17.046, 17.055, 17.1016, 17.084, 17.111, 17.4316, 17.448, 17.426, 5.42533, 5.42533, 105.64, 105.64, 100.215, 998.768, 998.759, 998.701, 1036.77, 1035.31, 100.443, 100.073, 347.978, -0.367552, 240176, 0.000418204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(74, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 11:16:58', '2014-01-23 11:22:57', 3, 22.3472, 951.517, 27.2686, 0, 0, 0, 0, 0, 0, 17.0592, 17.054, 17.062, 17.125, 17.114, 17.13, 17.4365, 17.429, 17.444, 5.60667, 5.60667, 105.809, 105.809, 100.203, 998.767, 998.755, 998.7, 1036.63, 1035.29, 100.431, 100.073, 347.982, -0.356025, 240176, 0.000418155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(75, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 11:23:45', '2014-01-23 11:29:44', 4, 22.3489, 951.527, 27.0005, 0, 0, 0, 0, 0, 0, 17.0613, 17.058, 17.063, 17.1369, 17.133, 17.135, 17.4475, 17.442, 17.454, 5.24433, 5.24433, 105.465, 105.465, 100.221, 998.766, 998.753, 998.698, 1036.52, 1034.99, 100.449, 100.073, 348.083, -0.374469, 240176, 0.000418233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(76, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 11:30:31', '2014-01-23 11:36:30', 5, 22.3677, 951.481, 26.8638, 0, 0, 0, 0, 0, 0, 17.0642, 17.061, 17.069, 17.142, 17.133, 17.15, 17.4536, 17.454, 17.452, 5.583, 5.583, 105.801, 105.801, 100.218, 998.766, 998.752, 998.697, 1036.55, 1035.06, 100.446, 100.073, 348.062, -0.371238, 240176, 0.000418219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(77, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 14:36:43', '2014-01-23 14:37:40', 1, 22.1304, 950.107, 27.0682, 0, 0, 0, 0, 0, 0, 17.1687, 17.174, 17.16, 17.167, 17.175, 17.159, 17.2108, 17.23, 17.196, 33.1, 33.1, 234.25, 234.25, 201.15, 998.747, 998.748, 998.74, 15876.4, 15874.5, 201.61, 201.125, 45.611, -0.240383, 72405, 0.00278447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(78, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 14:40:03', '2014-01-23 14:44:01', 1, 22.1172, 950.109, 27.9356, 0, 0, 0, 0, 0, 0, 17.1405, 17.13, 17.147, 17.1268, 17.119, 17.13, 17.1458, 17.145, 17.148, 33.5, 33.5, 1034.45, 1034.45, 1000.95, 998.752, 998.755, 998.751, 15870.6, 15873.4, 1003.23, 1001.12, 227.05, -0.209839, 360405, 0.00278362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(79, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 14:46:33', '2014-01-23 14:50:32', 2, 22.0557, 950.031, 27.9047, 0, 0, 0, 0, 0, 0, 17.0877, 17.134, 17.062, 17.0744, 17.123, 17.045, 17.0975, 17.145, 17.066, 32.7, 32.7, 1033.65, 1033.65, 1000.95, 998.762, 998.764, 998.76, 15870.6, 15873.4, 1003.22, 1001.12, 227.05, -0.208928, 360405, 0.00278359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(80, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 14:53:06', '2014-01-23 14:57:04', 3, 22.0006, 950.123, 27.87, 0, 0, 0, 0, 0, 0, 17.0567, 17.057, 17.05, 17.0369, 17.036, 17.031, 17.0565, 17.055, 17.051, 33.3, 33.3, 1034.4, 1034.4, 1001.1, 998.767, 998.77, 998.767, 15872.8, 15873.2, 1003.36, 1001.12, 227.053, -0.22323, 360405, 0.00278399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(81, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 14:59:35', '2014-01-23 15:03:33', 4, 21.9671, 950.105, 27.9426, 0, 0, 0, 0, 0, 0, 17.0501, 17.049, 17.051, 17.0276, 17.027, 17.029, 17.0484, 17.049, 17.048, 33, 33, 1033.9, 1033.9, 1000.9, 998.768, 998.772, 998.768, 15873.1, 15876.6, 1003.16, 1001.12, 227.003, -0.203403, 360404, 0.00278344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(82, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:06:08', '2014-01-23 15:10:06', 5, 21.9451, 950.152, 27.9535, 0, 0, 0, 0, 0, 0, 17.054, 17.051, 17.056, 17.0309, 17.029, 17.033, 17.0513, 17.05, 17.052, 32.9, 32.9, 1033.95, 1033.95, 1001.05, 998.768, 998.771, 998.768, 15872.7, 15873.9, 1003.31, 1001.12, 227.042, -0.218131, 360405, 0.00278385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(83, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:10:28', '2014-01-23 15:16:28', 1, 21.9423, 950.104, 28.1947, 0, 0, 0, 0, 0, 0, 17.0873, 17.059, 17.095, 17.0896, 17.038, 17.125, 17.8578, 19.567, 17.514, 0.236667, 0.236667, 100.459, 100.459, 100.223, 998.762, 998.761, 998.624, 1032.16, 1030.62, 100.45, 100.073, 349.559, -0.375704, 240175, 0.000418238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(84, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:17:15', '2014-01-23 15:23:15', 2, 21.9366, 950.112, 28.259, 0, 0, 0, 0, 0, 0, 17.1022, 17.095, 17.109, 17.1503, 17.13, 17.167, 17.4923, 17.505, 17.492, 5.38167, 5.38167, 105.599, 105.599, 100.217, 998.759, 998.751, 998.69, 1032.51, 1031.03, 100.446, 100.073, 349.421, -0.371126, 240175, 0.000418219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(85, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:24:03', '2014-01-23 15:30:04', 3, 21.9112, 950.105, 28.1581, 0, 0, 0, 0, 0, 0, 17.1102, 17.109, 17.115, 17.176, 17.173, 17.182, 17.4962, 17.494, 17.504, 5.20133, 5.20133, 105.405, 105.405, 100.203, 998.758, 998.746, 998.689, 1032.5, 1031.16, 100.432, 100.073, 349.376, -0.357995, 240175, 0.000418164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(86, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:30:52', '2014-01-23 15:36:52', 4, 21.9089, 950.05, 27.8639, 0, 0, 0, 0, 0, 0, 17.1158, 17.116, 17.115, 17.1856, 17.182, 17.212, 17.5053, 17.509, 17.515, 5.57667, 5.57667, 105.799, 105.799, 100.222, 998.757, 998.744, 998.688, 1032.58, 1031.04, 100.451, 100.073, 349.416, -0.376725, 240175, 0.000418242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(87, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 15:37:40', '2014-01-23 15:43:40', 5, 21.9101, 950.054, 27.8539, 0, 0, 0, 0, 0, 0, 17.117, 17.118, 17.121, 17.1896, 17.193, 17.191, 17.5014, 17.507, 17.499, 5.59267, 5.59267, 105.795, 105.795, 100.202, 998.756, 998.744, 998.688, 1032.52, 1031.19, 100.431, 100.073, 349.366, -0.356905, 240175, 0.000418159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(88, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 16:33:16', '2014-01-23 16:37:14', 1, 22.2809, 950.137, 29.0679, 0, 0, 0, 0, 0, 0, 17.1094, 17.109, 17.104, 17.0906, 17.089, 17.087, 17.1091, 17.107, 17.108, 1.15, 1.15, 1.15, 1.15, 0, 998.758, 998.761, 998.758, 0, 15850.1, 0, 1001.12, 227.383, 0.1, 360405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(89, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 16:50:04', '2014-01-23 16:51:00', 1, 22.2748, 950.052, 29.2155, 0, 0, 0, 0, 0, 0, 17.0772, 17.076, 17.077, 17.0559, 17.056, 17.056, 17.0756, 17.077, 17.075, 33.05, 33.05, 234.2, 234.2, 201.15, 998.763, 998.767, 998.764, 15905, 15903.3, 201.606, 201.128, 45.529, -0.237072, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(90, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 16:53:00', '2014-01-23 16:53:57', 2, 22.28, 950.177, 29.1289, 0, 0, 0, 0, 0, 0, 17.077, 17.075, 17.079, 17.054, 17.053, 17.056, 17.0725, 17.073, 17.073, 33.5667, 33.5667, 234.7, 234.7, 201.133, 998.763, 998.767, 998.764, 15911, 15910.6, 201.589, 201.128, 45.508, -0.228773, 72406, 0.00278415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(91, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 16:55:57', '2014-01-23 16:56:54', 3, 22.2762, 950.3, 29.1878, 0, 0, 0, 0, 0, 0, 17.0771, 17.077, 17.078, 17.0544, 17.053, 17.056, 17.072, 17.072, 17.072, 33, 33, 234.2, 234.2, 201.2, 998.763, 998.767, 998.764, 15910.4, 15904.4, 201.656, 201.125, 45.525, -0.263217, 72405, 0.00278511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(92, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 16:58:54', '2014-01-23 16:59:50', 4, 22.2625, 950.295, 29.23, 0, 0, 0, 0, 0, 0, 17.0783, 17.078, 17.077, 17.054, 17.054, 17.054, 17.0734, 17.073, 17.074, 33.45, 33.45, 234.6, 234.6, 201.15, 998.763, 998.768, 998.764, 15904.3, 15902.6, 201.606, 201.128, 45.531, -0.23705, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(93, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 17:01:50', '2014-01-23 17:02:47', 5, 22.25, 950.2, 29.2922, 0, 0, 0, 0, 0, 0, 17.0784, 17.078, 17.079, 17.0549, 17.054, 17.056, 17.0739, 17.073, 17.076, 32.9667, 32.9667, 234.117, 234.117, 201.15, 998.763, 998.767, 998.764, 15909.6, 15907.8, 201.606, 201.128, 45.516, -0.23705, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(94, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-23 18:11:56', '2014-01-23 18:12:59', 1, 21.6157, 950.069, 29.512, 0, 0, 0, 0, 0, 0, 17.1888, 17.242, 17.155, 17.1899, 17.236, 17.157, 17.2798, 17.427, 17.206, -0.05, -0.05, 200.9, 200.9, 200.95, 998.744, 998.744, 998.728, 14034.5, 14037.6, 201.41, 200.994, 51.546, -0.206317, 72358, 0.00278352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(95, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 09:49:41', '2014-01-24 09:50:40', 1, 22.6, 948.534, 27.64, 0, 0, 0, 0, 0, 0, 18.5668, 19.343, 18.13, 19.4426, 21.161, 18.427, 20.1827, 21.875, 18.962, 0, 0, 201.05, 201.05, 201.05, 998.491, 998.32, 998.168, 15121.3, 15123.2, 201.596, 201.075, 47.865, -0.258345, 72387, 0.00278497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(96, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 09:54:08', '2014-01-24 09:56:52', 1, 22.5919, 948.819, 29.9135, 0, 0, 0, 0, 0, 0, 17.7907, 17.86, 17.737, 17.8374, 17.969, 17.763, 17.9082, 18.042, 17.815, 302.75, 302.75, 903.683, 903.683, 600.933, 998.636, 998.628, 998.615, 14070.9, 14072.4, 602.379, 600.997, 153.747, -0.229386, 216359, 0.00278416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(97, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 09:57:48', '2014-01-24 10:01:47', 1, 22.5884, 948.599, 30.4115, 0, 0, 0, 0, 0, 0, 17.7214, 17.708, 17.735, 17.7629, 17.732, 17.776, 17.7996, 17.785, 17.816, 903.75, 903.75, 1104.1, 1104.1, 200.35, 998.649, 998.641, 998.634, 3157.6, 3155.59, 200.829, 200.222, 228.42, -0.302252, 72080, 0.0027862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(98, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 10:08:47', '2014-01-24 10:11:21', 1, 22.5246, 948.847, 30.101, 0, 0, 0, 0, 0, 0, 17.6874, 17.777, 17.624, 17.7124, 17.833, 17.631, 17.7955, 17.983, 17.687, 1104.15, 1104.15, 1705.03, 1705.03, 600.883, 998.655, 998.65, 998.635, 15090.3, 15094.9, 602.315, 601.067, 143.349, -0.207279, 216384, 0.00278355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(99, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 10:12:21', '2014-01-24 10:16:20', 1, 22.5002, 948.827, 31.126, 0, 0, 0, 0, 0, 0, 17.5736, 17.588, 17.548, 17.6089, 17.608, 17.593, 17.6488, 17.655, 17.637, 1705.1, 1705.1, 1905.42, 1905.42, 200.317, 998.675, 998.669, 998.662, 3151.86, 3150.38, 200.79, 200.222, 228.798, -0.282879, 72080, 0.00278566, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(100, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 10:17:13', '2014-01-24 10:22:31', 1, 22.4694, 948.939, 31.3745, 0, 0, 0, 0, 0, 0, 17.5237, 17.546, 17.493, 17.6182, 17.601, 17.625, 18.0608, 18.404, 17.923, 5.674, 5.674, 105.906, 105.906, 100.232, 998.684, 998.667, 998.586, 1178.96, 1177.21, 100.469, 100.083, 306.062, -0.383661, 240200, 0.000418271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(101, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 10:24:03', '2014-01-24 10:26:19', 1, 22.4202, 949.037, 30.8028, 0, 0, 0, 0, 0, 0, 17.4585, 17.498, 17.435, 17.5486, 17.6, 17.496, 17.744, 17.816, 17.688, 5.60467, 5.60467, 105.998, 105.998, 100.394, 998.696, 998.68, 998.645, 2888.08, 2882.56, 100.63, 100.202, 125.141, -0.425557, 240484, 0.000418447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(102, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 11:27:34', '2014-01-24 11:30:09', 1, 22.2572, 949.084, 29.9756, 0, 0, 0, 0, 0, 0, 17.3901, 17.615, 17.313, 17.4633, 17.94, 17.316, 17.6353, 18.542, 17.388, 1905.45, 1905.45, 2506.23, 2506.23, 600.784, 998.708, 998.695, 998.664, 15064, 15071.2, 602.188, 601.069, 143.575, -0.185765, 216385, 0.00278295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(103, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 11:33:10', '2014-01-24 11:37:10', 1, 22.2358, 949.059, 30.417, 0, 0, 0, 0, 0, 0, 17.2012, 17.2, 17.197, 17.2137, 17.208, 17.216, 17.244, 17.239, 17.25, 23.4, 23.4, 223.8, 223.8, 200.4, 998.742, 998.74, 998.734, 3146.94, 3144.15, 200.86, 200.222, 229.251, -0.317324, 72080, 0.00278662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(104, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 11:38:48', '2014-01-24 11:44:38', 1, 22.2371, 949.064, 29.9864, 0, 0, 0, 0, 0, 0, 17.2171, 17.207, 17.227, 17.2649, 17.223, 17.296, 17.7839, 18.155, 17.642, 5.552, 5.552, 105.759, 105.759, 100.207, 998.739, 998.73, 998.637, 1065.44, 1064.03, 100.438, 100.075, 338.589, -0.361469, 240180, 0.000418178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(105, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 11:46:13', '2014-01-24 11:48:28', 1, 22.2581, 949.068, 28.5927, 0, 0, 0, 0, 0, 0, 17.2312, 17.252, 17.219, 17.2727, 17.301, 17.246, 17.4753, 17.517, 17.454, 5.552, 5.552, 105.959, 105.959, 100.407, 998.736, 998.729, 998.693, 2907.1, 2901.22, 100.639, 100.204, 124.339, -0.431722, 240490, 0.000418473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(106, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 12:02:16', '2014-01-24 12:04:50', 1, 22.5164, 949.085, 27.5738, 0, 0, 0, 0, 0, 0, 17.2041, 17.274, 17.172, 17.215, 17.334, 17.169, 17.3073, 17.613, 17.213, 223.8, 223.8, 824.8, 824.8, 601, 998.741, 998.739, 998.723, 15076.2, 15078, 602.378, 601.072, 143.511, -0.216843, 216386, 0.00278381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(107, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 12:05:51', '2014-01-24 12:09:51', 1, 22.5944, 949.109, 27.5323, 0, 0, 0, 0, 0, 0, 17.1726, 17.166, 17.171, 17.1775, 17.165, 17.175, 17.2016, 17.196, 17.208, 824.85, 824.85, 1025.23, 1025.23, 200.383, 998.747, 998.746, 998.742, 3141.05, 3138.53, 200.842, 200.222, 229.662, -0.308402, 72080, 0.00278637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(108, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 13:07:48', '2014-01-24 13:10:21', 1, 23.0909, 949.002, 26.2842, 0, 0, 0, 0, 0, 0, 17.2331, 17.429, 17.175, 17.2812, 17.719, 17.182, 17.4027, 18.026, 17.225, 1025.25, 1025.25, 1626.13, 1626.13, 600.883, 998.736, 998.728, 998.706, 15204.5, 15209.4, 602.268, 601.075, 142.272, -0.198164, 216387, 0.00278329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(109, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 13:11:21', '2014-01-24 13:15:19', 1, 23.1303, 948.951, 26.183, 0, 0, 0, 0, 0, 0, 17.1652, 17.161, 17.166, 17.177, 17.161, 17.179, 17.202, 17.195, 17.209, 1626.2, 1626.2, 1826.55, 1826.55, 200.35, 998.748, 998.746, 998.742, 3172.69, 3170.71, 200.809, 200.225, 227.334, -0.290581, 72081, 0.00278587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(110, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 13:16:22', '2014-01-24 13:21:36', 1, 23.1949, 948.915, 26.1312, 0, 0, 0, 0, 0, 0, 17.1793, 17.175, 17.175, 17.2394, 17.196, 17.259, 17.883, 18.531, 17.64, 5.227, 5.227, 105.449, 105.449, 100.222, 998.746, 998.735, 998.619, 1190.55, 1188.91, 100.452, 100.084, 303.052, -0.366476, 240202, 0.000418199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(111, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 13:23:09', '2014-01-24 13:25:25', 1, 23.3193, 948.973, 26.3648, 0, 0, 0, 0, 0, 0, 17.1846, 17.197, 17.179, 17.226, 17.26, 17.202, 17.4636, 17.515, 17.43, 5.561, 5.561, 105.96, 105.96, 100.399, 998.745, 998.737, 998.695, 2916.87, 2911.32, 100.63, 100.208, 123.913, -0.418833, 240500, 0.000418419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(112, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 14:03:10', '2014-01-24 14:05:43', 1, 23.6351, 948.813, 26.7518, 155.811, 155.886, 155.911, 141.568, 141.71, 141.343, 10.5715, 10.6832, 10.5338, 10.621, 10.7674, 10.562, 10.6782, 10.7867, 10.6027, 196.25, 196.25, 796.983, 796.983, 600.733, 999.65, 999.645, 999.639, 15250, 15241.4, 601.566, 600.394, 141.812, -0.194703, 216142, 0.0027832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(113, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 14:55:04', '2014-01-24 14:57:37', 1, 24.3689, 948.904, 28.2572, 155.805, 155.828, 155.811, 141.454, 141.788, 141.235, 10.5344, 10.604, 10.4959, 10.5674, 10.6485, 10.5277, 10.6463, 10.8516, 10.563, 0, 0, 572.65, 572.65, 572.65, 999.653, 999.65, 999.642, 14534, 15238, 573.441, 600.392, 141.843, 4.6999, 216141, 0.00265309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(114, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 14:58:38', '2014-01-24 15:02:36', 1, 24.4131, 948.846, 28.5036, 155.913, 155.893, 155.986, 159.13, 158.947, 159.16, 10.5067, 10.4905, 10.5103, 10.5614, 10.5151, 10.589, 10.5935, 10.5522, 10.6172, 572.7, 572.7, 773, 773, 200.3, 999.656, 999.651, 999.647, 3171.19, 3167.67, 200.576, 200.078, 227.385, -0.248582, 72028, 0.0027847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(115, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 15:03:45', '2014-01-24 15:09:24', 1, 24.4372, 948.986, 28.6013, 155.93, 155.957, 155.975, 157.52, 157.461, 157.645, 10.5299, 10.5266, 10.532, 10.6805, 10.5908, 10.7206, 11.6102, 12.0364, 11.4289, 0.081, 0.081, 100.249, 100.249, 100.168, 999.654, 999.639, 999.543, 1100.24, 1098.97, 100.307, 100.052, 327.749, -0.254171, 240125, 0.000417728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(116, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-24 15:10:58', '2014-01-24 15:13:13', 1, 24.47, 948.983, 28.7628, 155.939, 155.975, 156.009, 155.564, 155.477, 155.056, 10.555, 10.5662, 10.532, 10.6734, 10.7188, 10.6341, 11.1051, 11.1928, 11.054, 5.425, 5.425, 105.682, 105.682, 100.257, 999.651, 999.64, 999.597, 2906.11, 2902.65, 100.396, 100.138, 124.195, -0.25757, 240330, 0.000417743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(117, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 12:49:03', '2014-01-27 12:51:36', 1, 24.3667, 937.303, 24.6681, 155.831, 155.767, 155.731, 141.339, 141.375, 140.818, 11.7791, 11.8739, 11.7424, 11.7954, 11.8166, 11.7697, 11.9446, 12.268, 11.8276, 6.4, 6.4, 607.083, 607.083, 600.683, 999.525, 999.523, 999.506, 15190.9, 15183.4, 601.589, 600.386, 142.352, -0.199971, 216139, 0.00278334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(118, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 12:52:37', '2014-01-27 12:56:36', 1, 24.3666, 937.21, 24.9066, 155.917, 155.903, 155.874, 159.405, 159.357, 159.47, 11.6909, 11.7261, 11.6144, 11.7866, 11.7499, 11.7264, 11.8528, 11.8024, 11.815, 607.15, 607.15, 807.45, 807.45, 200.3, 999.534, 999.524, 999.516, 3153.79, 3150.34, 200.602, 200.081, 228.639, -0.259853, 72029, 0.00278501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(119, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 12:57:10', '2014-01-27 13:02:55', 1, 24.3852, 937.231, 25.1367, 155.991, 155.988, 155.949, 157.687, 157.582, 157.573, 11.6022, 11.6162, 11.5658, 11.7865, 11.7318, 11.822, 12.7097, 13.5891, 12.433, 0.165, 0.165, 100.314, 100.314, 100.149, 999.544, 999.524, 999.415, 1078.36, 1077.31, 100.3, 100.051, 334.338, -0.248255, 240123, 0.000417704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(120, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 13:04:30', '2014-01-27 13:06:44', 1, 24.3937, 937.315, 25.3005, 156.012, 156.72, 156.424, 155.735, 154.088, 156.025, 11.6393, 11.6162, 11.6595, 11.7486, 11.8022, 11.7264, 12.1113, 12.1986, 12.0887, 5.558, 5.558, 105.796, 105.796, 100.238, 999.54, 999.528, 999.487, 2948.02, 2945.19, 100.388, 100.141, 122.406, -0.246084, 240339, 0.000417695, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(121, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 13:23:18', '2014-01-27 13:25:53', 1, 24.4548, 937.35, 25.3167, 155.877, 155.917, 155.876, 141.605, 141.611, 141.718, 11.1896, 11.5027, 11.0722, 11.3013, 11.9248, 11.1279, 11.4635, 12.4088, 11.1998, 807.45, 807.45, 1408.02, 1408.02, 600.567, 999.588, 999.576, 999.559, 15077.6, 15072.9, 601.44, 600.378, 143.394, -0.176629, 216136, 0.00278269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(122, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 13:26:52', '2014-01-27 13:30:51', 1, 24.4663, 937.297, 25.7032, 155.989, 155.904, 155.928, 159.459, 159.414, 159.496, 10.9305, 10.966, 10.8687, 11.0395, 11.0666, 11.0107, 11.0933, 11.1186, 11.0717, 1408.05, 1408.05, 1608.4, 1608.4, 200.35, 999.614, 999.603, 999.598, 3165.88, 3161.62, 200.636, 200.081, 227.823, -0.276792, 72029, 0.00278549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30); +INSERT INTO `testresult` (`Id`, `Name`, `TestName`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`, `Test_id`) VALUES +(123, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 13:32:33', '2014-01-27 13:38:12', 1, 24.4979, 937.409, 25.3508, 155.995, 156.017, 156.038, 161.118, 160.934, 161.192, 10.8131, 10.8201, 10.7985, 11.0214, 10.9981, 11.0468, 11.8933, 12.3952, 11.7065, 5.262, 5.262, 105.424, 105.424, 100.162, 999.626, 999.605, 999.512, 1100.81, 1099.61, 100.304, 100.053, 327.562, -0.251158, 240126, 0.000417716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(124, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-27 13:39:49', '2014-01-27 13:42:04', 1, 24.49, 937.333, 25.3118, 156.024, 155.662, 156.062, 154.579, 153.316, 157.252, 10.7452, 10.7967, 10.7246, 10.9408, 11.0378, 10.8485, 11.3199, 11.4487, 11.2343, 5.33767, 5.33767, 105.581, 105.581, 100.243, 999.633, 999.613, 999.574, 2911.72, 2908.72, 100.385, 100.14, 123.939, -0.24445, 240336, 0.000417688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(125, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 10:34:34', '2014-02-10 10:37:05', 1, 23.3814, 933.535, 24.0235, 155.816, 154.255, 165.099, 127.086, 126.867, 112.681, 11.4867, 12.5028, 11.1983, 12.3161, 13.4598, 11.5894, 13.4178, 15.3884, 12.3681, -0.009, -0.009, 99.7903, 99.7903, 99.7993, 999.557, 999.463, 999.325, 2559.89, 2568.78, 99.9558, 100.146, 140.349, 0.190109, 240350, 0.000415876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(126, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 10:37:31', '2014-02-10 10:38:31', 1, 23.38, 933.458, 23.5607, 155.147, 155.105, 155.165, 148.065, 148.153, 148.161, 11.0406, 11.1479, 10.948, 11.1406, 11.3749, 10.9657, 12.1197, 13.4921, 11.3639, 15, 15, 518.633, 518.633, 503.633, 999.603, 999.593, 999.486, 39799.8, 39591.7, 504.357, 501, 45.555, -0.665671, 18036, 0.0279639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(127, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 10:54:54', '2014-02-10 11:02:45', 1, 23.4246, 933.123, 23.3219, 155.617, 155.576, 155.689, 159.112, 159.045, 159.154, 10.8988, 11.1029, 10.8309, 11.3865, 11.6705, 11.1279, 12.1099, 12.6783, 11.6957, 5.546, 5.546, 5.542, 5.542, -0.00400019, 999.618, 999.567, 999.487, -0.101455, 2540.83, -0.00400604, 100.18, 141.941, 0.1, 240432, -0.0000000166618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(128, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 11:03:54', '2014-02-10 11:06:24', 1, 23.4238, 933.369, 23.5026, 155.618, 155.583, 155.659, 159.755, 159.658, 159.737, 10.8492, 11.0398, 10.7643, 11.1802, 11.2451, 11.045, 11.737, 12.0815, 11.4866, 5.542, 5.542, 105.769, 105.769, 100.227, 999.622, 999.589, 999.529, 2597.24, 2594.56, 100.371, 100.123, 138.923, -0.246894, 240296, 0.000417698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(129, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 11:06:51', '2014-02-10 11:07:50', 1, 23.4445, 933.343, 23.7755, 155.058, 155.031, 154.963, 148.861, 148.755, 148.871, 10.7121, 10.7553, 10.6652, 10.7856, 10.8936, 10.6989, 11.2167, 11.7861, 10.8606, 518.65, 518.65, 1022.27, 1022.27, 503.617, 999.636, 999.629, 999.585, 37991.3, 37789.7, 504.323, 500.944, 47.722, -0.669832, 18034, 0.0279651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(130, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:13:50', '2014-02-10 13:16:22', 1, 23.5781, 930.88, 22.0897, 155.456, 155.46, 155.478, 157.501, 157.365, 157.721, 11.0939, 11.8468, 10.7679, 12.3625, 13.2216, 11.6886, 13.184, 14.7368, 12.076, 5.79167, 5.79167, 106.011, 106.011, 100.219, 999.598, 999.457, 999.356, 2582.45, 2579.98, 100.377, 100.123, 139.708, -0.252391, 240296, 0.000417721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(131, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:23:48', '2014-02-10 13:26:19', 1, 23.6071, 930.643, 22.3375, 155.363, 155.318, 155.307, 157.705, 157.879, 157.768, 10.757, 10.948, 10.6904, 11.1593, 11.4001, 10.9495, 11.6593, 12.0003, 11.3784, 5.788, 5.788, 106.016, 106.016, 100.228, 999.632, 999.591, 999.538, 2584.56, 2581.87, 100.372, 100.123, 139.606, -0.248016, 240296, 0.000417703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(132, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:26:53', '2014-02-10 13:27:54', 1, 23.62, 930.617, 22.5558, 155.111, 155.153, 155.136, 149.841, 149.677, 149.921, 10.6263, 10.6832, 10.5608, 10.6902, 10.7818, 10.5962, 11.6511, 13.2212, 10.9184, 278.35, 278.35, 781.25, 781.25, 502.9, 999.644, 999.638, 999.539, 35989.3, 35845.3, 503.6, 500.889, 50.305, -0.53839, 18032, 0.0279281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(133, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:31:37', '2014-02-10 13:34:05', 1, 23.6456, 930.527, 22.8671, 155.489, 155.546, 155.463, 157.506, 157.511, 157.251, 10.4999, 10.5392, 10.4779, 10.6483, 10.6539, 10.6215, 11.1849, 11.3262, 11.0811, 5.399, 5.399, 105.623, 105.623, 100.224, 999.656, 999.642, 999.588, 2624.34, 2621.74, 100.363, 100.125, 137.485, -0.237601, 240300, 0.000417659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(134, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:35:00', '2014-02-10 13:37:33', 2, 23.6645, 930.379, 23.1497, 155.456, 155.418, 155.472, 157.88, 157.75, 157.91, 10.4526, 10.4689, 10.4437, 10.6007, 10.5998, 10.5926, 11.016, 11.0522, 10.9856, 5.337, 5.337, 105.558, 105.558, 100.221, 999.661, 999.647, 999.606, 2555.22, 2552.66, 100.359, 100.12, 141.199, -0.238051, 240289, 0.000417661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(135, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:38:33', '2014-02-10 13:41:05', 3, 23.67, 930.312, 22.9731, 155.484, 155.407, 155.499, 157.886, 157.785, 157.943, 10.4358, 10.4311, 10.4329, 10.5722, 10.5782, 10.5656, 10.9751, 10.9784, 10.9694, 5.692, 5.692, 105.919, 105.919, 100.227, 999.662, 999.649, 999.61, 2554.74, 2552.06, 100.366, 100.122, 141.235, -0.242772, 240293, 0.000417681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(136, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:42:02', '2014-02-10 13:44:34', 4, 23.6591, 930.233, 22.2285, 155.492, 155.39, 155.497, 157.898, 157.644, 157.563, 10.4236, 10.4329, 10.4275, 10.5604, 10.5656, 10.562, 10.9623, 10.9694, 10.9549, 5.705, 5.705, 105.929, 105.929, 100.224, 999.664, 999.651, 999.611, 2555.88, 2553.28, 100.362, 100.122, 141.167, -0.239011, 240293, 0.000417665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(137, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:45:31', '2014-02-10 13:48:03', 5, 23.6335, 930.357, 21.9714, 155.472, 155.327, 155.531, 157.901, 158.199, 157.989, 10.4169, 10.4221, 10.4113, 10.5434, 10.5548, 10.5349, 10.9381, 10.9387, 10.9351, 5.681, 5.681, 105.903, 105.903, 100.222, 999.664, 999.652, 999.614, 2555.14, 2552.58, 100.36, 100.121, 141.205, -0.237685, 240291, 0.000417659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(138, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:51:09', '2014-02-10 13:52:07', 1, 23.62, 930.481, 23.7909, 154.839, 154.849, 154.768, 147.469, 147.437, 147.31, 10.1477, 10.1682, 10.1178, 10.1627, 10.1836, 10.1385, 10.2193, 10.2583, 10.1934, 34.05, 34.05, 537.4, 537.4, 503.35, 999.689, 999.688, 999.682, 40012.8, 39823.8, 504.026, 500.972, 45.287, -0.605864, 18035, 0.0279471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(139, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:55:13', '2014-02-10 13:56:17', 2, 23.6083, 930.462, 24.0179, 155.215, 155.229, 155.163, 151.193, 151.341, 150.974, 10.0344, 10.035, 10.0296, 10.0474, 10.0538, 10.043, 10.0858, 10.0888, 10.0834, 34.3, 34.3, 537.55, 537.55, 503.25, 999.699, 999.698, 999.694, 34164.3, 34000.3, 503.921, 500.833, 53.029, -0.612646, 18030, 0.027949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(140, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 13:59:08', '2014-02-10 14:00:08', 3, 23.6, 930.469, 24.7452, 154.837, 154.865, 154.899, 147.167, 146.811, 147.117, 10.0194, 10.0206, 10.0188, 10.0313, 10.0304, 10.0286, 10.069, 10.069, 10.0672, 34.25, 34.25, 537.767, 537.767, 503.517, 999.7, 999.699, 999.696, 38978.6, 38783.8, 504.187, 501, 46.504, -0.632079, 18036, 0.0279545, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(141, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 14:02:59', '2014-02-10 14:03:56', 4, 23.5944, 930.338, 24.9489, 154.81, 154.753, 154.715, 147.193, 146.833, 147.061, 10.0107, 10.017, 10.0098, 10.0212, 10.0214, 10.0196, 10.0584, 10.06, 10.0564, 34.1, 34.1, 34.1, 34.1, 0, 999.701, 999.7, 999.697, 0, 38759.2, 0, 502.75, 46.696, 0.1, 18099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(142, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 14:04:22', '2014-02-10 14:05:24', 5, 23.59, 930.411, 24.8331, 154.803, 154.877, 154.767, 147.147, 146.9, 147.23, 10.0098, 10.008, 10.0116, 10.0195, 10.0214, 10.0178, 10.0571, 10.0582, 10.0564, 33.25, 33.25, 536.75, 536.75, 503.5, 999.701, 999.7, 999.697, 39003.3, 38809.6, 504.17, 501, 46.473, -0.628687, 18036, 0.0279535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(143, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 14:58:54', '2014-02-10 15:01:27', 1, 23.4812, 929.983, 22.7254, 155.456, 155.375, 155.476, 157.693, 157.762, 157.801, 10.387, 10.7949, 10.2241, 11.2192, 11.7877, 10.6899, 12.099, 13.1959, 11.3262, 5.318, 5.318, 105.546, 105.546, 100.228, 999.667, 999.585, 999.488, 2555.13, 2552.39, 100.373, 100.12, 141.214, -0.251208, 240289, 0.000417716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(144, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:02:19', '2014-02-10 15:04:51', 2, 23.4816, 929.988, 22.6396, 155.45, 155.298, 155.48, 157.747, 157.419, 157.424, 10.1956, 10.2133, 10.1844, 10.4232, 10.5169, 10.3764, 10.9236, 11.0631, 10.8342, 5.274, 5.274, 105.495, 105.495, 100.221, 999.685, 999.664, 999.615, 2553.93, 2551.4, 100.358, 100.122, 141.271, -0.235052, 240293, 0.000417648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(145, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:18:45', '2014-02-10 15:21:16', 1, 23.44, 929.927, 22.8441, 155.45, 155.505, 155.47, 157.566, 157.71, 157.402, 10.2599, 10.4131, 10.1862, 10.5411, 10.6647, 10.4088, 11.1378, 11.4577, 10.8973, 5.405, 5.405, 105.63, 105.63, 100.225, 999.679, 999.652, 999.593, 2584.72, 2582.08, 100.363, 100.123, 139.594, -0.239653, 240295, 0.000417668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(146, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:22:15', '2014-02-10 15:24:48', 2, 23.4553, 929.787, 23.0913, 155.446, 155.457, 155.532, 157.553, 157.411, 157.426, 10.1816, 10.1898, 10.1826, 10.3361, 10.3349, 10.3277, 10.763, 10.8054, 10.7369, 5.337, 5.337, 105.569, 105.569, 100.232, 999.686, 999.672, 999.631, 2584.39, 2581.56, 100.368, 100.122, 139.621, -0.245199, 240293, 0.000417691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(147, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:26:04', '2014-02-10 15:28:32', 3, 23.4879, 929.792, 23.0006, 155.466, 155.579, 155.577, 157.272, 157.258, 157.463, 10.1784, 10.1898, 10.179, 10.3079, 10.3115, 10.3115, 10.7041, 10.7225, 10.6901, 5.293, 5.293, 105.538, 105.538, 100.245, 999.686, 999.674, 999.637, 2642.46, 2639.35, 100.381, 100.127, 136.57, -0.252974, 240304, 0.000417723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(148, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:29:27', '2014-02-10 15:32:00', 4, 23.5265, 929.665, 23.17, 155.441, 155.342, 155.386, 157.682, 157.499, 157.658, 10.1735, 10.179, 10.1718, 10.299, 10.2917, 10.2953, 10.6968, 10.6919, 10.7027, 5.31, 5.31, 105.544, 105.544, 100.234, 999.687, 999.675, 999.637, 2554.47, 2551.61, 100.37, 100.122, 141.259, -0.24727, 240292, 0.0004177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(149, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:32:57', '2014-02-10 15:35:29', 5, 23.5329, 929.67, 23.1757, 155.454, 155.464, 155.444, 157.697, 157.86, 158.195, 10.1751, 10.1736, 10.1718, 10.2979, 10.3079, 10.2863, 10.6928, 10.7009, 10.6919, 5.739, 5.739, 105.978, 105.978, 100.239, 999.686, 999.675, 999.638, 2552.96, 2549.98, 100.375, 100.122, 141.35, -0.252144, 240293, 0.00041772, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33), +(150, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:38:38', '2014-02-10 15:39:42', 1, 23.53, 929.661, 23.7317, 154.968, 154.94, 155.048, 151.006, 151.045, 151.125, 10.118, 10.1322, 10.0998, 10.1323, 10.1439, 10.1169, 10.1965, 10.2078, 10.1735, 33.85, 33.85, 537.8, 537.8, 503.95, 999.692, 999.69, 999.685, 34333.6, 34121.2, 504.625, 500.833, 52.841, -0.751441, 18030, 0.0279881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(151, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-10 15:42:33', '2014-02-10 15:43:33', 2, 23.5109, 929.591, 23.7613, 154.881, 154.842, 154.68, 147.047, 147.483, 147.039, 10.0863, 10.0854, 10.0854, 10.0967, 10.0971, 10.0953, 10.1378, 10.1357, 10.1339, 34.05, 34.05, 538.067, 538.067, 504.017, 999.694, 999.693, 999.69, 38824.4, 38589.9, 504.69, 500.972, 46.735, -0.736741, 18035, 0.0279839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34), +(152, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-11 08:34:54', '2014-02-11 08:38:13', 1, 23.8203, 943.893, 26.1866, 154.687, 154.675, 154.641, 154.207, 154.188, 154.335, 12.8431, 13.7935, 12.0829, 15.8215, 17.1054, 14.2502, 16.5175, 17.9119, 15.1194, 0, 0, 50.0707, 50.0707, 50.0707, 999.399, 998.974, 998.859, 954.202, 953.712, 50.1737, 50.045, 188.906, -0.256562, 120108, 0.000417738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35), +(153, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-11 10:17:54', '2014-02-11 10:20:01', 1, 23.9527, 944.364, 25.9059, 155.542, 155.53, 155.574, 147.403, 145.269, 147.945, 11.4935, 11.5027, 11.5045, 11.9845, 11.9843, 12.0492, 12.4704, 12.6043, 12.3699, 30.152, 30.152, 80.2487, 80.2487, 50.0967, 999.556, 999.501, 999.445, 1562.05, 1561.32, 50.1733, 50.0733, 115.456, -0.1992, 120176, 0.000417498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35), +(154, 'Qsteig', 'Qsteig', 1.76569, 1.96569, 50, 96.4791, 1, 0, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 14:33:34', '2014-02-11 14:35:24', 1, 22.8701, 942.78, 23.1037, 155.409, 155.5, 155.352, 143.021, 144.653, 141.529, 11.7602, 11.773, 11.7658, 12.0301, 12.0492, 12.0149, 12.4607, 12.5412, 12.4006, 50.898, 50.898, 100.99, 100.99, 50.0917, 999.527, 999.496, 999.446, 1821.18, 1821.03, 50.1685, 50.0875, 99.018, -0.161512, 120210, 0.000417341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(155, 'Qsteig', 'Qsteig', 1.77058, 1.97058, 50, 96.2268, 1, 0, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 14:45:21', '2014-02-11 14:47:11', 1, 22.83, 942.744, 22.7084, 155.315, 155.272, 155.34, 141.867, 141.411, 142.985, 11.767, 11.7694, 11.7658, 11.9904, 12.0221, 11.9825, 12.4125, 12.5034, 12.3627, 0.652, 0.652, 50.738, 50.738, 50.086, 999.526, 999.501, 999.451, 1872.26, 1872.36, 50.1626, 50.0888, 96.306, -0.147272, 120213, 0.000417281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(156, 'Qfall', 'Qfall', 1.25781, 1.45781, 50, 132.566, 1, 0, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:30:06', '2014-02-11 15:32:29', 1, 22.9417, 942.232, 21.9756, 155.401, 155.31, 155.482, 162.191, 162.268, 162.245, 11.6636, 11.6919, 11.6415, 11.8384, 11.8563, 11.8364, 12.2965, 12.2852, 12.278, 50.703, 50.703, 100.792, 100.792, 50.0893, 999.537, 999.518, 999.465, 1373.62, 1372.95, 50.1651, 50.065, 131.275, -0.199552, 120156, 0.0004175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(157, 'Qsteig', 'Qsteig', 1.77459, 1.97459, 50, 96.0209, 1, 0, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:43:35', '2014-02-11 15:45:42', 1, 23.0381, 942.202, 22.5049, 155.389, 155.442, 155.459, 142.677, 143.858, 144.353, 11.5485, 11.5658, 11.5334, 11.9184, 11.9428, 11.923, 12.3495, 12.4709, 12.2545, 1.418, 1.418, 51.52, 51.52, 50.102, 999.55, 999.509, 999.459, 1831.68, 1831.12, 50.1782, 50.0867, 98.471, -0.182508, 120208, 0.000417429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(158, 'Qfall', 'Qfall', 1.66466, 1.86466, 50, 102.003, 1, 0, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:49:06', '2014-02-11 15:50:56', 1, 23.05, 942.403, 22.4866, 155.495, 155.559, 155.544, 159.773, 159.836, 159.946, 11.5551, 11.5496, 11.519, 11.6635, 11.685, 11.6615, 12.061, 12.058, 12.049, 51.519, 51.519, 101.629, 101.629, 50.11, 999.549, 999.537, 999.493, 1818.09, 1817.26, 50.1848, 50.0871, 99.223, -0.194768, 120209, 0.00041748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(159, 'Q1 (1/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:52:16', '2014-02-11 15:54:48', 1, 23.0715, 942.285, 22.5032, 155.5, 155.45, 155.378, 157.587, 157.382, 157.83, 11.4984, 11.5262, 11.5081, 11.6296, 11.694, 11.5912, 11.9657, 12.0274, 11.9264, 1.533, 1.533, 101.738, 101.738, 100.205, 999.555, 999.541, 999.504, 2563.64, 2561.5, 100.354, 100.121, 140.713, -0.232194, 240291, 0.000417636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(160, 'Q1 (2/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:55:32', '2014-02-11 15:58:04', 2, 23.0688, 942.354, 22.4026, 155.475, 155.53, 155.475, 157.609, 157.548, 157.776, 11.4189, 11.4847, 11.3983, 11.5789, 11.6074, 11.5335, 11.9096, 11.9408, 11.8741, 1.592, 1.592, 101.817, 101.817, 100.225, 999.564, 999.547, 999.51, 2561.17, 2558.55, 100.374, 100.123, 140.877, -0.250293, 240294, 0.000417712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(161, 'Q1 (3/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 15:58:49', '2014-02-11 16:01:20', 3, 23.0423, 942.438, 22.2702, 155.482, 155.552, 155.504, 157.586, 157.555, 157.581, 11.3581, 11.4019, 11.3046, 11.4971, 11.5209, 11.456, 11.8233, 11.8471, 11.7876, 1.58633, 1.58633, 101.812, 101.812, 100.225, 999.57, 999.555, 999.52, 2562.11, 2559.45, 100.373, 100.121, 140.826, -0.250994, 240291, 0.000417715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(162, 'Q1 (4/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 16:02:05', '2014-02-11 16:04:36', 4, 23.0164, 942.478, 22.3321, 155.496, 155.54, 155.528, 157.598, 157.438, 157.613, 11.2548, 11.283, 11.2037, 11.3971, 11.4308, 11.3767, 11.7192, 11.7552, 11.6885, 0.783, 0.783, 101.013, 101.013, 100.23, 999.581, 999.566, 999.531, 2561.93, 2559.2, 100.376, 100.123, 140.842, -0.252582, 240295, 0.000417722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(163, 'Q1 (5/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 16:05:20', '2014-02-11 16:07:53', 5, 23.01, 942.434, 22.5842, 155.493, 155.563, 155.519, 157.589, 157.593, 157.915, 11.1498, 11.1569, 11.1407, 11.3069, 11.3424, 11.2847, 11.6313, 11.6632, 11.6037, 1.38933, 1.38933, 101.614, 101.614, 100.225, 999.592, 999.576, 999.541, 2560.56, 2557.95, 100.37, 100.123, 140.91, -0.247055, 240294, 0.000417699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(164, 'Q2 (1/5)', 'Q2', 38, 44, 500, 43.9024, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 16:09:52', '2014-02-11 16:10:47', 1, 23.01, 942.402, 22.8181, 154.624, 154.667, 154.616, 144.794, 144.749, 144.983, 10.7788, 10.9047, 10.6328, 10.8004, 10.9314, 10.6899, 11.6261, 12.2933, 11.1547, 0, 0, 503.35, 503.35, 503.35, 999.629, 999.627, 999.541, 42743.3, 42548.5, 504.056, 501.056, 42.394, -0.595317, 18038, 0.0279441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(165, 'Q2 (2/5)', 'Q2', 38, 44, 500, 43.9024, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 16:12:32', '2014-02-11 16:13:27', 2, 23.0105, 942.356, 23.6678, 154.558, 154.61, 154.475, 144.881, 144.834, 144.899, 10.2374, 10.2565, 10.2187, 10.245, 10.2647, 10.225, 10.3434, 10.3701, 10.3052, 31.9833, 31.9833, 534.583, 534.583, 502.6, 999.681, 999.68, 999.671, 42660.5, 42529.4, 503.279, 501.056, 42.413, -0.441714, 18038, 0.027901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(166, 'Q2 (3/5)', 'Q2', 38, 44, 500, 43.9024, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 16:15:15', '2014-02-11 16:16:09', 3, 23.02, 942.357, 23.4829, 154.532, 154.535, 154.525, 144.906, 145.266, 144.559, 10.1927, 10.197, 10.1898, 10.2004, 10.2016, 10.1944, 10.2516, 10.2547, 10.2457, 31.2833, 31.2833, 534.4, 534.4, 503.117, 999.685, 999.684, 999.68, 42659.1, 42486.7, 503.794, 501.083, 42.458, -0.53805, 18039, 0.027928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(167, 'Q2 (4/5)', 'Q2', 38, 44, 500, 43.9024, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 16:17:56', '2014-02-11 16:18:51', 4, 23.02, 942.308, 23.6373, 154.536, 154.56, 154.534, 144.861, 144.84, 145.205, 10.1741, 10.1754, 10.1736, 10.1802, 10.1818, 10.1764, 10.2228, 10.2222, 10.2222, 32.5833, 32.5833, 534.85, 534.85, 502.267, 999.687, 999.686, 999.682, 42615.1, 42512.4, 502.942, 501.056, 42.43, -0.375058, 18038, 0.0278824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(168, 'Q2 (5/5)', 'Q2', 38, 44, 500, 43.9024, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 16:20:39', '2014-02-11 16:21:36', 5, 23.02, 942.412, 24.1654, 154.552, 154.447, 154.426, 144.894, 145.041, 145.161, 10.1667, 10.1682, 10.1664, 10.1713, 10.1746, 10.1692, 10.2113, 10.2168, 10.2096, 31.9667, 31.9667, 535.167, 535.167, 503.2, 999.687, 999.687, 999.683, 42658.1, 42478.7, 503.876, 501.083, 42.466, -0.554254, 18039, 0.0279326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(169, 'Qsteig (1/5)', 'Qsteig', 1.89828, 2.09828, 50, 90.0774, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 16:45:25', '2014-02-11 16:47:07', 1, 22.9968, 942.465, 24.3667, 155.516, 155.496, 155.724, 139.825, 140.769, 137.294, 10.3055, 10.3033, 10.3105, 10.5163, 10.5169, 10.5151, 10.9801, 11.045, 10.9567, 1.573, 1.573, 51.6677, 51.6677, 50.0947, 999.675, 999.655, 999.609, 1960.72, 1960.71, 50.1636, 50.0946, 91.977, -0.137528, 120227, 0.00041724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(170, 'Qsteig (2/5)', 'Qsteig', 1.89548, 2.09548, 50, 90.204, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 16:50:23', '2014-02-11 16:52:08', 2, 23.01, 942.467, 23.6088, 155.512, 155.539, 155.569, 139.45, 136.863, 138.829, 10.3065, 10.3069, 10.3105, 10.4491, 10.4466, 10.4629, 10.8888, 10.9135, 10.8847, 1.358, 1.358, 51.4687, 51.4687, 50.1107, 999.674, 999.661, 999.619, 1963.86, 1963.22, 50.1793, 50.0942, 91.859, -0.169619, 120226, 0.000417375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(171, 'Qsteig (3/5)', 'Qsteig', 1.88816, 2.08816, 50, 90.5359, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 16:55:21', '2014-02-11 16:57:06', 3, 23.03, 942.543, 23.3817, 155.515, 155.474, 155.552, 140.272, 141.225, 139.546, 10.3064, 10.2943, 10.3177, 10.4507, 10.4394, 10.4611, 10.8811, 10.8901, 10.8883, 1.312, 1.312, 51.417, 51.417, 50.105, 999.674, 999.661, 999.619, 1928.08, 1927.59, 50.1736, 50.0921, 93.553, -0.162506, 120221, 0.000417345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(172, 'Qsteig (4/5)', 'Qsteig', 1.87545, 2.07545, 50, 91.1185, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:00:15', '2014-02-11 17:02:12', 4, 23.0435, 942.414, 23.4428, 155.529, 155.583, 155.426, 140.241, 142.093, 139.64, 10.3056, 10.3051, 10.2997, 10.4488, 10.4466, 10.4539, 10.8829, 10.8955, 10.8811, 1.306, 1.306, 51.405, 51.405, 50.099, 999.675, 999.661, 999.619, 1945.07, 1944.85, 50.1676, 50.0933, 92.725, -0.148025, 120224, 0.000417284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(173, 'Qsteig (5/5)', 'Qsteig', 1.87301, 2.07301, 50, 91.2311, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:05:21', '2014-02-11 17:07:10', 5, 23.0686, 942.27, 23.4657, 155.532, 155.499, 155.351, 140.781, 139.917, 138.477, 10.3125, 10.3069, 10.3177, 10.4468, 10.4448, 10.4557, 10.8899, 10.8901, 10.8865, 1.325, 1.325, 51.424, 51.424, 50.099, 999.674, 999.661, 999.618, 1916.56, 1916.24, 50.1676, 50.0904, 94.104, -0.153819, 120217, 0.000417309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(174, 'Qfall (1/5)', 'Qfall', 1.56732, 1.66732, 50, 111.295, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:10:56', '2014-02-11 17:13:00', 1, 23.093, 942.136, 23.4172, 155.273, 155.328, 155.382, 160.45, 160.418, 160.376, 10.3206, 10.3087, 10.3105, 10.4304, 10.4394, 10.434, 10.9015, 10.8702, 10.9207, 1.33, 1.33, 51.4337, 51.4337, 50.1037, 999.673, 999.663, 999.617, 1586.28, 1585.36, 50.1722, 50.0746, 113.708, -0.194521, 120179, 0.000417479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(175, 'Qfall (2/5)', 'Qfall', 1.54171, 1.64171, 50, 113.086, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:16:49', '2014-02-11 17:18:55', 2, 23.1054, 942.124, 23.2282, 155.218, 155.242, 155.262, 160.557, 160.61, 160.519, 10.3085, 10.3159, 10.3069, 10.4416, 10.4412, 10.443, 10.9186, 10.9081, 10.9243, 1.281, 1.281, 51.3893, 51.3893, 50.1083, 999.674, 999.662, 999.616, 1580.08, 1579.04, 50.1769, 50.0754, 114.165, -0.202272, 120181, 0.000417511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(176, 'Qfall (3/5)', 'Qfall', 1.53782, 1.63782, 50, 113.363, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:22:41', '2014-02-11 17:24:48', 3, 23.13, 942.136, 23.1746, 155.167, 155.2, 155.217, 160.806, 160.816, 160.684, 10.3251, 10.3339, 10.3249, 10.4483, 10.4539, 10.4466, 10.9223, 10.8883, 10.9189, 1.286, 1.286, 51.39, 51.39, 50.104, 999.673, 999.661, 999.615, 1555.3, 1554.37, 50.1726, 50.0742, 115.974, -0.196184, 120178, 0.000417486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(177, 'Qfall (4/5)', 'Qfall', 1.53558, 1.63558, 50, 113.523, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:28:38', '2014-02-11 17:30:48', 4, 23.1317, 942.151, 23.1959, 155.236, 155.288, 155.182, 160.864, 160.984, 160.868, 10.3215, 10.3267, 10.3123, 10.4544, 10.4665, 10.4647, 10.9235, 10.8973, 10.9351, 2.363, 2.363, 52.4677, 52.4677, 50.1047, 999.673, 999.661, 999.615, 1541.38, 1540.44, 50.1733, 50.0742, 117.023, -0.197573, 120178, 0.000417492, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(178, 'Qfall (5/5)', 'Qfall', 1.55244, 1.65244, 50, 112.329, 5, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:34:34', '2014-02-11 17:36:42', 5, 23.1429, 942.236, 23.0711, 155.151, 155.16, 155.179, 160.594, 160.621, 160.625, 10.3335, 10.3375, 10.3339, 10.4592, 10.4521, 10.4611, 10.943, 10.9171, 10.9531, 0.736, 0.736, 50.8367, 50.8367, 50.1007, 999.672, 999.66, 999.613, 1577.27, 1576.44, 50.1693, 50.0742, 114.351, -0.189658, 120178, 0.000417458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(179, 'Q1 (1/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:37:45', '2014-02-11 17:40:08', 1, 23.15, 942.098, 23.4511, 155.333, 155.449, 155.345, 156.622, 156.566, 156.373, 10.346, 10.3591, 10.3249, 10.448, 10.4791, 10.4196, 10.839, 10.8919, 10.818, 1.19, 1.19, 101.424, 101.424, 100.234, 999.671, 999.661, 999.624, 2746.26, 2743.42, 100.371, 100.13, 131.394, -0.239931, 240313, 0.000417669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(180, 'Q1 (2/5)', 'Q1', 2.4, 2.6, 100, 144, 5, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 17:40:58', '2014-02-11 17:43:29', 2, 23.1291, 942.222, 23.5566, 155.309, 155.339, 155.354, 157.425, 158.123, 157.453, 10.3236, 10.3339, 10.3177, 10.4201, 10.425, 10.416, 10.8196, 10.8162, 10.8108, 0.822, 0.822, 101.063, 101.063, 100.241, 999.673, 999.664, 999.625, 2578.98, 2575.89, 100.378, 100.12, 139.926, -0.25625, 240289, 0.000417737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(181, 'Q2', 'Q2', 38, 44, 500, 43.9024, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-11 18:00:00', '2014-02-11 18:00:54', 1, 23.0019, 942.224, 23.6567, 154.825, 154.73, 154.873, 145.016, 144.846, 145.388, 10.3422, 10.3375, 10.3483, 10.3448, 10.3457, 10.3511, 10.4543, 10.4927, 10.4296, 31.55, 31.55, 31.55, 31.55, 0, 999.671, 999.671, 999.661, 0, 42367.2, 0, 503.028, 42.743, 0.1, 18109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(182, 'Q1', 'Q1', 5, 5.5, 100, 68.5714, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-11 18:03:06', '2014-02-11 18:04:24', 1, 23.0315, 942.385, 24.8615, 155.407, 155.495, 155.393, 161.744, 161.607, 161.725, 10.3912, 10.3843, 10.3987, 10.4045, 10.3908, 10.4178, 10.4655, 10.4476, 10.4801, 29.55, 29.55, 129.883, 129.883, 100.333, 999.667, 999.665, 999.66, 5337.04, 5326.4, 100.47, 100.133, 67.678, -0.335383, 36048, 0.00278713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(183, 'Qsteig', 'Qsteig', 1.80768, 2.00768, 50, 94.3556, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 18:08:54', '2014-02-11 18:10:43', 1, 23.0858, 942.354, 24.8067, 155.283, 155.286, 155.424, 142.298, 140.499, 142.6, 10.4658, 10.4599, 10.4743, 10.5495, 10.5241, 10.5674, 11.1111, 11.1568, 11.0811, 1.134, 1.134, 51.2377, 51.2377, 50.1037, 999.66, 999.652, 999.596, 1846.7, 1846.12, 50.1727, 50.0879, 97.673, -0.169078, 120211, 0.000417372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(184, 'Qfall', 'Qfall', 2.60318, 2.80318, 50, 66.5883, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-11 18:12:35', '2014-02-11 18:13:51', 1, 23.1369, 942.399, 24.4736, 155.305, 155.445, 155.237, 156.336, 156.039, 155.77, 10.4596, 10.4617, 10.4527, 10.5327, 10.5386, 10.5277, 10.9532, 10.9585, 10.9459, 1.253, 1.253, 51.4053, 51.4053, 50.1523, 999.66, 999.653, 999.612, 2751.3, 2750.19, 50.2214, 50.1321, 65.623, -0.177855, 120317, 0.000417409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(185, 'Q2', 'Q2', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 08:59:31', '2014-02-12 09:00:20', 1, 24.39, 947.296, 24.1278, 153.923, 153.754, 153.812, 95.265, 95.2036, 95.4415, 11.6113, 11.6793, 11.5262, 11.6889, 11.8563, 11.593, 11.938, 12.2157, 11.7428, 0.1, 0.1, 605.6, 605.6, 605.5, 999.543, 999.535, 999.507, 77073.8, 76621.2, 606.406, 601.944, 28.282, -0.735716, 21670, 0.0279837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(186, 'Q1', 'Q1', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 09:02:32', '2014-02-12 09:04:18', 1, 24.3792, 947.391, 23.9491, 155.404, 155.389, 155.392, 152.634, 152.768, 152.775, 11.5368, 11.5244, 11.5298, 11.6282, 11.6237, 11.6291, 11.6907, 11.6959, 11.6815, 32.1, 32.1, 232.5, 232.5, 200.4, 999.551, 999.541, 999.534, 7625.65, 7617.83, 200.698, 200.194, 94.607, -0.251145, 72070, 0.00278477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(187, 'Q2', 'Q2', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 09:10:49', '2014-02-12 09:11:35', 1, 24.32, 947.411, 24.2856, 153.783, 154.057, 153.758, 94.1333, 94.5115, 94.5256, 10.833, 10.9444, 10.7174, 10.8866, 11.0126, 10.7873, 11.0286, 11.1763, 10.8859, 8.3, 8.3, 612.417, 612.417, 604.117, 999.624, 999.619, 999.604, 77401.2, 77130, 604.97, 602, 28.098, -0.490858, 21672, 0.0279148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(188, 'Q1', 'Q1', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 09:13:41', '2014-02-12 09:15:27', 1, 24.3065, 947.524, 24.5919, 155.379, 155.457, 155.42, 152.466, 152.634, 152.51, 10.501, 10.5139, 10.4887, 10.5686, 10.5728, 10.5566, 10.6229, 10.6262, 10.6153, 31.95, 31.95, 232.317, 232.317, 200.367, 999.656, 999.65, 999.645, 7603.09, 7596.55, 200.643, 200.194, 94.872, -0.223707, 72070, 0.00278401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(189, 'Qsteig', 'Qsteig', 1.74913, 1.94913, 100, 194.686, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 09:37:03', '2014-02-12 09:40:35', 1, 24.2442, 947.69, 24.4377, 155.554, 155.45, 155.627, 143.101, 141.828, 141.911, 10.3882, 10.4167, 10.3663, 10.7036, 10.7476, 10.7007, 11.1919, 11.3136, 11.146, -0.004, -0.004, 100.148, 100.148, 100.152, 999.667, 999.637, 999.588, 1800.16, 1798.99, 100.291, 100.086, 200.285, -0.204399, 240207, 0.00041752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(190, 'Qfall', 'Qfall', 1.55001, 1.65001, 100, 224.998, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 09:44:35', '2014-02-12 09:48:32', 1, 24.1984, 947.703, 24.1629, 155.388, 155.361, 155.36, 160.39, 160.502, 160.463, 10.3225, 10.3393, 10.3051, 10.5241, 10.5151, 10.5277, 11.0209, 10.9982, 11.027, 5.735, 5.735, 105.911, 105.911, 100.176, 999.673, 999.654, 999.605, 1591.64, 1590.05, 100.314, 100.076, 226.58, -0.237634, 240182, 0.000417659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(191, 'Qsteig', 'Qsteig', 1.78364, 1.98364, 50, 95.5597, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 09:57:10', '2014-02-12 09:58:58', 1, 24.1412, 947.677, 24.0846, 155.601, 155.597, 155.575, 142.488, 140.333, 144.089, 10.3053, 10.3195, 10.2997, 10.5556, 10.5566, 10.571, 11.0389, 11.0739, 11.0162, 4.208, 4.208, 54.2957, 54.2957, 50.0877, 999.675, 999.651, 999.603, 1834.06, 1834.07, 50.1568, 50.0879, 98.315, -0.13725, 120211, 0.000417239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(192, 'Qfall', 'Qfall', 1.53317, 1.63317, 50, 113.696, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:02:40', '2014-02-12 10:04:47', 1, 24.0515, 947.802, 23.7436, 155.431, 155.469, 155.449, 160.458, 160.443, 160.584, 10.3322, 10.3123, 10.3285, 10.4497, 10.4665, 10.4575, 10.9563, 10.9279, 10.9712, 5.618, 5.618, 55.7243, 55.7243, 50.1063, 999.672, 999.661, 999.612, 1555, 1553.99, 50.1749, 50.0737, 116.002, -0.201687, 120177, 0.000417509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(193, 'Q1', 'Q1', 2.4, 2.6, 100, 144, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:05:50', '2014-02-12 10:08:22', 1, 23.9531, 947.802, 23.6814, 155.421, 155.514, 155.46, 157.031, 157.067, 156.964, 10.312, 10.3429, 10.2835, 10.4556, 10.5007, 10.4142, 10.8874, 10.9477, 10.8414, 5.527, 5.527, 105.738, 105.738, 100.211, 999.674, 999.661, 999.619, 2553.73, 2551.43, 100.348, 100.12, 141.267, -0.226735, 240289, 0.000417614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(194, 'Q2', 'Q2', 38, 44, 500, 43.9024, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 10:09:16', '2014-02-12 10:10:10', 1, 23.902, 947.75, 23.669, 154.792, 154.851, 154.737, 143.91, 143.894, 143.787, 10.2125, 10.2331, 10.1952, 10.2241, 10.2538, 10.2016, 10.47, 10.7578, 10.3412, 0, 0, 504.317, 504.317, 504.317, 999.683, 999.682, 999.659, 43608.2, 43331, 504.997, 501.111, 41.633, -0.769423, 18040, 0.0279932, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(195, 'Qsteig', 'Qsteig', 1.79723, 1.99723, 50, 94.875, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:26:49', '2014-02-12 10:28:38', 1, 23.5893, 947.858, 23.8378, 155.433, 155.579, 155.423, 142.132, 142.52, 142.568, 10.2835, 10.2925, 10.2889, 10.5451, 10.5746, 10.5584, 11.1332, 11.2361, 11.0559, 5.585, 5.585, 55.6787, 55.6787, 50.0937, 999.677, 999.652, 999.594, 1848.38, 1848.18, 50.1627, 50.0883, 97.565, -0.148283, 120212, 0.000417285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(196, 'Qfall', 'Qfall', 1.54707, 1.64707, 50, 112.707, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:32:21', '2014-02-12 10:34:28', 1, 23.5599, 947.953, 24.1142, 155.376, 155.4, 155.437, 160.446, 160.41, 160.515, 10.2695, 10.2619, 10.2673, 10.4222, 10.4142, 10.4611, 10.9331, 10.9117, 10.9405, 5.83, 5.83, 55.935, 55.935, 50.105, 999.678, 999.664, 999.614, 1556.88, 1555.92, 50.1735, 50.0742, 115.859, -0.197944, 120178, 0.000417493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(197, 'Qsteig', 'Qsteig', 1.7827, 1.9827, 100, 191.215, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:37:48', '2014-02-12 10:41:15', 1, 23.5118, 948.071, 24.026, 155.426, 155.426, 155.32, 142.351, 143.915, 143.703, 10.2639, 10.2691, 10.2529, 10.4627, 10.4683, 10.4701, 10.9439, 10.982, 10.9297, 5.964, 5.964, 106.121, 106.121, 100.157, 999.678, 999.66, 999.613, 1841.46, 1840.18, 100.294, 100.087, 195.803, -0.20666, 240208, 0.00041753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(198, 'Qfall', 'Qfall', 1.53903, 1.63903, 100, 226.553, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 10:45:12', '2014-02-12 10:49:13', 1, 23.4743, 948.079, 23.9058, 155.375, 155.295, 155.238, 160.373, 160.34, 160.357, 10.2551, 10.2601, 10.2457, 10.4046, 10.3998, 10.4304, 10.9047, 10.8829, 10.9153, 5.465, 5.465, 105.633, 105.633, 100.168, 999.679, 999.665, 999.617, 1574.11, 1572.65, 100.305, 100.075, 229.086, -0.228962, 240181, 0.000417623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(199, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 10:51:21', '2014-02-12 10:53:06', 1, 23.4514, 948.345, 24.1072, 155.522, 155.494, 155.53, 152.922, 152.928, 152.944, 10.197, 10.2133, 10.1826, 10.2523, 10.2827, 10.234, 10.3794, 10.4675, 10.3142, 33.0667, 33.0667, 233.45, 233.45, 200.383, 999.684, 999.679, 999.668, 7619.86, 7612.89, 200.654, 200.2, 94.671, -0.226273, 72072, 0.00278408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(200, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 10:55:33', '2014-02-12 10:56:25', 1, 23.42, 948.246, 24.0592, 153.679, 153.827, 153.436, 93.9943, 93.7608, 94.2054, 10.0936, 10.098, 10.0854, 10.0982, 10.1025, 10.0935, 10.1285, 10.1375, 10.1231, 33.05, 33.05, 638.967, 638.967, 605.917, 999.694, 999.693, 999.691, 77540.8, 77032.5, 606.727, 601.944, 28.131, -0.788221, 21670, 0.0279985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(201, 'Qsteig', 'Qsteig', 1.71164, 1.91164, 100, 198.715, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 11:14:19', '2014-02-12 11:17:59', 1, 23.26, 948.328, 24.2585, 155.284, 155.342, 155.298, 144.515, 142.503, 144.04, 10.1462, 10.1232, 10.1412, 10.2328, 10.1854, 10.2719, 10.8296, 10.9225, 10.7982, 0.173, 0.173, 100.325, 100.325, 100.152, 999.689, 999.681, 999.624, 1724.09, 1722.9, 100.287, 100.083, 209.122, -0.203708, 240198, 0.000417517, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(202, 'Qfall', 'Qfall', 1.53217, 1.63217, 100, 227.535, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 11:22:00', '2014-02-12 11:26:04', 1, 23.2256, 948.339, 24.2575, 155.312, 155.309, 155.406, 160.471, 160.79, 160.433, 10.1556, 10.1538, 10.1574, 10.2611, 10.2466, 10.2773, 10.7965, 10.7657, 10.8216, 5.32667, 5.32667, 105.49, 105.49, 100.163, 999.688, 999.679, 999.628, 1547.48, 1546.1, 100.298, 100.074, 233.016, -0.223972, 240177, 0.000417602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(203, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 11:26:25', '2014-02-12 11:28:10', 1, 23.22, 948.378, 24.27, 155.219, 155.31, 155.242, 153.219, 153.318, 153.009, 10.1487, 10.1754, 10.1376, 10.2128, 10.2719, 10.1728, 10.4105, 10.6911, 10.2619, 19.6, 19.6, 220, 220, 200.4, 999.689, 999.683, 999.665, 7636.63, 7628.8, 200.67, 200.194, 94.471, -0.236984, 72070, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(204, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 11:30:04', '2014-02-12 11:30:46', 1, 23.21, 948.477, 24.4754, 153.567, 153.731, 153.632, 94.3636, 93.7417, 94.4694, 10.0728, 10.0782, 10.071, 10.0788, 10.0845, 10.0737, 10.1043, 10.1104, 10.0996, 33.2, 33.2, 639.133, 639.133, 605.933, 999.696, 999.695, 999.693, 77589.8, 77082.6, 606.742, 601.972, 28.114, -0.786199, 21671, 0.0279979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(205, 'Qsteig', 'Qsteig', 1.7052, 1.9052, 100, 199.424, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 11:47:27', '2014-02-12 11:51:01', 1, 23.1755, 948.36, 24.7173, 155.257, 155.153, 155.278, 143.449, 142.702, 142.917, 10.1396, 10.1286, 10.1448, 10.2225, 10.18, 10.252, 10.7877, 10.8811, 10.7477, 0.161333, 0.161333, 100.302, 100.302, 100.141, 999.69, 999.682, 999.629, 1777.79, 1776.8, 100.276, 100.085, 202.784, -0.190499, 240204, 0.000417462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(206, 'Qfall', 'Qfall', 1.52073, 1.62073, 100, 229.193, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 11:55:03', '2014-02-12 11:59:09', 1, 23.1181, 948.259, 24.6504, 155.308, 155.281, 155.276, 160.733, 160.723, 160.714, 10.1577, 10.1628, 10.1556, 10.2726, 10.2628, 10.2935, 10.7887, 10.7387, 10.8018, 5.285, 5.285, 105.445, 105.445, 100.16, 999.688, 999.678, 999.628, 1530.76, 1529.43, 100.296, 100.073, 235.554, -0.222266, 240175, 0.000417595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(207, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 11:59:30', '2014-02-12 12:01:15', 1, 23.119, 948.293, 24.7455, 155.238, 155.447, 155.288, 152.898, 152.861, 152.904, 10.1451, 10.1682, 10.1322, 10.2218, 10.2863, 10.1764, 10.3962, 10.655, 10.2583, 14.1, 14.1, 214.433, 214.433, 200.333, 999.689, 999.682, 999.666, 7623.28, 7618.1, 200.603, 200.197, 94.605, -0.202484, 72071, 0.00278341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(208, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 12:03:08', '2014-02-12 12:03:59', 1, 23.14, 947.977, 24.7915, 153.465, 153.6, 153.285, 94.4564, 94.2222, 94.7648, 10.081, 10.0836, 10.0818, 10.0917, 10.0935, 10.0899, 10.1153, 10.1195, 10.114, 33.25, 33.25, 640.033, 640.033, 606.783, 999.695, 999.694, 999.692, 77602.1, 76990.3, 607.594, 602, 28.149, -0.920729, 21672, 0.0280359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(209, 'Qsteig', 'Qsteig', 1.71861, 1.91861, 100, 197.953, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 13:26:45', '2014-02-12 13:30:17', 1, 23.4412, 948.179, 25.1057, 155.065, 155.114, 154.917, 142.841, 143.897, 142.947, 10.2121, 10.2006, 10.2133, 10.3117, 10.2737, 10.3439, 10.9074, 10.9892, 10.8793, 0.044, 0.044, 100.186, 100.186, 100.142, 999.683, 999.674, 999.617, 1796.68, 1795.68, 100.278, 100.086, 200.653, -0.191135, 240206, 0.000417465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(210, 'Qfall', 'Qfall', 1.51806, 1.61806, 100, 229.583, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 13:34:15', '2014-02-12 13:38:17', 1, 23.4949, 948.107, 24.9742, 155.174, 155.194, 155.211, 160.313, 160.347, 160.381, 10.2278, 10.2241, 10.2313, 10.3406, 10.3259, 10.3638, 10.8677, 10.845, 10.8793, 5.303, 5.303, 105.466, 105.466, 100.163, 999.682, 999.671, 999.621, 1567.01, 1565.62, 100.299, 100.075, 230.112, -0.223879, 240179, 0.000417602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(211, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 13:38:38', '2014-02-12 13:40:22', 1, 23.4903, 948.13, 24.564, 155.18, 155.209, 155.188, 152.537, 152.586, 152.546, 10.2147, 10.2475, 10.1988, 10.2924, 10.362, 10.252, 10.5027, 10.8101, 10.3448, -0.133333, -0.133333, 200.283, 200.283, 200.417, 999.683, 999.676, 999.656, 7708.09, 7699.75, 200.688, 200.2, 93.603, -0.243227, 72072, 0.00278455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(212, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 13:42:37', '2014-02-12 13:43:31', 1, 23.4726, 948.23, 24.52, 153.579, 153.709, 153.606, 93.6685, 92.6869, 93.277, 10.103, 10.1088, 10.0926, 10.1167, 10.1223, 10.1115, 10.1458, 10.1519, 10.1429, 33.85, 33.85, 640.65, 640.65, 606.8, 999.693, 999.692, 999.689, 78072.9, 77455.3, 607.612, 602, 27.98, -0.923675, 21672, 0.0280367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(213, 'Qsteig', 'Qsteig', 1.71886, 1.91886, 100, 197.926, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 14:06:03', '2014-02-12 14:09:38', 1, 23.2177, 948.149, 24.7618, 155.26, 155.196, 155.249, 143.909, 143.851, 142.847, 10.1808, 10.161, 10.188, 10.2584, 10.2106, 10.2827, 10.8351, 10.9081, 10.7964, 0.151, 0.151, 100.294, 100.294, 100.143, 999.686, 999.679, 999.624, 1768.57, 1767.55, 100.278, 100.085, 203.845, -0.192481, 240204, 0.00041747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(214, 'Qfall', 'Qfall', 1.53412, 1.63412, 100, 227.255, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 14:13:41', '2014-02-12 14:17:40', 1, 23.1278, 948.106, 24.7521, 155.281, 155.228, 155.422, 160.32, 160.108, 160.573, 10.2035, 10.2042, 10.1988, 10.294, 10.2881, 10.3061, 10.7839, 10.7459, 10.8, 5.412, 5.412, 105.584, 105.584, 100.172, 999.684, 999.676, 999.629, 1582.41, 1580.89, 100.308, 100.076, 227.893, -0.231154, 240182, 0.000417632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(215, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 14:18:01', '2014-02-12 14:19:45', 1, 23.0791, 948.042, 24.7716, 155.209, 155.124, 155.291, 152.888, 153.043, 152.805, 10.19, 10.2115, 10.1772, 10.2465, 10.3025, 10.207, 10.4394, 10.7127, 10.298, 26.95, 26.95, 227.35, 227.35, 200.4, 999.685, 999.68, 999.662, 7723.21, 7715.39, 200.671, 200.197, 93.412, -0.235919, 72071, 0.00278435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(216, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 14:22:06', '2014-02-12 14:22:47', 1, 23.04, 947.835, 25.0346, 153.564, 153.381, 153.546, 93.1579, 93.3164, 92.9786, 10.1147, 10.1232, 10.107, 10.1136, 10.1205, 10.1061, 10.1427, 10.1483, 10.1393, 34.0167, 34.0167, 640.4, 640.4, 606.383, 999.692, 999.692, 999.689, 78173, 77604.3, 607.195, 601.972, 27.925, -0.860138, 21671, 0.0280188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(217, 'Qsteig', 'Qsteig', 1.70033, 1.90033, 100, 199.963, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 14:36:04', '2014-02-12 14:39:44', 1, 22.9438, 947.883, 24.9002, 155.971, 155.955, 156.086, 145.303, 145.655, 145.895, 10.2209, 10.2205, 10.2223, 10.3787, 10.4485, 10.3385, 11.0028, 11.2811, 10.8738, 0.084, 0.084, 100.273, 100.273, 100.189, 999.682, 999.668, 999.607, 1722.55, 1720.71, 100.326, 100.082, 209.388, -0.242983, 240197, 0.000417682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(218, 'Qfall', 'Qfall', 1.61484, 1.71484, 100, 216.238, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 14:43:39', '2014-02-12 14:47:21', 1, 22.9331, 947.892, 24.7242, 155.986, 156.009, 155.968, 162.829, 162.833, 162.811, 10.2418, 10.2403, 10.2259, 10.3103, 10.3133, 10.3241, 10.7765, 10.7567, 10.791, 5.281, 5.281, 105.466, 105.466, 100.185, 999.68, 999.674, 999.63, 1709.88, 1708.12, 100.321, 100.082, 210.931, -0.23837, 240197, 0.000417662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(219, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 14:47:44', '2014-02-12 14:49:30', 1, 22.9628, 947.969, 24.847, 155.948, 155.964, 155.961, 160.505, 160.37, 160.531, 10.1982, 10.2475, 10.179, 10.2456, 10.3133, 10.2034, 11.5568, 14.8236, 10.4476, 5.3, 5.3, 205.333, 205.333, 200.033, 999.684, 999.68, 999.549, 7612.02, 7617.94, 200.303, 200.189, 94.603, -0.0571871, 72068, 0.00277937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(220, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 14:51:46', '2014-02-12 14:52:41', 1, 23.0135, 947.969, 24.69, 153.69, 153.548, 153.825, 93.8078, 92.9503, 93.8381, 10.1293, 10.1358, 10.1232, 10.1305, 10.1349, 10.1241, 10.1742, 10.179, 10.1681, 33.75, 33.75, 639.783, 639.783, 606.033, 999.691, 999.69, 999.687, 78077.5, 77550.7, 606.845, 601.944, 27.943, -0.807609, 21670, 0.0280039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(221, 'Qsteig', 'Qsteig', 1.68967, 1.88967, 100, 201.155, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 15:59:12', '2014-02-12 16:02:51', 1, 23.8897, 947.37, 22.6616, 155.2, 155.093, 155.148, 144.474, 144.848, 145.557, 10.2808, 10.2709, 10.2709, 10.3997, 10.3493, 10.434, 11.0613, 11.1946, 10.991, 0.027, 0.027, 100.19, 100.19, 100.163, 999.677, 999.666, 999.601, 1727.54, 1726.15, 100.3, 100.083, 208.729, -0.216529, 240198, 0.000417571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(222, 'Qsteig', 'Qsteig', 1.80279, 2.00279, 100, 189.196, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 16:36:22', '2014-02-12 16:39:47', 1, 24.2851, 947.275, 22.8132, 155.39, 155.324, 155.111, 141.965, 142.164, 139.672, 10.2221, 10.2097, 10.2313, 10.3243, 10.2809, 10.3565, 10.8489, 10.863, 10.8522, 0.115, 0.115, 100.272, 100.272, 100.157, 999.682, 999.673, 999.623, 1857.78, 1856.54, 100.293, 100.09, 194.083, -0.202471, 240215, 0.000417512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL); +INSERT INTO `testresult` (`Id`, `Name`, `TestName`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`, `Test_id`) VALUES +(223, 'Qfall', 'Qfall', 1.62192, 1.72192, 100, 215.321, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 16:43:38', '2014-02-12 16:47:21', 1, 24.1921, 947.088, 23.0671, 155.421, 155.363, 155.43, 160.08, 160.18, 160.116, 10.2256, 10.2349, 10.2187, 10.3425, 10.3421, 10.362, 10.8334, 10.8072, 10.854, 5.704, 5.704, 105.883, 105.883, 100.179, 999.682, 999.671, 999.624, 1702.67, 1701.01, 100.315, 100.081, 211.811, -0.233182, 240195, 0.000417641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(224, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 16:47:45', '2014-02-12 16:49:30', 1, 24.1444, 947.061, 23.1614, 155.413, 155.41, 155.451, 152.617, 152.469, 152.547, 10.2119, 10.2367, 10.2006, 10.278, 10.3439, 10.243, 10.4974, 10.839, 10.3358, -0.1, -0.1, 200.283, 200.283, 200.383, 999.683, 999.677, 999.657, 7635.19, 7627.88, 200.655, 200.192, 94.481, -0.230675, 72069, 0.0027842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(225, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 16:51:51', '2014-02-12 16:52:32', 1, 24.0846, 946.908, 23.2208, 153.563, 153.53, 153.415, 93.3551, 94.0705, 93.3385, 10.0966, 10.1016, 10.0908, 10.1062, 10.1133, 10.0989, 10.134, 10.1393, 10.1303, 34.0333, 34.0333, 640.483, 640.483, 606.45, 999.693, 999.693, 999.69, 78100.5, 77516.6, 607.261, 601.917, 27.954, -0.880116, 21669, 0.0280244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(226, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 17:05:40', '2014-02-12 17:06:25', 1, 23.8788, 946.912, 23.6535, 153.809, 153.999, 153.881, 93.788, 94.6997, 93.5672, 10.1106, 10.116, 10.1088, 10.1242, 10.1313, 10.1187, 10.1581, 10.1754, 10.1483, 8.3, 8.3, 613.05, 613.05, 604.75, 999.692, 999.691, 999.688, 77884.3, 77523, 605.56, 601.944, 27.953, -0.597057, 21670, 0.0279446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(227, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 17:09:13', '2014-02-12 17:10:58', 1, 23.8151, 946.968, 23.8398, 155.32, 155.316, 155.312, 152.62, 152.507, 152.698, 10.1129, 10.1142, 10.1124, 10.1393, 10.1385, 10.1385, 10.1798, 10.179, 10.1826, 34.1, 34.1, 34.1, 34.1, 0, 999.692, 999.69, 999.686, 0, 7625.7, 0, 200.539, 94.672, 0.1, 72194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(228, 'Qsteig', 'Qsteig', 1.66617, 1.86617, 100, 203.831, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 17:13:25', '2014-02-12 17:17:04', 1, 23.7489, 946.989, 24.0505, 155.462, 155.53, 155.532, 144.559, 144.493, 145.402, 10.1915, 10.161, 10.2024, 10.2614, 10.2124, 10.2935, 10.8504, 10.9802, 10.8018, 0.044, 0.044, 100.19, 100.19, 100.146, 999.685, 999.679, 999.622, 1733.32, 1732.23, 100.281, 100.083, 207.996, -0.197983, 240198, 0.000417493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(229, 'Qfall', 'Qfall', 1.6237, 1.7237, 100, 215.092, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 17:20:59', '2014-02-12 17:24:49', 1, 23.6582, 946.975, 23.9772, 155.478, 155.549, 155.485, 160.275, 160.313, 160.222, 10.1884, 10.197, 10.1772, 10.2808, 10.2791, 10.2935, 10.7763, 10.7513, 10.7892, 5.412, 5.412, 105.593, 105.593, 100.181, 999.685, 999.677, 999.63, 1648.08, 1646.39, 100.317, 100.079, 218.832, -0.23743, 240189, 0.000417658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(230, 'Qmax', 'Qmax', 76, 84, 600, 27, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ5', 'PMess1', '2014-02-12 17:36:12', '2014-02-12 17:36:55', 1, 23.4641, 946.74, 23.94, 153.743, 153.917, 153.629, 92.9069, 93.1351, 92.3387, 10.3009, 10.4203, 10.2349, 10.5077, 10.8485, 10.3331, 11.2828, 12.0352, 10.7218, 0.45, 0.45, 596.75, 596.75, 596.3, 999.675, 999.656, 999.578, 77218.7, 77956.8, 597.12, 602, 27.8, 0.817288, 21672, 0.0275526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(231, 'Qt', 'Qt', 7.5, 7.8, 200, 94.1177, 1, 1, 0, 'Verbund', -2, 2, 'PS2', 'PBank2', 'PQ4', 'PMess1', '2014-02-12 17:39:45', '2014-02-12 17:41:29', 1, 23.3967, 946.811, 24.5048, 155.434, 155.559, 155.407, 159.558, 159.461, 159.46, 10.1432, 10.1412, 10.1502, 10.1631, 10.1637, 10.1673, 10.2192, 10.2204, 10.2204, 34.05, 34.05, 234.433, 234.433, 200.383, 999.689, 999.688, 999.682, 7752.44, 7745.13, 200.652, 200.194, 93.052, -0.228237, 72070, 0.00278413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(232, 'Qsteig', 'Qsteig', 1.67471, 1.87471, 100, 202.85, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 17:43:54', '2014-02-12 17:47:29', 1, 23.3185, 946.74, 24.0545, 155.657, 155.676, 155.426, 144.151, 143.679, 143.69, 10.1937, 10.1826, 10.1952, 10.2843, 10.2376, 10.3205, 10.944, 11.1748, 10.8396, 0.053, 0.053, 100.205, 100.205, 100.152, 999.685, 999.677, 999.613, 1768.36, 1767.18, 100.288, 100.085, 203.888, -0.202344, 240204, 0.000417511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(233, 'Qfall', 'Qfall', 1.56802, 1.66802, 100, 222.494, 1, 1, 0, 'Verbund-steig-fall', -2, 2, 'PS2', 'PBank2', 'PQ3', 'PMess1', '2014-02-12 17:51:30', '2014-02-12 17:55:28', 1, 23.234, 946.613, 23.8995, 155.655, 155.59, 155.614, 160.994, 161.083, 161.007, 10.2128, 10.2151, 10.2024, 10.3121, 10.2935, 10.3223, 10.7987, 10.7603, 10.827, 5.298, 5.298, 105.463, 105.463, 100.165, 999.683, 999.674, 999.628, 1582.05, 1580.65, 100.301, 100.076, 227.927, -0.224035, 240182, 0.000417602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `Password` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `LastPwChange` datetime DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`Id`, `Name`, `Password`, `Description`, `LastPwChange`) VALUES +(1, 'admin', 'af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909', 'Application administrator', '2013-12-30 12:17:19'), +(2, 'tester', '', 'tester', '2013-12-30 12:17:19'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `watermeter` +-- + +CREATE TABLE IF NOT EXISTS `watermeter` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Serial` varchar(255) DEFAULT NULL, + `WMType_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `WMType_id` (`WMType_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `wmtype` +-- + +CREATE TABLE IF NOT EXISTS `wmtype` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CreateTime` datetime DEFAULT NULL, + `CreateUserName` varchar(255) DEFAULT NULL, + `CreateDescription` varchar(255) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `PulseRate` float DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `componentprocedure` +-- +ALTER TABLE `componentprocedure` + ADD CONSTRAINT `FKA4EE67E2C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `componenttest` +-- +ALTER TABLE `componenttest` + ADD CONSTRAINT `FK4933B35E048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Constraints for table `group` +-- +ALTER TABLE `group` + ADD CONSTRAINT `FKFBBA8E27F90D2266` FOREIGN KEY (`User_id`) REFERENCES `user` (`Id`); + +-- +-- Constraints for table `measurementcorrection` +-- +ALTER TABLE `measurementcorrection` + ADD CONSTRAINT `FK2E70F3322F02977E` FOREIGN KEY (`Component_id`) REFERENCES `component` (`Id`); + +-- +-- Constraints for table `metertestresult` +-- +ALTER TABLE `metertestresult` + ADD CONSTRAINT `FK1CE41B064BD6C9B6` FOREIGN KEY (`TestResult_id`) REFERENCES `testresult` (`Id`); + +-- +-- Constraints for table `purgeend` +-- +ALTER TABLE `purgeend` + ADD CONSTRAINT `FK14832B1AC1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `purgestart` +-- +ALTER TABLE `purgestart` + ADD CONSTRAINT `FKDC8627F9C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `test` +-- +ALTER TABLE `test` + ADD CONSTRAINT `FKCC127866C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints for table `testresult` +-- +ALTER TABLE `testresult` + ADD CONSTRAINT `FKAD39033FE048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Constraints for table `watermeter` +-- +ALTER TABLE `watermeter` + ADD CONSTRAINT `FKA968A8E699BF9B30` FOREIGN KEY (`WMType_id`) REFERENCES `wmtype` (`Id`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/TestBenchFramework/SampleConfig/log4netConfig.xml b/TestBenchFramework/SampleConfig/log4netConfig.xml new file mode 100644 index 000000000..3180f4e9f --- /dev/null +++ b/TestBenchFramework/SampleConfig/log4netConfig.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestBenchFramework/SampleConfig/munich-gwz-1.sql b/TestBenchFramework/SampleConfig/munich-gwz-1.sql new file mode 100644 index 000000000..af2d2a3e8 --- /dev/null +++ b/TestBenchFramework/SampleConfig/munich-gwz-1.sql @@ -0,0 +1,1166 @@ +-- phpMyAdmin SQL Dump +-- version 3.4.5 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Erstellungszeit: 24. Jan 2014 um 15:40 +-- Server Version: 5.5.16 +-- PHP-Version: 5.3.8 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Datenbank: `gwz-1` +-- + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `benchpath` +-- + +CREATE TABLE IF NOT EXISTS `benchpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `TempIn` varchar(255) DEFAULT NULL, + `TempOut` varchar(255) DEFAULT NULL, + `PressIn` varchar(255) DEFAULT NULL, + `PressOut` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; + +-- +-- Daten für Tabelle `benchpath` +-- + +INSERT INTO `benchpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `TempIn`, `TempOut`, `PressIn`, `PressOut`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PBank1', 0.01, 0.03, 'T1', 'T2', 'Druck1', 'Druck2', 'VL13;VL12', ''), +(2, 2, 'PBank2', 0.03, 250, 'T1', 'T2', 'Druck1', 'Druck2', 'VL11;VL12;VI12', ''), +(3, 3, 'PBank3', 0.02, 12, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22', 'VM1;VM2;VM3;VM4'), +(4, 4, 'PBank4', 0.02, 15, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM2;VM3', 'VM1;VM4'), +(5, 5, 'PBank5', 0.02, 18, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM1;VM3', 'VM2;VM4'), +(6, 6, 'PBank6', 0.02, 18, 'T5', 'T2', 'Druck3', 'Druck4', 'VI21;VI22;VM1;VM2', 'VM3;VM4'), +(7, 7, 'PBank7', 0.02, 5, 'T5', 'T2', 'Druck3', 'Druck4', 'VL21', ''), +(8, 0, '', 0, 0, '---', '---', '---', '---', '', ''); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `component` +-- + +CREATE TABLE IF NOT EXISTS `component` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `ClassName` varchar(255) DEFAULT NULL, + `ParentName` varchar(255) DEFAULT NULL, + `ItemNr` int(11) DEFAULT NULL, + `DebugLevel` varchar(255) DEFAULT NULL, + `LogLevel` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=67 ; + +-- +-- Daten für Tabelle `component` +-- + +INSERT INTO `component` (`Id`, `Name`, `ClassName`, `ParentName`, `ItemNr`, `DebugLevel`, `LogLevel`, `Parameters`) VALUES +(1, 'CB', 'ControlBoard', NULL, 0, 'Off', 'Off', '\r\n\r\n 1\r\n'), +(2, 'W1', 'MettlerToledoBalanceSN', NULL, 1, 'Off', 'Off', '\r\n\r\n 11\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 3000\r\n'), +(3, 'W2', 'MettlerToledoBalanceSN', NULL, 2, 'Off', 'Off', '\r\n\r\n 10\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 150\r\n'), +(4, 'Luft', 'Greco Ambient', NULL, 3, 'Off', 'Off', '\r\n\r\n 6\r\n 19200\r\n None\r\n 8\r\n One\r\n None\r\n'), +(5, 'I1', 'FlowMeter', 'CB', 4, 'Off', 'Off', '\r\n\r\n 1\r\n 200\r\n'), +(6, 'I2', 'FlowMeter', 'CB', 5, 'Off', 'Off', '\r\n\r\n 2\r\n 20\r\n'), +(7, 'I3', 'FlowMeter', 'CB', 6, 'Off', 'Off', '\r\n\r\n 3\r\n 3\r\n'), +(8, 'I4', 'FlowMeter', 'CB', 7, 'Off', 'Off', '\r\n\r\n 4\r\n 0.25\r\n'), +(9, 'Druck1', 'PressureMeter', 'CB', 8, 'Off', 'Off', '\r\n\r\n 0\r\n 78\r\n'), +(10, 'Druck2', 'PressureMeter', 'CB', 9, 'Off', 'Off', '\r\n\r\n 1\r\n 81\r\n'), +(11, 'Druck3', 'PressureMeter', 'CB', 10, 'Off', 'Off', '\r\n\r\n 2\r\n 11\r\n'), +(12, 'Druck4', 'PressureMeter', 'CB', 11, 'Off', 'Off', '\r\n\r\n 3\r\n 82\r\n'), +(13, 'T1', 'TempMeter', 'CB', 12, 'Off', 'Off', '\r\n\r\n 0\r\n -20.14631\r\n 0.00177572737\r\n 7.601795E-10\r\n -1.237E-15\r\n 0\r\n'), +(14, 'T2', 'TempMeter', 'CB', 13, 'Off', 'Off', '\r\n\r\n 1\r\n -20.13342\r\n 0.001777626\r\n 7.41529E-10\r\n -1.066678E-15\r\n 0\r\n'), +(15, 'T3', 'TempMeter', 'CB', 14, 'Off', 'Off', '\r\n\r\n 2\r\n -20.138031\r\n 0.00177645753\r\n 7.68710429E-10\r\n -1.307915E-15\r\n 0\r\n'), +(16, 'T4', 'TempMeter', 'CB', 15, 'Off', 'Off', '\r\n\r\n 3\r\n -20.1234074\r\n 0.00177655893\r\n 7.53911156E-10\r\n 1.13868757E-15\r\n 0\r\n'), +(17, 'T5', 'TempMeter', 'CB', 16, 'Off', 'Off', '\r\n\r\n 4\r\n -20.0712757\r\n 0.00177105656\r\n 9.751451E-10\r\n -3.51362E-15\r\n 0\r\n'), +(18, 'RV1', 'RegulationValve', 'CB', 17, 'Off', 'Off', '\r\n\r\n 1\r\n 100\r\n 500\r\n 10\r\n'), +(19, 'RV2', 'RegulationValve', 'CB', 18, 'Off', 'Off', '\r\n\r\n 2\r\n 100\r\n 500\r\n 3\r\n'), +(20, 'RV3', 'RegulationValve', 'CB', 19, 'Off', 'Off', '\r\n\r\n 3\r\n 100\r\n 500\r\n 10\r\n'), +(21, 'RV4', 'RegulationValve', 'CB', 20, 'Off', 'Off', '\r\n\r\n 4\r\n 100\r\n 500\r\n 30\r\n'), +(22, 'RV5', 'RegulationValve', 'CB', 21, 'Off', 'Off', '\r\n\r\n 5\r\n 100\r\n 500\r\n 10\r\n'), +(23, 'DIV1', 'Diverter', 'CB', 22, 'Off', 'Off', '\r\n\r\n 34\r\n'), +(24, 'DIV2', 'Diverter', 'CB', 23, 'Off', 'Off', '\r\n\r\n 35\r\n'), +(25, 'DIV3', 'Diverter', 'CB', 24, 'Off', 'Off', '\r\n\r\n 36\r\n'), +(26, 'VL11', 'Valve', 'CB', 25, 'Off', 'Off', '\r\n\r\n 0\r\n \r\n false\r\n'), +(27, 'VL13', 'Valve', 'CB', 26, 'Off', 'Off', '\r\n\r\n 1\r\n \r\n false\r\n'), +(28, 'VL21', 'Valve', 'CB', 27, 'Off', 'Off', '\r\n\r\n 2\r\n \r\n false\r\n'), +(29, 'VL23', 'Valve', 'CB', 28, 'Off', 'Off', '\r\n\r\n 3\r\n \r\n false\r\n'), +(30, 'VZ1', 'Valve', 'CB', 29, 'Off', 'Off', '\r\n\r\n 4\r\n \r\n false\r\n'), +(31, 'VP2', 'Valve', 'CB', 30, 'Off', 'Off', '\r\n\r\n 5\r\n \r\n false\r\n'), +(32, 'VP4', 'Valve', 'CB', 31, 'Off', 'Off', '\r\n\r\n 6\r\n \r\n false\r\n'), +(33, 'VP5', 'Valve', 'CB', 32, 'Off', 'Off', '\r\n\r\n 7\r\n \r\n false\r\n'), +(34, 'VP6', 'Valve', 'CB', 33, 'Off', 'Off', '\r\n\r\n 8\r\n \r\n false\r\n'), +(35, 'VL12', 'Valve', 'CB', 34, 'Off', 'Off', '\r\n\r\n 9\r\n \r\n false\r\n'), +(36, 'VL22', 'Valve', 'CB', 35, 'Off', 'Off', '\r\n\r\n 10\r\n \r\n false\r\n'), +(37, 'VI11', 'Valve', 'CB', 36, 'Off', 'Off', '\r\n\r\n 11\r\n \r\n false\r\n'), +(38, 'VI12', 'Valve', 'CB', 37, 'Off', 'Off', '\r\n\r\n 12\r\n \r\n false\r\n'), +(39, 'VI13', 'Valve', 'CB', 38, 'Off', 'Off', '\r\n\r\n 13\r\n \r\n false\r\n'), +(40, 'VI21', 'Valve', 'CB', 39, 'Off', 'Off', '\r\n\r\n 14\r\n \r\n false\r\n'), +(41, 'VI22', 'Valve', 'CB', 40, 'Off', 'Off', '\r\n\r\n 15\r\n \r\n false\r\n'), +(42, 'VI2P', 'Valve', 'CB', 41, 'Off', 'Off', '\r\n\r\n 16\r\n \r\n false\r\n'), +(43, 'VI31', 'Valve', 'CB', 42, 'Off', 'Off', '\r\n\r\n 17\r\n \r\n false\r\n'), +(44, 'VI32', 'Valve', 'CB', 43, 'Off', 'Off', '\r\n\r\n 18\r\n \r\n false\r\n'), +(45, 'VI3P', 'Valve', 'CB', 44, 'Off', 'Off', '\r\n\r\n 19\r\n \r\n false\r\n'), +(46, 'VI41', 'Valve', 'CB', 45, 'Off', 'Off', '\r\n\r\n 20\r\n \r\n false\r\n'), +(47, 'VI42', 'Valve', 'CB', 46, 'Off', 'Off', '\r\n\r\n 21\r\n \r\n false\r\n'), +(48, 'VI43', 'Valve', 'CB', 47, 'Off', 'Off', '\r\n\r\n 22\r\n \r\n false\r\n'), +(49, 'VI4P', 'Valve', 'CB', 48, 'Off', 'Off', '\r\n\r\n 23\r\n \r\n false\r\n'), +(50, 'VB1', 'Valve', 'CB', 49, 'Off', 'Off', '\r\n\r\n 24\r\n \r\n false\r\n'), +(51, 'VB1a', 'Valve', 'CB', 50, 'Off', 'Off', '\r\n\r\n 25\r\n VB1\r\n false\r\n -2\r\n 2\r\n'), +(52, 'VB2', 'Valve', 'CB', 51, 'Off', 'Off', '\r\n\r\n 26\r\n \r\n false\r\n'), +(53, 'VB2a', 'Valve', 'CB', 52, 'Off', 'Off', '\r\n\r\n 27\r\n VB2\r\n false\r\n -2\r\n 2\r\n'), +(54, 'VM1', 'Valve', 'CB', 53, 'Off', 'Off', '\r\n\r\n 28\r\n \r\n false\r\n'), +(55, 'VM2', 'Valve', 'CB', 54, 'Off', 'Off', '\r\n\r\n 29\r\n \r\n false\r\n'), +(56, 'VM3', 'Valve', 'CB', 55, 'Off', 'Off', '\r\n\r\n 30\r\n \r\n false\r\n'), +(57, 'VM4', 'Valve', 'CB', 56, 'Off', 'Off', '\r\n\r\n 31\r\n \r\n false\r\n'), +(58, 'Pumpe1', 'Pump', 'CB', 57, 'Off', 'Off', '\r\n\r\n 32\r\n \r\n false\r\n'), +(59, 'Block', 'Valve', 'CB', 58, 'Off', 'Off', '\r\n\r\n 33\r\n \r\n false\r\n'), +(60, 'VZ8', 'Valve', 'CB', 59, 'Off', 'Off', '\r\n\r\n 37\r\n \r\n false\r\n'), +(61, 'Sick1', 'RegisterReader', 'CB', 60, 'Off', 'Off', '\r\n\r\n 1\r\n'), +(62, 'Sick2', 'RegisterReader', 'CB', 61, 'Off', 'Off', '\r\n\r\n 2\r\n'), +(63, 'Sick3', 'RegisterReader', 'CB', 62, 'Off', 'Off', '\r\n\r\n 3\r\n'), +(64, 'Kamera', 'IdcCamera', NULL, 63, 'Simulate', 'Off', '\r\n\r\n 20\r\n 57600\r\n 0.5\r\n'), +(65, 'Fliegender Start-Stopp', 'Flying-Start-Collection', NULL, 64, 'Off', 'Off', '\r\n'), +(66, 'Verbund', 'CombinedMeters', NULL, 65, 'Off', 'Off', '\r\n'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `componentprocedure` +-- + +CREATE TABLE IF NOT EXISTS `componentprocedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `componenttest` +-- + +CREATE TABLE IF NOT EXISTS `componenttest` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Daten für Tabelle `componenttest` +-- + +INSERT INTO `componenttest` (`Id`, `CmpntName`, `Parameters`, `Test_id`) VALUES +(1, 'Verbund', '\r\n\r\n 3.05\r\n 3.3\r\n -0.7\r\n -0.5\r\n 0\r\n 0.1\r\n', 29), +(2, 'Verbund', '\r\n\r\n 3.05\r\n 3.3\r\n -0.7\r\n -0.5\r\n 0.05\r\n 0.1\r\n', 30), +(3, 'Verbund', '\r\n\r\n 3.05\r\n 3.3\r\n -0.7\r\n -0.5\r\n 0.05\r\n 0.1\r\n', 31), +(4, 'Verbund', '\r\n\r\n 0.9\r\n 1\r\n -0.7\r\n -0.5\r\n 0.05\r\n 0.1\r\n', 32); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `feedingpath` +-- + +CREATE TABLE IF NOT EXISTS `feedingpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Pump` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Daten für Tabelle `feedingpath` +-- + +INSERT INTO `feedingpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Pump`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PS1', 0.01, 0.03, '---', 'VZ1', ''), +(2, 3, 'PS2', 0.03, 250, '---', 'VZ1', ''), +(3, 2, 'PS3', 0.01, 5, 'Pumpe1', 'VP2', ''), +(4, 0, '', 0, 0, '---', 'VZ1', 'VL11;VL13;VL21;VL23;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI2P;VI31;VI32;VI3P;VI41;VI42;VI43;VI4P;VB1;VB1a;VB2;VB2a;VM1;VM2;VM3;VM4;Pumpe1;Block;VZ8'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `group` +-- + +CREATE TABLE IF NOT EXISTS `group` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Gid` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `User_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `User_id` (`User_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Daten für Tabelle `group` +-- + +INSERT INTO `group` (`Id`, `Gid`, `Name`, `User_id`) VALUES +(1, 0, 'Testers', 2), +(2, 1, 'Testing Specialists', 1), +(3, 2, 'Head Of Lab', 1), +(4, 3, 'Maintenance Specialists', 1), +(5, 4, 'Metrologists', 1), +(6, 5, 'Calibration Specialists', 1), +(7, 6, 'Administrators', 1); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `measurementcorrection` +-- + +CREATE TABLE IF NOT EXISTS `measurementcorrection` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Measurement` float DEFAULT NULL, + `Correction` float DEFAULT NULL, + `Component_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Component_id` (`Component_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `meterspath` +-- + +CREATE TABLE IF NOT EXISTS `meterspath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Sensor1` varchar(255) DEFAULT NULL, + `Sensor2` varchar(255) DEFAULT NULL, + `Sensor3` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Daten für Tabelle `meterspath` +-- + +INSERT INTO `meterspath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Sensor1`, `Sensor2`, `Sensor3`) VALUES +(1, 0, 'PMess1', 0.01, 300, 'Sick1', 'Sick2', 'Sick3'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `metertestresult` +-- + +CREATE TABLE IF NOT EXISTS `metertestresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `SerialNr` varchar(255) DEFAULT NULL, + `VolumeStart` float DEFAULT NULL, + `VolumeEnd` float DEFAULT NULL, + `VolumeMeter` float DEFAULT NULL, + `VolumeRef` float DEFAULT NULL, + `VolumeErrorPct` float DEFAULT NULL, + `PulsesMeter` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `TestResult_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `TestResult_id` (`TestResult_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=352 ; + +-- +-- Daten für Tabelle `metertestresult` +-- + +INSERT INTO `metertestresult` (`Id`, `SerialNr`, `VolumeStart`, `VolumeEnd`, `VolumeMeter`, `VolumeRef`, `VolumeErrorPct`, `PulsesMeter`, `PulsesMaster`, `Time`, `TestResult_id`) VALUES +(1, 'wm1', 0, 0, 142, 200.256, -29.0907, 142, 72051, 45.712, 1), +(2, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.712, 1), +(3, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.712, 1), +(4, 'wm1', 0, 0, 362, 59.9706, 503.629, 362, 143864, 104.98, 2), +(5, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.98, 2), +(6, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.98, 2), +(7, 'wm1', 0, 0, 141, 200.27, -29.5951, 141, 72046, 45.705, 3), +(8, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.705, 3), +(9, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.705, 3), +(10, 'wm1', 0, 0, 361, 60.1188, 500.478, 361, 143933, 104.919, 4), +(11, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.919, 4), +(12, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.919, 4), +(13, 'wm1', 0, 0, 141, 200.38, -29.6335, 141, 72078, 45.707, 5), +(14, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.707, 5), +(15, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.707, 5), +(16, 'wm1', 0, 0, 362, 60.0895, 502.435, 362, 143850, 104.938, 6), +(17, 'wm2', 0, 0, 0, 0, -100, 0, 0, 104.938, 6), +(18, 'wm3', 0, 0, 0, 0, -100, 0, 0, 104.938, 6), +(19, 'wm1', 0, 0, 5.6, 199.069, -97.1869, 56, 71576, 45.673, 7), +(20, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.673, 7), +(21, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.673, 7), +(25, 'wm1', 0, 0, 1.9, 190.598, -99.0031, 19, 68552, 45.822, 8), +(26, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.822, 8), +(27, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.822, 8), +(28, 'wm1', 0, 0, 1.9, 190.521, -99.0027, 19, 68543, 45.956, 9), +(29, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.956, 9), +(30, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.956, 9), +(31, 'wm1', 0, 0, 190, 190.39, -0.204866, 19, 68517, 45.988, 10), +(32, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.988, 10), +(33, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.988, 10), +(34, 'wm1', 0, 0, 190, 190.643, -0.337179, 19, 68558, 45.839, 11), +(35, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.839, 11), +(36, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.839, 11), +(37, 'wm1', 0, 0, 50, 39.8137, 25.5851, 5, 119374, 99.47, 12), +(38, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.47, 12), +(39, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.47, 12), +(40, 'wm1', 0, 0, 190, 190.549, -0.288296, 19, 68558, 45.834, 13), +(41, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.834, 13), +(42, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.834, 13), +(43, 'wm1', 0, 0, 50, 42.4429, 17.8054, 5, 119438, 99.653, 14), +(44, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.653, 14), +(45, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.653, 14), +(46, 'wm1', 0, 0, 190, 190.532, -0.279457, 19, 68518, 45.838, 15), +(47, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.838, 15), +(48, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.838, 15), +(49, 'wm1', 0, 0, 50, 42.5645, 17.4688, 5, 119409, 99.689, 16), +(50, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.689, 16), +(51, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.689, 16), +(52, 'wm1', 0, 0, 190, 190.678, -0.355387, 19, 68569, 45.876, 17), +(53, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.876, 17), +(54, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.876, 17), +(55, 'wm1', 0, 0, 190, 190.508, -0.266501, 19, 68525, 45.844, 18), +(56, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.844, 18), +(57, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.844, 18), +(58, 'wm1', 0, 0, 200, 200.696, -0.346793, 20, 72203, 45.812, 19), +(59, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.812, 19), +(60, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.812, 19), +(61, 'wm1', 0, 0, 190, 190.62, -0.32514, 19, 68555, 45.85, 20), +(62, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.85, 20), +(63, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.85, 20), +(64, 'wm1', 0, 0, 190, 190.701, -0.36741, 19, 68578, 45.85, 21), +(65, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.85, 21), +(66, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.85, 21), +(67, 'wm1', 0, 0, 190, 191.073, -0.561429, 19, 68623, 45.841, 22), +(68, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.841, 22), +(69, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.841, 22), +(70, 'wm1', 0, 0, 190, 190.796, -0.416979, 19, 68502, 45.864, 23), +(71, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.864, 23), +(72, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.864, 23), +(73, 'wm1', 0, 0, 190, 190.875, -0.458495, 19, 68548, 45.842, 24), +(74, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.842, 24), +(75, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.842, 24), +(76, 'wm1', 0, 0, 190, 190.967, -0.506622, 19, 68554, 45.847, 25), +(77, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.847, 25), +(78, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.847, 25), +(79, 'wm1', 0, 0, 190, 190.841, -0.4405, 19, 68537, 45.837, 26), +(80, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.837, 26), +(81, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.837, 26), +(82, 'wm1', 0, 0, 50, 50.0062, -0.0123505, 5, 119527, 99.841, 27), +(83, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.841, 27), +(84, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.841, 27), +(85, 'wm1', 0, 0, 50, 50.0312, -0.0623848, 5, 119563, 99.871, 28), +(86, 'wm2', 0, 0, 0, 0, -100, 0, 0, 99.871, 28), +(87, 'wm3', 0, 0, 0, 0, -100, 0, 0, 99.871, 28), +(88, 'wm1', 0, 0, 50, -113.154, -100, 5, 119370, 87.146, 29), +(89, 'wm2', 0, 0, 0, 0, -100, 0, 0, 87.146, 29), +(90, 'wm3', 0, 0, 0, 0, -100, 0, 0, 87.146, 29), +(91, 'wm1', 0, 0, 0, 19.0219, -100, 8, 6841, 64.05, 30), +(92, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.05, 30), +(93, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.05, 30), +(94, 'wm1', 0, 0, 0, 14.8243, -100, 3, 5327, 64.246, 31), +(95, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.246, 31), +(96, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.246, 31), +(97, 'wm1', 0, 0, 0, 14.7066, -100, 3, 5276, 64.346, 32), +(98, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.346, 32), +(99, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.346, 32), +(100, 'wm1', 0, 0, 0, 17.0307, -100, 4, 6120, 64.316, 33), +(101, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.316, 33), +(102, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.316, 33), +(103, 'wm1', 0, 0, 0, 14.9433, -100, 5, 5361, 64.328, 34), +(104, 'wm2', 0, 0, 0, 0, -100, 0, 0, 64.328, 34), +(105, 'wm3', 0, 0, 0, 0, -100, 0, 0, 64.328, 34), +(106, 'wm1', 0, 0, 0, 35.6131, -100, 34, 12773, 71.015, 35), +(107, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.015, 35), +(108, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.015, 35), +(109, 'wm1', 0, 0, 0, 37.8982, -100, 33, 13603, 71.007, 36), +(110, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.007, 36), +(111, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.007, 36), +(112, 'wm1', 0, 0, 0, 39.3708, -100, 28, 14121, 71.024, 37), +(113, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.024, 37), +(114, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.024, 37), +(115, 'wm1', 0, 0, 0, 38.3891, -100, 29, 13768, 71.021, 38), +(116, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.021, 38), +(117, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.021, 38), +(118, 'wm1', 0, 0, 0, 39.7502, -100, 32, 14268, 71.013, 39), +(119, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.013, 39), +(120, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.013, 39), +(121, 'wm1', 0, 0, 0, 59.1279, -100, 42, 21226, 69.587, 40), +(122, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.587, 40), +(123, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.587, 40), +(124, 'wm1', 0, 0, 0, 58.214, -100, 42, 20898, 69.564, 41), +(125, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.564, 41), +(126, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.564, 41), +(127, 'wm1', 0, 0, 0, 59.3587, -100, 43, 21309, 69.548, 42), +(128, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.548, 42), +(129, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.548, 42), +(130, 'wm1', 0, 0, 0, 58.2055, -100, 46, 20895, 69.524, 43), +(131, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.524, 43), +(132, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.524, 43), +(133, 'wm1', 0, 0, 0, 59.1874, -100, 43, 21230, 69.545, 44), +(134, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.545, 44), +(135, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.545, 44), +(136, 'wm1', 0, 0, 0, 79.3873, -100, 59, 28489, 69.226, 45), +(137, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.226, 45), +(138, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.226, 45), +(139, 'wm1', 0, 0, 0, 79.5877, -100, 54, 28566, 69.211, 46), +(140, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.211, 46), +(141, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.211, 46), +(142, 'wm1', 0, 0, 0, 78.178, -100, 57, 28060, 69.281, 47), +(143, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.281, 47), +(144, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.281, 47), +(145, 'wm1', 0, 0, 0, 79.4592, -100, 55, 28520, 69.18, 48), +(146, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.18, 48), +(147, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.18, 48), +(148, 'wm1', 0, 0, 0, 79.4478, -100, 60, 28510, 69.189, 49), +(149, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.189, 49), +(150, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.189, 49), +(151, 'wm1', 0, 0, 0, 119.112, -100, 85, 42785, 72.154, 50), +(152, 'wm2', 0, 0, 0, 0, -100, 0, 0, 72.154, 50), +(153, 'wm3', 0, 0, 0, 0, -100, 0, 0, 72.154, 50), +(154, 'wm1', 0, 0, 0, 119.29, -100, 85, 42845, 71.198, 51), +(155, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.198, 51), +(156, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.198, 51), +(157, 'wm1', 0, 0, 0, 119.209, -100, 86, 42822, 71.207, 52), +(158, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.207, 52), +(159, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.207, 52), +(160, 'wm1', 0, 0, 0, 119.434, -100, 87, 42891, 71.225, 53), +(161, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.225, 53), +(162, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.225, 53), +(163, 'wm1', 0, 0, 0, 119.206, -100, 87, 42826, 71.469, 54), +(164, 'wm2', 0, 0, 0, 0, -100, 0, 0, 71.469, 54), +(165, 'wm3', 0, 0, 0, 0, -100, 0, 0, 71.469, 54), +(166, 'wm1', 0, 0, 1410, 200.559, 603.034, 141, 7203, 44.567, 55), +(167, 'wm2', 0, 0, 0, 0, -100, 0, 0, 44.567, 55), +(168, 'wm3', 0, 0, 0, 0, -100, 0, 0, 44.567, 55), +(169, 'wm1', 0, 0, 1410, 200.571, 602.991, 141, 72032, 45.788, 56), +(170, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.788, 56), +(171, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.788, 56), +(172, 'wm1', 0, 0, 1400, 187.698, 645.881, 140, 71532, 45.616, 57), +(173, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.616, 57), +(174, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.616, 57), +(175, 'wm1', 0, 0, 1430, 186.342, 667.405, 143, 72077, 45.594, 58), +(176, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.594, 58), +(177, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.594, 58), +(178, 'wm1', 0, 0, 1420, 186.346, 662.024, 142, 72081, 45.602, 59), +(179, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.602, 59), +(180, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.602, 59), +(181, 'wm1', 0, 0, 1430, 200.703, 612.496, 143, 72079, 45.59, 60), +(182, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.59, 60), +(183, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.59, 60), +(184, 'wm1', 0, 0, 0, 989.503, -100, 705, 359760, 227.074, 61), +(185, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.074, 61), +(186, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.074, 61), +(187, 'wm1', 0, 0, 0, 1001.3, -100, 705, 359717, 227.025, 62), +(188, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.025, 62), +(189, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.025, 62), +(190, 'wm1', 0, 0, 0, 1002.82, -100, 705, 360253, 227.033, 63), +(191, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.033, 63), +(192, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.033, 63), +(193, 'wm1', 0, 0, 0, 1001.29, -100, 704, 359646, 227.044, 64), +(194, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.044, 64), +(195, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.044, 64), +(196, 'wm1', 0, 0, 0, 1002.58, -100, 705, 360167, 227.036, 65), +(197, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.036, 65), +(198, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.036, 65), +(199, 'wm1', 0, 0, 0, 1001.43, -100, 704, 359748, 227.023, 66), +(200, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.023, 66), +(201, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.023, 66), +(202, 'wm1', 0, 0, 1000, 1001.3, -0.130122, 704, 359716, 227.032, 67), +(203, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.032, 67), +(204, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.032, 67), +(205, 'wm1', 0, 0, 1001.42, 1002.83, -0.140678, 705, 360271, 227.041, 68), +(206, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.041, 68), +(207, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.041, 68), +(208, 'wm1', 0, 0, 1000, 1001.36, -0.135966, 704, 359725, 227.076, 69), +(209, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.076, 69), +(210, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.076, 69), +(211, 'wm1', 0, 0, 1000, 1001.25, -0.125136, 704, 359693, 227.051, 70), +(212, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.051, 70), +(213, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.051, 70), +(214, 'wm1', 0, 0, 1000, 1001.2, -0.119632, 704, 359685, 227.011, 71), +(215, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.011, 71), +(216, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.011, 71), +(217, 'wm1', 0, 0, 99.4318, 98.3085, 1.14262, 70, 235168, 348.14, 72), +(218, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.14, 72), +(219, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.14, 72), +(220, 'wm1', 0, 0, 99.4318, 98.2879, 1.16382, 70, 235024, 347.978, 73), +(221, 'wm2', 0, 0, 0, 0, -100, 0, 0, 347.978, 73), +(222, 'wm3', 0, 0, 0, 0, -100, 0, 0, 347.978, 73), +(223, 'wm1', 0, 0, 100.852, 99.8041, 1.05024, 71, 238677, 347.982, 74), +(224, 'wm2', 0, 0, 0, 0, -100, 0, 0, 347.982, 74), +(225, 'wm3', 0, 0, 0, 0, -100, 0, 0, 347.982, 74), +(226, 'wm1', 0, 0, 113.636, 98.5252, 15.3374, 80, 235575, 348.083, 75), +(227, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.083, 75), +(228, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.083, 75), +(229, 'wm1', 0, 0, 166.193, 99.9431, 66.2878, 117, 238973, 348.062, 76), +(230, 'wm2', 0, 0, 0, 0, -100, 0, 0, 348.062, 76), +(231, 'wm3', 0, 0, 0, 0, -100, 0, 0, 348.062, 76), +(232, 'wm1', 0, 0, 1410, 200.627, 602.798, 141, 72052, 45.611, 77), +(233, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.611, 77), +(234, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.611, 77), +(235, 'wm1', 0, 0, 1000, 1001.49, -0.149094, 704, 359781, 227.05, 78), +(236, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.05, 78), +(237, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.05, 78), +(238, 'wm1', 0, 0, 1000, 1001.43, -0.142637, 704, 359761, 227.05, 79), +(239, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.05, 79), +(240, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.05, 79), +(241, 'wm1', 0, 0, 1002.84, 1001.4, 0.143683, 706, 359700, 227.053, 80), +(242, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.053, 80), +(243, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.053, 80), +(244, 'wm1', 0, 0, 1000, 1001.56, -0.155696, 704, 359828, 227.003, 81), +(245, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.003, 81), +(246, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.003, 81), +(247, 'wm1', 0, 0, 1000, 1001.35, -0.135193, 704, 359701, 227.042, 82), +(248, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.042, 82), +(249, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.042, 82), +(250, 'wm1', 0, 0, 99.4318, 98.314, 1.13703, 70, 235067, 349.559, 83), +(251, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.559, 83), +(252, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.559, 83), +(253, 'wm1', 0, 0, 99.4318, 98.2718, 1.18042, 70, 234977, 349.421, 84), +(254, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.421, 84), +(255, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.421, 84), +(256, 'wm1', 0, 0, 100.852, 99.7588, 1.09611, 71, 238564, 349.376, 85), +(257, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.376, 85), +(258, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.376, 85), +(259, 'wm1', 0, 0, 99.4318, 98.4383, 1.00923, 70, 235362, 349.416, 86), +(260, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.416, 86), +(261, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.416, 86), +(262, 'wm1', 0, 0, 100.852, 99.8505, 1.00323, 71, 238786, 349.366, 87), +(263, 'wm2', 0, 0, 0, 0, -100, 0, 0, 349.366, 87), +(264, 'wm3', 0, 0, 0, 0, -100, 0, 0, 349.366, 87), +(265, 'wm1', 0, 0, 1065.34, 0, -100, 750, 360027, 227.383, 88), +(266, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.383, 88), +(267, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.383, 88), +(268, 'wm1', 0, 0, 1410, 200.609, 602.86, 141, 72048, 45.529, 89), +(269, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.529, 89), +(270, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.529, 89), +(271, 'wm1', 0, 0, 1420, 199.108, 613.18, 142, 71515, 45.508, 90), +(272, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.508, 90), +(273, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.508, 90), +(274, 'wm1', 0, 0, 1420, 200.65, 607.699, 142, 72044, 45.525, 91), +(275, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.525, 91), +(276, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.525, 91), +(277, 'wm1', 0, 0, 1420, 200.581, 607.943, 142, 72038, 45.531, 92), +(278, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.531, 92), +(279, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.531, 92), +(280, 'wm1', 0, 0, 1400, 199.228, 602.713, 140, 71552, 45.516, 93), +(281, 'wm2', 0, 0, 0, 0, -100, 0, 0, 45.516, 93), +(282, 'wm3', 0, 0, 0, 0, -100, 0, 0, 45.516, 93), +(283, 'wm1', 0, 0, 1800, 200.088, 799.605, 180, 71883, 51.546, 94), +(284, 'wm2', 0, 0, 13620, 201.24, 6668.03, 1362, 72297, 51.546, 94), +(285, 'wm3', 0, 0, 0, 0, -100, 0, 0, 51.546, 94), +(286, 'wm1', 0, 0, 1803.5, 201.596, 0, 179, 71845, 47.865, 95), +(287, 'wm2', 0, 0, 0, 201.596, 0, 1424, 72366, 47.865, 95), +(288, NULL, 0, 0, 1803.5, 201.596, -100, 0, 0, 47.865, 95), +(289, 'wm1', 0, 0, 543.097, 602.379, 0, 542, 215922, 153.747, 96), +(290, 'wm2', 0, 0, 59.7737, 602.379, 0, 4029, 216302, 153.747, 96), +(291, NULL, 0, 0, 602.871, 602.379, -100, 0, 0, 153.747, 96), +(292, 'wm1', 0, 0, 161.217, 200.829, 0, 160, 71536, 228.42, 97), +(293, 'wm2', 0, 0, 40.1069, 200.829, 0, 2703, 72051, 228.42, 97), +(294, NULL, 0, 0, 201.324, 200.829, -100, 0, 0, 228.42, 97), +(295, 'wm1', 0, 0, 539.861, 602.315, 0, 539, 216039, 143.349, 98), +(296, 'wm2', 0, 0, 62.3862, 602.315, 0, 4205, 216322, 143.349, 98), +(297, NULL, 0, 0, 602.247, 602.315, -100, 0, 0, 143.349, 98), +(298, 'wm1', 0, 0, 162.342, 200.79, 0, 161, 71484, 228.798, 99), +(299, 'wm2', 0, 0, 39.6096, 200.79, 0, 2669, 72038, 228.798, 99), +(300, NULL, 0, 0, 201.952, 200.79, -100, 0, 0, 228.798, 99), +(301, 'wm1', 0, 0, 0, 100.469, 0, 0, 16776800, 306.062, 100), +(302, 'wm2', 0, 0, 99.1319, 100.469, 0, 6683, 240176, 306.062, 100), +(303, NULL, 0, 0, 99.1319, 100.469, -100, 0, 0, 306.062, 100), +(304, 'wm1', 0, 0, 64.0209, 100.63, 0, 63, 236649, 125.141, 101), +(305, 'wm2', 0, 0, 37.3474, 100.63, 0, 2517, 240385, 125.141, 101), +(306, NULL, 0, 0, 101.368, 100.63, -100, 0, 0, 125.141, 101), +(307, 'wm1', 0, 0, 540.281, 602.188, 0, 539, 215872, 143.575, 102), +(308, 'wm2', 0, 0, 61.8944, 602.188, 0, 4172, 216331, 143.575, 102), +(309, NULL, 0, 0, 602.175, 602.188, -100, 0, 0, 143.575, 102), +(310, 'wm1', 0, 0, 160.017, 200.86, 0, 159, 71622, 229.251, 103), +(311, 'wm2', 0, 0, 39.8327, 200.86, 0, 2684, 72037, 229.251, 103), +(312, NULL, 0, 0, 199.849, 200.86, -100, 0, 0, 229.251, 103), +(313, 'wm1', 0, 0, 0, 100.438, 0, 0, 16776900, 338.589, 104), +(314, 'wm2', 0, 0, 99.0655, 100.438, 0, 6678, 240137, 338.589, 104), +(315, NULL, 0, 0, 99.0655, 100.438, -100, 0, 0, 338.589, 104), +(316, 'wm1', 0, 0, 63.1665, 100.639, 0, 62, 236049, 124.339, 105), +(317, 'wm2', 0, 0, 37.3833, 100.639, 0, 2519, 240351, 124.339, 105), +(318, NULL, 0, 0, 100.55, 100.639, -100, 0, 0, 124.339, 105), +(319, 'wm1', 0, 0, 539.968, 602.378, 0, 539, 215998, 143.511, 106), +(320, 'wm2', 0, 0, 62.1642, 602.378, 0, 4191, 216374, 143.511, 106), +(321, NULL, 0, 0, 602.132, 602.378, -100, 0, 0, 143.511, 106), +(322, 'wm1', 0, 0, 160.774, 200.842, 0, 160, 71733, 229.662, 107), +(323, 'wm2', 0, 0, 40.1103, 200.842, 0, 2703, 72045, 229.662, 107), +(324, NULL, 0, 0, 200.884, 200.842, -100, 0, 0, 229.662, 107), +(325, 'wm1', 0, 0, 541.727, 602.268, 0, 540, 215697, 142.272, 108), +(326, 'wm2', 0, 0, 61.7283, 602.268, 0, 4161, 216343, 142.272, 108), +(327, NULL, 0, 0, 603.456, 602.268, -100, 0, 0, 142.272, 108), +(328, 'wm1', 0, 0, 161.883, 200.809, 0, 161, 71688, 227.334, 109), +(329, 'wm2', 0, 0, 39.8706, 200.809, 0, 2687, 72050, 227.334, 109), +(330, NULL, 0, 0, 201.753, 200.809, -100, 0, 0, 227.334, 109), +(331, 'wm1', 0, 0, 0, 100.452, 0, 0, 16777200, 303.052, 110), +(332, 'wm2', 0, 0, 99.1244, 100.452, 0, 6683, 240196, 303.052, 110), +(333, NULL, 0, 0, 99.1244, 100.452, -100, 0, 0, 303.052, 110), +(334, 'wm1', 0, 0, 59.9333, 100.63, 0, 59, 236755, 123.913, 111), +(335, 'wm2', 0, 0, 39.6961, 100.63, 0, 2676, 240465, 123.913, 111), +(336, NULL, 0, 0, 99.6293, 100.63, -100, 0, 0, 123.913, 111), +(337, 'wm1', 0, 0, 557.026, 601.566, 0, 556, 215744, 141.812, 112), +(338, 'wm2', 0, 0, 44.2035, 601.566, 0, 2980, 216121, 141.812, 112), +(339, NULL, 0, 0, 601.229, 601.566, -100, 0, 0, 141.812, 112), +(340, 'wm1', 0, 0, 540.17, 573.441, 0, 539, 215673, 141.843, 113), +(341, 'wm2', 0, 0, 61.4893, 573.441, 0, 4145, 216103, 141.843, 113), +(342, NULL, 0, 0, 601.659, 573.441, -100, 0, 0, 141.843, 113), +(343, 'wm1', 0, 0, 163.388, 200.576, 0, 163, 71857, 227.385, 114), +(344, 'wm2', 0, 0, 38.3645, 200.576, 0, 2586, 72011, 227.385, 114), +(345, NULL, 0, 0, 201.752, 200.576, -100, 0, 0, 227.385, 114), +(346, 'wm1', 0, 0, 0, 100.307, 0, 0, 16777100, 327.749, 115), +(347, 'wm2', 0, 0, 99.0589, 100.307, 0, 6678, 240098, 327.749, 115), +(348, NULL, 0, 0, 99.0589, 100.307, -100, 0, 0, 327.749, 115), +(349, 'wm1', 0, 0, 52.1295, 100.396, 0, 52, 239733, 124.195, 116), +(350, 'wm2', 0, 0, 47.3139, 100.396, 0, 3189, 240255, 124.195, 116), +(351, NULL, 0, 0, 99.4434, 100.396, -100, 0, 0, 124.195, 116); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `outputpath` +-- + +CREATE TABLE IF NOT EXISTS `outputpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `RegulValve` varchar(255) DEFAULT NULL, + `FlowMeter` varchar(255) DEFAULT NULL, + `Diverter` varchar(255) DEFAULT NULL, + `TempDiv` varchar(255) DEFAULT NULL, + `Balance` varchar(255) DEFAULT NULL, + `EmptyTankValve` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Daten für Tabelle `outputpath` +-- + +INSERT INTO `outputpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `RegulValve`, `FlowMeter`, `Diverter`, `TempDiv`, `Balance`, `EmptyTankValve`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PQ1', 0.01, 0.75, 'RV4', 'I4', 'DIV3', 'T5', 'W2', 'VB2', 'VI41;VI42', ''), +(2, 2, 'PQ2', 0.075, 0.18, 'RV5', 'I4', 'DIV3', 'T5', 'W2', 'VB2', 'VI41;VI43', ''), +(3, 3, 'PQ3', 0.18, 3, 'RV3', 'I3', 'DIV2', 'T3', 'W2', 'VB2', 'VI31;VI32', ''), +(4, 4, 'PQ4', 3, 19, 'RV2', 'I2', 'DIV1', 'T4', 'W1', 'VB1', 'VI13;VI21;VI22', ''), +(5, 5, 'PQ5', 19, 160, 'RV1', 'I1', 'DIV1', 'T4', 'W1', 'VB1', 'VI11;VI13', 'VI12'), +(6, 6, 'PQ6', 160, 210, 'RV1', 'I1', 'DIV1', 'T4', 'W1', 'VB1', 'VI11;VI12;VI13', ''), +(7, 0, '', 0, 0, '---', '---', '---', '---', '---', '---', '', ''); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `procedure` +-- + +CREATE TABLE IF NOT EXISTS `procedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `CreationUser` varchar(255) DEFAULT NULL, + `CreationTime` datetime DEFAULT NULL, + `LastChgUser` varchar(255) DEFAULT NULL, + `LastChgTime` datetime DEFAULT NULL, + `LongDescription` varchar(255) DEFAULT NULL, + `Watermeters` varchar(255) DEFAULT NULL, + `PulsesPerLtr` float DEFAULT '0', + `PulsesPerLtr2` float DEFAULT '0', + `DataEntry` varchar(255) DEFAULT NULL, + `ResultsPrinter` varchar(255) DEFAULT NULL, + `ResultsWriter` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; + +-- +-- Daten für Tabelle `procedure` +-- + +INSERT INTO `procedure` (`Id`, `ItemNr`, `Name`, `Description`, `CreationUser`, `CreationTime`, `LastChgUser`, `LastChgTime`, `LongDescription`, `Watermeters`, `PulsesPerLtr`, `PulsesPerLtr2`, `DataEntry`, `ResultsPrinter`, `ResultsWriter`) VALUES +(7, 0, 'Prüfung1', 'test1 meistream50', 'admin', '2014-01-21 08:21:49', 'admin', '2014-01-23 18:09:43', '', '', 0.1, 0, NULL, NULL, NULL), +(8, 1, 'Prüfung2', '', 'admin', '2014-01-21 14:46:58', 'admin', '2014-01-23 14:23:32', '', '', 1, 0, NULL, NULL, NULL), +(10, 2, 'Test 1', 'Karsten Test meistream50', 'admin', '2014-01-22 14:42:31', 'admin', '2014-01-23 14:23:45', '', '', 1, 0, NULL, NULL, NULL), +(11, 3, 'TestIgor', 'flowrates', 'admin', '2014-01-22 15:38:37', 'admin', '2014-01-23 14:23:58', '', '', 0, 0, NULL, NULL, NULL), +(12, 4, 'Prüfung3', 'bigline', 'admin', '2014-01-22 16:55:21', 'admin', '2014-01-23 14:24:30', '', '', 0.1, 0, NULL, NULL, NULL), +(13, 5, 'TEST VERIFICATION', '', 'admin', '2014-01-23 09:20:49', 'admin', '2014-01-23 16:38:55', '', '', 0.704, 0, NULL, NULL, NULL), +(14, 6, 'Prüfung4', '', 'admin', '2014-01-24 08:51:59', 'admin', '2014-01-24 14:23:00', '', '', 1, 67.422, NULL, NULL, NULL), +(15, 7, 'Prüfung5', '', 'admin', '2014-01-24 13:39:20', 'admin', '2014-01-24 13:44:29', '', '', 0, 0, NULL, NULL, NULL); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `purgeend` +-- + +CREATE TABLE IF NOT EXISTS `purgeend` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) NOT NULL DEFAULT ';;;;', + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Daten für Tabelle `purgeend` +-- + +INSERT INTO `purgeend` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `Procedure_id`) VALUES +(1, 0, 5, '', '', '10;20;30;40;50', 7); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `purgestart` +-- + +CREATE TABLE IF NOT EXISTS `purgestart` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) NOT NULL DEFAULT ';;;;', + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ; + +-- +-- Daten für Tabelle `purgestart` +-- + +INSERT INTO `purgestart` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `Procedure_id`) VALUES +(1, 1, 10, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL21', '50;40;30;20;10', 7), +(2, 0, 10, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL21', '0;0;0;0;0', 7), +(3, 2, 10, 'VL11;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', 'VL13;VL21', '0;0;0;0;0', 7), +(4, 3, 5, 'VZ1', 'VL11;VL13;VL21;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB1a;VB2;VB2a', '0;0;0;0;0', 7), +(5, 0, 5, '', '', '0;0;0;0;0', 11), +(6, 0, 20, 'VL13;VZ1;VL12;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '5;5;5;5;5', 13), +(7, 1, 10, 'VL13;VZ1;VL12;VI11;VI12;VI32', 'VL11', '0;0;0;0;0', 13), +(8, 2, 5, 'VL11;VL13;VZ1;VL12;VI11;VI12;VI32', '', '0;0;0;0;0', 13), +(9, 3, 10, 'VL11;VL13;VZ1;VI11;VI12', 'VL12', '0;0;0;0;0', 13), +(10, 4, 25, 'VL11;VL13;VZ1;VL12;VI11;VI12', '', '0;0;0;0;0', 13), +(11, 5, 5, 'VL11;VL13;VZ1;VL12', 'VI11;VI12', '0;0;0;0;0', 13), +(12, 6, 5, '', 'VL11;VL13;VL21;VL23;VZ1;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VI4P;VB1;VB2', '0;0;0;0;0', 13), +(13, 0, 10, 'VL13', '', '0;0;0;0;0', 15), +(14, 0, 10, 'VL13;VL12;VI11;VI12;VI13', '', '25;25;25;25;25', 14), +(15, 1, 30, 'VL13', 'VL12;VI11;VI12;VI13', '30;40;40;40;40', 14), +(16, 2, 20, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL13', '15;40;40;40;80', 14), +(17, 3, 15, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(18, 4, 8, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VI11;VI13', '15;60;60;60;80', 14), +(19, 5, 8, 'VL11;VL12;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(20, 6, 2, 'VL11;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL12', '15;40;40;40;40', 14), +(21, 7, 28, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(22, 8, 2, 'VL11;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', 'VL12', '15;40;40;40;40', 14), +(23, 9, 15, 'VL11;VL12;VI11;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VB1;VB2', '', '15;40;40;40;40', 14), +(24, 10, 5, 'VZ1', 'VL11;VL13;VL21;VL23;VP2;VP4;VP5;VP6;VL12;VL22;VI11;VI12;VI13;VI21;VI22;VI31;VI32;VI41;VI42;VI43;VI4P;VB1;VB2;VM1;VM2;VM3;VM4;Pumpe1;Block', '0;0;0;0;0', 14); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `test` +-- + +CREATE TABLE IF NOT EXISTS `test` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Volume` float DEFAULT NULL, + `TstTime` float DEFAULT NULL, + `Repeats` int(11) DEFAULT NULL, + `Emptying` tinyint(1) DEFAULT NULL, + `Zeroing` tinyint(1) DEFAULT NULL, + `Method` varchar(255) DEFAULT NULL, + `ErrLimLo` float DEFAULT NULL, + `ErrLimHi` float DEFAULT NULL, + `TolerRed` double DEFAULT NULL, + `RedType` varchar(255) DEFAULT NULL, + `FeadingPath` varchar(255) DEFAULT NULL, + `BenchPath` varchar(255) DEFAULT NULL, + `OutputPath` varchar(255) DEFAULT NULL, + `MetersPath` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ; + +-- +-- Daten für Tabelle `test` +-- + +INSERT INTO `test` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `TolerRed`, `RedType`, `FeadingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `Procedure_id`) VALUES +(15, 0, 'Qn', 15, 16, 200, 46.4516, 5, 1, 0, 'Verbund', 0, 2, 0, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 7), +(16, 1, 'Qt', 2, 2.2, 60, 102.857, 5, 1, 0, 'Fliegender Start-Stopp', 0, 5, 0, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 7), +(17, 2, 'Qmin', 1, 1.2, 20, 65.4545, 1, 1, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 7), +(18, 0, 'Qmin', 1, 1.1, 30, 102.857, 1, 0, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 8), +(19, 0, 'Qn', 12, 16, 200, 51.4286, 1, 0, 0, 'Fliegender Start-Stopp', 5, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', '', 10), +(20, 1, 'Qt', 2.5, 3.5, 100, 120, 1, 0, 0, 'Fliegender Start-Stopp', 0, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', '', 10), +(21, 0, 'Prüfpunkt1', 1, 1.2, 20, 65.4545, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(22, 1, 'Prüfpunkt2', 2, 2.1, 40, 70.2439, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(23, 2, 'Prüfpunkt3', 3.1, 3.2, 60, 68.5714, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(24, 3, 'Prüfpunkt4', 4.1, 4.3, 80, 68.5714, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(25, 4, 'Prüfpunkt5', 6, 6.1, 120, 71.405, 5, 0, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 11), +(26, 0, 'Prüfpunkt1', 15, 17, 200, 45, 4, 0, 0, 'Fliegender Start-Stopp', 2, 0, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ5', 'PMess1', 12), +(27, 0, 'Prüfpunkt1', 15, 16, 1000, 232.258, 5, 1, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 13), +(28, 1, 'Prüfpunkt2', 1, 1.1, 100, 342.857, 5, 1, 0, 'Fliegender Start-Stopp', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 13), +(29, 0, 'Qn', 15, 16, 600, 139.355, 1, 0, 0, 'Verbund', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 14), +(30, 1, 'Qt', 3, 3.2, 200, 232.258, 1, 0, 0, 'Verbund', 0, 2, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ4', 'PMess1', 14), +(31, 2, 'Qsteig', 0.9, 1, 100, 378.947, 1, 1, 0, 'Verbund', 0, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 14), +(32, 3, 'Qfall', 2.8, 3, 100, 124.138, 1, 1, 0, 'Verbund', 0, 5, 0.20000000298023224, 'Fix', 'PS2', 'PBank2', 'PQ3', 'PMess1', 14); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `testresult` +-- + +CREATE TABLE IF NOT EXISTS `testresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `TimeStart` datetime DEFAULT NULL, + `TimeEnd` datetime DEFAULT NULL, + `RepetitionNr` int(11) DEFAULT NULL, + `AmbientTempAve` float DEFAULT NULL, + `AmbientPressAve` float DEFAULT NULL, + `AmbientHumiAve` float DEFAULT NULL, + `PressInAvrg` float DEFAULT NULL, + `PressInStart` float DEFAULT NULL, + `PressInEnd` float DEFAULT NULL, + `PressOutAvrg` float DEFAULT NULL, + `PressOutStart` float DEFAULT NULL, + `PressOutEnd` float DEFAULT NULL, + `TempInAvrg` float DEFAULT NULL, + `TempInStart` float DEFAULT NULL, + `TempInEnd` float DEFAULT NULL, + `TempOutAvrg` float DEFAULT NULL, + `TempOutStart` float DEFAULT NULL, + `TempOutEnd` float DEFAULT NULL, + `TempDivAvrg` float DEFAULT NULL, + `TempDivStart` float DEFAULT NULL, + `TempDivEnd` float DEFAULT NULL, + `MassStartRaw` float DEFAULT NULL, + `MassStart` float DEFAULT NULL, + `MassEndRaw` float DEFAULT NULL, + `MassEnd` float DEFAULT NULL, + `MassDiff` float DEFAULT NULL, + `DensityIn` float DEFAULT NULL, + `DensityOut` float DEFAULT NULL, + `DensityDiv` float DEFAULT NULL, + `FlowMass` float DEFAULT NULL, + `FlowVolume` float DEFAULT NULL, + `VolumeCTV` float DEFAULT NULL, + `VolumeMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `ErrorMaster` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `ConstMaster` float DEFAULT NULL, + `TimeDivStart0` float DEFAULT NULL, + `TimeDivStart1` float DEFAULT NULL, + `TimeDivStart2` float DEFAULT NULL, + `TimeDivStart3` float DEFAULT NULL, + `TimeDivStart4` float DEFAULT NULL, + `TimeDivStart5` float DEFAULT NULL, + `TimeDivEnd0` float DEFAULT NULL, + `TimeDivEnd1` float DEFAULT NULL, + `TimeDivEnd2` float DEFAULT NULL, + `TimeDivEnd3` float DEFAULT NULL, + `TimeDivEnd4` float DEFAULT NULL, + `TimeDivEnd5` float DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=117 ; + +-- +-- Daten für Tabelle `testresult` +-- + +INSERT INTO `testresult` (`Id`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`, `Test_id`) VALUES +(1, '2014-01-21 17:41:57', '2014-01-21 17:42:54', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1818, 17.198, 17.17, 17.1656, 17.183, 17.155, 17.2016, 17.227, 17.181, 0.05, 0.05, 201.15, 201.15, 201.1, 1000.35, 1000.35, 1000.34, 15837.4, 15839.2, 201.237, 201.122, 45.712, -0.0570204, 72404, 0.00277936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(2, '2014-01-21 17:43:11', '2014-01-21 17:45:07', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1555, 17.162, 17.152, 17.1364, 17.144, 17.132, 17.5829, 17.91, 17.487, 0, 0, 60.133, 60.133, 60.133, 1000.35, 1000.35, 1000.27, 2062.1, 2062.55, 60.1737, 60.1463, 104.98, -0.0455428, 144351, 0.000416857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(3, '2014-01-21 17:49:21', '2014-01-21 17:50:18', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2002, 17.222, 17.183, 17.182, 17.199, 17.168, 17.2144, 17.235, 17.194, 0, 0, 201.133, 201.133, 201.133, 1000.34, 1000.35, 1000.34, 15842.5, 15842, 201.271, 201.128, 45.705, -0.071127, 72406, 0.00277976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(4, '2014-01-21 17:50:31', '2014-01-21 17:52:28', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1553, 17.168, 17.147, 17.1358, 17.151, 17.128, 17.5125, 17.846, 17.436, 3.26133, 3.26133, 63.514, 63.514, 60.2527, 1000.35, 1000.35, 1000.29, 2067.4, 2063.75, 60.2934, 60.1463, 104.919, -0.244041, 144351, 0.000417686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(5, '2014-01-21 17:54:04', '2014-01-21 17:55:01', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1507, 17.157, 17.146, 17.1317, 17.139, 17.127, 17.1593, 17.17, 17.147, 0, 0, 201.15, 201.15, 201.15, 1000.35, 1000.35, 1000.35, 15843.1, 15840.9, 201.286, 201.122, 45.707, -0.0812647, 72404, 0.00278004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(6, '2014-01-21 17:55:14', '2014-01-21 17:57:12', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1391, 17.141, 17.136, 17.1179, 17.121, 17.115, 17.4528, 17.727, 17.403, 3.363, 3.363, 63.6217, 63.6217, 60.2587, 1000.35, 1000.36, 1000.3, 2067.23, 2063.39, 60.2992, 60.1467, 104.938, -0.252975, 144352, 0.000417723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(7, '2014-01-22 09:13:46', '2014-01-22 09:14:43', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.8708, 19.804, 18.321, 19.4739, 20.842, 18.646, 20.0805, 21.682, 18.94, 0, 0, 201.15, 201.15, 201.15, 1000.03, 999.913, 999.789, 15854.9, 15852.9, 201.375, 201.125, 45.673, -0.123957, 72405, 0.00278123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(8, '2014-01-22 09:30:27', '2014-01-22 09:31:24', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.7432, 17.782, 17.721, 17.7499, 17.793, 17.725, 17.8648, 17.989, 17.775, 0, 0, 201.15, 201.15, 201.15, 1000.25, 1000.24, 1000.22, 15803.3, 15801.1, 201.308, 201.122, 45.822, -0.0923222, 72404, 0.00278034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(9, '2014-01-22 09:44:48', '2014-01-22 09:45:45', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2819, 17.314, 17.248, 17.2901, 17.331, 17.254, 17.3612, 17.457, 17.291, 0, 0, 201.1, 201.1, 201.1, 1000.33, 1000.33, 1000.31, 15753.3, 15754.2, 201.241, 201.111, 45.956, -0.0647607, 72400, 0.00277958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(10, '2014-01-22 09:54:30', '2014-01-22 09:55:27', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1931, 17.237, 17.156, 17.2, 17.254, 17.161, 17.2767, 17.379, 17.212, 0, 0, 201.05, 201.05, 201.05, 1000.34, 1000.34, 1000.33, 15738.5, 15743.9, 201.188, 201.119, 45.988, -0.0341599, 72403, 0.00277873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(11, '2014-01-22 10:11:13', '2014-01-22 10:12:09', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1765, 17.23, 17.137, 17.1807, 17.234, 17.139, 17.2987, 17.466, 17.189, 0, 0, 201.2, 201.2, 201.2, 1000.35, 1000.35, 1000.33, 15801.4, 15795.3, 201.338, 201.122, 45.839, -0.106966, 72404, 0.00278075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(12, '2014-01-22 10:12:23', '2014-01-22 10:14:13', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.102, 17.107, 17.104, 17.1125, 17.109, 17.125, 17.6444, 18.254, 17.504, 0, 0, 48.118, 48.118, 48.118, 1000.36, 1000.36, 1000.26, 1741.48, 2177.09, 48.1503, 60.1542, 99.47, 24.9299, 144370, 0.00033352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(13, '2014-01-22 10:24:14', '2014-01-22 10:25:11', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1366, 17.172, 17.106, 17.1396, 17.197, 17.107, 17.2267, 17.342, 17.155, 0, 0, 201.1, 201.1, 201.1, 1000.35, 1000.35, 1000.34, 15795.3, 15796.8, 201.236, 201.119, 45.834, -0.0579684, 72403, 0.00277939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(14, '2014-01-22 10:25:25', '2014-01-22 10:27:16', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.0878, 17.087, 17.089, 17.0902, 17.084, 17.103, 17.5711, 18.084, 17.455, 0, 0, 51.2683, 51.2683, 51.2683, 1000.36, 1000.36, 1000.28, 1852.09, 2173.09, 51.3026, 60.1542, 99.653, 17.2537, 144370, 0.000355355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(15, '2014-01-22 10:31:24', '2014-01-22 10:32:21', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1506, 17.152, 17.161, 17.1276, 17.132, 17.136, 17.1659, 17.207, 17.152, 0, 0, 201.2, 201.2, 201.2, 1000.35, 1000.36, 1000.35, 15801.7, 15795.4, 201.336, 201.119, 45.838, -0.107422, 72403, 0.00278077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(16, '2014-01-22 10:32:35', '2014-01-22 10:34:26', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1924, 17.174, 17.209, 17.1736, 17.15, 17.195, 17.5562, 17.921, 17.499, 0, 0, 51.4273, 51.4273, 51.4273, 1000.34, 1000.35, 1000.28, 1857.16, 2172.32, 51.4624, 60.1546, 99.689, 16.8903, 144371, 0.00035646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(17, '2014-01-22 10:40:35', '2014-01-22 10:41:32', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2396, 17.245, 17.237, 17.2284, 17.238, 17.222, 17.2562, 17.276, 17.242, 0, 0, 201.2, 201.2, 201.2, 1000.34, 1000.34, 1000.33, 15788.6, 15782.3, 201.339, 201.119, 45.876, -0.109186, 72403, 0.00278081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(18, '2014-01-22 10:41:45', '2014-01-22 10:42:42', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2369, 17.24, 17.233, 17.2221, 17.223, 17.22, 17.239, 17.24, 17.24, 0, 0, 201.15, 201.15, 201.15, 1000.34, 1000.34, 1000.34, 15795.7, 15793.3, 201.289, 201.119, 45.844, -0.0842349, 72403, 0.00278012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(19, '2014-01-22 10:42:55', '2014-01-22 10:43:52', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2012, 17.216, 17.181, 17.1943, 17.21, 17.176, 17.2148, 17.228, 17.202, 0, 0, 201.117, 201.117, 201.117, 1000.34, 1000.34, 1000.34, 15804.2, 15804.6, 201.255, 201.122, 45.812, -0.0658179, 72404, 0.00277961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(20, '2014-01-22 10:44:05', '2014-01-22 10:45:02', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1431, 17.16, 17.128, 17.1348, 17.153, 17.118, 17.1586, 17.178, 17.141, 0.0166667, 0.0166667, 201.2, 201.2, 201.183, 1000.35, 1000.35, 1000.35, 15796.3, 15791.3, 201.319, 201.119, 45.85, -0.0992674, 72403, 0.00278054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(21, '2014-01-22 10:45:15', '2014-01-22 10:46:12', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1021, 17.114, 17.094, 17.0894, 17.101, 17.079, 17.1112, 17.123, 17.101, 0, 0, 201.2, 201.2, 201.2, 1000.36, 1000.36, 1000.36, 15797.6, 15791.1, 201.334, 201.117, 45.85, -0.108127, 72402, 0.00278078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(22, '2014-01-22 13:30:40', '2014-01-22 13:31:36', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2618, 17.308, 17.226, 17.3, 17.394, 17.247, 17.6104, 17.992, 17.382, 0, 0, 201.133, 201.133, 201.133, 998.731, 998.724, 998.669, 15795.5, 15794.4, 201.598, 201.119, 45.841, -0.237233, 72403, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(23, '2014-01-22 13:31:49', '2014-01-22 13:32:45', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1934, 17.202, 17.186, 17.1978, 17.216, 17.184, 17.2435, 17.281, 17.217, 0, 0, 201.2, 201.2, 201.2, 998.743, 998.742, 998.734, 15792.8, 15786.5, 201.661, 201.119, 45.864, -0.268477, 72403, 0.00278526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(24, '2014-01-22 13:32:58', '2014-01-22 13:33:54', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1658, 17.173, 17.158, 17.1658, 17.176, 17.157, 17.1913, 17.206, 17.18, 0, 0, 201.15, 201.15, 201.15, 998.748, 998.748, 998.743, 15796.4, 15794, 201.61, 201.119, 45.842, -0.243115, 72403, 0.00278455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(25, '2014-01-22 13:34:07', '2014-01-22 13:35:04', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1447, 17.15, 17.139, 17.1406, 17.147, 17.136, 17.1617, 17.17, 17.155, 0, 0, 201.233, 201.233, 201.233, 998.752, 998.752, 998.749, 15801.3, 15792.5, 201.692, 201.122, 45.847, -0.282612, 72404, 0.00278565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(26, '2014-01-22 13:35:17', '2014-01-22 13:36:14', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1352, 17.136, 17.137, 17.1284, 17.13, 17.128, 17.1452, 17.147, 17.144, 0, 0, 201.15, 201.15, 201.15, 998.753, 998.754, 998.752, 15798.2, 15796, 201.608, 201.122, 45.837, -0.241088, 72404, 0.00278449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(27, '2014-01-22 13:36:30', '2014-01-22 13:38:23', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1575, 17.144, 17.166, 17.1557, 17.132, 17.176, 17.8218, 18.699, 17.611, 0, 0, 60.2617, 60.2617, 60.2617, 998.749, 998.75, 998.63, 2172.88, 2168.98, 60.3993, 60.1538, 99.841, -0.406466, 144369, 0.000418367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(28, '2014-01-22 13:38:37', '2014-01-22 13:40:28', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1742, 17.172, 17.178, 17.1969, 17.185, 17.207, 17.5216, 17.568, 17.487, 0, 0, 60.2737, 60.2737, 60.2737, 998.746, 998.742, 998.685, 2172.65, 2168.35, 60.4117, 60.1542, 99.871, -0.426323, 144370, 0.000418451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(29, '2014-01-22 13:40:41', '2014-01-22 13:44:13', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1814, 17.18, 17.179, 17.2121, 17.208, 17.215, 17.4733, 17.479, 17.469, 0, 0, -119.212, -119.212, -119.212, 998.745, 998.74, 998.693, -4924.63, 2169.62, -119.485, 52.5204, 87.146, 0.1, 126049, -0.000947925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16), +(30, '2014-01-22 16:02:00', '2014-01-22 16:03:15', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.4985, 17.532, 17.456, 17.7711, 17.797, 17.76, 18.1239, 18.126, 18.063, 0.7, 0.7, 20.75, 20.75, 20.05, 998.689, 998.64, 998.575, 1126.93, 1128.49, 20.098, 20.0778, 64.05, -0.100578, 7228, 0.00278057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(31, '2014-01-22 16:03:26', '2014-01-22 16:04:41', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.4188, 17.423, 17.399, 17.7271, 17.753, 17.701, 17.9281, 18, 17.874, 20.8, 20.8, 40.8667, 40.8667, 20.0667, 998.703, 998.648, 998.611, 1124.43, 1125.05, 20.1145, 20.0778, 64.246, -0.182746, 7228, 0.00278286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(32, '2014-01-22 16:04:52', '2014-01-22 16:06:07', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3671, 17.385, 17.358, 17.6452, 17.667, 17.616, 17.8033, 17.841, 17.767, 40.9, 40.9, 61, 61, 20.1, 998.712, 998.662, 998.634, 1124.55, 1123.3, 20.1476, 20.0778, 64.346, -0.34679, 7228, 0.00278744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(33, '2014-01-22 16:06:18', '2014-01-22 16:07:33', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3574, 17.358, 17.353, 17.5951, 17.61, 17.599, 17.7199, 17.748, 17.698, 61.05, 61.05, 81.1167, 81.1167, 20.0667, 998.714, 998.672, 998.649, 1123.2, 1123.83, 20.1141, 20.0778, 64.316, -0.180379, 7228, 0.0027828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(34, '2014-01-22 16:07:44', '2014-01-22 16:08:58', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3483, 17.349, 17.343, 17.5803, 17.599, 17.556, 17.6685, 17.682, 17.657, 81.15, 81.15, 101.25, 101.25, 20.1, 998.716, 998.674, 998.658, 1124.86, 1123.62, 20.1474, 20.0778, 64.328, -0.345629, 7228, 0.00278741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21), +(35, '2014-01-22 16:09:21', '2014-01-22 16:10:43', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3572, 17.356, 17.353, 17.5227, 17.544, 17.525, 17.6173, 17.646, 17.583, 101.25, 101.25, 141.45, 141.45, 40.2, 998.714, 998.685, 998.667, 2037.88, 2035.06, 40.2944, 40.1444, 71.015, -0.372169, 14452, 0.00278815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(36, '2014-01-22 16:10:54', '2014-01-22 16:12:16', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3371, 17.346, 17.333, 17.4815, 17.521, 17.451, 17.5445, 17.568, 17.519, 141.45, 141.45, 181.617, 181.617, 40.1667, 998.718, 998.692, 998.681, 2036.42, 2035.15, 40.2607, 40.1417, 71.007, -0.295629, 14451, 0.00278601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(37, '2014-01-22 16:12:27', '2014-01-22 16:13:49', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3189, 17.323, 17.319, 17.4144, 17.429, 17.407, 17.4837, 17.5, 17.469, 181.65, 181.65, 221.85, 221.85, 40.2, 998.721, 998.704, 998.692, 2037.62, 2034.81, 40.2937, 40.1444, 71.024, -0.370349, 14452, 0.0027881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(38, '2014-01-22 16:14:00', '2014-01-22 16:15:22', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.317, 17.321, 17.313, 17.3955, 17.409, 17.39, 17.4482, 17.459, 17.439, 221.85, 221.85, 262.05, 262.05, 40.2, 998.721, 998.707, 998.698, 2037.71, 2034.75, 40.2935, 40.1417, 71.021, -0.376722, 14451, 0.00278828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(39, '2014-01-22 16:15:33', '2014-01-22 16:16:55', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3006, 17.309, 17.299, 17.3899, 17.4, 17.385, 17.4324, 17.436, 17.426, 262.1, 262.1, 302.267, 302.267, 40.1667, 998.724, 998.708, 998.701, 2036.25, 2034.98, 40.26, 40.1417, 71.013, -0.293995, 14451, 0.00278597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22), +(40, '2014-01-22 16:17:15', '2014-01-22 16:18:35', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.3041, 17.311, 17.3, 17.3716, 17.393, 17.357, 17.415, 17.427, 17.401, 302.3, 302.3, 362.55, 362.55, 60.25, 998.724, 998.712, 998.704, 3116.96, 3115.38, 60.3898, 60.2194, 69.587, -0.282152, 21679, 0.00278564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(41, '2014-01-22 16:18:46', '2014-01-22 16:20:06', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.292, 17.295, 17.291, 17.3415, 17.356, 17.331, 17.3764, 17.387, 17.365, 362.6, 362.6, 422.85, 422.85, 60.25, 998.726, 998.717, 998.711, 3117.99, 3116.41, 60.3895, 60.2194, 69.564, -0.281667, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(42, '2014-01-22 16:20:17', '2014-01-22 16:21:37', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2851, 17.293, 17.278, 17.3302, 17.338, 17.328, 17.3581, 17.362, 17.359, 422.9, 422.9, 483.15, 483.15, 60.25, 998.727, 998.719, 998.714, 3118.71, 3117.13, 60.3894, 60.2194, 69.548, -0.281465, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(43, '2014-01-22 16:21:48', '2014-01-22 16:23:08', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2673, 17.274, 17.259, 17.3324, 17.329, 17.316, 17.3468, 17.355, 17.342, 483.2, 483.2, 543.45, 543.45, 60.25, 998.73, 998.719, 998.716, 3119.78, 3118.2, 60.3894, 60.2194, 69.524, -0.281453, 21679, 0.00278562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(44, '2014-01-22 16:23:19', '2014-01-22 16:24:39', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2602, 17.263, 17.254, 17.3006, 17.31, 17.297, 17.3294, 17.338, 17.324, 543.45, 543.45, 603.75, 603.75, 60.3, 998.731, 998.724, 998.719, 3121.43, 3117.26, 60.4392, 60.2194, 69.545, -0.363607, 21679, 0.00278791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23), +(45, '2014-01-22 16:25:00', '2014-01-22 16:26:20', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.248, 17.253, 17.242, 17.288, 17.295, 17.275, 17.3215, 17.324, 17.313, 603.75, 603.75, 684.117, 684.117, 80.3667, 998.733, 998.726, 998.72, 4179.36, 4175.74, 80.5521, 80.2972, 69.226, -0.316373, 28907, 0.00278659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(46, '2014-01-22 16:26:31', '2014-01-22 16:27:51', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2481, 17.242, 17.243, 17.2722, 17.271, 17.275, 17.3024, 17.31, 17.3, 684.15, 684.15, 764.5, 764.5, 80.3499, 998.733, 998.729, 998.724, 4179.39, 4176.5, 80.535, 80.2944, 69.211, -0.298715, 28906, 0.0027861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(47, '2014-01-22 16:28:02', '2014-01-22 16:29:22', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2303, 17.236, 17.227, 17.2607, 17.271, 17.254, 17.2948, 17.3, 17.286, 764.55, 764.55, 844.9, 844.9, 80.3501, 998.737, 998.731, 998.725, 4175.18, 4172.28, 80.535, 80.2944, 69.281, -0.298743, 28906, 0.0027861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(48, '2014-01-22 16:29:33', '2014-01-22 16:30:53', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2214, 17.225, 17.218, 17.2451, 17.25, 17.238, 17.2773, 17.283, 17.273, 844.9, 844.9, 925.25, 925.25, 80.3499, 998.738, 998.734, 998.728, 4181.26, 4178.38, 80.5346, 80.2944, 69.18, -0.298233, 28906, 0.00278609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(49, '2014-01-22 16:31:04', '2014-01-22 16:32:24', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2209, 17.22, 17.221, 17.2358, 17.239, 17.236, 17.2663, 17.268, 17.263, 925.25, 925.25, 1005.62, 1005.62, 80.3667, 998.738, 998.736, 998.73, 4181.59, 4177.83, 80.5513, 80.2944, 69.189, -0.318895, 28906, 0.00278666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24), +(50, '2014-01-22 16:32:44', '2014-01-22 16:34:07', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2195, 17.226, 17.212, 17.2277, 17.23, 17.23, 17.2623, 17.265, 17.259, 1005.65, 1005.65, 1126.07, 1126.07, 120.417, 998.738, 998.737, 998.731, 6007.98, 6008.4, 120.693, 120.425, 72.154, -0.222163, 43353, 0.00278396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(51, '2014-01-22 16:34:18', '2014-01-22 16:35:40', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.2095, 17.218, 17.203, 17.22, 17.22, 17.215, 17.2511, 17.255, 17.247, 1126.1, 1126.1, 1246.53, 1246.53, 120.433, 998.74, 998.738, 998.733, 6089.5, 6089.36, 120.71, 120.431, 71.198, -0.231234, 43355, 0.00278422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(52, '2014-01-22 16:35:51', '2014-01-22 16:37:13', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1967, 17.199, 17.193, 17.2102, 17.214, 17.204, 17.2379, 17.245, 17.234, 1246.55, 1246.55, 1366.97, 1366.97, 120.417, 998.742, 998.74, 998.735, 6087.88, 6088.59, 120.693, 120.431, 71.207, -0.217208, 43355, 0.00278382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(53, '2014-01-22 16:37:24', '2014-01-22 16:38:46', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1888, 17.19, 17.189, 17.2037, 17.201, 17.192, 17.2271, 17.228, 17.224, 1367, 1367, 1487.45, 1487.45, 120.45, 998.744, 998.741, 998.737, 6088.02, 6087.05, 120.726, 120.431, 71.225, -0.2446, 43355, 0.00278459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(54, '2014-01-22 16:38:58', '2014-01-22 16:40:19', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.1873, 17.188, 17.188, 17.19, 17.192, 17.19, 17.2222, 17.224, 17.219, 1487.5, 1487.5, 1607.9, 1607.9, 120.4, 998.744, 998.744, 998.738, 6064.73, 6066.13, 120.676, 120.428, 71.469, -0.205397, 43354, 0.0027835, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25), +(55, '2014-01-22 17:02:12', '2014-01-22 17:03:08', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.0874, 17.097, 17.081, 17.0734, 17.085, 17.065, 17.1019, 17.109, 17.095, 15.1, 15.1, 216.233, 216.233, 201.133, 998.762, 998.764, 998.759, 16247, 16245.2, 201.59, 201.111, 44.567, -0.237371, 7240, 0.0278439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26), +(56, '2014-01-22 17:57:43', '2014-01-22 17:58:40', 1, 21.81, 948.212, 29.9233, 0, 0, 0, 0, 0, 0, 17.1047, 17.122, 17.09, 17.0985, 17.122, 17.083, 17.1413, 17.185, 17.114, -17.05, -17.05, 184.1, 184.1, 201.15, 998.759, 998.76, 998.752, 15815.1, 15812.9, 201.607, 201.122, 45.788, -0.240582, 72404, 0.00278448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(57, '2014-01-23 08:44:35', '2014-01-23 08:45:32', 1, 23.45, 950.68, 26.0282, 0, 0, 0, 0, 0, 0, 18.453, 19.041, 18.037, 19.1917, 20.404, 18.331, 20.0359, 21.914, 18.711, 0, 0, 189.483, 189.483, 189.483, 998.513, 998.37, 998.199, 14954, 15872.7, 189.988, 201.125, 45.616, 5.86181, 72405, 0.00262397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(58, '2014-01-23 08:50:09', '2014-01-23 08:51:06', 2, 23.5362, 950.676, 26.7004, 0, 0, 0, 0, 0, 0, 17.6413, 17.64, 17.65, 17.6502, 17.655, 17.655, 17.6828, 17.695, 17.677, 0, 0, 186.75, 186.75, 186.75, 998.663, 998.662, 998.656, 14745.4, 15880.6, 187.193, 201.128, 45.594, 7.44413, 72406, 0.00258532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(59, '2014-01-23 08:55:42', '2014-01-23 08:56:38', 3, 23.62, 950.554, 26.6455, 0, 0, 0, 0, 0, 0, 17.416, 17.47, 17.361, 17.4474, 17.493, 17.395, 17.4955, 17.54, 17.442, 0, 0, 186.75, 186.75, 186.75, 998.704, 998.698, 998.689, 14742.8, 15877.8, 187.186, 201.128, 45.602, 7.44806, 72406, 0.00258523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(60, '2014-01-23 08:56:55', '2014-01-23 08:57:51', 4, 23.623, 950.795, 26.392, 0, 0, 0, 0, 0, 0, 17.2409, 17.284, 17.2, 17.2702, 17.312, 17.222, 17.3208, 17.373, 17.266, -22.55, -22.55, 178.6, 178.6, 201.15, 998.735, 998.73, 998.721, 15883.7, 15882, 201.613, 201.128, 45.59, -0.24084, 72406, 0.00278448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(61, '2014-01-23 09:31:37', '2014-01-23 09:35:35', 1, 23.5322, 951.066, 27.0611, 0, 0, 0, 0, 0, 0, 17.1355, 17.562, 17.05, 17.1693, 17.66, 17.047, 17.2724, 17.93, 17.091, 0, 0, 989.017, 989.017, 989.017, 998.753, 998.747, 998.729, 15679.7, 15871.7, 991.277, 1001.12, 227.074, 0.993456, 360405, 0.00275045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(62, '2014-01-23 09:49:45', '2014-01-23 09:53:43', 1, 23.4289, 951.307, 27.749, 0, 0, 0, 0, 0, 0, 17.0658, 17.192, 17.039, 17.0687, 17.222, 17.031, 17.106, 17.246, 17.054, -0.3, -0.3, 1000.65, 1000.65, 1000.95, 998.765, 998.765, 998.758, 15872.4, 15875.2, 1003.22, 1001.13, 227.025, -0.208551, 360406, 0.00278358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(63, '2014-01-23 09:58:22', '2014-01-23 10:02:20', 1, 23.3655, 951.275, 27.6753, 0, 0, 0, 0, 0, 0, 17.0131, 17.017, 17.007, 17.0014, 17.006, 16.996, 17.0201, 17.025, 17.01, 34.1, 34.1, 1035.08, 1035.08, 1000.98, 998.775, 998.777, 998.773, 15872.3, 15874.6, 1003.24, 1001.12, 227.033, -0.210986, 360405, 0.00278365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(64, '2014-01-23 10:04:51', '2014-01-23 10:08:49', 2, 23.2715, 951.288, 27.3465, 0, 0, 0, 0, 0, 0, 16.996, 16.998, 16.995, 16.9819, 16.985, 16.981, 17.0011, 17.004, 17.002, 32.9, 32.9, 1034.05, 1034.05, 1001.15, 998.778, 998.78, 998.777, 15874.2, 15873.8, 1003.41, 1001.12, 227.044, -0.227527, 360404, 0.00278411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(65, '2014-01-23 10:11:24', '2014-01-23 10:15:22', 3, 23.1503, 951.305, 27.0103, 0, 0, 0, 0, 0, 0, 16.9938, 16.995, 16.993, 16.9781, 16.978, 16.98, 16.9963, 16.996, 16.996, 33.15, 33.15, 1034.13, 1034.13, 1000.98, 998.778, 998.781, 998.778, 15872.1, 15874.3, 1003.24, 1001.12, 227.036, -0.210841, 360404, 0.00278365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(66, '2014-01-23 10:17:57', '2014-01-23 10:21:55', 4, 23.0528, 951.479, 27.0146, 0, 0, 0, 0, 0, 0, 16.9936, 16.993, 16.994, 16.9767, 16.977, 16.977, 16.9958, 16.998, 16.997, 32.85, 32.85, 1033.85, 1033.85, 1001, 998.778, 998.781, 998.778, 15873.3, 15875.3, 1003.25, 1001.12, 227.023, -0.212212, 360405, 0.00278369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(67, '2014-01-23 10:32:46', '2014-01-23 10:36:44', 1, 22.836, 951.592, 27.534, 0, 0, 0, 0, 0, 0, 16.999, 17, 16.999, 16.9772, 16.978, 16.977, 16.9958, 16.998, 16.994, 33.3, 33.3, 1034.27, 1034.27, 1000.97, 998.777, 998.781, 998.778, 15872.1, 15874.6, 1003.22, 1001.12, 227.032, -0.20891, 360405, 0.00278359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(68, '2014-01-23 10:39:14', '2014-01-23 10:43:12', 2, 22.7173, 951.711, 27.5574, 0, 0, 0, 0, 0, 0, 17.0003, 16.999, 17.001, 16.9784, 16.977, 16.979, 16.9973, 16.996, 16.998, 32.95, 32.95, 1033.9, 1033.9, 1000.95, 998.777, 998.781, 998.777, 15871.2, 15874, 1003.2, 1001.12, 227.041, -0.207258, 360405, 0.00278355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(69, '2014-01-23 10:45:43', '2014-01-23 10:49:41', 3, 22.5937, 951.647, 27.4176, 0, 0, 0, 0, 0, 0, 17.0002, 17, 16.999, 16.9784, 16.978, 16.979, 16.9972, 16.997, 16.996, 33.05, 33.05, 1034.05, 1034.05, 1001, 998.777, 998.781, 998.777, 15869.6, 15871.6, 1003.25, 1001.12, 227.076, -0.212249, 360405, 0.00278369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(70, '2014-01-23 10:52:16', '2014-01-23 10:56:15', 4, 22.526, 951.594, 27.5806, 0, 0, 0, 0, 0, 0, 17.0014, 17.002, 17.003, 16.9788, 16.978, 16.979, 16.9989, 16.997, 16.998, 33, 33, 1033.98, 1033.98, 1000.98, 998.777, 998.781, 998.777, 15871.1, 15873.4, 1003.24, 1001.13, 227.051, -0.210299, 360406, 0.00278363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(71, '2014-01-23 10:58:49', '2014-01-23 11:02:47', 5, 22.4358, 951.725, 27.4002, 0, 0, 0, 0, 0, 0, 17.0043, 17.003, 17.004, 16.981, 16.979, 16.982, 16.9999, 16.997, 17, 33.15, 33.15, 1034.1, 1034.1, 1000.95, 998.776, 998.78, 998.777, 15873.3, 15876.1, 1003.2, 1001.13, 227.011, -0.207021, 360406, 0.00278354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(72, '2014-01-23 11:03:27', '2014-01-23 11:09:25', 1, 22.381, 951.688, 27.6094, 0, 0, 0, 0, 0, 0, 17.0359, 17.014, 17.041, 17.0425, 16.99, 17.078, 17.8152, 18.731, 17.476, -0.0136667, -0.0136667, 100.162, 100.162, 100.175, 998.771, 998.769, 998.632, 1035.88, 1034.83, 100.402, 100.073, 348.14, -0.327396, 240176, 0.000418035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(73, '2014-01-23 11:10:11', '2014-01-23 11:16:10', 2, 22.3575, 951.648, 27.5311, 0, 0, 0, 0, 0, 0, 17.0517, 17.046, 17.055, 17.1016, 17.084, 17.111, 17.4316, 17.448, 17.426, 5.42533, 5.42533, 105.64, 105.64, 100.215, 998.768, 998.759, 998.701, 1036.77, 1035.31, 100.443, 100.073, 347.978, -0.367552, 240176, 0.000418204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(74, '2014-01-23 11:16:58', '2014-01-23 11:22:57', 3, 22.3472, 951.517, 27.2686, 0, 0, 0, 0, 0, 0, 17.0592, 17.054, 17.062, 17.125, 17.114, 17.13, 17.4365, 17.429, 17.444, 5.60667, 5.60667, 105.809, 105.809, 100.203, 998.767, 998.755, 998.7, 1036.63, 1035.29, 100.431, 100.073, 347.982, -0.356025, 240176, 0.000418155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(75, '2014-01-23 11:23:45', '2014-01-23 11:29:44', 4, 22.3489, 951.527, 27.0005, 0, 0, 0, 0, 0, 0, 17.0613, 17.058, 17.063, 17.1369, 17.133, 17.135, 17.4475, 17.442, 17.454, 5.24433, 5.24433, 105.465, 105.465, 100.221, 998.766, 998.753, 998.698, 1036.52, 1034.99, 100.449, 100.073, 348.083, -0.374469, 240176, 0.000418233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(76, '2014-01-23 11:30:31', '2014-01-23 11:36:30', 5, 22.3677, 951.481, 26.8638, 0, 0, 0, 0, 0, 0, 17.0642, 17.061, 17.069, 17.142, 17.133, 17.15, 17.4536, 17.454, 17.452, 5.583, 5.583, 105.801, 105.801, 100.218, 998.766, 998.752, 998.697, 1036.55, 1035.06, 100.446, 100.073, 348.062, -0.371238, 240176, 0.000418219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(77, '2014-01-23 14:36:43', '2014-01-23 14:37:40', 1, 22.1304, 950.107, 27.0682, 0, 0, 0, 0, 0, 0, 17.1687, 17.174, 17.16, 17.167, 17.175, 17.159, 17.2108, 17.23, 17.196, 33.1, 33.1, 234.25, 234.25, 201.15, 998.747, 998.748, 998.74, 15876.4, 15874.5, 201.61, 201.125, 45.611, -0.240383, 72405, 0.00278447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(78, '2014-01-23 14:40:03', '2014-01-23 14:44:01', 1, 22.1172, 950.109, 27.9356, 0, 0, 0, 0, 0, 0, 17.1405, 17.13, 17.147, 17.1268, 17.119, 17.13, 17.1458, 17.145, 17.148, 33.5, 33.5, 1034.45, 1034.45, 1000.95, 998.752, 998.755, 998.751, 15870.6, 15873.4, 1003.23, 1001.12, 227.05, -0.209839, 360405, 0.00278362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(79, '2014-01-23 14:46:33', '2014-01-23 14:50:32', 2, 22.0557, 950.031, 27.9047, 0, 0, 0, 0, 0, 0, 17.0877, 17.134, 17.062, 17.0744, 17.123, 17.045, 17.0975, 17.145, 17.066, 32.7, 32.7, 1033.65, 1033.65, 1000.95, 998.762, 998.764, 998.76, 15870.6, 15873.4, 1003.22, 1001.12, 227.05, -0.208928, 360405, 0.00278359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(80, '2014-01-23 14:53:06', '2014-01-23 14:57:04', 3, 22.0006, 950.123, 27.87, 0, 0, 0, 0, 0, 0, 17.0567, 17.057, 17.05, 17.0369, 17.036, 17.031, 17.0565, 17.055, 17.051, 33.3, 33.3, 1034.4, 1034.4, 1001.1, 998.767, 998.77, 998.767, 15872.8, 15873.2, 1003.36, 1001.12, 227.053, -0.22323, 360405, 0.00278399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(81, '2014-01-23 14:59:35', '2014-01-23 15:03:33', 4, 21.9671, 950.105, 27.9426, 0, 0, 0, 0, 0, 0, 17.0501, 17.049, 17.051, 17.0276, 17.027, 17.029, 17.0484, 17.049, 17.048, 33, 33, 1033.9, 1033.9, 1000.9, 998.768, 998.772, 998.768, 15873.1, 15876.6, 1003.16, 1001.12, 227.003, -0.203403, 360404, 0.00278344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(82, '2014-01-23 15:06:08', '2014-01-23 15:10:06', 5, 21.9451, 950.152, 27.9535, 0, 0, 0, 0, 0, 0, 17.054, 17.051, 17.056, 17.0309, 17.029, 17.033, 17.0513, 17.05, 17.052, 32.9, 32.9, 1033.95, 1033.95, 1001.05, 998.768, 998.771, 998.768, 15872.7, 15873.9, 1003.31, 1001.12, 227.042, -0.218131, 360405, 0.00278385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(83, '2014-01-23 15:10:28', '2014-01-23 15:16:28', 1, 21.9423, 950.104, 28.1947, 0, 0, 0, 0, 0, 0, 17.0873, 17.059, 17.095, 17.0896, 17.038, 17.125, 17.8578, 19.567, 17.514, 0.236667, 0.236667, 100.459, 100.459, 100.223, 998.762, 998.761, 998.624, 1032.16, 1030.62, 100.45, 100.073, 349.559, -0.375704, 240175, 0.000418238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(84, '2014-01-23 15:17:15', '2014-01-23 15:23:15', 2, 21.9366, 950.112, 28.259, 0, 0, 0, 0, 0, 0, 17.1022, 17.095, 17.109, 17.1503, 17.13, 17.167, 17.4923, 17.505, 17.492, 5.38167, 5.38167, 105.599, 105.599, 100.217, 998.759, 998.751, 998.69, 1032.51, 1031.03, 100.446, 100.073, 349.421, -0.371126, 240175, 0.000418219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(85, '2014-01-23 15:24:03', '2014-01-23 15:30:04', 3, 21.9112, 950.105, 28.1581, 0, 0, 0, 0, 0, 0, 17.1102, 17.109, 17.115, 17.176, 17.173, 17.182, 17.4962, 17.494, 17.504, 5.20133, 5.20133, 105.405, 105.405, 100.203, 998.758, 998.746, 998.689, 1032.5, 1031.16, 100.432, 100.073, 349.376, -0.357995, 240175, 0.000418164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(86, '2014-01-23 15:30:52', '2014-01-23 15:36:52', 4, 21.9089, 950.05, 27.8639, 0, 0, 0, 0, 0, 0, 17.1158, 17.116, 17.115, 17.1856, 17.182, 17.212, 17.5053, 17.509, 17.515, 5.57667, 5.57667, 105.799, 105.799, 100.222, 998.757, 998.744, 998.688, 1032.58, 1031.04, 100.451, 100.073, 349.416, -0.376725, 240175, 0.000418242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(87, '2014-01-23 15:37:40', '2014-01-23 15:43:40', 5, 21.9101, 950.054, 27.8539, 0, 0, 0, 0, 0, 0, 17.117, 17.118, 17.121, 17.1896, 17.193, 17.191, 17.5014, 17.507, 17.499, 5.59267, 5.59267, 105.795, 105.795, 100.202, 998.756, 998.744, 998.688, 1032.52, 1031.19, 100.431, 100.073, 349.366, -0.356905, 240175, 0.000418159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28), +(88, '2014-01-23 16:33:16', '2014-01-23 16:37:14', 1, 22.2809, 950.137, 29.0679, 0, 0, 0, 0, 0, 0, 17.1094, 17.109, 17.104, 17.0906, 17.089, 17.087, 17.1091, 17.107, 17.108, 1.15, 1.15, 1.15, 1.15, 0, 998.758, 998.761, 998.758, 0, 15850.1, 0, 1001.12, 227.383, 0.1, 360405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27), +(89, '2014-01-23 16:50:04', '2014-01-23 16:51:00', 1, 22.2748, 950.052, 29.2155, 0, 0, 0, 0, 0, 0, 17.0772, 17.076, 17.077, 17.0559, 17.056, 17.056, 17.0756, 17.077, 17.075, 33.05, 33.05, 234.2, 234.2, 201.15, 998.763, 998.767, 998.764, 15905, 15903.3, 201.606, 201.128, 45.529, -0.237072, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(90, '2014-01-23 16:53:00', '2014-01-23 16:53:57', 2, 22.28, 950.177, 29.1289, 0, 0, 0, 0, 0, 0, 17.077, 17.075, 17.079, 17.054, 17.053, 17.056, 17.0725, 17.073, 17.073, 33.5667, 33.5667, 234.7, 234.7, 201.133, 998.763, 998.767, 998.764, 15911, 15910.6, 201.589, 201.128, 45.508, -0.228773, 72406, 0.00278415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(91, '2014-01-23 16:55:57', '2014-01-23 16:56:54', 3, 22.2762, 950.3, 29.1878, 0, 0, 0, 0, 0, 0, 17.0771, 17.077, 17.078, 17.0544, 17.053, 17.056, 17.072, 17.072, 17.072, 33, 33, 234.2, 234.2, 201.2, 998.763, 998.767, 998.764, 15910.4, 15904.4, 201.656, 201.125, 45.525, -0.263217, 72405, 0.00278511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(92, '2014-01-23 16:58:54', '2014-01-23 16:59:50', 4, 22.2625, 950.295, 29.23, 0, 0, 0, 0, 0, 0, 17.0783, 17.078, 17.077, 17.054, 17.054, 17.054, 17.0734, 17.073, 17.074, 33.45, 33.45, 234.6, 234.6, 201.15, 998.763, 998.768, 998.764, 15904.3, 15902.6, 201.606, 201.128, 45.531, -0.23705, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(93, '2014-01-23 17:01:50', '2014-01-23 17:02:47', 5, 22.25, 950.2, 29.2922, 0, 0, 0, 0, 0, 0, 17.0784, 17.078, 17.079, 17.0549, 17.054, 17.056, 17.0739, 17.073, 17.076, 32.9667, 32.9667, 234.117, 234.117, 201.15, 998.763, 998.767, 998.764, 15909.6, 15907.8, 201.606, 201.128, 45.516, -0.23705, 72406, 0.00278438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(94, '2014-01-23 18:11:56', '2014-01-23 18:12:59', 1, 21.6157, 950.069, 29.512, 0, 0, 0, 0, 0, 0, 17.1888, 17.242, 17.155, 17.1899, 17.236, 17.157, 17.2798, 17.427, 17.206, -0.05, -0.05, 200.9, 200.9, 200.95, 998.744, 998.744, 998.728, 14034.5, 14037.6, 201.41, 200.994, 51.546, -0.206317, 72358, 0.00278352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(95, '2014-01-24 09:49:41', '2014-01-24 09:50:40', 1, 22.6, 948.534, 27.64, 0, 0, 0, 0, 0, 0, 18.5668, 19.343, 18.13, 19.4426, 21.161, 18.427, 20.1827, 21.875, 18.962, 0, 0, 201.05, 201.05, 201.05, 998.491, 998.32, 998.168, 15121.3, 15123.2, 201.596, 201.075, 47.865, -0.258345, 72387, 0.00278497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15), +(96, '2014-01-24 09:54:08', '2014-01-24 09:56:52', 1, 22.5919, 948.819, 29.9135, 0, 0, 0, 0, 0, 0, 17.7907, 17.86, 17.737, 17.8374, 17.969, 17.763, 17.9082, 18.042, 17.815, 302.75, 302.75, 903.683, 903.683, 600.933, 998.636, 998.628, 998.615, 14070.9, 14072.4, 602.379, 600.997, 153.747, -0.229386, 216359, 0.00278416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(97, '2014-01-24 09:57:48', '2014-01-24 10:01:47', 1, 22.5884, 948.599, 30.4115, 0, 0, 0, 0, 0, 0, 17.7214, 17.708, 17.735, 17.7629, 17.732, 17.776, 17.7996, 17.785, 17.816, 903.75, 903.75, 1104.1, 1104.1, 200.35, 998.649, 998.641, 998.634, 3157.6, 3155.59, 200.829, 200.222, 228.42, -0.302252, 72080, 0.0027862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(98, '2014-01-24 10:08:47', '2014-01-24 10:11:21', 1, 22.5246, 948.847, 30.101, 0, 0, 0, 0, 0, 0, 17.6874, 17.777, 17.624, 17.7124, 17.833, 17.631, 17.7955, 17.983, 17.687, 1104.15, 1104.15, 1705.03, 1705.03, 600.883, 998.655, 998.65, 998.635, 15090.3, 15094.9, 602.315, 601.067, 143.349, -0.207279, 216384, 0.00278355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(99, '2014-01-24 10:12:21', '2014-01-24 10:16:20', 1, 22.5002, 948.827, 31.126, 0, 0, 0, 0, 0, 0, 17.5736, 17.588, 17.548, 17.6089, 17.608, 17.593, 17.6488, 17.655, 17.637, 1705.1, 1705.1, 1905.42, 1905.42, 200.317, 998.675, 998.669, 998.662, 3151.86, 3150.38, 200.79, 200.222, 228.798, -0.282879, 72080, 0.00278566, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(100, '2014-01-24 10:17:13', '2014-01-24 10:22:31', 1, 22.4694, 948.939, 31.3745, 0, 0, 0, 0, 0, 0, 17.5237, 17.546, 17.493, 17.6182, 17.601, 17.625, 18.0608, 18.404, 17.923, 5.674, 5.674, 105.906, 105.906, 100.232, 998.684, 998.667, 998.586, 1178.96, 1177.21, 100.469, 100.083, 306.062, -0.383661, 240200, 0.000418271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(101, '2014-01-24 10:24:03', '2014-01-24 10:26:19', 1, 22.4202, 949.037, 30.8028, 0, 0, 0, 0, 0, 0, 17.4585, 17.498, 17.435, 17.5486, 17.6, 17.496, 17.744, 17.816, 17.688, 5.60467, 5.60467, 105.998, 105.998, 100.394, 998.696, 998.68, 998.645, 2888.08, 2882.56, 100.63, 100.202, 125.141, -0.425557, 240484, 0.000418447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(102, '2014-01-24 11:27:34', '2014-01-24 11:30:09', 1, 22.2572, 949.084, 29.9756, 0, 0, 0, 0, 0, 0, 17.3901, 17.615, 17.313, 17.4633, 17.94, 17.316, 17.6353, 18.542, 17.388, 1905.45, 1905.45, 2506.23, 2506.23, 600.784, 998.708, 998.695, 998.664, 15064, 15071.2, 602.188, 601.069, 143.575, -0.185765, 216385, 0.00278295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(103, '2014-01-24 11:33:10', '2014-01-24 11:37:10', 1, 22.2358, 949.059, 30.417, 0, 0, 0, 0, 0, 0, 17.2012, 17.2, 17.197, 17.2137, 17.208, 17.216, 17.244, 17.239, 17.25, 23.4, 23.4, 223.8, 223.8, 200.4, 998.742, 998.74, 998.734, 3146.94, 3144.15, 200.86, 200.222, 229.251, -0.317324, 72080, 0.00278662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(104, '2014-01-24 11:38:48', '2014-01-24 11:44:38', 1, 22.2371, 949.064, 29.9864, 0, 0, 0, 0, 0, 0, 17.2171, 17.207, 17.227, 17.2649, 17.223, 17.296, 17.7839, 18.155, 17.642, 5.552, 5.552, 105.759, 105.759, 100.207, 998.739, 998.73, 998.637, 1065.44, 1064.03, 100.438, 100.075, 338.589, -0.361469, 240180, 0.000418178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(105, '2014-01-24 11:46:13', '2014-01-24 11:48:28', 1, 22.2581, 949.068, 28.5927, 0, 0, 0, 0, 0, 0, 17.2312, 17.252, 17.219, 17.2727, 17.301, 17.246, 17.4753, 17.517, 17.454, 5.552, 5.552, 105.959, 105.959, 100.407, 998.736, 998.729, 998.693, 2907.1, 2901.22, 100.639, 100.204, 124.339, -0.431722, 240490, 0.000418473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(106, '2014-01-24 12:02:16', '2014-01-24 12:04:50', 1, 22.5164, 949.085, 27.5738, 0, 0, 0, 0, 0, 0, 17.2041, 17.274, 17.172, 17.215, 17.334, 17.169, 17.3073, 17.613, 17.213, 223.8, 223.8, 824.8, 824.8, 601, 998.741, 998.739, 998.723, 15076.2, 15078, 602.378, 601.072, 143.511, -0.216843, 216386, 0.00278381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(107, '2014-01-24 12:05:51', '2014-01-24 12:09:51', 1, 22.5944, 949.109, 27.5323, 0, 0, 0, 0, 0, 0, 17.1726, 17.166, 17.171, 17.1775, 17.165, 17.175, 17.2016, 17.196, 17.208, 824.85, 824.85, 1025.23, 1025.23, 200.383, 998.747, 998.746, 998.742, 3141.05, 3138.53, 200.842, 200.222, 229.662, -0.308402, 72080, 0.00278637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(108, '2014-01-24 13:07:48', '2014-01-24 13:10:21', 1, 23.0909, 949.002, 26.2842, 0, 0, 0, 0, 0, 0, 17.2331, 17.429, 17.175, 17.2812, 17.719, 17.182, 17.4027, 18.026, 17.225, 1025.25, 1025.25, 1626.13, 1626.13, 600.883, 998.736, 998.728, 998.706, 15204.5, 15209.4, 602.268, 601.075, 142.272, -0.198164, 216387, 0.00278329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(109, '2014-01-24 13:11:21', '2014-01-24 13:15:19', 1, 23.1303, 948.951, 26.183, 0, 0, 0, 0, 0, 0, 17.1652, 17.161, 17.166, 17.177, 17.161, 17.179, 17.202, 17.195, 17.209, 1626.2, 1626.2, 1826.55, 1826.55, 200.35, 998.748, 998.746, 998.742, 3172.69, 3170.71, 200.809, 200.225, 227.334, -0.290581, 72081, 0.00278587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(110, '2014-01-24 13:16:22', '2014-01-24 13:21:36', 1, 23.1949, 948.915, 26.1312, 0, 0, 0, 0, 0, 0, 17.1793, 17.175, 17.175, 17.2394, 17.196, 17.259, 17.883, 18.531, 17.64, 5.227, 5.227, 105.449, 105.449, 100.222, 998.746, 998.735, 998.619, 1190.55, 1188.91, 100.452, 100.084, 303.052, -0.366476, 240202, 0.000418199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(111, '2014-01-24 13:23:09', '2014-01-24 13:25:25', 1, 23.3193, 948.973, 26.3648, 0, 0, 0, 0, 0, 0, 17.1846, 17.197, 17.179, 17.226, 17.26, 17.202, 17.4636, 17.515, 17.43, 5.561, 5.561, 105.96, 105.96, 100.399, 998.745, 998.737, 998.695, 2916.87, 2911.32, 100.63, 100.208, 123.913, -0.418833, 240500, 0.000418419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32), +(112, '2014-01-24 14:03:10', '2014-01-24 14:05:43', 1, 23.6351, 948.813, 26.7518, 155.811, 155.886, 155.911, 141.568, 141.71, 141.343, 10.5715, 10.6832, 10.5338, 10.621, 10.7674, 10.562, 10.6782, 10.7867, 10.6027, 196.25, 196.25, 796.983, 796.983, 600.733, 999.65, 999.645, 999.639, 15250, 15241.4, 601.566, 600.394, 141.812, -0.194703, 216142, 0.0027832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(113, '2014-01-24 14:55:04', '2014-01-24 14:57:37', 1, 24.3689, 948.904, 28.2572, 155.805, 155.828, 155.811, 141.454, 141.788, 141.235, 10.5344, 10.604, 10.4959, 10.5674, 10.6485, 10.5277, 10.6463, 10.8516, 10.563, 0, 0, 572.65, 572.65, 572.65, 999.653, 999.65, 999.642, 14534, 15238, 573.441, 600.392, 141.843, 4.6999, 216141, 0.00265309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29), +(114, '2014-01-24 14:58:38', '2014-01-24 15:02:36', 1, 24.4131, 948.846, 28.5036, 155.913, 155.893, 155.986, 159.13, 158.947, 159.16, 10.5067, 10.4905, 10.5103, 10.5614, 10.5151, 10.589, 10.5935, 10.5522, 10.6172, 572.7, 572.7, 773, 773, 200.3, 999.656, 999.651, 999.647, 3171.19, 3167.67, 200.576, 200.078, 227.385, -0.248582, 72028, 0.0027847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30), +(115, '2014-01-24 15:03:45', '2014-01-24 15:09:24', 1, 24.4372, 948.986, 28.6013, 155.93, 155.957, 155.975, 157.52, 157.461, 157.645, 10.5299, 10.5266, 10.532, 10.6805, 10.5908, 10.7206, 11.6102, 12.0364, 11.4289, 0.081, 0.081, 100.249, 100.249, 100.168, 999.654, 999.639, 999.543, 1100.24, 1098.97, 100.307, 100.052, 327.749, -0.254171, 240125, 0.000417728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31), +(116, '2014-01-24 15:10:58', '2014-01-24 15:13:13', 1, 24.47, 948.983, 28.7628, 155.939, 155.975, 156.009, 155.564, 155.477, 155.056, 10.555, 10.5662, 10.532, 10.6734, 10.7188, 10.6341, 11.1051, 11.1928, 11.054, 5.425, 5.425, 105.682, 105.682, 100.257, 999.651, 999.64, 999.597, 2906.11, 2902.65, 100.396, 100.138, 124.195, -0.25757, 240330, 0.000417743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `Password` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `LastPwChange` datetime DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Daten für Tabelle `user` +-- + +INSERT INTO `user` (`Id`, `Name`, `Password`, `Description`, `LastPwChange`) VALUES +(1, 'admin', 'af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909', 'Application administrator', '2013-12-30 12:17:19'), +(2, 'tester', '', 'tester', '2013-12-30 12:17:19'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `watermeter` +-- + +CREATE TABLE IF NOT EXISTS `watermeter` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Serial` varchar(255) DEFAULT NULL, + `WMType_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `WMType_id` (`WMType_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `wmtype` +-- + +CREATE TABLE IF NOT EXISTS `wmtype` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CreateTime` datetime DEFAULT NULL, + `CreateUserName` varchar(255) DEFAULT NULL, + `CreateDescription` varchar(255) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `PulseRate` float DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- +-- Constraints der exportierten Tabellen +-- + +-- +-- Constraints der Tabelle `componentprocedure` +-- +ALTER TABLE `componentprocedure` + ADD CONSTRAINT `FKA4EE67E2C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints der Tabelle `componenttest` +-- +ALTER TABLE `componenttest` + ADD CONSTRAINT `FK4933B35E048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Constraints der Tabelle `group` +-- +ALTER TABLE `group` + ADD CONSTRAINT `FKFBBA8E27F90D2266` FOREIGN KEY (`User_id`) REFERENCES `user` (`Id`); + +-- +-- Constraints der Tabelle `measurementcorrection` +-- +ALTER TABLE `measurementcorrection` + ADD CONSTRAINT `FK2E70F3322F02977E` FOREIGN KEY (`Component_id`) REFERENCES `component` (`Id`); + +-- +-- Constraints der Tabelle `metertestresult` +-- +ALTER TABLE `metertestresult` + ADD CONSTRAINT `FK1CE41B064BD6C9B6` FOREIGN KEY (`TestResult_id`) REFERENCES `testresult` (`Id`); + +-- +-- Constraints der Tabelle `purgeend` +-- +ALTER TABLE `purgeend` + ADD CONSTRAINT `FK14832B1AC1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints der Tabelle `purgestart` +-- +ALTER TABLE `purgestart` + ADD CONSTRAINT `FKDC8627F9C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints der Tabelle `test` +-- +ALTER TABLE `test` + ADD CONSTRAINT `FKCC127866C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Constraints der Tabelle `testresult` +-- +ALTER TABLE `testresult` + ADD CONSTRAINT `FKAD39033FE048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Constraints der Tabelle `watermeter` +-- +ALTER TABLE `watermeter` + ADD CONSTRAINT `FKA968A8E699BF9B30` FOREIGN KEY (`WMType_id`) REFERENCES `wmtype` (`Id`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/TestBenchFramework/SampleConfig/sensus.sql b/TestBenchFramework/SampleConfig/sensus.sql new file mode 100644 index 000000000..73c89d61f --- /dev/null +++ b/TestBenchFramework/SampleConfig/sensus.sql @@ -0,0 +1,1147 @@ +-- phpMyAdmin SQL Dump +-- version 4.0.4.1 +-- http://www.phpmyadmin.net +-- +-- Hostiteľ: 127.0.0.1 +-- Vygenerované: Ne 27.Júl 2014, 11:39 +-- Verzia serveru: 5.6.11 +-- Verzia PHP: 5.5.3 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Databáza: `sensus` +-- +CREATE DATABASE IF NOT EXISTS `sensus` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +USE `sensus`; + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `benchpath` +-- + +CREATE TABLE IF NOT EXISTS `benchpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `TempIn` varchar(255) DEFAULT NULL, + `TempOut` varchar(255) DEFAULT NULL, + `PressIn` varchar(255) DEFAULT NULL, + `PressOut` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Sťahujem dáta pre tabuľku `benchpath` +-- + +INSERT INTO `benchpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `TempIn`, `TempOut`, `PressIn`, `PressOut`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PT1', 0, 250, 'T1', 'T2', 'P1', 'P2', 'K5', ''), +(2, 0, '', 0, 0, '---', '---', '---', '---', '', 'K5'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `component` +-- + +CREATE TABLE IF NOT EXISTS `component` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `ClassName` varchar(255) DEFAULT NULL, + `ParentName` varchar(255) DEFAULT NULL, + `ItemNr` int(11) DEFAULT NULL, + `Mode` varchar(255) DEFAULT NULL, + `Logging` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=62 ; + +-- +-- Sťahujem dáta pre tabuľku `component` +-- + +INSERT INTO `component` (`Id`, `Name`, `ClassName`, `ParentName`, `ItemNr`, `Mode`, `Logging`, `Parameters`) VALUES +(1, 'CB', 'ControlBoard', NULL, 0, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(2, 'K5', 'Valve', 'CB', 1, 'Normal', 'Off', '\r\n\r\n 0\r\n \r\n false\r\n K5\r\n CB\r\n'), +(3, 'K7', 'Valve', 'CB', 2, 'Normal', 'Off', '\r\n\r\n 1\r\n \r\n false\r\n K7\r\n CB\r\n'), +(4, 'K10', 'Valve', 'CB', 3, 'Normal', 'Off', '\r\n\r\n 2\r\n \r\n false\r\n K10\r\n CB\r\n'), +(5, 'K13', 'Valve', 'CB', 4, 'Normal', 'Off', '\r\n\r\n 3\r\n \r\n false\r\n K13\r\n CB\r\n'), +(6, 'K16', 'Valve', 'CB', 5, 'Normal', 'Off', '\r\n\r\n 4\r\n \r\n false\r\n K16\r\n CB\r\n'), +(7, 'K2', 'Valve', 'CB', 6, 'Normal', 'Off', '\r\n\r\n 5\r\n \r\n false\r\n K2\r\n CB\r\n'), +(8, 'K4', 'Valve', 'CB', 7, 'Normal', 'Off', '\r\n\r\n 6\r\n \r\n false\r\n K4\r\n CB\r\n'), +(9, 'Pumpe1', 'Valve', 'CB', 8, 'Normal', 'Off', '\r\n\r\n 16\r\n \r\n false\r\n Pumpe1\r\n CB\r\n'), +(10, 'K19', 'Valve', 'CB', 9, 'Normal', 'Off', '\r\n\r\n 17\r\n \r\n false\r\n K19\r\n CB\r\n'), +(11, 'K20', 'Valve', 'CB', 10, 'Normal', 'Off', '\r\n\r\n 18\r\n \r\n false\r\n K20\r\n CB\r\n'), +(12, 'K21', 'Valve', 'CB', 11, 'Normal', 'Off', '\r\n\r\n 19\r\n \r\n false\r\n K21\r\n CB\r\n'), +(13, 'Pumpe2', 'Valve', 'CB', 12, 'Normal', 'Off', '\r\n\r\n 20\r\n \r\n false\r\n Pumpe2\r\n CB\r\n'), +(14, 'Vl5', 'Valve', 'CB', 13, 'Normal', 'Off', '\r\n\r\n 21\r\n \r\n false\r\n Vl5\r\n CB\r\n'), +(15, 'KL1', 'Diverter', 'CB', 14, 'Normal', 'Off', '\r\n\r\n 8\r\n KL1\r\n CB\r\n'), +(16, 'KL2', 'Diverter', 'CB', 15, 'Normal', 'Off', '\r\n\r\n 9\r\n KL2\r\n CB\r\n'), +(17, 'T1', 'TempMeter', 'CB', 16, 'Normal', 'Off', '\r\n\r\n 0\r\n -21.62223\r\n 0.001777413\r\n 4.39902E-09\r\n 1.357676E-15\r\n 0\r\n'), +(18, 'T2', 'TempMeter', 'CB', 17, 'Normal', 'Off', '\r\n\r\n 1\r\n -21.56429\r\n 0.001777858\r\n 4.61575E-09\r\n 1.18247E-15\r\n 0\r\n'), +(19, 'T3', 'TempMeter', 'CB', 18, 'Normal', 'Off', '\r\n\r\n 2\r\n -21.7311\r\n 0.001780699\r\n 3.371811E-09\r\n 2.692937E-15\r\n 0\r\n'), +(20, 'T4', 'TempMeter', 'CB', 19, 'Normal', 'Off', '\r\n\r\n 3\r\n -21.68512\r\n 0.001776832\r\n 3.822327E-09\r\n 1.940195E-15\r\n 0\r\n'), +(22, 'RV1', 'RegulationValve', 'CB', 20, 'Normal', 'Off', '\r\n\r\n 1\r\n 100\r\n 500\r\n 0\r\n true\r\n'), +(23, 'RV2', 'RegulationValve', 'CB', 21, 'Normal', 'Off', '\r\n\r\n 2\r\n 100\r\n 500\r\n 0\r\n true\r\n'), +(24, 'RV3', 'RegulationValve', 'CB', 22, 'Normal', 'Off', '\r\n\r\n 3\r\n 100\r\n 500\r\n 0\r\n true\r\n'), +(25, 'RV4', 'RegulationValve', 'CB', 23, 'Normal', 'Off', '\r\n\r\n 4\r\n 100\r\n 500\r\n 0\r\n true\r\n'), +(26, 'RV5', 'RegulationValve', 'CB', 24, 'Normal', 'Off', '\r\n\r\n 5\r\n 100\r\n 500\r\n 0\r\n true\r\n'), +(27, 'E1', 'FlowMeter', 'CB', 25, 'Normal', 'Off', '\r\n\r\n 1\r\n 0.3\r\n E1\r\n CB\r\n'), +(28, 'E2', 'FlowMeter', 'CB', 26, 'Normal', 'Off', '\r\n\r\n 2\r\n 2.5\r\n E2\r\n CB\r\n'), +(29, 'E3', 'FlowMeter', 'CB', 27, 'Normal', 'Off', '\r\n\r\n 3\r\n 25\r\n E3\r\n CB\r\n'), +(30, 'E4', 'FlowMeter', 'CB', 28, 'Normal', 'Off', '\r\n\r\n 4\r\n 250\r\n E4\r\n CB\r\n'), +(31, 'E5', 'FlowMeter', 'CB', 29, 'Normal', 'Off', '\r\n\r\n 5\r\n 0.2\r\n E5\r\n CB\r\n'), +(32, 'Sens1', 'RegisterReader', 'CB', 30, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(33, 'Sens2', 'RegisterReader', 'CB', 31, 'Normal', 'Off', '\r\n\r\n 2\r\n'), +(34, 'Sens3', 'RegisterReader', 'CB', 32, 'Normal', 'Off', '\r\n\r\n 3\r\n'), +(36, 'Waage1', 'MettlerToledo Balance', NULL, 34, 'Normal', 'Off', '\r\n\r\n 4\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 120\r\n'), +(37, 'Waage2', 'MettlerToledo Balance', NULL, 35, 'Normal', 'Off', '\r\n\r\n 3\r\n 2400\r\n Even\r\n 7\r\n One\r\n XOnXOff\r\n 3000\r\n'), +(40, 'P1', 'PressureMeter', 'CB', 37, 'Normal', 'Off', '\r\n\r\n 0\r\n 99\r\n P1\r\n CB\r\n'), +(41, 'P2', 'PressureMeter', 'CB', 38, 'Normal', 'Off', '\r\n\r\n 1\r\n 100\r\n P2\r\n CB\r\n'), +(42, 'FlyingStartCollection', 'Flying-Start-Collection', NULL, 37, 'Normal', 'Off', '\r\n'), +(43, 'CombinedMeters', 'CombinedMeters', NULL, 38, 'Normal', 'Off', '\r\n'), +(44, 'Idc1', 'IdcCamera', NULL, 39, 'Off', 'Off', '\r\n\r\n 5\r\n 57600\r\n 1\r\n'), +(45, 'Idc2', 'IdcCamera', NULL, 40, 'AutoDetect', 'Off', '\r\n\r\n 6\r\n 57600\r\n 1\r\n'), +(46, 'Idc3', 'IdcCamera', NULL, 41, 'Off', 'Off', '\r\n\r\n 23\r\n 57600\r\n 1\r\n'), +(47, 'DataEntryForm', 'DataEntryForm-Munich', NULL, 42, 'Normal', 'Off', '\r\n'), +(48, 'Printer4Munich', 'ResultsPrinter4Munich', NULL, 43, 'Normal', 'Off', '\r\n'), +(49, 'Printer', 'BasicResultsPrinter', NULL, 44, 'Normal', 'Off', '\r\n'), +(50, 'Results2Disk', 'BasicResultsWriter', NULL, 45, 'Normal', 'Off', '\r\n'), +(51, 'WaterMeter1', 'WaterMeter', NULL, 46, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(52, 'WaterMeter2', 'WaterMeter', NULL, 47, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(53, 'WaterMeter3', 'WaterMeter', NULL, 48, 'Normal', 'Off', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n'), +(54, 'Bench-ID', 'Bench-ID', NULL, 49, 'Normal', 'Off', '\r\n\r\n 1\r\n'), +(55, 'Idc1-Roi1', 'CameraROI', 'Idc1', 50, 'Off', 'Off', '\r\n\r\n 1\r\n'), +(56, 'Idc1-Roi2', 'CameraROI', 'Idc1', 51, 'Off', 'Off', '\r\n\r\n 2\r\n'), +(57, 'Idc2-Roi1', 'CameraROI', 'Idc2', 52, 'Inherit', 'Off', '\r\n\r\n 1\r\n'), +(58, 'Idc2-Roi2', 'CameraROI', 'Idc2', 53, 'Inherit', 'Off', '\r\n\r\n 2\r\n'), +(59, 'Idc3-Roi1', 'CameraROI', 'Idc3', 54, 'Off', 'Off', '\r\n\r\n 1\r\n'), +(60, 'Idc3-Roi2', 'CameraROI', 'Idc3', 55, 'Off', 'Off', '\r\n\r\n 2\r\n'), +(61, 'RoiDetection', 'ROI Detection', NULL, 56, 'Normal', 'Off', '\r\n'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `componentprocedure` +-- + +CREATE TABLE IF NOT EXISTS `componentprocedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ; + +-- +-- Sťahujem dáta pre tabuľku `componentprocedure` +-- + +INSERT INTO `componentprocedure` (`Id`, `CmpntName`, `Parameters`, `Procedure_id`) VALUES +(1, 'Sens1', '\r\n\r\n 1\r\n', 1), +(2, 'Sens2', '\r\n\r\n 1\r\n', 1), +(3, 'Sens3', '\r\n\r\n 1\r\n', 1), +(4, 'Printer4Munich', '\r\n\r\n 4/13\r\n \r\n \r\n 2014\r\n', 1), +(5, 'WaterMeter1', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(6, 'WaterMeter2', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(7, 'WaterMeter3', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 1), +(8, 'WaterMeter1', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 2), +(9, 'WaterMeter2', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 2), +(10, 'WaterMeter3', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 2), +(11, 'Sens1', '\r\n\r\n 1\r\n', 2), +(12, 'Sens2', '\r\n\r\n 1\r\n', 2), +(13, 'Sens3', '\r\n\r\n 1\r\n', 2), +(14, 'WaterMeter1', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 3), +(15, 'WaterMeter2', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 3), +(16, 'WaterMeter3', '\r\n\r\n \r\n 2.5\r\n \r\n A\r\n', 3), +(17, 'Sens1', '\r\n\r\n 1\r\n', 3), +(18, 'Sens2', '\r\n\r\n 1\r\n', 3), +(19, 'Sens3', '\r\n\r\n 1\r\n', 3), +(20, 'Idc1-Roi1', '\r\n\r\n 60\r\n 1\r\n 520\r\n 478\r\n 40\r\n true\r\n 89\r\n 89\r\n 44\r\n 44\r\n 44\r\n 20\r\n 0\r\n 0\r\n 400\r\n 40\r\n 8\r\n 1\r\n 0\r\n 1\r\n', 3), +(21, 'Idc2-Roi1', '\r\n\r\n 60\r\n 1\r\n 520\r\n 478\r\n 40\r\n true\r\n 89\r\n 89\r\n 44\r\n 44\r\n 20\r\n 44\r\n 0\r\n 0\r\n 400\r\n 66.67\r\n 0\r\n 0\r\n 8\r\n 1\r\n 0\r\n 1\r\n', 3), +(22, 'Idc3-Roi1', '\r\n\r\n 60\r\n 1\r\n 520\r\n 478\r\n 40\r\n true\r\n 89\r\n 89\r\n 44\r\n 44\r\n 44\r\n 20\r\n 0\r\n 0\r\n 400\r\n 40\r\n 8\r\n 1\r\n 0\r\n 1\r\n', 3), +(23, 'Printer4Munich', NULL, 3), +(24, 'Idc1-Roi2', NULL, 3), +(25, 'Idc2-Roi2', NULL, 3), +(26, 'Idc3-Roi2', NULL, 3), +(27, 'Idc1-Roi1', NULL, 1), +(28, 'Idc1-Roi2', NULL, 1), +(29, 'Idc3-Roi1', NULL, 1), +(30, 'Idc3-Roi2', NULL, 1); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `componenttest` +-- + +CREATE TABLE IF NOT EXISTS `componenttest` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CmpntName` varchar(255) DEFAULT NULL, + `Parameters` varchar(8000) DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; + +-- +-- Sťahujem dáta pre tabuľku `componenttest` +-- + +INSERT INTO `componenttest` (`Id`, `CmpntName`, `Parameters`, `Test_id`) VALUES +(1, 'CombinedMeters', '\r\n\r\n 3.05\r\n 3.3\r\n -0.7\r\n -0.5\r\n 0.05\r\n 0.1\r\n', 1); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `feedingpath` +-- + +CREATE TABLE IF NOT EXISTS `feedingpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) NOT NULL DEFAULT '0', + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Pump` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Sťahujem dáta pre tabuľku `feedingpath` +-- + +INSERT INTO `feedingpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Pump`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PF1', 0, 250, '', 'K2', 'K4'), +(2, 2, 'PF2', 0, 10, 'Pumpe1', '', 'K2;K4'), +(3, 3, 'PF3', 10, 250, 'Pumpe2', 'K4', 'K2'), +(4, 0, '', 0, 0, '', '', 'K2;K4'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `group` +-- + +CREATE TABLE IF NOT EXISTS `group` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Gid` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `User_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `User_id` (`User_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; + +-- +-- Sťahujem dáta pre tabuľku `group` +-- + +INSERT INTO `group` (`Id`, `Gid`, `Name`, `User_id`) VALUES +(1, 0, 'Testers', 2), +(2, 1, 'Testing Specialists', 1), +(3, 2, 'Head Of Lab', 1), +(4, 3, 'Maintenance Specialists', 1), +(5, 4, 'Metrologists', 1), +(6, 5, 'Calibration Specialists', 1), +(7, 6, 'Administrators', 1); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `measurementcorrection` +-- + +CREATE TABLE IF NOT EXISTS `measurementcorrection` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Measurement` float DEFAULT NULL, + `Correction` float DEFAULT NULL, + `Component_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Component_id` (`Component_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Sťahujem dáta pre tabuľku `measurementcorrection` +-- + +INSERT INTO `measurementcorrection` (`Id`, `Measurement`, `Correction`, `Component_id`) VALUES +(1, 10, 0, 36), +(2, 20, 0, 36), +(3, 50, 0, 36), +(4, 100, 0, 36), +(5, 250, 0, 36), +(6, 150, 0.0005, 36); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `meterspath` +-- + +CREATE TABLE IF NOT EXISTS `meterspath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) NOT NULL DEFAULT '0', + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Sensor1` varchar(255) DEFAULT NULL, + `Sensor2` varchar(255) DEFAULT NULL, + `Sensor3` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Sťahujem dáta pre tabuľku `meterspath` +-- + +INSERT INTO `meterspath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Sensor1`, `Sensor2`, `Sensor3`) VALUES +(1, 0, 'PM1', 0, 250, 'Sens1', 'Sens2', 'Sens3'), +(2, 1, 'CamR1', 0, 250, 'Idc1-Roi1', 'Idc2-Roi1', 'Idc3-Roi1'), +(3, 2, 'CamR2', 0, 250, 'Idc1-Roi2', 'Idc2-Roi2', 'Idc3-Roi2'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `metertestresult` +-- + +CREATE TABLE IF NOT EXISTS `metertestresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `SerialNr` varchar(255) DEFAULT NULL, + `VolumeStart` float DEFAULT NULL, + `VolumeEnd` float DEFAULT NULL, + `VolumeMeter` float DEFAULT NULL, + `VolumeRef` float DEFAULT NULL, + `VolumeErrorPct` float DEFAULT NULL, + `PulsesMeter` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `TestResult_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `TestResult_id` (`TestResult_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=319 ; + +-- +-- Sťahujem dáta pre tabuľku `metertestresult` +-- + +INSERT INTO `metertestresult` (`Id`, `SerialNr`, `VolumeStart`, `VolumeEnd`, `VolumeMeter`, `VolumeRef`, `VolumeErrorPct`, `PulsesMeter`, `PulsesMaster`, `Time`, `TestResult_id`) VALUES +(1, 'wm1', 0, 0, 0, -0.0000014201, -100, 0, 43368, 65.643, 12), +(2, 'wm2', 0, 0, 7.5, -0.00000136807, -548219000, 15, 41779, 65.643, 12), +(3, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.643, 12), +(4, 'wm4', 0, 0, 0, 0, -100, 0, 0, 65.643, 12), +(5, 'wm1', 0, 0, 0, -0.00000141785, -100, 0, 43368, 65.689, 13), +(6, 'wm2', 0, 0, 7, -0.00000128243, -545839000, 14, 39226, 65.689, 13), +(7, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.689, 13), +(8, 'wm4', 0, 0, 0, 0, -100, 0, 0, 65.689, 13), +(9, 'wm1', 0, 0, 0, -0.00000520273, -100, 0, 14465, 56.854, 14), +(10, 'wm2', 0, 0, 24.5, -0.00000504339, -485784000, 49, 14022, 56.854, 14), +(11, 'wm3', 0, 0, 0, 0, -100, 0, 0, 56.854, 14), +(12, 'wm4', 0, 0, 0, 0, -100, 0, 0, 56.854, 14), +(13, 'wm1', 0, 0, 0, -0.00000141865, -100, 0, 41862, 65.593, 15), +(14, 'wm2', 0, 0, 7.5, 0, -100, 15, 0, 65.593, 15), +(15, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.593, 15), +(16, 'wm1', 0, 0, 0, -0.00000140309, -100, 0, 41967, 65.605, 16), +(17, 'wm2', 0, 0, 7.5, 0, -100, 15, 0, 65.605, 16), +(18, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.605, 16), +(19, 'wm1', 0, 0, 0, -0.00000481652, -100, 0, 14324, 56.645, 17), +(20, 'wm2', 0, 0, 25, 0, -100, 50, 0, 56.645, 17), +(21, 'wm3', 0, 0, 0, 0, -100, 0, 0, 56.645, 17), +(22, 'wm1', 0, 0, 0, -0.00000143335, -100, 0, 39130, 65.835, 18), +(23, 'wm2', 0, 0, 7, 0, -100, 14, 0, 65.835, 18), +(24, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.835, 18), +(25, 'wm1', 0, 0, 7.5, -0.00000158789, -100, 15, 41910, 65.3, 19), +(26, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.3, 19), +(27, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.3, 19), +(28, 'wm1', 0, 0, 7, -0.00000146845, -100, 14, 39259, 65.434, 20), +(29, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.434, 20), +(30, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.434, 20), +(31, 'wm1', 0, 0, 24.5, -0.0000053534, -100, 49, 14064, 56.942, 21), +(32, 'wm2', 0, 0, 0, 0, -100, 0, 0, 56.942, 21), +(33, 'wm3', 0, 0, 0, 0, -100, 0, 0, 56.942, 21), +(34, 'wm1', 0, 0, 14, -0.0000017251, -100, 14, 39042, 65.181, 22), +(35, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.181, 22), +(36, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.181, 22), +(37, 'wm1', 0, 0, 15, -0.00000184669, -100, 15, 41903, 65.272, 23), +(38, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.272, 23), +(39, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.272, 23), +(40, 'wm1', 0, 0, 50, -0.00000632833, -100, 50, 14332, 57.218, 24), +(41, 'wm2', 0, 0, 0, 0, -100, 0, 0, 57.218, 24), +(42, 'wm3', 0, 0, 0, 0, -100, 0, 0, 57.218, 24), +(43, 'wm1', 0, 0, 19, -0.00000243629, -100, 19, 53128, 76.309, 25), +(44, 'wm2', 0, 0, 0, 0, -100, 0, 0, 76.309, 25), +(45, 'wm3', 0, 0, 0, 0, -100, 0, 0, 76.309, 25), +(46, 'wm1', 0, 0, 20, -0.00000255392, -100, 20, 55773, 76.156, 26), +(47, 'wm2', 0, 0, 0, 0, -100, 0, 0, 76.156, 26), +(48, 'wm3', 0, 0, 0, 0, -100, 0, 0, 76.156, 26), +(49, 'wm1', 0, 0, 20, -0.00000255049, -100, 20, 55783, 76.172, 27), +(50, 'wm2', 0, 0, 0, 0, -100, 0, 0, 76.172, 27), +(51, 'wm3', 0, 0, 0, 0, -100, 0, 0, 76.172, 27), +(52, 'wm1', 0, 0, 19, -0.00000242366, -100, 19, 53016, 76.181, 28), +(53, 'wm2', 0, 0, 0, 0, -100, 0, 0, 76.181, 28), +(54, 'wm3', 0, 0, 0, 0, -100, 0, 0, 76.181, 28), +(55, 'wm1', 0, 0, 20, -0.0000025397, -100, 20, 55712, 76.206, 29), +(56, 'wm2', 0, 0, 0, 0, -100, 0, 0, 76.206, 29), +(57, 'wm3', 0, 0, 0, 0, -100, 0, 0, 76.206, 29), +(58, 'wm1', 0, 0, 49, -0.00000643354, -100, 49, 14090, 42.913, 30), +(59, 'wm2', 0, 0, 0, 0, -100, 0, 0, 42.913, 30), +(60, 'wm3', 0, 0, 0, 0, -100, 0, 0, 42.913, 30), +(61, 'wm1', 0, 0, 49, -0.00000650082, -100, 49, 14107, 42.918, 31), +(62, 'wm2', 0, 0, 0, 0, -100, 0, 0, 42.918, 31), +(63, 'wm3', 0, 0, 0, 0, -100, 0, 0, 42.918, 31), +(64, 'wm1', 0, 0, 50, -0.00000668643, -100, 50, 14391, 42.91, 32), +(65, 'wm2', 0, 0, 0, 0, -100, 0, 0, 42.91, 32), +(66, 'wm3', 0, 0, 0, 0, -100, 0, 0, 42.91, 32), +(67, 'wm1', 0, 0, 50, -0.00000674168, -100, 50, 14415, 42.908, 33), +(68, 'wm2', 0, 0, 0, 0, -100, 0, 0, 42.908, 33), +(69, 'wm3', 0, 0, 0, 0, -100, 0, 0, 42.908, 33), +(70, 'wm1', 0, 0, 49, -0.00000662135, -100, 49, 14107, 42.927, 34), +(71, 'wm2', 0, 0, 0, 0, -100, 0, 0, 42.927, 34), +(72, 'wm3', 0, 0, 0, 0, -100, 0, 0, 42.927, 34), +(73, 'wm1', 0, 0, 14, 0.0134641, 103880, 14, 38794, 60.867, 35), +(74, 'wm2', 0, 0, 0, 0, -100, 0, 0, 60.867, 35), +(75, 'wm3', 0, 0, 0, 0, -100, 0, 0, 60.867, 35), +(76, 'wm1', 0, 0, 20, 0.0193145, 103449, 20, 55638, 78.562, 36), +(77, 'wm2', 0, 0, 0, 0, -100, 0, 0, 78.562, 36), +(78, 'wm3', 0, 0, 0, 0, -100, 0, 0, 78.562, 36), +(79, 'wm1', 0, 0, 20, 0.0193175, 103433, 20, 55640, 78.606, 37), +(80, 'wm2', 0, 0, 0, 0, -100, 0, 0, 78.606, 37), +(81, 'wm3', 0, 0, 0, 0, -100, 0, 0, 78.606, 37), +(82, 'wm1', 0, 0, 20, 0.0193201, 103419, 20, 55644, 78.652, 38), +(83, 'wm2', 0, 0, 0, 0, -100, 0, 0, 78.652, 38), +(84, 'wm3', 0, 0, 0, 0, -100, 0, 0, 78.652, 38), +(85, 'wm1', 0, 0, 20, 0.0193422, 103301, 20, 55713, 78.661, 39), +(86, 'wm2', 0, 0, 0, 0, -100, 0, 0, 78.661, 39), +(87, 'wm3', 0, 0, 0, 0, -100, 0, 0, 78.661, 39), +(88, 'wm1', 0, 0, 19, 0.0184151, 103076, 19, 53049, 78.694, 40), +(89, 'wm2', 0, 0, 0, 0, -100, 0, 0, 78.694, 40), +(90, 'wm3', 0, 0, 0, 0, -100, 0, 0, 78.694, 40), +(91, 'wm1', 0, 0, 50, 0.0496446, 100616, 50, 14324, 43.227, 41), +(92, 'wm2', 0, 0, 0, 0, -100, 0, 0, 43.227, 41), +(93, 'wm3', 0, 0, 0, 0, -100, 0, 0, 43.227, 41), +(94, 'wm1', 0, 0, 50, 0.0496703, 100564, 50, 14345, 43.175, 42), +(95, 'wm2', 0, 0, 0, 0, -100, 0, 0, 43.175, 42), +(96, 'wm3', 0, 0, 0, 0, -100, 0, 0, 43.175, 42), +(97, 'wm1', 0, 0, 50, 0.049618, 100670, 50, 14330, 43.161, 43), +(98, 'wm2', 0, 0, 0, 0, -100, 0, 0, 43.161, 43), +(99, 'wm3', 0, 0, 0, 0, -100, 0, 0, 43.161, 43), +(100, 'wm1', 0, 0, 49, 0.048745, 100423, 49, 14078, 43.114, 44), +(101, 'wm2', 0, 0, 0, 0, -100, 0, 0, 43.114, 44), +(102, 'wm3', 0, 0, 0, 0, -100, 0, 0, 43.114, 44), +(103, 'wm1', 0, 0, 49, 0.0488142, 100281, 49, 14084, 43.151, 45), +(104, 'wm2', 0, 0, 0, 0, -100, 0, 0, 43.151, 45), +(105, 'wm3', 0, 0, 0, 0, -100, 0, 0, 43.151, 45), +(106, 'wm1', 0, 0, 14, 0.0134812, 103748, 14, 38841, 65.647, 46), +(107, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.647, 46), +(108, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.647, 46), +(109, 'wm1', 0, 0, 15, 0.0144675, 103581, 15, 41676, 65.691, 47), +(110, 'wm2', 0, 0, 0, 0, -100, 0, 0, 65.691, 47), +(111, 'wm3', 0, 0, 0, 0, -100, 0, 0, 65.691, 47), +(112, 'wm1', 0, 0, 51, 49.1762, 3.70868, 51, 141729, 221.982, 48), +(113, 'wm2', 0, 0, 0, 0, -100, 0, 0, 221.982, 48), +(114, 'wm3', 0, 0, 0, 0, -100, 0, 0, 221.982, 48), +(115, 'wm1', 0, 0, 0, 0, -100, 0, 0, 227.928, 49), +(116, 'wm2', 0, 0, 0, 0, -100, 0, 0, 227.928, 49), +(117, 'wm3', 0, 0, 0, 0, -100, 0, 0, 227.928, 49), +(118, 'wm1', 0, 0, 0, 0, -100, 0, 0, 221.56, 50), +(119, 'wm2', 0, 0, 0, 0, -100, 0, 0, 221.56, 50), +(120, 'wm3', 0, 0, 0, 0, -100, 0, 0, 221.56, 50), +(121, 'wm1', 0, 0, 0, 0, -100, 0, 0, 225.102, 51), +(122, 'wm2', 0, 0, 0, 0, -100, 0, 0, 225.102, 51), +(123, 'wm3', 0, 0, 0, 0, -100, 0, 0, 225.102, 51), +(124, 'wm1', 0, 0, 0, 0, -100, 0, 0, 224.715, 52), +(125, 'wm2', 0, 0, 0, 0, -100, 0, 0, 224.715, 52), +(126, 'wm3', 0, 0, 0, 0, -100, 0, 0, 224.715, 52), +(127, 'wm1', 0, 0, 0, 0, -100, 0, 0, 224.588, 53), +(128, 'wm2', 0, 0, 0, 0, -100, 0, 0, 224.588, 53), +(129, 'wm3', 0, 0, 0, 0, -100, 0, 0, 224.588, 53), +(130, 'wm1', 0, 0, 0, 0, -100, 0, 0, 214.569, 54), +(131, 'wm2', 0, 0, 0, 0, -100, 0, 0, 214.569, 54), +(132, 'wm3', 0, 0, 0, 0, -100, 0, 0, 214.569, 54), +(133, 'wm1', 0, 0, 0, 0, -100, 0, 0, 223.989, 55), +(134, 'wm2', 0, 0, 0, 0, -100, 0, 0, 223.989, 55), +(135, 'wm3', 0, 0, 177.6, 49.7885, 256.709, 1776, 143594, 223.989, 55), +(136, 'wm1', 0, 0, 0, 0, -100, 0, 0, 223.628, 56), +(137, 'wm2', 0, 0, 0, 0, -100, 0, 0, 223.628, 56), +(138, 'wm3', 0, 0, 113.4, 46.0886, 146.048, 1134, 132892, 223.628, 56), +(139, 'wm1', 0, 0, 0, 0, -100, 0, 0, 223.655, 57), +(140, 'wm2', 0, 0, 0, 0, -100, 0, 0, 223.655, 57), +(141, 'wm3', 0, 0, 17.3, 39.5122, -56.2161, 173, 113938, 223.655, 57), +(142, 'wm1', 0, 0, 0, 0, -100, 0, 0, 223.463, 58), +(143, 'wm2', 0, 0, 0, 0, -100, 0, 0, 223.463, 58), +(144, 'wm3', 0, 0, 0, 5816.1, -100, 0, 16775400, 223.463, 58), +(145, 'wm1', 0, 0, 0, 0, -100, 0, 0, 56.945, 59), +(146, 'wm2', 0, 0, 0, 0, -100, 0, 0, 56.945, 59), +(147, 'wm3', 0, 0, 0, 58059.1, -100, 0, 16775400, 56.945, 59), +(148, 'wm1', 0, 0, 0, 0, -100, 0, 0, 57.148, 60), +(149, 'wm2', 0, 0, 0, 0, -100, 0, 0, 57.148, 60), +(150, 'wm3', 0, 0, 0, 58059.1, -100, 0, 16775400, 57.148, 60), +(151, 'wm1', 0, 0, 0, 0, -100, 0, 0, 222.742, 61), +(152, 'wm2', 0, 0, 0, 0, -100, 0, 0, 222.742, 61), +(153, 'wm3', 0, 0, 0, 5814.02, -100, 0, 16775400, 222.742, 61), +(154, 'wm1', 0, 0, 0, 0, -100, 0, 0, 57.164, 62), +(155, 'wm2', 0, 0, 0, 0, -100, 0, 0, 57.164, 62), +(156, 'wm3', 0, 0, 0, 58059.1, -100, 0, 16775400, 57.164, 62), +(157, 'wm1', 0, 0, 0, 0, -100, 0, 0, 215.445, 63), +(158, 'wm2', 0, 0, 0, 0, -100, 0, 0, 215.445, 63), +(159, 'wm3', 0, 0, 0, 0, -100, 0, 0, 215.445, 63), +(160, 'wm1', 0, 0, 0, 0, -100, 0, 0, 56.661, 64), +(161, 'wm2', 0, 0, 0, 0, -100, 0, 0, 56.661, 64), +(162, 'wm3', 0, 0, 4.8, 49.5899, -90.3206, 48, 14288, 56.661, 64), +(163, 'wm1', 0, 0, 0, 0, -100, 0, 0, 216.739, 65), +(164, 'wm2', 0, 0, 0, 0, -100, 0, 0, 216.739, 65), +(165, 'wm3', 0, 0, 0, 5816.55, -100, 0, 16777200, 216.739, 65), +(166, 'wm1', 0, 0, 0, 0, -100, 0, 0, 217.506, 66), +(167, 'wm2', 0, 0, 0, 0, -100, 0, 0, 217.506, 66), +(168, 'wm3', 0, 0, 0, 5817.48, -100, 0, 16777200, 217.506, 66), +(169, 'wm1', 0, 0, 0, 0, -100, 0, 0, 55.072, 67), +(170, 'wm2', 0, 0, 0, 0, -100, 0, 0, 55.072, 67), +(171, 'wm3', 0, 0, 47, 49.6764, -5.38774, 47, 14341, 55.072, 67), +(172, 'wm1', 0, 0, 0, 0, -100, 0, 0, 216.334, 68), +(173, 'wm2', 0, 0, 0, 0, -100, 0, 0, 216.334, 68), +(174, 'wm3', 0, 0, 0, 5815.24, -100, 0, 16777200, 216.334, 68), +(175, 'wm1', 0, 0, 0, 0, -100, 0, 0, 54.924, 69), +(176, 'wm2', 0, 0, 0, 0, -100, 0, 0, 54.924, 69), +(177, 'wm3', 0, 0, 46, 48.3776, -4.91467, 46, 13967, 54.924, 69), +(178, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 70), +(179, 'wm2', 0, 0, 0, 0, -100, 0, 0, 44.087, 70), +(180, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 70), +(181, 'wm1', 0, 0, 0, 0, -100, 0, 0, 173.4, 71), +(182, 'wm2', 0, 0, 0, 0, -100, 0, 0, 173.4, 71), +(183, 'wm3', 0, 0, 0, 0, -100, 0, 0, 173.4, 71), +(184, 'wm1', 0, 0, 0, 0, -100, 0, 0, 69.588, 72), +(185, 'wm2', 0, 0, 0, 0, -100, 0, 0, 69.588, 72), +(186, 'wm3', 0, 0, 0, 0, -100, 0, 0, 69.588, 72), +(187, 'wm1', 0, 0, 0, 0, -100, 0, 0, 87.774, 73), +(188, 'wm2', 0, 0, 0, 0, -100, 0, 0, 87.774, 73), +(189, 'wm3', 0, 0, 0, 0, -100, 0, 0, 87.774, 73), +(190, 'wm1', 0, 0, 0, 0, -100, 0, 0, 73.019, 74), +(191, 'wm2', 0, 0, 0, 0, -100, 0, 0, 73.019, 74), +(192, 'wm3', 0, 0, 0, 0, -100, 0, 0, 73.019, 74), +(193, 'wm1', 0, 0, 0, 0, -100, 0, 0, 89.881, 75), +(194, 'wm2', 0, 0, 0, 0, -100, 0, 0, 89.881, 75), +(195, 'wm3', 0, 0, 0, 0, -100, 0, 0, 89.881, 75), +(196, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.484, 76), +(197, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.484, 76), +(198, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.484, 76), +(199, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.335, 77), +(200, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.335, 77), +(201, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.335, 77), +(202, 'wm1', 0, 0, 0, 0, -100, 0, 0, 89.601, 78), +(203, 'wm2', 0, 0, 0, 0, -100, 0, 0, 89.601, 78), +(204, 'wm3', 0, 0, 0, 0, -100, 0, 0, 89.601, 78), +(205, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.414, 79), +(206, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.414, 79), +(207, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.414, 79), +(208, 'wm1', 0, 0, 0, 0, -100, 0, 0, 89.587, 80), +(209, 'wm2', 0, 0, 0, 0, -100, 0, 0, 89.587, 80), +(210, 'wm3', 0, 0, 0, 0, -100, 0, 0, 89.587, 80), +(211, 'wm1', 0, 0, 0, 0, -100, 0, 0, 67.821, 81), +(212, 'wm2', 0, 0, 0, 0, -100, 0, 0, 67.821, 81), +(213, 'wm3', 0, 0, 0, 0, -100, 0, 0, 67.821, 81), +(214, 'wm1', 0, 0, 0, 0, -100, 0, 0, 89.595, 82), +(215, 'wm2', 0, 0, 0, 0, -100, 0, 0, 89.595, 82), +(216, 'wm3', 0, 0, 0, 0, -100, 0, 0, 89.595, 82), +(217, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.883, 83), +(218, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.883, 83), +(219, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.883, 83), +(220, 'wm1', 0, 0, 0, 0, -100, 0, 0, 90.391, 84), +(221, 'wm2', 0, 0, 0, 0, -100, 0, 0, 90.391, 84), +(222, 'wm3', 0, 0, 0, 0, -100, 0, 0, 90.391, 84), +(223, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.953, 85), +(224, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.953, 85), +(225, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.953, 85), +(226, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 86), +(227, 'wm2', 0, 0, -0.5, 0, -100, -20, 0, 71.498, 86), +(228, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 86), +(229, 'wm1', 0, 0, 0, 0, -100, 0, 0, 67.139, 87), +(230, 'wm2', 0, 0, 0, 0, -100, 0, 0, 67.139, 87), +(231, 'wm3', 0, 0, 0, 0, -100, 0, 0, 67.139, 87), +(232, 'wm1', 0, 0, 0, 0, -100, 0, 0, 68.254, 88), +(233, 'wm2', 0, 0, 0, 0, -100, 0, 0, 68.254, 88), +(234, 'wm3', 0, 0, 0, 0, -100, 0, 0, 68.254, 88), +(235, 'wm1', 0, 0, 0, 0, -100, 0, 0, 68.379, 89), +(236, 'wm2', 0, 0, 0, 0, -100, 0, 0, 68.379, 89), +(237, 'wm3', 0, 0, 0, 0, -100, 0, 0, 68.379, 89), +(238, 'wm1', 0, 0, 0, 0, -100, 0, 0, 90.174, 90), +(239, 'wm2', 0, 0, 0, 0, -100, 0, 0, 90.174, 90), +(240, 'wm3', 0, 0, 0, 0, -100, 0, 0, 90.174, 90), +(241, 'wm1', 0, 0, 0, 0, -100, 0, 0, 67.109, 91), +(242, 'wm2', 0, 0, 0, 0, -100, 0, 0, 67.109, 91), +(243, 'wm3', 0, 0, 0, 0, -100, 0, 0, 67.109, 91), +(244, 'wm1', 0, 0, 0, 0, -100, 0, 0, 68.109, 92), +(245, 'wm2', 0, 0, 0, 0, -100, 0, 0, 68.109, 92), +(246, 'wm3', 0, 0, 0, 0, -100, 0, 0, 68.109, 92), +(247, 'wm1', 0, 0, 0, 0, -100, 0, 0, 88.966, 93), +(248, 'wm2', 0, 0, 0, 0, -100, 0, 0, 88.966, 93), +(249, 'wm3', 0, 0, 0, 0, -100, 0, 0, 88.966, 93), +(250, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.832, 94), +(251, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.832, 94), +(252, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.832, 94), +(253, 'wm1', 0, 0, 0, 0, -100, 0, 0, 90.071, 95), +(254, 'wm2', 0, 0, 0, 0, -100, 0, 0, 90.071, 95), +(255, 'wm3', 0, 0, 0, 0, -100, 0, 0, 90.071, 95), +(256, 'wm1', 0, 0, 0, 0, -100, 0, 0, 67.071, 96), +(257, 'wm2', 0, 0, 0, 0, -100, 0, 0, 67.071, 96), +(258, 'wm3', 0, 0, 0, 0, -100, 0, 0, 67.071, 96), +(259, 'wm1', 0, 0, 0, 0, -100, 0, 0, 90.5, 97), +(260, 'wm2', 0, 0, 0, 0, -100, 0, 0, 90.5, 97), +(261, 'wm3', 0, 0, 0, 0, -100, 0, 0, 90.5, 97), +(262, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.515, 98), +(263, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.515, 98), +(264, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.515, 98), +(265, 'wm1', 0, 0, 0, 0, -100, 0, 0, 73.818, 99), +(266, 'wm2', 0, 0, 0, 0, -100, 0, 0, 73.818, 99), +(267, 'wm3', 0, 0, 0, 0, -100, 0, 0, 73.818, 99), +(268, 'wm1', 0, 0, 0, 0, -100, 0, 0, 89.951, 100), +(269, 'wm2', 0, 0, 0, 0, -100, 0, 0, 89.951, 100), +(270, 'wm3', 0, 0, 0, 0, -100, 0, 0, 89.951, 100), +(271, 'wm1', 0, 0, 0, 0, -100, 0, 0, 224.321, 101), +(272, 'wm2', 0, 0, 0, 0, -100, 0, 0, 224.321, 101), +(273, 'wm3', 0, 0, 0, 0, -100, 0, 0, 224.321, 101), +(274, 'wm1', 0, 0, 0, 0, -100, 0, 0, 55.013, 102), +(275, 'wm2', 0, 0, 0, 0, -100, 0, 0, 55.013, 102), +(276, 'wm3', 0, 0, 0, 0, -100, 0, 0, 55.013, 102), +(277, 'wm1', 0, 0, 0, 0, -100, 0, 0, 66.765, 103), +(278, 'wm2', 0, 0, 0, 0, -100, 0, 0, 66.765, 103), +(279, 'wm3', 0, 0, 0, 0, -100, 0, 0, 66.765, 103), +(280, 'wm1', 0, 0, 0, 0, -100, 0, 0, 90.12, 104), +(281, 'wm2', 0, 0, 0, 0, -100, 0, 0, 90.12, 104), +(282, 'wm3', 0, 0, 0, 0, -100, 0, 0, 90.12, 104), +(283, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 105), +(284, 'wm2', 0, 0, -0.5, 0, -100, -20, 0, 71.567, 105), +(285, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 105), +(286, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 106), +(287, 'wm2', 0, 0, -0.5, 0, -100, -20, 0, 72.269, 106), +(288, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 106), +(289, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 107), +(290, 'wm2', 0, 0, 523.65, 0, -100, 20946, 0, 72.508, 107), +(291, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 107), +(292, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 108), +(293, 'wm2', 0, 0, -0.5, 0, -100, -20, 0, 72.255, 108), +(294, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 108), +(295, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 109), +(296, 'wm2', 0, 0, -0.5, 0, -100, -20, 0, 72.134, 109), +(297, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 109), +(298, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 110), +(299, 'wm2', 0, 0, 625.075, 0, -100, 25003, 0, 72.128, 110), +(300, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 110), +(301, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 111), +(302, 'wm2', 0, 0, -62, 0, -100, -2480, 0, 103.047, 111), +(303, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 111), +(304, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 112), +(305, 'wm2', 0, 0, 0, 0, -100, 0, 0, 110.424, 112), +(306, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 112), +(307, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 113), +(308, 'wm2', 0, 0, 0, 0, -100, 0, 0, 109.842, 113), +(309, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 113), +(310, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 114), +(311, 'wm2', 0, 0, -642.025, 0, -100, -25681, 0, 107.2, 114), +(312, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 114), +(313, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 115), +(314, 'wm2', 0, 0, -1522.07, 0, -100, -60883, 0, 35.92, 115), +(315, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 115), +(316, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 116), +(317, 'wm2', 0, 0, -3519.18, 0, -100, -140767, 0, 35.797, 116), +(318, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 116); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `outputpath` +-- + +CREATE TABLE IF NOT EXISTS `outputpath` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) NOT NULL DEFAULT '0', + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `RegulValve` varchar(255) DEFAULT NULL, + `FlowMeter` varchar(255) DEFAULT NULL, + `Diverter` varchar(255) DEFAULT NULL, + `TempDiv` varchar(255) DEFAULT NULL, + `Balance` varchar(255) DEFAULT NULL, + `EmptyTankValve` varchar(255) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Sťahujem dáta pre tabuľku `outputpath` +-- + +INSERT INTO `outputpath` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `RegulValve`, `FlowMeter`, `Diverter`, `TempDiv`, `Balance`, `EmptyTankValve`, `ValvesOpen`, `ValvesClose`) VALUES +(1, 1, 'PO1', 0.1, 0.3, 'RV1', 'E1', 'KL1', 'T3', 'Waage1', 'K19', 'K7', 'K10;K13;K16;Vl5'), +(2, 2, 'PO2', 0.2, 2.5, 'RV2', 'E2', 'KL1', 'T3', 'Waage1', 'K19', 'K10', 'K7;K13;K16;Vl5'), +(3, 3, 'PO3', 2, 25, 'RV3', 'E3', 'KL2', 'T4', 'Waage2', 'K20', 'K13', 'K7;K10;K16;Vl5'), +(4, 4, 'PO4', 20, 250, 'RV4', 'E4', 'KL2', 'T4', 'Waage2', 'K20', 'K16', 'K7;K10;K13;Vl5'), +(5, 5, 'PO5', 0, 0.2, 'RV5', 'E5', 'KL1', 'T3', 'Waage1', 'K19', 'Vl5', 'K7;K10;K13;K16'), +(6, 0, '', 0, 0, '---', '---', '---', '---', '---', '---', '', 'K7;K10;K13;K16;Vl5'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `procedure` +-- + +CREATE TABLE IF NOT EXISTS `procedure` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `CreationUser` varchar(255) DEFAULT NULL, + `CreationTime` datetime DEFAULT NULL, + `LastChgUser` varchar(255) DEFAULT NULL, + `LastChgTime` datetime DEFAULT NULL, + `LongDescription` varchar(255) DEFAULT NULL, + `Watermeters` varchar(255) DEFAULT NULL, + `DataEntry` varchar(255) DEFAULT NULL, + `ResultsPrinter` varchar(255) DEFAULT NULL, + `ResultsWriter` varchar(255) DEFAULT NULL, + `TransitionStart` varchar(255) DEFAULT NULL, + `TransitionEnd` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Sťahujem dáta pre tabuľku `procedure` +-- + +INSERT INTO `procedure` (`Id`, `ItemNr`, `Name`, `Description`, `CreationUser`, `CreationTime`, `LastChgUser`, `LastChgTime`, `LongDescription`, `Watermeters`, `DataEntry`, `ResultsPrinter`, `ResultsWriter`, `TransitionStart`, `TransitionEnd`) VALUES +(1, 0, 'Procedure1', '', 'admin', '2013-12-30 12:26:17', 'admin', '2014-07-26 15:39:40', '', '', 'DataEntryForm', 'Printer4Munich', '', 'Tr1', ''), +(2, 0, 'Procedure2', '', 'admin', '2014-01-12 17:10:26', 'admin', '2014-02-09 23:46:45', '', '', '', '', '', '', ''), +(3, 0, 'Procedure3', '', 'admin', '2014-01-16 19:16:14', 'admin', '2014-07-27 11:11:46', '', '', '', '', '', '', ''); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `test` +-- + +CREATE TABLE IF NOT EXISTS `test` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Qfrom` float DEFAULT NULL, + `Qto` float DEFAULT NULL, + `Volume` float DEFAULT NULL, + `TstTime` float DEFAULT NULL, + `Repeats` int(11) DEFAULT NULL, + `Emptying` tinyint(1) DEFAULT NULL, + `Zeroing` tinyint(1) DEFAULT NULL, + `Method` varchar(255) DEFAULT NULL, + `ErrLimLo` float DEFAULT NULL, + `ErrLimHi` float DEFAULT NULL, + `TolerRed` double DEFAULT NULL, + `RedType` varchar(255) DEFAULT NULL, + `FeedingPath` varchar(255) DEFAULT NULL, + `BenchPath` varchar(255) DEFAULT NULL, + `OutputPath` varchar(255) DEFAULT NULL, + `MetersPath` varchar(255) DEFAULT NULL, + `TransitionStart` varchar(255) DEFAULT NULL, + `TransitionEnd` varchar(255) DEFAULT NULL, + `Procedure_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Procedure_id` (`Procedure_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; + +-- +-- Sťahujem dáta pre tabuľku `test` +-- + +INSERT INTO `test` (`Id`, `ItemNr`, `Name`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `TolerRed`, `RedType`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TransitionStart`, `TransitionEnd`, `Procedure_id`) VALUES +(1, 3, 'Q4', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 0, 'Fix', 'PF1', 'PT1', 'PO3', 'PM1', '', '', 1), +(2, 2, 'Q3', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 0, 'Fix', 'PF1', 'PT1', 'PO2', 'PM1', '', '', 1), +(3, 0, 'Q1', 0.8, 0.85, 15, 65.4545, 2, 0, 0, 'FlyingStartCollection', -2, 2, 0, 'Fix', 'PF1', 'PT1', 'PO2', 'PM1', NULL, NULL, 2), +(4, 1, 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 0, 'Fix', 'PF1', 'PT1', 'PO3', 'PM1', NULL, NULL, 2), +(5, 0, 'Q1', 0.1, 0.11, 1, 34.2857, 1, 0, 0, 'RoiDetection', 0, 0, 0, 'Fix', 'PF1', 'PT1', 'PO1', 'CamR1', '', 'Empty', 3), +(6, 1, 'Q2', 0.1, 0.11, 1, 34.2857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 0, 'Fix', 'PF1', 'PT1', 'PO1', 'CamR1', 'Empty', '', 3), +(7, 0, 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 0.20000000298023224, 'Fix', 'PF1', 'PT1', 'PO1', 'PM1', NULL, NULL, 1), +(9, 1, 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 0.20000000298023224, 'Fix', 'PF1', 'PT1', 'PO1', 'PM1', NULL, NULL, 1); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `testresult` +-- + +CREATE TABLE IF NOT EXISTS `testresult` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) NOT NULL, + `TestName` varchar(255) NOT NULL, + `Qfrom` float NOT NULL, + `Qto` float NOT NULL, + `Volume` float NOT NULL, + `TstTime` float NOT NULL, + `Repeats` int(11) NOT NULL, + `Emptying` tinyint(4) NOT NULL, + `Zeroing` tinyint(4) NOT NULL, + `Method` varchar(255) NOT NULL, + `ErrLimLo` float NOT NULL, + `ErrLimHi` float NOT NULL, + `FeedingPath` varchar(4000) NOT NULL, + `BenchPath` varchar(4000) NOT NULL, + `OutputPath` varchar(4000) NOT NULL, + `MetersPath` varchar(4000) NOT NULL, + `TimeStart` datetime DEFAULT NULL, + `TimeEnd` datetime DEFAULT NULL, + `RepetitionNr` int(11) DEFAULT NULL, + `AmbientTempAve` float DEFAULT NULL, + `AmbientPressAve` float DEFAULT NULL, + `AmbientHumiAve` float DEFAULT NULL, + `PressInAvrg` float DEFAULT NULL, + `PressInStart` float DEFAULT NULL, + `PressInEnd` float DEFAULT NULL, + `PressOutAvrg` float DEFAULT NULL, + `PressOutStart` float DEFAULT NULL, + `PressOutEnd` float DEFAULT NULL, + `TempInAvrg` float DEFAULT NULL, + `TempInStart` float DEFAULT NULL, + `TempInEnd` float DEFAULT NULL, + `TempOutAvrg` float DEFAULT NULL, + `TempOutStart` float DEFAULT NULL, + `TempOutEnd` float DEFAULT NULL, + `TempDivAvrg` float DEFAULT NULL, + `TempDivStart` float DEFAULT NULL, + `TempDivEnd` float DEFAULT NULL, + `MassStartRaw` float DEFAULT NULL, + `MassStart` float DEFAULT NULL, + `MassEndRaw` float DEFAULT NULL, + `MassEnd` float DEFAULT NULL, + `MassDiff` float DEFAULT NULL, + `DensityIn` float DEFAULT NULL, + `DensityOut` float DEFAULT NULL, + `DensityDiv` float DEFAULT NULL, + `FlowMass` float DEFAULT NULL, + `FlowVolume` float DEFAULT NULL, + `VolumeCTV` float DEFAULT NULL, + `VolumeMaster` float DEFAULT NULL, + `Time` float DEFAULT NULL, + `ErrorMaster` float DEFAULT NULL, + `PulsesMaster` float DEFAULT NULL, + `ConstMaster` float DEFAULT NULL, + `TimeDivStart0` float DEFAULT NULL, + `TimeDivStart1` float DEFAULT NULL, + `TimeDivStart2` float DEFAULT NULL, + `TimeDivStart3` float DEFAULT NULL, + `TimeDivStart4` float DEFAULT NULL, + `TimeDivStart5` float DEFAULT NULL, + `TimeDivEnd0` float DEFAULT NULL, + `TimeDivEnd1` float DEFAULT NULL, + `TimeDivEnd2` float DEFAULT NULL, + `TimeDivEnd3` float DEFAULT NULL, + `TimeDivEnd4` float DEFAULT NULL, + `TimeDivEnd5` float DEFAULT NULL, + `Test_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `Test_id` (`Test_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=117 ; + +-- +-- Sťahujem dáta pre tabuľku `testresult` +-- + +INSERT INTO `testresult` (`Id`, `Name`, `TestName`, `Qfrom`, `Qto`, `Volume`, `TstTime`, `Repeats`, `Emptying`, `Zeroing`, `Method`, `ErrLimLo`, `ErrLimHi`, `FeedingPath`, `BenchPath`, `OutputPath`, `MetersPath`, `TimeStart`, `TimeEnd`, `RepetitionNr`, `AmbientTempAve`, `AmbientPressAve`, `AmbientHumiAve`, `PressInAvrg`, `PressInStart`, `PressInEnd`, `PressOutAvrg`, `PressOutStart`, `PressOutEnd`, `TempInAvrg`, `TempInStart`, `TempInEnd`, `TempOutAvrg`, `TempOutStart`, `TempOutEnd`, `TempDivAvrg`, `TempDivStart`, `TempDivEnd`, `MassStartRaw`, `MassStart`, `MassEndRaw`, `MassEnd`, `MassDiff`, `DensityIn`, `DensityOut`, `DensityDiv`, `FlowMass`, `FlowVolume`, `VolumeCTV`, `VolumeMaster`, `Time`, `ErrorMaster`, `PulsesMaster`, `ConstMaster`, `TimeDivStart0`, `TimeDivStart1`, `TimeDivStart2`, `TimeDivStart3`, `TimeDivStart4`, `TimeDivStart5`, `TimeDivEnd0`, `TimeDivEnd1`, `TimeDivEnd2`, `TimeDivEnd3`, `TimeDivEnd4`, `TimeDivEnd5`, `Test_id`) VALUES +(12, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 16:14:45', '2014-01-16 16:16:01', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.6817, 20.707, 20.66, 20.6444, 20.64, 20.649, 21.0332, 21.476, 20.977, 15.004, 15.004, 30.0003, 30.0003, 14.9963, -10653400, -10560100, -11565500, 0.82243, 0.000825831, -0.0000014201, 0.0150583, 65.643, -1060470, 43368, -0.0000000000327453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(13, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 16:16:12', '2014-01-16 16:17:29', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.5147, 20.594, 20.434, 20.6606, 20.655, 20.665, 20.8344, 20.985, 20.671, 30.001, 30.001, 45.031, 45.031, 15.03, -10240700, -10600600, -11042300, 0.823699, 0.000825252, -0.00000141785, 0.0150583, 65.689, -1062160, 43368, -0.0000000000326934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(14, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 16:18:24', '2014-01-16 16:19:32', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.9611, 20.087, 19.855, 20.253, 20.359, 20.162, 19.5097, 19.689, 19.392, -0.15, -0.15, 49.9, 49.9, 50.05, -8963330, -9619950, -8018890, 3.16917, 0.00318029, -0.00000520273, 0.0502257, 56.854, -965472, 14465, -0.000000000359677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(15, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 18:07:01', '2014-01-16 18:08:17', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21.1302, 21.238, 21.055, 20.5009, 20.49, 20.52, 21.1938, 22.347, 21.157, 45.0307, 45.0307, 60.032, 60.032, 15.0013, -11827900, -10207200, -12002400, 0.823332, 0.00082646, -0.00000146969, 0.0150583, 65.593, -1024690, 43368, -0.0000000000338887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(16, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 18:08:28', '2014-01-16 18:09:44', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.8347, 20.945, 20.74, 20.5656, 20.539, 20.586, 21.0495, 21.208, 20.886, 60.033, 60.033, 75.0617, 75.0617, 15.0287, -11043100, -10365100, -11609200, 0.824681, 0.000826309, -0.00000144993, 0.0150583, 65.605, -1038660, 43368, -0.0000000000334332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(17, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 18:09:57', '2014-01-16 18:11:05', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.5572, 20.668, 20.437, 20.5237, 20.59, 20.427, 20.4795, 20.667, 20.07, 37.5333, 37.5333, 87.45, 87.45, 49.9167, -10344600, -10262600, -10155400, 3.17239, 0.00319203, -0.00000486393, 0.0502257, 56.645, -1032710, 14465, -0.000000000336255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(18, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 18:11:58', '2014-01-16 18:13:15', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.089, 20.18, 20.028, 20.1851, 20.23, 20.162, 19.7536, 20.562, 19.612, 75.064, 75.064, 90.0983, 90.0983, 15.0343, -9246400, -9463970, -8518710, 0.822109, 0.000823422, -0.00000158859, 0.0150583, 65.835, -948008, 43368, -0.0000000000366304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(19, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 18:58:11', '2014-01-16 18:59:28', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.4796, 20.516, 20.472, 20.0509, 20.045, 20.06, 20.5582, 21.385, 20.513, 105.137, 105.137, 120.175, 120.175, 15.0382, -10155600, -9161340, -10347100, 0.829056, 0.000830188, -0.00000164317, 0.0150587, 65.3, -916540, 43369, -0.0000000000378881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(20, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:02:57', '2014-01-16 19:04:13', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.0879, 20.11, 20.067, 20.1025, 20.116, 20.088, 19.71, 19.767, 19.663, -0.015, -0.015, 15.018, 15.018, 15.033, -9243910, -9276700, -8427500, 0.827075, 0.000828488, -0.00000162218, 0.0150587, 65.434, -928399, 43369, -0.0000000000374041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(21, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:04:26', '2014-01-16 19:05:35', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.009, 20.048, 19.945, 20.015, 20.073, 19.948, 20.0492, 20.382, 19.64, 62.2, 62.2, 112.15, 112.15, 49.95, -9068620, -9081830, -9157540, 3.15795, 0.00317516, -0.00000550566, 0.0502222, 56.942, -912293, 14464, -0.000000000380646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(22, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:12:23', '2014-01-16 19:13:39', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4851, 19.484, 19.495, 19.427, 19.423, 19.432, 19.3704, 20.249, 19.264, 15.019, 15.019, 30.0557, 30.0557, 15.0367, -7969830, -7854850, -7744200, 0.830487, 0.000831703, -0.00000191629, 0.0150587, 65.181, -785926, 43369, -0.0000000000441856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(23, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:13:50', '2014-01-16 19:15:06', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.516, 19.502, 19.53, 19.4375, 19.435, 19.44, 19.233, 19.243, 19.227, 30.0567, 30.0567, 45.094, 45.094, 15.0373, -8031570, -7875550, -7480540, 0.829367, 0.000830563, -0.00000191134, 0.015059, 65.272, -787979, 43370, -0.0000000000440705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(24, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:15:19', '2014-01-16 19:16:28', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5343, 19.539, 19.516, 19.4179, 19.439, 19.391, 19.1755, 19.149, 19.144, 99.45, 99.45, 149.45, 149.45, 50, -8068290, -7836940, -7372300, 3.14586, 0.00315984, -0.00000638661, 0.0502222, 57.218, -786467, 14464, -0.000000000441552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(25, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:21:22', '2014-01-16 19:22:49', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4173, 19.404, 19.432, 19.275, 19.268, 19.281, 19.2343, 19.514, 19.188, 45.096, 45.096, 65.112, 65.112, 20.016, -7835780, -7560240, -7482960, 0.944287, 0.00094671, -0.00000265026, 0.0200674, 76.309, -757284, 57794, -0.0000000000458571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(26, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:23:00', '2014-01-16 19:24:27', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4584, 19.443, 19.468, 19.287, 19.284, 19.29, 19.1715, 19.181, 19.165, 65.113, 65.113, 85.1613, 85.1613, 20.0483, -7916720, -7583320, -7364810, 0.947713, 0.000948612, -0.00000264647, 0.0200674, 76.156, -758370, 57794, -0.0000000000457913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(27, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:24:38', '2014-01-16 19:26:05', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4885, 19.478, 19.497, 19.2926, 19.29, 19.294, 19.158, 19.154, 19.157, 85.162, 85.162, 105.208, 105.208, 20.0457, -7976610, -7593900, -7339700, 0.94739, 0.000948413, -0.00000264243, 0.0200674, 76.172, -759527, 57794, -0.0000000000457216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(28, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:26:16', '2014-01-16 19:27:44', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5015, 19.499, 19.506, 19.2965, 19.295, 19.297, 19.1523, 19.153, 19.148, 105.209, 105.209, 125.272, 125.272, 20.0632, -8002540, -7601500, -7329090, 0.948104, 0.000948301, -0.00000264209, 0.0200674, 76.181, -759626, 57794, -0.0000000000457157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(29, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:31:21', '2014-01-16 19:32:48', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5373, 19.531, 19.541, 19.3035, 19.303, 19.303, 19.1628, 19.162, 19.167, -0.0146667, -0.0146667, 20.0267, 20.0267, 20.0413, -8074350, -7614920, -7348710, 0.94676, 0.000947973, -0.00000263456, 0.020067, 76.206, -761783, 57793, -0.0000000000455862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(30, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:33:05', '2014-01-16 19:34:00', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5399, 19.547, 19.522, 19.2907, 19.303, 19.277, 19.2285, 19.281, 19.17, 135.35, 135.35, 185.5, 185.5, 50.15, -8079450, -7590320, -7472090, 4.20712, 0.00421929, -0.0000066139, 0.0502951, 42.913, -760546, 14485, -0.000000000456604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(31, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:34:11', '2014-01-16 19:35:05', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4769, 19.499, 19.457, 19.25, 19.264, 19.24, 19.0993, 19.122, 19.082, 185.5, 185.5, 235.6, 235.6, 50.1, -7953420, -7512820, -7230970, 4.20243, 0.00421909, -0.00000667547, 0.0502986, 42.918, -753584, 14486, -0.000000000460822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(32, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:35:16', '2014-01-16 19:36:10', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4244, 19.441, 19.409, 19.2175, 19.228, 19.206, 19.0555, 19.068, 19.043, 235.6, 235.6, 285.7, 285.7, 50.1, -7849770, -7451310, -7150720, 4.20322, 0.00421988, -0.00000673057, 0.0502986, 42.91, -747416, 14486, -0.000000000464626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(33, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:36:21', '2014-01-16 19:37:16', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.387, 19.397, 19.378, 19.1919, 19.197, 19.186, 19.0261, 19.032, 19.022, 285.7, 285.7, 335.8, 335.8, 50.1, -7776420, -7403080, -7097240, 4.20341, 0.00421978, -0.00000677442, 0.0502951, 42.908, -742528, 14485, -0.000000000467685, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(34, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 19:37:27', '2014-01-16 19:38:21', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.3662, 19.371, 19.364, 19.1738, 19.176, 19.169, 19.0227, 19.018, 19.022, 335.85, 335.85, 385.9, 385.9, 50.05, -7735960, -7369200, -7090920, 4.19736, 0.00421792, -0.00000679877, 0.0502951, 42.927, -739868, 14485, -0.000000000469367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(35, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:00:50', '2014-01-16 20:02:02', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.8612, 19.848, 19.899, 19.3546, 19.353, 19.363, 19.7422, 20.301, 19.717, 20.026, 20.026, 35.066, 35.066, 15.04, 999.835, 999.937, 999.859, 889.546, 0.890918, 0.0150564, 0.0150632, 60.867, 0.0448699, 43382, 0.000000347067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(36, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:12:46', '2014-01-16 20:14:15', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.74, 19.768, 19.725, 19.5982, 19.595, 19.601, 19.5246, 19.636, 19.445, 35.068, 35.068, 55.1057, 55.1057, 20.0377, 999.859, 999.888, 999.903, 918.2, 0.919449, 0.0200605, 0.0200649, 78.562, 0.0218572, 57787, 0.000000347146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(37, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:14:26', '2014-01-16 20:15:55', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.7113, 19.715, 19.706, 19.5993, 19.601, 19.594, 19.3943, 19.42, 19.368, 55.106, 55.106, 75.146, 75.146, 20.04, 999.865, 999.888, 999.929, 917.793, 0.918934, 0.0200629, 0.0200649, 78.606, 0.0101567, 57787, 0.000000347187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(38, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:16:06', '2014-01-16 20:17:35', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.6979, 19.702, 19.693, 19.5842, 19.592, 19.574, 19.3313, 19.352, 19.316, 75.147, 75.147, 95.1887, 95.1887, 20.0417, 999.868, 999.891, 999.942, 917.332, 0.918413, 0.0200645, 0.0200653, 78.652, 0.00390826, 57788, 0.000000347209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(39, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:17:46', '2014-01-16 20:19:15', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.6841, 19.691, 19.679, 19.5638, 19.571, 19.556, 19.2957, 19.302, 19.283, 95.19, 95.19, 115.229, 115.229, 20.0395, 999.871, 999.895, 999.949, 917.127, 0.918292, 0.0200622, 0.0200649, 78.661, 0.0134901, 57787, 0.000000347175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(40, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:22:40', '2014-01-16 20:24:09', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.6572, 19.662, 19.654, 19.5088, 19.514, 19.503, 19.2485, 19.247, 19.243, -0.008, -0.008, 20.0293, 20.0293, 20.0373, 999.876, 999.906, 999.958, 916.644, 0.917907, 0.0200599, 0.0200649, 78.694, 0.0253307, 57787, 0.000000347134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5), +(41, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:24:22', '2014-01-16 20:25:17', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.6376, 19.647, 19.619, 19.4704, 19.498, 19.444, 19.5684, 19.723, 19.322, 321.3, 321.3, 371.45, 371.45, 50.1501, 999.88, 999.914, 999.894, 4176.56, 4.18893, 0.050206, 0.0502986, 43.227, 0.184409, 14486, 0.00000346583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(42, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:25:28', '2014-01-16 20:26:23', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5563, 19.585, 19.534, 19.3967, 19.416, 19.375, 19.1705, 19.204, 19.142, 371.45, 371.45, 421.55, 421.55, 50.0999, 999.897, 999.929, 999.974, 4177.41, 4.19369, 0.0501551, 0.0502951, 43.175, 0.279231, 14485, 0.00000346255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(43, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:26:34', '2014-01-16 20:27:29', 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4932, 19.508, 19.474, 19.3424, 19.355, 19.326, 19.1169, 19.123, 19.11, 421.55, 421.55, 471.65, 471.65, 50.1, 999.909, 999.94, 999.984, 4178.78, 4.19505, 0.0501547, 0.0502951, 43.161, 0.28008, 14485, 0.00000346252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(44, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:27:40', '2014-01-16 20:28:35', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4493, 19.463, 19.439, 19.3025, 19.314, 19.295, 19.0939, 19.104, 19.083, 471.65, 471.65, 521.75, 521.75, 50.1, 999.918, 999.948, 999.989, 4183.33, 4.19962, 0.0501542, 0.0502951, 43.114, 0.280944, 14485, 0.00000346249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(45, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:28:46', '2014-01-16 20:29:41', 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4219, 19.429, 19.418, 19.2712, 19.28, 19.263, 19.0808, 19.079, 19.082, 521.75, 521.75, 571.9, 571.9, 50.15, 999.924, 999.954, 999.991, 4183.91, 4.19602, 0.050204, 0.0502951, 43.151, 0.181545, 14485, 0.00000346593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6), +(46, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:40:54', '2014-01-16 20:42:10', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5879, 19.565, 19.632, 19.266, 19.264, 19.269, 19.4481, 20.174, 19.391, 20.03, 20.03, 35.0663, 35.0663, 15.0363, 999.89, 999.955, 999.918, 824.574, 825.78, 0.0150525, 15.0583, 65.647, 99938.8, 43368, 0.000000347088, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(47, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 20:42:21', '2014-01-16 20:43:38', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.6285, 19.633, 19.623, 19.2796, 19.27, 19.286, 19.3683, 19.376, 19.415, 35.067, 35.067, 50.1057, 50.1057, 15.0387, 999.882, 999.952, 999.934, 824.149, 825.227, 0.0150549, 15.0583, 65.691, 99923, 43368, 0.000000347143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(48, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-01-16 21:13:06', '2014-01-16 21:16:59', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.7619, 19.772, 19.735, 19.5558, 19.549, 19.559, 19.5009, 19.92, 19.399, 65.114, 65.114, 115.079, 115.079, 49.9652, 999.855, 999.897, 999.908, 810.312, 811.811, 50.0218, 50.0576, 221.982, 0.0716774, 144166, 0.000346974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(49, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-09 16:26:51', '2014-02-09 16:30:50', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 20.0735, 20.92, 19.658, 20.7167, 20.932, 20.172, 20.8378, 21.172, 20.15, 0.01, 0.01, 49.9093, 49.9093, 49.8993, 998.191, 998.056, 998.03, 788.133, 790.606, 50.048, 50.0559, 227.928, 0.0157243, 144161, 0.000347168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(50, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-09 16:31:58', '2014-02-09 16:35:50', 2, 20, 1, 40, 0, 0, 0, 0, 0, 0, 19.4366, 19.6, 19.234, 19.7194, 19.891, 19.556, 19.7971, 19.945, 19.648, 18.304, 18.304, 68.2543, 68.2543, 49.9503, 998.321, 998.264, 998.248, 811.614, 813.346, 50.0887, 50.0569, 221.56, -0.063486, 144164, 0.000347443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(51, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-09 18:14:07', '2014-02-09 18:18:04', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 22.6622, 22.933, 22.489, 23.1471, 23.138, 23.14, 23.0598, 23.464, 22.816, 0.008, 0.008, 49.845, 49.845, 49.837, 997.621, 997.506, 997.527, 797.031, 800.543, 50.0131, 50.0566, 225.102, 0.0870668, 144163, 0.00034692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(52, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-09 18:19:10', '2014-02-09 18:23:06', 2, 20, 1, 40, 0, 0, 0, 0, 0, 0, 21.2836, 22.028, 20.712, 23.0582, 23.115, 22.967, 22.1527, 22.736, 21.466, 18.1983, 18.1983, 68.0997, 68.0997, 49.9013, 997.933, 997.527, 997.738, 799.434, 801.921, 50.0766, 50.0566, 224.715, -0.039856, 144163, 0.000347361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(53, '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '2014-02-09 18:24:41', '2014-02-09 18:28:36', 3, 20, 1, 40, 0, 0, 0, 0, 0, 0, 20.2791, 20.433, 20.162, 22.6056, 22.818, 22.389, 20.7234, 20.996, 20.53, 18.1687, 18.1687, 68.0953, 68.0953, 49.9267, 998.148, 997.634, 998.054, 800.292, 802.38, 50.0966, 50.0569, 224.588, -0.0792307, 144164, 0.000347498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), +(54, 'Q1 (1/3)', 'Q1', 0.8, 0.85, 50, 218.182, 3, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-09 21:52:01', '2014-02-09 21:55:53', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68.0957, 68.0957, 117.959, 117.959, 49.8632, 999.843, 999.843, 999.843, 836.595, 839.305, 49.9224, 50.0247, 214.569, 0.204862, 144071, 0.000346512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(55, 'Q1 (1/3)', 'Q1', 0.8, 0.85, 50, 218.182, 3, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-09 23:22:17', '2014-02-09 23:26:18', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.28, 18.28, 68.1767, 68.1767, 49.8967, 999.843, 999.843, 999.843, 801.95, 804.041, 49.9559, 50.0267, 223.989, 0.141757, 144077, 0.000346731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(56, 'Q1 (2/3)', 'Q1', 0.8, 0.85, 50, 218.182, 3, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-09 23:28:05', '2014-02-09 23:32:06', 2, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.1723, 18.1723, 68.0773, 68.0773, 49.905, 999.843, 999.843, 999.843, 803.379, 805.283, 49.9643, 50.0233, 223.628, 0.118073, 144067, 0.000346813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(57, 'Q1 (3/3)', 'Q1', 0.8, 0.85, 50, 218.182, 3, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-09 23:33:53', '2014-02-09 23:37:54', 3, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.8957, 17.8957, 67.797, 67.797, 49.9013, 999.843, 999.843, 999.843, 803.223, 805.185, 49.9606, 50.0233, 223.655, 0.12545, 144067, 0.000346787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(58, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 00:23:37', '2014-02-10 00:27:39', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.6677, 17.6677, 67.5567, 67.5567, 49.889, 999.843, 999.843, 999.843, 803.714, 805.872, 49.9483, 50.0229, 223.463, 0.149485, 144066, 0.000346704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(59, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 00:28:01', '2014-02-10 00:29:16', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77.4, 77.4, 127.4, 127.4, 50, 999.843, 999.843, 999.843, 3160.94, 3174.99, 50.0594, 50.2222, 56.945, 0.325297, 14464, 0.00346096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(60, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 00:44:43', '2014-02-10 00:45:59', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36.9, 36.9, 86.9, 86.9, 50, 999.843, 999.843, 999.843, 3149.72, 3163.72, 50.0594, 50.2222, 57.148, 0.325297, 14464, 0.00346096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(61, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 00:47:02', '2014-02-10 00:51:02', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.26, 10.26, 60.1353, 60.1353, 49.8753, 999.843, 999.843, 999.843, 806.095, 808.548, 49.9346, 50.0271, 222.742, 0.185278, 144078, 0.00034658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(62, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 01:00:54', '2014-02-10 01:02:10', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86.85, 86.85, 136.85, 136.85, 50, 999.843, 999.843, 999.843, 3148.84, 3162.83, 50.0594, 50.2222, 57.164, 0.325282, 14464, 0.00346096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(63, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 01:35:39', '2014-02-10 01:39:32', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 20.618, 20.938, 20.255, 22.3268, 22.327, 22.319, 21.924, 22.491, 21.371, 0.011, 0.011, 49.915, 49.915, 49.904, 998.077, 997.698, 997.79, 833.876, 836.466, 50.0706, 50.059, 215.445, -0.0231911, 144170, 0.000347303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(64, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 01:49:10', '2014-02-10 01:50:26', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 19.694, 19.697, 19.686, 21.1796, 21.209, 21.152, 19.9144, 19.905, 19.874, 0.2, 0.2, 50.25, 50.25, 50.05, 998.269, 997.956, 998.224, 3179.97, 3191.13, 50.2042, 50.2257, 56.661, 0.0428624, 14465, 0.00347073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(65, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 02:03:10', '2014-02-10 02:07:04', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.2937, 18.2937, 68.182, 68.182, 49.8883, 999.843, 999.843, 999.843, 828.637, 830.884, 49.9476, 50.0236, 216.739, 0.152221, 144068, 0.000346694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(66, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 02:16:08', '2014-02-10 02:20:04', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17.7903, 17.7903, 67.6867, 67.6867, 49.8963, 999.843, 999.843, 999.843, 825.847, 827.954, 49.9556, 50.0236, 217.506, 0.136191, 144068, 0.00034675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(67, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 02:20:31', '2014-02-10 02:21:45', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95.05, 95.05, 145.1, 145.1, 50.05, 999.843, 999.843, 999.843, 3271.72, 3283.43, 50.1094, 50.2292, 55.072, 0.238948, 14466, 0.00346395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(68, 'Q1', 'Q1', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-02-10 02:59:06', '2014-02-10 03:03:00', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.208, 19.208, 69.0857, 69.0857, 49.8777, 999.843, 999.843, 999.843, 830.011, 832.451, 49.9369, 50.0243, 216.334, 0.175041, 144070, 0.000346616, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(69, 'Q2', 'Q2', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-02-10 03:03:30', '2014-02-10 03:04:43', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145.05, 145.05, 195.1, 195.1, 50.05, 999.843, 999.843, 999.843, 3280.53, 3292.5, 50.1095, 50.2326, 54.924, 0.24583, 14467, 0.00346371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(70, 'Q2', 'Q2', 4, 4.4, 50, 42.8571, 1, 0, 0, 'FlyingStartCollection', 0, 2, 'PF1', 'PT1', 'PO3', 'CamR1', '2014-02-10 08:20:28', '2014-02-10 08:21:30', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 50.2, 50.2, 50.1, 999.843, 999.843, 999.843, 4091, 4106.37, 50.1595, 50.2882, 44.087, 0.256574, 14483, 0.00346334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(71, 'Q0', 'Q0', 0.1, 0.11, 5, 171.429, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 10:17:23', '2014-07-26 10:20:25', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.269, 7.269, 12.257, 12.257, 4.988, 999.843, 999.843, 999.843, 103.557, 103.867, 4.99392, 5.00292, 173.4, 0.180072, 120070, 0.0000415918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(72, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 11:14:17', '2014-07-26 11:15:35', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12.256, 12.256, 14.2223, 14.2223, 1.96633, 999.843, 999.843, 999.843, 101.724, 103.617, 1.96867, 2.00292, 69.588, 1.73966, 48070, 0.0000409542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(73, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 11:16:44', '2014-07-26 11:18:20', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14.225, 14.225, 19.1427, 19.1427, 4.91767, 999.843, 999.843, 999.843, 201.695, 205.317, 4.92351, 5.00596, 87.774, 1.67467, 120143, 0.0000409804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(74, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 11:30:06', '2014-07-26 11:31:28', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.145, 19.145, 21.1093, 21.1093, 1.96433, 999.843, 999.843, 999.843, 96.846, 98.7421, 1.96667, 2.00279, 73.019, 1.83694, 48067, 0.0000409151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(75, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 11:33:12', '2014-07-26 11:34:50', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21.112, 21.112, 26.0257, 26.0257, 4.91367, 999.843, 999.843, 999.843, 196.807, 200.529, 4.9195, 5.00658, 89.881, 1.77015, 120158, 0.0000409419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(76, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 11:44:38', '2014-07-26 11:45:53', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26.028, 26.028, 28.024, 28.024, 1.996, 999.843, 999.843, 999.843, 108.08, 108.489, 1.99837, 2.00354, 66.484, 0.258764, 48085, 0.0000415591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(77, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:08:50', '2014-07-26 12:10:05', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28.025, 28.025, 29.992, 29.992, 1.967, 999.843, 999.843, 999.843, 106.749, 108.705, 1.96933, 2.00304, 66.335, 1.71158, 48073, 0.0000409655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(78, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:11:09', '2014-07-26 12:12:47', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.994, 29.994, 34.9147, 34.9147, 4.92067, 999.843, 999.843, 999.843, 197.703, 201.158, 4.92652, 5.00667, 89.601, 1.62695, 120160, 0.0000409996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(79, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:13:40', '2014-07-26 12:14:55', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34.917, 34.917, 36.883, 36.883, 1.966, 999.843, 999.843, 999.843, 106.568, 108.58, 1.96833, 2.00313, 66.414, 1.76753, 48075, 0.000040943, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(80, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:17:31', '2014-07-26 12:19:09', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36.885, 36.885, 41.8103, 41.8103, 4.92533, 999.843, 999.843, 999.843, 197.922, 201.153, 4.93118, 5.00575, 89.587, 1.51213, 120138, 0.000041046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(81, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:29:18', '2014-07-26 12:30:35', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41.813, 41.813, 43.7767, 43.7767, 1.96367, 999.843, 999.843, 999.843, 104.233, 106.345, 1.966, 2.00346, 67.821, 1.90527, 48083, 0.0000408876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(82, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:31:45', '2014-07-26 12:33:24', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43.779, 43.779, 48.706, 48.706, 4.927, 999.843, 999.843, 999.843, 197.971, 201.135, 4.93285, 5.00575, 89.595, 1.47778, 120138, 0.0000410599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(83, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:37:44', '2014-07-26 12:39:00', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48.708, 48.708, 50.6973, 50.6973, 1.98933, 999.843, 999.843, 999.843, 107.077, 108.059, 1.9917, 2.00758, 66.883, 0.797651, 48182, 0.0000413369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(84, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:40:05', '2014-07-26 12:41:44', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50.699, 50.699, 55.6387, 55.6387, 4.93967, 999.843, 999.843, 999.843, 196.732, 199.696, 4.94553, 5.01408, 90.391, 1.38612, 120338, 0.000041097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(85, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 12:58:37', '2014-07-26 12:59:52', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55.64, 55.64, 57.6257, 57.6257, 1.98567, 999.843, 999.843, 999.843, 106.768, 107.946, 1.98803, 2.00758, 66.953, 0.983745, 48182, 0.0000412608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(86, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 13:26:50', '2014-07-26 13:28:10', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57.627, 57.627, 60.5873, 60.5873, 2.96034, 999.843, 999.843, 999.843, 149.056, 151.592, 2.96385, 3.01071, 71.498, 1.58086, 72257, 0.0000410182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(87, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 14:19:00', '2014-07-26 14:20:16', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.534, 0.534, 2.505, 2.505, 1.971, 999.843, 999.843, 999.843, 105.685, 107.645, 1.97334, 2.00754, 67.139, 1.73315, 48181, 0.0000409568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(88, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 14:22:17', '2014-07-26 14:23:34', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.507, 2.507, 4.48033, 4.48033, 1.97333, 999.843, 999.843, 999.843, 104.082, 105.877, 1.97568, 2.00738, 68.254, 1.60444, 48177, 0.0000410087, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(89, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 14:30:05', '2014-07-26 14:31:22', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.482, 4.482, 6.45633, 6.45633, 1.97433, 999.843, 999.843, 999.843, 103.944, 105.684, 1.97668, 2.00738, 68.379, 1.55298, 48177, 0.0000410295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(90, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 14:41:57', '2014-07-26 14:43:36', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6.458, 6.458, 11.393, 11.393, 4.935, 999.843, 999.843, 999.843, 197.019, 200.178, 4.94086, 5.01413, 90.174, 1.48282, 120339, 0.0000410579, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(91, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:03:04', '2014-07-26 15:04:20', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11.394, 11.394, 13.3933, 13.3933, 1.99933, 999.843, 999.843, 999.843, 107.252, 107.695, 2.00171, 2.00758, 67.109, 0.293529, 48182, 0.0000415447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(92, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:09:48', '2014-07-26 15:11:05', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13.394, 13.394, 15.3663, 15.3663, 1.97233, 999.843, 999.843, 999.843, 104.251, 106.107, 1.97468, 2.00746, 68.109, 1.66019, 48179, 0.0000409862, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(93, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:12:15', '2014-07-26 15:13:53', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15.368, 15.368, 20.2937, 20.2937, 4.92566, 999.843, 999.843, 999.843, 199.317, 202.901, 4.93151, 5.01425, 88.966, 1.6777, 120342, 0.0000409792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(94, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:14:19', '2014-07-26 15:15:35', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.295, 20.295, 22.2647, 22.2647, 1.96967, 999.843, 999.843, 999.843, 106.099, 108.141, 1.972, 2.00758, 66.832, 1.80419, 48182, 0.0000409282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(95, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:16:05', '2014-07-26 15:17:44', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22.266, 22.266, 27.203, 27.203, 4.937, 999.843, 999.843, 999.843, 197.324, 200.414, 4.94286, 5.01429, 90.071, 1.44517, 120343, 0.0000410731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(96, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:25:44', '2014-07-26 15:27:00', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.775, 19.775, 21.7583, 21.7583, 1.98333, 999.843, 999.843, 999.843, 106.454, 107.756, 1.98569, 2.00758, 67.071, 1.10261, 48182, 0.0000412123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(97, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:27:57', '2014-07-26 15:29:36', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21.759, 21.759, 26.696, 26.696, 4.937, 999.843, 999.843, 999.843, 196.389, 199.455, 4.94286, 5.01408, 90.5, 1.44091, 120338, 0.0000410748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(98, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 15:30:04', '2014-07-26 15:31:19', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26.697, 26.697, 28.6853, 28.6853, 1.98833, 999.843, 999.843, 999.843, 107.615, 108.659, 1.99069, 2.00763, 66.515, 0.85051, 48183, 0.0000413153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(99, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 16:18:39', '2014-07-26 16:20:02', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28.685, 28.685, 30.6587, 30.6587, 1.97367, 999.843, 999.843, 999.843, 96.253, 97.8684, 1.97601, 2.00679, 73.818, 1.55772, 48163, 0.0000410276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(100, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 16:20:47', '2014-07-26 16:22:26', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30.66, 30.66, 35.599, 35.599, 4.939, 999.843, 999.843, 999.843, 197.668, 200.678, 4.94487, 5.01421, 89.951, 1.40231, 120341, 0.0000410905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(101, 'Q3', 'Q3', 0.8, 0.85, 50, 218.182, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO2', 'PM1', '2014-07-26 16:23:16', '2014-07-26 16:27:09', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35.599, 35.599, 85.5213, 85.5213, 49.9223, 999.843, 999.843, 999.843, 801.175, 803.33, 49.9816, 50.0566, 224.321, 0.150003, 144163, 0.000346702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(102, 'Q4', 'Q4', 3, 3.3, 50, 57.1429, 1, 0, 0, 'FlyingStartCollection', -2, 2, 'PF1', 'PT1', 'PO3', 'PM1', '2014-07-26 16:30:24', '2014-07-26 16:31:29', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35, 0.35, 50.45, 50.45, 50.1, 999.843, 999.843, 999.843, 3278.5, 3287.18, 50.1595, 50.2326, 55.013, 0.145813, 14467, 0.00346717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(103, 'Q1', 'Q1', 0.1, 0.11, 2, 68.5714, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 17:15:25', '2014-07-26 17:16:40', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.722, 1.722, 3.695, 3.695, 1.973, 999.843, 999.843, 999.843, 106.385, 108.25, 1.97534, 2.00758, 66.765, 1.63214, 48182, 0.0000409975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(104, 'Q2', 'Q2', 0.2, 0.22, 5, 85.7143, 1, 0, 0, 'FlyingStartCollection', 0, 0, 'PF1', 'PT1', 'PO1', 'PM1', '2014-07-26 17:23:26', '2014-07-26 17:25:05', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.694, 3.694, 8.63, 8.63, 4.936, 999.843, 999.843, 999.843, 197.177, 200.296, 4.94186, 5.01408, 90.12, 1.46144, 120338, 0.0000410665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(105, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 17:34:19', '2014-07-26 17:35:39', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.631, 8.631, 11.555, 11.555, 2.924, 999.843, 999.843, 999.843, 147.085, 151.444, 2.92747, 3.01067, 71.567, 2.84183, 72256, 0.0000405153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(106, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 17:59:24', '2014-07-26 18:00:45', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12.154, 12.154, 15.117, 15.117, 2.963, 999.843, 999.843, 999.843, 147.599, 149.967, 2.96652, 3.01054, 72.269, 1.48402, 72253, 0.0000410574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(107, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 18:19:22', '2014-07-26 18:20:43', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15.119, 15.119, 18.0793, 18.0793, 2.96033, 999.843, 999.843, 999.843, 146.98, 149.47, 2.96385, 3.0105, 72.508, 1.57406, 72252, 0.000041021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(108, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 18:41:58', '2014-07-26 18:43:19', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.08, 18.08, 21.0407, 21.0407, 2.96067, 999.843, 999.843, 999.843, 147.511, 149.996, 2.96418, 3.01054, 72.255, 1.56398, 72253, 0.000041025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(109, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 18:55:08', '2014-07-26 18:56:29', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21.042, 21.042, 24.004, 24.004, 2.962, 999.843, 999.843, 999.843, 147.825, 150.247, 2.96552, 3.01054, 72.134, 1.51826, 72253, 0.0000410435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(110, 'Q2', 'Q2', 0.15, 0.17, 3, 67.5, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 19:18:36', '2014-07-26 19:19:57', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24.005, 24.005, 26.9677, 26.9677, 2.96267, 999.843, 999.843, 999.843, 147.87, 150.26, 2.96619, 3.01054, 72.128, 1.49539, 72253, 0.0000410528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(111, 'Q2', 'Q2', 0.1, 0.11, 3, 102.857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-26 19:47:10', '2014-07-26 19:49:02', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26.969, 26.969, 29.9237, 29.9237, 2.95467, 999.843, 999.843, 999.843, 103.223, 105.064, 2.95817, 3.00738, 103.047, 1.6632, 72177, 0.000040985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(112, 'Q2', 'Q2', 0.1, 0.11, 3, 102.857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-27 10:30:09', '2014-07-27 10:32:08', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.011, 0.011, 2.96033, 2.96033, 2.94933, 999.843, 999.843, 999.843, 96.153, 98.029, 2.95284, 3.00688, 110.424, 1.83007, 72165, 0.0000409178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(113, 'Q2', 'Q2', 0.1, 0.11, 3, 102.857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-27 10:36:50', '2014-07-27 10:38:49', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.962, 2.962, 5.91533, 5.91533, 2.95333, 999.843, 999.843, 999.843, 96.7936, 98.547, 2.95684, 3.00683, 109.842, 1.69075, 72164, 0.0000409739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(114, 'Q2', 'Q2', 0.1, 0.11, 3, 102.857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-27 11:01:45', '2014-07-27 11:03:41', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5.916, 5.916, 8.87, 8.87, 2.954, 999.843, 999.843, 999.843, 99.2015, 100.984, 2.95751, 3.00708, 107.2, 1.67626, 72170, 0.0000409797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(115, 'Q2', 'Q2', 0.1, 0.11, 1, 34.2857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-27 11:13:59', '2014-07-27 11:14:44', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.623, 10.623, 11.611, 11.611, 0.988, 999.843, 999.843, 999.843, 99.02, 100.937, 0.989173, 1.00713, 35.92, 1.81483, 24171, 0.000040924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL), +(116, 'Q2', 'Q2', 0.1, 0.11, 1, 34.2857, 1, 0, 0, 'FlyingStartCollection', -5, 5, 'PF1', 'PT1', 'PO1', 'CamR1', '2014-07-27 11:26:19', '2014-07-27 11:27:04', 1, 20, 1, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12.603, 12.603, 13.5893, 13.5893, 0.986333, 999.843, 999.843, 999.843, 99.1926, 101.284, 0.987504, 1.00713, 35.797, 1.98691, 24171, 0.0000408549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `transitionsequence` +-- + +CREATE TABLE IF NOT EXISTS `transitionsequence` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Sťahujem dáta pre tabuľku `transitionsequence` +-- + +INSERT INTO `transitionsequence` (`Id`, `ItemNr`, `Name`, `Description`) VALUES +(1, 0, 'Tr1', NULL), +(2, 1, 'Tr0', NULL), +(3, 2, 'Empty', NULL); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `transitionstep` +-- + +CREATE TABLE IF NOT EXISTS `transitionstep` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `ItemNr` int(11) DEFAULT NULL, + `Duration` int(11) DEFAULT NULL, + `ValvesOpen` varchar(8000) DEFAULT NULL, + `ValvesClose` varchar(8000) DEFAULT NULL, + `RegulValvesPct` varchar(255) DEFAULT NULL, + `TransitionSequence_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; + +-- +-- Sťahujem dáta pre tabuľku `transitionstep` +-- + +INSERT INTO `transitionstep` (`Id`, `ItemNr`, `Duration`, `ValvesOpen`, `ValvesClose`, `RegulValvesPct`, `TransitionSequence_id`) VALUES +(1, 0, 15, 'K5;K7;K2', '', '30;---;---;---;---', 1), +(2, 1, 15, 'K10', '', '20;30;---;---;---', 1), +(3, 2, 15, 'K13', '', '10;20;30;---;---', 1), +(4, 3, 15, 'K5', 'K7;K10;K13;K2', '0;0;0;---;---', 1), +(5, 0, 1, '', '', '---;---;---;---;---', 2); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(255) DEFAULT NULL, + `Password` varchar(255) DEFAULT NULL, + `Description` varchar(255) DEFAULT NULL, + `LastPwChange` datetime DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Sťahujem dáta pre tabuľku `user` +-- + +INSERT INTO `user` (`Id`, `Name`, `Password`, `Description`, `LastPwChange`) VALUES +(1, 'admin', 'af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909', 'Application administrator', '2013-12-30 12:17:19'), +(2, 'tester', '', 'tester', '2013-12-30 12:17:19'); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `watermeter` +-- + +CREATE TABLE IF NOT EXISTS `watermeter` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Serial` varchar(255) DEFAULT NULL, + `WMType_id` int(11) DEFAULT NULL, + PRIMARY KEY (`Id`), + KEY `WMType_id` (`WMType_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Sťahujem dáta pre tabuľku `watermeter` +-- + +INSERT INTO `watermeter` (`Id`, `Serial`, `WMType_id`) VALUES +(1, '1234', 1), +(2, '4321', 2); + +-- -------------------------------------------------------- + +-- +-- Štruktúra tabuľky pre tabuľku `wmtype` +-- + +CREATE TABLE IF NOT EXISTS `wmtype` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `CreateTime` datetime DEFAULT NULL, + `CreateUserName` varchar(255) DEFAULT NULL, + `CreateDescription` varchar(255) DEFAULT NULL, + `Name` varchar(255) DEFAULT NULL, + `PulseRate` float DEFAULT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Sťahujem dáta pre tabuľku `wmtype` +-- + +INSERT INTO `wmtype` (`Id`, `CreateTime`, `CreateUserName`, `CreateDescription`, `Name`, `PulseRate`) VALUES +(1, '0001-01-01 00:00:00', NULL, NULL, 'defaultmetertype', 1000), +(2, '0001-01-01 00:00:00', NULL, NULL, 'secondtype', 2000); + +-- +-- Obmedzenie pre exportované tabuľky +-- + +-- +-- Obmedzenie pre tabuľku `componentprocedure` +-- +ALTER TABLE `componentprocedure` + ADD CONSTRAINT `FKA4EE67E2C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`), + ADD CONSTRAINT `FKF52C29EE2B6C2FF0` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Obmedzenie pre tabuľku `componenttest` +-- +ALTER TABLE `componenttest` + ADD CONSTRAINT `FK191C57B82582AD8D` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`), + ADD CONSTRAINT `FK4933B35E048BC68` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Obmedzenie pre tabuľku `group` +-- +ALTER TABLE `group` + ADD CONSTRAINT `FKBA21C18EF68B56E6` FOREIGN KEY (`User_id`) REFERENCES `user` (`Id`); + +-- +-- Obmedzenie pre tabuľku `measurementcorrection` +-- +ALTER TABLE `measurementcorrection` + ADD CONSTRAINT `FK2E70F3322F02977E` FOREIGN KEY (`Component_id`) REFERENCES `component` (`Id`), + ADD CONSTRAINT `FKD31F9EED177796BA` FOREIGN KEY (`Component_id`) REFERENCES `component` (`Id`); + +-- +-- Obmedzenie pre tabuľku `metertestresult` +-- +ALTER TABLE `metertestresult` + ADD CONSTRAINT `FK70D262D7BB966EEE` FOREIGN KEY (`TestResult_id`) REFERENCES `testresult` (`Id`); + +-- +-- Obmedzenie pre tabuľku `test` +-- +ALTER TABLE `test` + ADD CONSTRAINT `FKCC127866C1B693F2` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`), + ADD CONSTRAINT `FKEAE38E972B6C2FF0` FOREIGN KEY (`Procedure_id`) REFERENCES `procedure` (`Id`); + +-- +-- Obmedzenie pre tabuľku `testresult` +-- +ALTER TABLE `testresult` + ADD CONSTRAINT `FK420D31612582AD8D` FOREIGN KEY (`Test_id`) REFERENCES `test` (`Id`); + +-- +-- Obmedzenie pre tabuľku `watermeter` +-- +ALTER TABLE `watermeter` + ADD CONSTRAINT `FK7FD3784077883960` FOREIGN KEY (`WMType_id`) REFERENCES `wmtype` (`Id`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/TestBenchFramework/Screens/LogsTabPageCtrl.Designer.cs b/TestBenchFramework/Screens/LogsTabPageCtrl.Designer.cs new file mode 100644 index 000000000..f9b01e17a --- /dev/null +++ b/TestBenchFramework/Screens/LogsTabPageCtrl.Designer.cs @@ -0,0 +1,100 @@ +namespace TBF.Screens +{ + partial class LogsTabPageCtrl + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogsTabPageCtrl)); + this.logTextBox = new System.Windows.Forms.TextBox(); + this.clearButton = new System.Windows.Forms.Button(); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.logsTextBox = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // logTextBox + // + resources.ApplyResources(this.logTextBox, "logTextBox"); + this.logTextBox.Name = "logTextBox"; + // + // clearButton + // + resources.ApplyResources(this.clearButton, "clearButton"); + this.clearButton.Name = "clearButton"; + this.clearButton.UseVisualStyleBackColor = true; + this.clearButton.Click += new System.EventHandler(this.clearButton_Click); + // + // splitContainer + // + resources.ApplyResources(this.splitContainer, "splitContainer"); + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control; + this.splitContainer.Panel1.Controls.Add(this.clearButton); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.logsTextBox); + // + // logsTextBox + // + this.logsTextBox.BackColor = System.Drawing.SystemColors.Control; + resources.ApplyResources(this.logsTextBox, "logsTextBox"); + this.logsTextBox.Name = "logsTextBox"; + // + // LogsTabPageCtrl + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Silver; + this.Controls.Add(this.splitContainer); + this.Controls.Add(this.logTextBox); + this.Name = "LogsTabPageCtrl"; + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + this.splitContainer.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox logTextBox; + private System.Windows.Forms.Button clearButton; + private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.TextBox logsTextBox; + } +} diff --git a/TestBenchFramework/Screens/LogsTabPageCtrl.cs b/TestBenchFramework/Screens/LogsTabPageCtrl.cs new file mode 100644 index 000000000..63049a589 --- /dev/null +++ b/TestBenchFramework/Screens/LogsTabPageCtrl.cs @@ -0,0 +1,35 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.Screens +{ + public partial class LogsTabPageCtrl : UserControl + { + public LogsTabPageCtrl() + { + InitializeComponent(); + clearButton.Text = Strings.ClearBtnText; + + Bridge.LogHandler += delegate(object sender, LogEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnLog), sender, args); + } + else OnLog(sender, args); + }; + } + + private void clearButton_Click(object sender, EventArgs e) + { + logsTextBox.Clear(); + } + + void OnLog(object sender, LogEventArgs args) + { + logsTextBox.AppendText(args.LogMessage); + } + } +} diff --git a/TestBenchFramework/Screens/LogsTabPageCtrl.resx b/TestBenchFramework/Screens/LogsTabPageCtrl.resx new file mode 100644 index 000000000..968ca4f69 --- /dev/null +++ b/TestBenchFramework/Screens/LogsTabPageCtrl.resx @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 98, 249 + + + + 2, 2, 2, 2 + + + + True + + + Both + + + 644, 420 + + + 0 + + + logTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 20, 10 + + + 2, 2, 2, 2 + + + 100, 30 + + + 1 + + + &Clear + + + clearButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 0 + + + Fill + + + True + + + 0, 0 + + + Horizontal + + + splitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 0 + + + Fill + + + 0, 0 + + + True + + + Vertical + + + 965, 643 + + + 0 + + + logsTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel2 + + + 0 + + + splitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 1 + + + 965, 689 + + + 42 + + + 2 + + + splitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + Microsoft Sans Serif, 8.25pt + + + 965, 689 + + + LogsTabPageCtrl + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Screens/MeasurementTabPageCtrl.Designer.cs b/TestBenchFramework/Screens/MeasurementTabPageCtrl.Designer.cs new file mode 100644 index 000000000..6013a73f9 --- /dev/null +++ b/TestBenchFramework/Screens/MeasurementTabPageCtrl.Designer.cs @@ -0,0 +1,205 @@ +namespace TBF.Screens +{ + partial class MeasurementTabPageCtrl + { + /// + /// 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() + { + this.measurementLabel5 = new System.Windows.Forms.Label(); + this.measurementLabel4 = new System.Windows.Forms.Label(); + this.measurementLabel3 = new System.Windows.Forms.Label(); + this.measurementLabel2 = new System.Windows.Forms.Label(); + this.measurementLabel = new System.Windows.Forms.Label(); + this.measurementTableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.measurementTableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.measurementTableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.measurementTableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.SuspendLayout(); + // + // measurementLabel5 + // + this.measurementLabel5.AutoSize = true; + this.measurementLabel5.Font = new System.Drawing.Font("Verdana", 11.25F); + this.measurementLabel5.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.measurementLabel5.Location = new System.Drawing.Point(471, 136); + this.measurementLabel5.Name = "measurementLabel5"; + this.measurementLabel5.Size = new System.Drawing.Size(74, 18); + this.measurementLabel5.TabIndex = 17; + this.measurementLabel5.Text = "Time Bar"; + // + // measurementLabel4 + // + this.measurementLabel4.AutoSize = true; + this.measurementLabel4.Font = new System.Drawing.Font("Verdana", 11.25F); + this.measurementLabel4.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.measurementLabel4.Location = new System.Drawing.Point(328, 136); + this.measurementLabel4.Name = "measurementLabel4"; + this.measurementLabel4.Size = new System.Drawing.Size(74, 18); + this.measurementLabel4.TabIndex = 16; + this.measurementLabel4.Text = "Time Bar"; + // + // measurementLabel3 + // + this.measurementLabel3.AutoSize = true; + this.measurementLabel3.Font = new System.Drawing.Font("Verdana", 11.25F); + this.measurementLabel3.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.measurementLabel3.Location = new System.Drawing.Point(484, 164); + this.measurementLabel3.Name = "measurementLabel3"; + this.measurementLabel3.Size = new System.Drawing.Size(45, 18); + this.measurementLabel3.TabIndex = 15; + this.measurementLabel3.Text = "Total"; + // + // measurementLabel2 + // + this.measurementLabel2.AutoSize = true; + this.measurementLabel2.Font = new System.Drawing.Font("Verdana", 11.25F); + this.measurementLabel2.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.measurementLabel2.Location = new System.Drawing.Point(323, 164); + this.measurementLabel2.Name = "measurementLabel2"; + this.measurementLabel2.Size = new System.Drawing.Size(87, 18); + this.measurementLabel2.TabIndex = 14; + this.measurementLabel2.Text = "Actual test"; + // + // measurementLabel + // + this.measurementLabel.AutoSize = true; + this.measurementLabel.Font = new System.Drawing.Font("Verdana", 11.25F); + this.measurementLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.measurementLabel.Location = new System.Drawing.Point(639, 514); + this.measurementLabel.Name = "measurementLabel"; + this.measurementLabel.Size = new System.Drawing.Size(108, 18); + this.measurementLabel.TabIndex = 13; + this.measurementLabel.Text = "Target values"; + // + // measurementTableLayoutPanel4 + // + this.measurementTableLayoutPanel4.ColumnCount = 3; + this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.measurementTableLayoutPanel4.Location = new System.Drawing.Point(642, 544); + this.measurementTableLayoutPanel4.Name = "measurementTableLayoutPanel4"; + this.measurementTableLayoutPanel4.RowCount = 4; + this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.measurementTableLayoutPanel4.Size = new System.Drawing.Size(216, 101); + this.measurementTableLayoutPanel4.TabIndex = 12; + // + // measurementTableLayoutPanel3 + // + this.measurementTableLayoutPanel3.ColumnCount = 3; + this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); + this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); + this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34F)); + this.measurementTableLayoutPanel3.Location = new System.Drawing.Point(521, 11); + this.measurementTableLayoutPanel3.Name = "measurementTableLayoutPanel3"; + this.measurementTableLayoutPanel3.RowCount = 2; + this.measurementTableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.measurementTableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.measurementTableLayoutPanel3.Size = new System.Drawing.Size(348, 55); + this.measurementTableLayoutPanel3.TabIndex = 11; + // + // measurementTableLayoutPanel2 + // + this.measurementTableLayoutPanel2.ColumnCount = 2; + this.measurementTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.measurementTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.measurementTableLayoutPanel2.Location = new System.Drawing.Point(11, 245); + this.measurementTableLayoutPanel2.Name = "measurementTableLayoutPanel2"; + this.measurementTableLayoutPanel2.RowCount = 12; + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel2.Size = new System.Drawing.Size(177, 303); + this.measurementTableLayoutPanel2.TabIndex = 10; + // + // measurementTableLayoutPanel1 + // + this.measurementTableLayoutPanel1.ColumnCount = 3; + this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F)); + this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F)); + this.measurementTableLayoutPanel1.Location = new System.Drawing.Point(11, 21); + this.measurementTableLayoutPanel1.Name = "measurementTableLayoutPanel1"; + this.measurementTableLayoutPanel1.RowCount = 7; + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.measurementTableLayoutPanel1.Size = new System.Drawing.Size(283, 183); + this.measurementTableLayoutPanel1.TabIndex = 9; + // + // MeasurementTabPageCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(180)))), ((int)(((byte)(200))))); + this.Controls.Add(this.measurementLabel5); + this.Controls.Add(this.measurementLabel4); + this.Controls.Add(this.measurementLabel3); + this.Controls.Add(this.measurementLabel2); + this.Controls.Add(this.measurementLabel); + this.Controls.Add(this.measurementTableLayoutPanel4); + this.Controls.Add(this.measurementTableLayoutPanel3); + this.Controls.Add(this.measurementTableLayoutPanel2); + this.Controls.Add(this.measurementTableLayoutPanel1); + this.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.Margin = new System.Windows.Forms.Padding(4); + this.Name = "MeasurementTabPageCtrl"; + this.Size = new System.Drawing.Size(900, 689); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.measurement_Paint); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label measurementLabel5; + private System.Windows.Forms.Label measurementLabel4; + private System.Windows.Forms.Label measurementLabel3; + private System.Windows.Forms.Label measurementLabel2; + private System.Windows.Forms.Label measurementLabel; + private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel4; + private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel3; + private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel1; + } +} diff --git a/TestBenchFramework/Screens/MeasurementTabPageCtrl.cs b/TestBenchFramework/Screens/MeasurementTabPageCtrl.cs new file mode 100644 index 000000000..603a28c97 --- /dev/null +++ b/TestBenchFramework/Screens/MeasurementTabPageCtrl.cs @@ -0,0 +1,178 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using log4net; +using TBF.UiBridge; + +namespace TBF.Screens +{ + public partial class MeasurementTabPageCtrl : UserControl + { + static readonly ILog log = LogManager.GetLogger(typeof(MeasurementTabPageCtrl)); + + AttachedTextBoxes measurementTbl1Row1; /// Table 1 + AttachedTextBoxes measurementTbl1Col1; + AttachedTextBoxes measurementTbl1Col2; + AttachedTextBoxes measurementTbl1Col3; + AttachedTextBoxes measurementTbl2Row1; /// Table 2 + AttachedTextBoxes measurementTbl2Col1; + AttachedTextBoxes measurementTbl2Col2; + AttachedTextBoxes measurementTbl3Row1; /// Table 3 + AttachedTextBoxes measurementTbl3Row2; + AttachedTextBoxes measurementTbl4Col1; + AttachedTextBoxes measurementTbl4Col2; + AttachedTextBoxes measurementTbl4Col3; + + BarGraph measurementBar1; + BarGraph measurementBar2; + + public MeasurementTabPageCtrl() + { + InitializeComponent(); + + Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestSelected), sender, args); + } + else OnTestSelected(sender, args); + }; + Bridge.TestProgressHandler += delegate(object sender, TestProgressEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestProgress), sender, args); + } + else OnTestProgress(sender, args); + }; + Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestCompleted), sender, args); + } + else OnTestCompleted(sender, args); + }; + + Init(); + } + + private void Init() + { + measurementTbl1Row1 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.RowOfStrings, 1, 0, 2); + measurementTbl1Col1 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfStrings, 0, 1, 6); + measurementTbl1Col2 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfDoubles, 1, 1, 6); + measurementTbl1Col3 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfDoubles, 2, 1, 6); + measurementTbl2Row1 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.RowOfStrings, 1, 0, 1); + measurementTbl2Col1 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.ColumnOfStrings, 0, 1, 11); + measurementTbl2Col2 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.ColumnOfDoubles, 1, 1, 11); + measurementTbl3Row1 = new AttachedTextBoxes(measurementTableLayoutPanel3, Arrangement.RowOfStrings, 0, 0, 3); + measurementTbl3Row2 = new AttachedTextBoxes(measurementTableLayoutPanel3, Arrangement.RowOfDoubles, 0, 1, 3); + measurementTbl4Col1 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfStrings, 0, 0, 4); + measurementTbl4Col2 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfDoubles, 1, 0, 4); + measurementTbl4Col3 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfStrings, 2, 0, 4); + + CustomStyle.Apply(1, measurementTbl1Row1); + CustomStyle.Apply(1, measurementTbl1Col1); + CustomStyle.Apply(1, measurementTbl1Col2); + CustomStyle.Apply(1, measurementTbl1Col3); + CustomStyle.Apply(1, measurementTbl2Row1); + CustomStyle.Apply(1, measurementTbl2Col1); + CustomStyle.Apply(1, measurementTbl2Col2); + CustomStyle.Apply(1, measurementTbl3Row1); + CustomStyle.Apply(1, measurementTbl3Row2); + CustomStyle.Apply(1, measurementTbl4Col1); + CustomStyle.Apply(1, measurementTbl4Col2); + CustomStyle.Apply(1, measurementTbl4Col3); + + measurementTbl1Row1.SetData(0, "Vmer"); + measurementTbl1Row1.SetData(1, "Emer"); + for (int i = 0; i < Program.WMsCount; i++) measurementTbl1Col1.SetData(i, "Meter" + (i + 1).ToString()); + + measurementTbl2Row1.SetData(0, "Ergebnise"); + measurementTbl2Col1.SetData(0, "IMP"); + measurementTbl2Col1.SetData(1, "Zeit"); + measurementTbl2Col1.SetData(2, "V_etn"); + measurementTbl2Col1.SetData(3, "Temp up"); + measurementTbl2Col1.SetData(4, "Temp dn"); + measurementTbl2Col1.SetData(5, "T Kl"); + measurementTbl2Col1.SetData(6, "Druck up"); + measurementTbl2Col1.SetData(7, "Druck dn"); + measurementTbl2Col1.SetData(8, "Durchfl. act"); + measurementTbl2Col1.SetData(9, "Zeit Kl in"); + measurementTbl2Col1.SetData(10, "Zeit Kl out"); + + measurementTbl3Row1.SetData(0, "Temp. Luft"); + measurementTbl3Row1.SetData(1, "Druck Luft"); + measurementTbl3Row1.SetData(2, "Humi. Luft"); + + measurementTbl4Col1.SetData(0, "Durchfl. Tar Min"); + measurementTbl4Col1.SetData(1, "Durchfl. Tar Max"); + measurementTbl4Col1.SetData(2, "Volumen Tar"); + measurementTbl4Col1.SetData(3, "Dauer"); + + //measurementTbl4Col2.SetData(0, 1.5); + //measurementTbl4Col2.SetData(1, 1.65); + //measurementTbl4Col2.SetData(2, 50); + //measurementTbl4Col2.SetData(3, 114.29); + + measurementTbl4Col3.SetData(0, "m3/h"); + measurementTbl4Col3.SetData(1, "m3/h"); + measurementTbl4Col3.SetData(2, "l"); + measurementTbl4Col3.SetData(3, "s"); + + measurementBar1 = new BarGraph(this, 320, 200, 100, 400, Color.DarkBlue, Color.WhiteSmoke); + measurementBar2 = new BarGraph(this, 470, 200, 100, 400, Color.DarkBlue, Color.WhiteSmoke); + } + + private void measurement_Paint(object sender, PaintEventArgs e) + { + Graphics g = e.Graphics; + if (measurementBar1 != null) measurementBar1.Paint(g); + if (measurementBar2 != null) measurementBar2.Paint(g); + g.DrawRectangle(new Pen(Color.Black, 2.0F), 500, -2, 402, 80); + g.DrawRectangle(new Pen(Color.Black, 2.0F), 620, 500, 282, 250); + } + + + public void OnTestSelected(object sender, TestSelectedEventArgs data) + { + measurementTbl4Col2.SetData(0, data.Test.Qfrom.ToString("F2")); + measurementTbl4Col2.SetData(1, data.Test.Qto.ToString("F2")); + measurementTbl4Col2.SetData(2, data.Test.Volume.ToString("F1")); + measurementTbl4Col2.SetData(3, data.Test.TstTime.ToString("F1")); + } + + public void OnTestProgress(object sender, TestProgressEventArgs data) + { + if (data.WmVolume != null) + { + for (int i = 0; i < Program.WMsCount; i++) + { + measurementTbl1Col2.SetData(i, data.WmVolume[i].ToString("F1")); + measurementTbl1Col3.SetData(i, data.WmErrPct[i].ToString("F1")); + } + } + measurementTbl2Col2.SetData(0, data.RefPulses); + measurementTbl2Col2.SetData(1, data.Time.ToString("F1")); + + measurementTbl2Col2.SetData(3, data.Tin.ToString("F2")); + measurementTbl2Col2.SetData(4, data.Tout.ToString("F2")); + measurementTbl2Col2.SetData(5, data.Tdiv.ToString("F2")); + measurementTbl2Col2.SetData(6, data.Pin); + measurementTbl2Col2.SetData(7, data.Pout); + measurementTbl2Col2.SetData(8, data.Flow.ToString("F3")); + + measurementTbl3Row2.SetData(0, data.AmbientTemp); + measurementTbl3Row2.SetData(1, data.AmbientPressure); + measurementTbl3Row2.SetData(2, data.AmbientHumidity); + + //measurementBar1.FValue = data.Progress; + } + + public void OnTestCompleted(object sender, TestCompletedEventArgs data) + { + } + } +} diff --git a/TestBenchFramework/Screens/MeasurementTabPageCtrl.resx b/TestBenchFramework/Screens/MeasurementTabPageCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Screens/MeasurementTabPageCtrl.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/TestBenchFramework/Screens/PicturesTabPageCtrl.Designer.cs b/TestBenchFramework/Screens/PicturesTabPageCtrl.Designer.cs new file mode 100644 index 000000000..ee6062e67 --- /dev/null +++ b/TestBenchFramework/Screens/PicturesTabPageCtrl.Designer.cs @@ -0,0 +1,174 @@ +namespace TBF.Screens +{ + partial class PicturesTabPageCtrl + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PicturesTabPageCtrl)); + this.logTextBox = new System.Windows.Forms.TextBox(); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.configureButton = new System.Windows.Forms.Button(); + this.cameraPictureCtrl6 = new TBF.UiControls.CameraPictureCtrl(); + this.cameraPictureCtrl5 = new TBF.UiControls.CameraPictureCtrl(); + this.cameraPictureCtrl4 = new TBF.UiControls.CameraPictureCtrl(); + this.cameraPictureCtrl3 = new TBF.UiControls.CameraPictureCtrl(); + this.cameraPictureCtrl2 = new TBF.UiControls.CameraPictureCtrl(); + this.cameraPictureCtrl1 = new TBF.UiControls.CameraPictureCtrl(); + this.grabButton = new System.Windows.Forms.Button(); + this.liveButton = new System.Windows.Forms.Button(); + this.focusButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // logTextBox + // + resources.ApplyResources(this.logTextBox, "logTextBox"); + this.logTextBox.Name = "logTextBox"; + // + // splitContainer + // + resources.ApplyResources(this.splitContainer, "splitContainer"); + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer.Name = "splitContainer"; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control; + this.splitContainer.Panel1.Controls.Add(this.focusButton); + this.splitContainer.Panel1.Controls.Add(this.liveButton); + this.splitContainer.Panel1.Controls.Add(this.grabButton); + this.splitContainer.Panel1.Controls.Add(this.configureButton); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl6); + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl5); + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl4); + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl3); + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl2); + this.splitContainer.Panel2.Controls.Add(this.cameraPictureCtrl1); + // + // configureButton + // + resources.ApplyResources(this.configureButton, "configureButton"); + this.configureButton.Name = "configureButton"; + this.configureButton.UseVisualStyleBackColor = true; + this.configureButton.Click += new System.EventHandler(this.configureButton_Click); + // + // cameraPictureCtrl6 + // + this.cameraPictureCtrl6.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl6, "cameraPictureCtrl6"); + this.cameraPictureCtrl6.Name = "cameraPictureCtrl6"; + // + // cameraPictureCtrl5 + // + this.cameraPictureCtrl5.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl5, "cameraPictureCtrl5"); + this.cameraPictureCtrl5.Name = "cameraPictureCtrl5"; + // + // cameraPictureCtrl4 + // + this.cameraPictureCtrl4.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl4, "cameraPictureCtrl4"); + this.cameraPictureCtrl4.Name = "cameraPictureCtrl4"; + // + // cameraPictureCtrl3 + // + this.cameraPictureCtrl3.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl3, "cameraPictureCtrl3"); + this.cameraPictureCtrl3.Name = "cameraPictureCtrl3"; + // + // cameraPictureCtrl2 + // + this.cameraPictureCtrl2.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl2, "cameraPictureCtrl2"); + this.cameraPictureCtrl2.Name = "cameraPictureCtrl2"; + // + // cameraPictureCtrl1 + // + this.cameraPictureCtrl1.BackColor = System.Drawing.SystemColors.ButtonShadow; + resources.ApplyResources(this.cameraPictureCtrl1, "cameraPictureCtrl1"); + this.cameraPictureCtrl1.Name = "cameraPictureCtrl1"; + // + // grabButton + // + resources.ApplyResources(this.grabButton, "grabButton"); + this.grabButton.Name = "grabButton"; + this.grabButton.UseVisualStyleBackColor = true; + this.grabButton.Click += new System.EventHandler(this.grabButton_Click); + // + // liveButton + // + resources.ApplyResources(this.liveButton, "liveButton"); + this.liveButton.Name = "liveButton"; + this.liveButton.UseVisualStyleBackColor = true; + this.liveButton.Click += new System.EventHandler(this.liveButton_Click); + // + // focusButton + // + resources.ApplyResources(this.focusButton, "focusButton"); + this.focusButton.Name = "focusButton"; + this.focusButton.UseVisualStyleBackColor = true; + this.focusButton.Click += new System.EventHandler(this.focusButton_Click); + // + // PicturesTabPageCtrl + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Silver; + this.Controls.Add(this.splitContainer); + this.Controls.Add(this.logTextBox); + this.Name = "PicturesTabPageCtrl"; + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox logTextBox; + private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.Button configureButton; + private UiControls.CameraPictureCtrl cameraPictureCtrl6; + private UiControls.CameraPictureCtrl cameraPictureCtrl5; + private UiControls.CameraPictureCtrl cameraPictureCtrl4; + private UiControls.CameraPictureCtrl cameraPictureCtrl3; + private UiControls.CameraPictureCtrl cameraPictureCtrl2; + private UiControls.CameraPictureCtrl cameraPictureCtrl1; + private System.Windows.Forms.Button focusButton; + private System.Windows.Forms.Button liveButton; + private System.Windows.Forms.Button grabButton; + } +} diff --git a/TestBenchFramework/Screens/PicturesTabPageCtrl.cs b/TestBenchFramework/Screens/PicturesTabPageCtrl.cs new file mode 100644 index 000000000..a99e133e9 --- /dev/null +++ b/TestBenchFramework/Screens/PicturesTabPageCtrl.cs @@ -0,0 +1,82 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.Screens +{ + public partial class PicturesTabPageCtrl : UserControl + { + public PicturesTabPageCtrl() + { + InitializeComponent(); + configureButton.Text = Strings.Configure; + + Bridge.CameraStateChangedHandler += delegate(object sender, CameraStateChangedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnCameraStateChanged), sender, args); + } + else OnCameraStateChanged(sender, args); + }; + + Bridge.ImageUpdatedHandler += delegate(object sender, ImageUpdatedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnImageUpdated), sender, args); + } + else OnImageUpdated(sender, args); + }; + } + + void OnCameraStateChanged(object sender, CameraStateChangedEventArgs args) + { + switch (args.CameraIdx) + { + case 0: cameraPictureCtrl1.CameraState = args.State; break; + case 1: cameraPictureCtrl2.CameraState = args.State; break; + case 2: cameraPictureCtrl3.CameraState = args.State; break; + case 3: cameraPictureCtrl4.CameraState = args.State; break; + case 4: cameraPictureCtrl5.CameraState = args.State; break; + case 5: cameraPictureCtrl6.CameraState = args.State; break; + default: break; + } + } + + void OnImageUpdated(object sender, ImageUpdatedEventArgs args) + { + switch (args.CameraIdx) + { + case 0: cameraPictureCtrl1.PictureBox.ImageLocation = args.ImageLocation; break; + case 1: cameraPictureCtrl2.PictureBox.ImageLocation = args.ImageLocation; break; + case 2: cameraPictureCtrl3.PictureBox.ImageLocation = args.ImageLocation; break; + case 3: cameraPictureCtrl4.PictureBox.ImageLocation = args.ImageLocation; break; + case 4: cameraPictureCtrl5.PictureBox.ImageLocation = args.ImageLocation; break; + case 5: cameraPictureCtrl6.PictureBox.ImageLocation = args.ImageLocation; break; + default: break; + } + } + + private void configureButton_Click(object sender, EventArgs e) + { + + } + + private void grabButton_Click(object sender, EventArgs e) + { + + } + + private void liveButton_Click(object sender, EventArgs e) + { + + } + + private void focusButton_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/TestBenchFramework/Screens/PicturesTabPageCtrl.resx b/TestBenchFramework/Screens/PicturesTabPageCtrl.resx new file mode 100644 index 000000000..00e84dd5f --- /dev/null +++ b/TestBenchFramework/Screens/PicturesTabPageCtrl.resx @@ -0,0 +1,462 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 98, 249 + + + + 2, 2, 2, 2 + + + + True + + + Both + + + 644, 420 + + + 0 + + + logTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Fill + + + True + + + 0, 0 + + + Horizontal + + + NoControl + + + 386, 7 + + + 100, 30 + + + 5 + + + Focus + + + focusButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 0 + + + NoControl + + + 280, 7 + + + 100, 30 + + + 4 + + + Live + + + liveButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 1 + + + 174, 7 + + + 100, 30 + + + 3 + + + Grab + + + grabButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 2 + + + False + + + 20, 7 + + + 100, 30 + + + 2 + + + Configure + + + False + + + configureButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer.Panel1 + + + 3 + + + splitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 0 + + + 673, 323 + + + 334, 320 + + + 5 + + + cameraPictureCtrl6 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 0 + + + 338, 323 + + + 334, 320 + + + 4 + + + cameraPictureCtrl5 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 1 + + + 3, 323 + + + 334, 320 + + + 3 + + + cameraPictureCtrl4 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 2 + + + 673, 3 + + + 334, 320 + + + 2 + + + cameraPictureCtrl3 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 3 + + + 338, 3 + + + 334, 320 + + + 1 + + + cameraPictureCtrl2 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 4 + + + 3, 3 + + + 334, 320 + + + 0 + + + cameraPictureCtrl1 + + + TBF.UiControls.CameraPictureCtrl, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + splitContainer.Panel2 + + + 5 + + + splitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer + + + 1 + + + 965, 689 + + + 42 + + + 2 + + + splitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + Microsoft Sans Serif, 8.25pt + + + 965, 689 + + + PicturesTabPageCtrl + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/Screens/ProcessTabPageCtrl.Designer.cs b/TestBenchFramework/Screens/ProcessTabPageCtrl.Designer.cs new file mode 100644 index 000000000..7f1a12772 --- /dev/null +++ b/TestBenchFramework/Screens/ProcessTabPageCtrl.Designer.cs @@ -0,0 +1,1081 @@ +namespace TBF.Screens +{ + partial class ProcessTabPageCtrl + { + /// + /// 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() + { + this.sensor1Label = new System.Windows.Forms.Label(); + this.pulses1Label = new System.Windows.Forms.Label(); + this.refPulses1Label = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.volume1Label = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.error1Label = new System.Windows.Forms.Label(); + this.passed1Label = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.passed2Label = new System.Windows.Forms.Label(); + this.error2Label = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.volume2Label = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.refPulses2Label = new System.Windows.Forms.Label(); + this.pulses2Label = new System.Windows.Forms.Label(); + this.sensor2Label = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.passed3Label = new System.Windows.Forms.Label(); + this.error3Label = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.volume3Label = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.refPulses3Label = new System.Windows.Forms.Label(); + this.pulses3Label = new System.Windows.Forms.Label(); + this.sensor3Label = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.tInLabel = new System.Windows.Forms.Label(); + this.prInLabel = new System.Windows.Forms.Label(); + this.prOutLabel = new System.Windows.Forms.Label(); + this.tOutLabel = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.tInCmpntLabel = new System.Windows.Forms.Label(); + this.tOutCmpntLabel = new System.Windows.Forms.Label(); + this.prOutCmpntLabel = new System.Windows.Forms.Label(); + this.prInCmpntLabel = new System.Windows.Forms.Label(); + this.refFlowLabel = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.refFreqLabel = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.refPulsesLabel = new System.Windows.Forms.Label(); + this.refFlowCmpntLabel = new System.Windows.Forms.Label(); + this.regValveCmpntLabel = new System.Windows.Forms.Label(); + this.regValvePosLabel = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.tDivCmpntLabel = new System.Windows.Forms.Label(); + this.tDivLabel = new System.Windows.Forms.Label(); + this.label24 = new System.Windows.Forms.Label(); + this.scaleCmpntLabel = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.massLabel = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.massDiffLabel = new System.Windows.Forms.Label(); + this.label25 = new System.Windows.Forms.Label(); + this.refVolumeLabel = new System.Windows.Forms.Label(); + this.label26 = new System.Windows.Forms.Label(); + this.volumeCtvLabel = new System.Windows.Forms.Label(); + this.label27 = new System.Windows.Forms.Label(); + this.refErrorLabel = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.label29 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label30 = new System.Windows.Forms.Label(); + this.targetFlowLowLabel = new System.Windows.Forms.Label(); + this.targetFlowHighLabel = new System.Windows.Forms.Label(); + this.targetVolumeLabel = new System.Windows.Forms.Label(); + this.label31 = new System.Windows.Forms.Label(); + this.targetRefCountLabel = new System.Windows.Forms.Label(); + this.estmtdTimeLabel = new System.Windows.Forms.Label(); + this.label32 = new System.Windows.Forms.Label(); + this.label33 = new System.Windows.Forms.Label(); + this.label34 = new System.Windows.Forms.Label(); + this.airTempLabel = new System.Windows.Forms.Label(); + this.airPressLabel = new System.Windows.Forms.Label(); + this.airHumiLabel = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // sensor1Label + // + this.sensor1Label.AutoSize = true; + this.sensor1Label.Location = new System.Drawing.Point(74, 16); + this.sensor1Label.Name = "sensor1Label"; + this.sensor1Label.Size = new System.Drawing.Size(44, 13); + this.sensor1Label.TabIndex = 0; + this.sensor1Label.Text = "sensor1"; + // + // pulses1Label + // + this.pulses1Label.AutoSize = true; + this.pulses1Label.Location = new System.Drawing.Point(74, 36); + this.pulses1Label.Name = "pulses1Label"; + this.pulses1Label.Size = new System.Drawing.Size(43, 13); + this.pulses1Label.TabIndex = 1; + this.pulses1Label.Text = "pulses1"; + // + // refPulses1Label + // + this.refPulses1Label.AutoSize = true; + this.refPulses1Label.Location = new System.Drawing.Point(74, 57); + this.refPulses1Label.Name = "refPulses1Label"; + this.refPulses1Label.Size = new System.Drawing.Size(56, 13); + this.refPulses1Label.TabIndex = 2; + this.refPulses1Label.Text = "refPulses1"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(30, 36); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(38, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Count:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 57); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(60, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Ref. count:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(23, 77); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(45, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Volume:"; + // + // volume1Label + // + this.volume1Label.AutoSize = true; + this.volume1Label.Location = new System.Drawing.Point(74, 77); + this.volume1Label.Name = "volume1Label"; + this.volume1Label.Size = new System.Drawing.Size(47, 13); + this.volume1Label.TabIndex = 6; + this.volume1Label.Text = "volume1"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(19, 98); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(49, 13); + this.label4.TabIndex = 7; + this.label4.Text = "Error [%]:"; + // + // error1Label + // + this.error1Label.AutoSize = true; + this.error1Label.Location = new System.Drawing.Point(74, 98); + this.error1Label.Name = "error1Label"; + this.error1Label.Size = new System.Drawing.Size(34, 13); + this.error1Label.TabIndex = 8; + this.error1Label.Text = "error1"; + // + // passed1Label + // + this.passed1Label.AutoSize = true; + this.passed1Label.Location = new System.Drawing.Point(74, 118); + this.passed1Label.Name = "passed1Label"; + this.passed1Label.Size = new System.Drawing.Size(47, 13); + this.passed1Label.TabIndex = 9; + this.passed1Label.Text = "passed1"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.passed1Label); + this.groupBox1.Controls.Add(this.error1Label); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.volume1Label); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.refPulses1Label); + this.groupBox1.Controls.Add(this.pulses1Label); + this.groupBox1.Controls.Add(this.sensor1Label); + this.groupBox1.Location = new System.Drawing.Point(134, 181); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(139, 144); + this.groupBox1.TabIndex = 10; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Meter 1"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.passed2Label); + this.groupBox2.Controls.Add(this.error2Label); + this.groupBox2.Controls.Add(this.label8); + this.groupBox2.Controls.Add(this.volume2Label); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.refPulses2Label); + this.groupBox2.Controls.Add(this.pulses2Label); + this.groupBox2.Controls.Add(this.sensor2Label); + this.groupBox2.Location = new System.Drawing.Point(279, 181); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(139, 144); + this.groupBox2.TabIndex = 11; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Meter 2"; + // + // passed2Label + // + this.passed2Label.AutoSize = true; + this.passed2Label.Location = new System.Drawing.Point(74, 118); + this.passed2Label.Name = "passed2Label"; + this.passed2Label.Size = new System.Drawing.Size(47, 13); + this.passed2Label.TabIndex = 9; + this.passed2Label.Text = "passed2"; + // + // error2Label + // + this.error2Label.AutoSize = true; + this.error2Label.Location = new System.Drawing.Point(74, 98); + this.error2Label.Name = "error2Label"; + this.error2Label.Size = new System.Drawing.Size(34, 13); + this.error2Label.TabIndex = 8; + this.error2Label.Text = "error2"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(19, 98); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(49, 13); + this.label8.TabIndex = 7; + this.label8.Text = "Error [%]:"; + // + // volume2Label + // + this.volume2Label.AutoSize = true; + this.volume2Label.Location = new System.Drawing.Point(74, 77); + this.volume2Label.Name = "volume2Label"; + this.volume2Label.Size = new System.Drawing.Size(47, 13); + this.volume2Label.TabIndex = 6; + this.volume2Label.Text = "volume2"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(23, 77); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(45, 13); + this.label7.TabIndex = 5; + this.label7.Text = "Volume:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 57); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(60, 13); + this.label6.TabIndex = 4; + this.label6.Text = "Ref. count:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(30, 36); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(38, 13); + this.label5.TabIndex = 3; + this.label5.Text = "Count:"; + // + // refPulses2Label + // + this.refPulses2Label.AutoSize = true; + this.refPulses2Label.Location = new System.Drawing.Point(74, 57); + this.refPulses2Label.Name = "refPulses2Label"; + this.refPulses2Label.Size = new System.Drawing.Size(56, 13); + this.refPulses2Label.TabIndex = 2; + this.refPulses2Label.Text = "refPulses2"; + // + // pulses2Label + // + this.pulses2Label.AutoSize = true; + this.pulses2Label.Location = new System.Drawing.Point(74, 36); + this.pulses2Label.Name = "pulses2Label"; + this.pulses2Label.Size = new System.Drawing.Size(43, 13); + this.pulses2Label.TabIndex = 1; + this.pulses2Label.Text = "pulses2"; + // + // sensor2Label + // + this.sensor2Label.AutoSize = true; + this.sensor2Label.Location = new System.Drawing.Point(74, 16); + this.sensor2Label.Name = "sensor2Label"; + this.sensor2Label.Size = new System.Drawing.Size(44, 13); + this.sensor2Label.TabIndex = 0; + this.sensor2Label.Text = "sensor2"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.passed3Label); + this.groupBox3.Controls.Add(this.error3Label); + this.groupBox3.Controls.Add(this.label12); + this.groupBox3.Controls.Add(this.volume3Label); + this.groupBox3.Controls.Add(this.label11); + this.groupBox3.Controls.Add(this.label10); + this.groupBox3.Controls.Add(this.label9); + this.groupBox3.Controls.Add(this.refPulses3Label); + this.groupBox3.Controls.Add(this.pulses3Label); + this.groupBox3.Controls.Add(this.sensor3Label); + this.groupBox3.Location = new System.Drawing.Point(424, 181); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(139, 144); + this.groupBox3.TabIndex = 12; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Meter 3"; + // + // passed3Label + // + this.passed3Label.AutoSize = true; + this.passed3Label.Location = new System.Drawing.Point(74, 118); + this.passed3Label.Name = "passed3Label"; + this.passed3Label.Size = new System.Drawing.Size(47, 13); + this.passed3Label.TabIndex = 9; + this.passed3Label.Text = "passed3"; + // + // error3Label + // + this.error3Label.AutoSize = true; + this.error3Label.Location = new System.Drawing.Point(74, 98); + this.error3Label.Name = "error3Label"; + this.error3Label.Size = new System.Drawing.Size(34, 13); + this.error3Label.TabIndex = 8; + this.error3Label.Text = "error3"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(19, 98); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(49, 13); + this.label12.TabIndex = 7; + this.label12.Text = "Error [%]:"; + // + // volume3Label + // + this.volume3Label.AutoSize = true; + this.volume3Label.Location = new System.Drawing.Point(74, 77); + this.volume3Label.Name = "volume3Label"; + this.volume3Label.Size = new System.Drawing.Size(47, 13); + this.volume3Label.TabIndex = 6; + this.volume3Label.Text = "volume3"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(23, 77); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(45, 13); + this.label11.TabIndex = 5; + this.label11.Text = "Volume:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(8, 57); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(60, 13); + this.label10.TabIndex = 4; + this.label10.Text = "Ref. count:"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(30, 36); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(38, 13); + this.label9.TabIndex = 3; + this.label9.Text = "Count:"; + // + // refPulses3Label + // + this.refPulses3Label.AutoSize = true; + this.refPulses3Label.Location = new System.Drawing.Point(74, 57); + this.refPulses3Label.Name = "refPulses3Label"; + this.refPulses3Label.Size = new System.Drawing.Size(56, 13); + this.refPulses3Label.TabIndex = 2; + this.refPulses3Label.Text = "refPulses3"; + // + // pulses3Label + // + this.pulses3Label.AutoSize = true; + this.pulses3Label.Location = new System.Drawing.Point(74, 36); + this.pulses3Label.Name = "pulses3Label"; + this.pulses3Label.Size = new System.Drawing.Size(43, 13); + this.pulses3Label.TabIndex = 1; + this.pulses3Label.Text = "pulses3"; + // + // sensor3Label + // + this.sensor3Label.AutoSize = true; + this.sensor3Label.Location = new System.Drawing.Point(74, 16); + this.sensor3Label.Name = "sensor3Label"; + this.sensor3Label.Size = new System.Drawing.Size(44, 13); + this.sensor3Label.TabIndex = 0; + this.sensor3Label.Text = "sensor3"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(22, 242); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(52, 13); + this.label13.TabIndex = 13; + this.label13.Text = "T up [°C]:"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(6, 291); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(68, 13); + this.label14.TabIndex = 14; + this.label14.Text = "Pr up [mBar]:"; + // + // tInLabel + // + this.tInLabel.AutoSize = true; + this.tInLabel.Location = new System.Drawing.Point(80, 242); + this.tInLabel.Name = "tInLabel"; + this.tInLabel.Size = new System.Drawing.Size(19, 13); + this.tInLabel.TabIndex = 15; + this.tInLabel.Text = "tIn"; + // + // prInLabel + // + this.prInLabel.AutoSize = true; + this.prInLabel.Location = new System.Drawing.Point(80, 291); + this.prInLabel.Name = "prInLabel"; + this.prInLabel.Size = new System.Drawing.Size(25, 13); + this.prInLabel.TabIndex = 16; + this.prInLabel.Text = "prIn"; + // + // prOutLabel + // + this.prOutLabel.AutoSize = true; + this.prOutLabel.Location = new System.Drawing.Point(654, 291); + this.prOutLabel.Name = "prOutLabel"; + this.prOutLabel.Size = new System.Drawing.Size(33, 13); + this.prOutLabel.TabIndex = 20; + this.prOutLabel.Text = "prOut"; + // + // tOutLabel + // + this.tOutLabel.AutoSize = true; + this.tOutLabel.Location = new System.Drawing.Point(654, 242); + this.tOutLabel.Name = "tOutLabel"; + this.tOutLabel.Size = new System.Drawing.Size(27, 13); + this.tOutLabel.TabIndex = 19; + this.tOutLabel.Text = "tOut"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(568, 291); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(82, 13); + this.label17.TabIndex = 18; + this.label17.Text = "Pr down [mBar]:"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(584, 242); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(66, 13); + this.label18.TabIndex = 17; + this.label18.Text = "T down [°C]:"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(564, 119); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(86, 13); + this.label15.TabIndex = 21; + this.label15.Text = "Ref. flow [m3/h]:"; + // + // tInCmpntLabel + // + this.tInCmpntLabel.AutoSize = true; + this.tInCmpntLabel.Location = new System.Drawing.Point(80, 222); + this.tInCmpntLabel.Name = "tInCmpntLabel"; + this.tInCmpntLabel.Size = new System.Drawing.Size(49, 13); + this.tInCmpntLabel.TabIndex = 22; + this.tInCmpntLabel.Text = "tInCmpnt"; + // + // tOutCmpntLabel + // + this.tOutCmpntLabel.AutoSize = true; + this.tOutCmpntLabel.Location = new System.Drawing.Point(654, 222); + this.tOutCmpntLabel.Name = "tOutCmpntLabel"; + this.tOutCmpntLabel.Size = new System.Drawing.Size(57, 13); + this.tOutCmpntLabel.TabIndex = 23; + this.tOutCmpntLabel.Text = "tOutCmpnt"; + // + // prOutCmpntLabel + // + this.prOutCmpntLabel.AutoSize = true; + this.prOutCmpntLabel.Location = new System.Drawing.Point(654, 272); + this.prOutCmpntLabel.Name = "prOutCmpntLabel"; + this.prOutCmpntLabel.Size = new System.Drawing.Size(63, 13); + this.prOutCmpntLabel.TabIndex = 24; + this.prOutCmpntLabel.Text = "prOutCmpnt"; + // + // prInCmpntLabel + // + this.prInCmpntLabel.AutoSize = true; + this.prInCmpntLabel.Location = new System.Drawing.Point(80, 272); + this.prInCmpntLabel.Name = "prInCmpntLabel"; + this.prInCmpntLabel.Size = new System.Drawing.Size(55, 13); + this.prInCmpntLabel.TabIndex = 25; + this.prInCmpntLabel.Text = "prInCmpnt"; + // + // refFlowLabel + // + this.refFlowLabel.AutoSize = true; + this.refFlowLabel.Location = new System.Drawing.Point(654, 119); + this.refFlowLabel.Name = "refFlowLabel"; + this.refFlowLabel.Size = new System.Drawing.Size(41, 13); + this.refFlowLabel.TabIndex = 26; + this.refFlowLabel.Text = "refFlow"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(574, 98); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(76, 13); + this.label16.TabIndex = 27; + this.label16.Text = "Ref. freq. [Hz]:"; + // + // refFreqLabel + // + this.refFreqLabel.AutoSize = true; + this.refFreqLabel.Location = new System.Drawing.Point(654, 98); + this.refFreqLabel.Name = "refFreqLabel"; + this.refFreqLabel.Size = new System.Drawing.Size(40, 13); + this.refFreqLabel.TabIndex = 28; + this.refFreqLabel.Text = "refFreq"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(590, 78); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(60, 13); + this.label19.TabIndex = 29; + this.label19.Text = "Ref. count:"; + // + // refPulsesLabel + // + this.refPulsesLabel.AutoSize = true; + this.refPulsesLabel.Location = new System.Drawing.Point(654, 78); + this.refPulsesLabel.Name = "refPulsesLabel"; + this.refPulsesLabel.Size = new System.Drawing.Size(50, 13); + this.refPulsesLabel.TabIndex = 30; + this.refPulsesLabel.Text = "refPulses"; + // + // refFlowCmpntLabel + // + this.refFlowCmpntLabel.AutoSize = true; + this.refFlowCmpntLabel.Location = new System.Drawing.Point(654, 58); + this.refFlowCmpntLabel.Name = "refFlowCmpntLabel"; + this.refFlowCmpntLabel.Size = new System.Drawing.Size(71, 13); + this.refFlowCmpntLabel.TabIndex = 31; + this.refFlowCmpntLabel.Text = "refFlowCmpnt"; + // + // regValveCmpntLabel + // + this.regValveCmpntLabel.AutoSize = true; + this.regValveCmpntLabel.Location = new System.Drawing.Point(875, 58); + this.regValveCmpntLabel.Name = "regValveCmpntLabel"; + this.regValveCmpntLabel.Size = new System.Drawing.Size(79, 13); + this.regValveCmpntLabel.TabIndex = 34; + this.regValveCmpntLabel.Text = "regValveCmpnt"; + // + // regValvePosLabel + // + this.regValvePosLabel.AutoSize = true; + this.regValvePosLabel.Location = new System.Drawing.Point(875, 78); + this.regValvePosLabel.Name = "regValvePosLabel"; + this.regValvePosLabel.Size = new System.Drawing.Size(67, 13); + this.regValvePosLabel.TabIndex = 35; + this.regValvePosLabel.Text = "regValvePos"; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(786, 78); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(85, 13); + this.label21.TabIndex = 36; + this.label21.Text = "Reg. valve pos.:"; + // + // tDivCmpntLabel + // + this.tDivCmpntLabel.AutoSize = true; + this.tDivCmpntLabel.Location = new System.Drawing.Point(875, 129); + this.tDivCmpntLabel.Name = "tDivCmpntLabel"; + this.tDivCmpntLabel.Size = new System.Drawing.Size(56, 13); + this.tDivCmpntLabel.TabIndex = 39; + this.tDivCmpntLabel.Text = "tDivCmpnt"; + // + // tDivLabel + // + this.tDivLabel.AutoSize = true; + this.tDivLabel.Location = new System.Drawing.Point(875, 148); + this.tDivLabel.Name = "tDivLabel"; + this.tDivLabel.Size = new System.Drawing.Size(26, 13); + this.tDivLabel.TabIndex = 38; + this.tDivLabel.Text = "tDiv"; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(817, 148); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(54, 13); + this.label24.TabIndex = 37; + this.label24.Text = "T div [°C]:"; + // + // scaleCmpntLabel + // + this.scaleCmpntLabel.AutoSize = true; + this.scaleCmpntLabel.Location = new System.Drawing.Point(875, 209); + this.scaleCmpntLabel.Name = "scaleCmpntLabel"; + this.scaleCmpntLabel.Size = new System.Drawing.Size(62, 13); + this.scaleCmpntLabel.TabIndex = 40; + this.scaleCmpntLabel.Text = "scaleCmpnt"; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(815, 230); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(56, 13); + this.label22.TabIndex = 41; + this.label22.Text = "Mass [kg]:"; + // + // massLabel + // + this.massLabel.AutoSize = true; + this.massLabel.Location = new System.Drawing.Point(875, 230); + this.massLabel.Name = "massLabel"; + this.massLabel.Size = new System.Drawing.Size(31, 13); + this.massLabel.TabIndex = 42; + this.massLabel.Text = "mass"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(795, 250); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(76, 13); + this.label23.TabIndex = 43; + this.label23.Text = "Mass diff. [kg]:"; + // + // massDiffLabel + // + this.massDiffLabel.AutoSize = true; + this.massDiffLabel.Location = new System.Drawing.Point(875, 250); + this.massDiffLabel.Name = "massDiffLabel"; + this.massDiffLabel.Size = new System.Drawing.Size(47, 13); + this.massDiffLabel.TabIndex = 44; + this.massDiffLabel.Text = "massDiff"; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(576, 140); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(78, 13); + this.label25.TabIndex = 45; + this.label25.Text = "Ref. volume [l]:"; + // + // refVolumeLabel + // + this.refVolumeLabel.AutoSize = true; + this.refVolumeLabel.Location = new System.Drawing.Point(654, 140); + this.refVolumeLabel.Name = "refVolumeLabel"; + this.refVolumeLabel.Size = new System.Drawing.Size(54, 13); + this.refVolumeLabel.TabIndex = 46; + this.refVolumeLabel.Text = "refVolume"; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(815, 271); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(56, 13); + this.label26.TabIndex = 47; + this.label26.Text = "Volume [l]:"; + // + // volumeCtvLabel + // + this.volumeCtvLabel.AutoSize = true; + this.volumeCtvLabel.Location = new System.Drawing.Point(875, 271); + this.volumeCtvLabel.Name = "volumeCtvLabel"; + this.volumeCtvLabel.Size = new System.Drawing.Size(57, 13); + this.volumeCtvLabel.TabIndex = 48; + this.volumeCtvLabel.Text = "volumeCtv"; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(800, 293); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(71, 13); + this.label27.TabIndex = 49; + this.label27.Text = "Ref. error [%]:"; + // + // refErrorLabel + // + this.refErrorLabel.AutoSize = true; + this.refErrorLabel.Location = new System.Drawing.Point(875, 293); + this.refErrorLabel.Name = "refErrorLabel"; + this.refErrorLabel.Size = new System.Drawing.Size(41, 13); + this.refErrorLabel.TabIndex = 50; + this.refErrorLabel.Text = "refError"; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(291, 58); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(116, 13); + this.label28.TabIndex = 51; + this.label28.Text = "Target flow low [m3/h]:"; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(287, 78); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(120, 13); + this.label29.TabIndex = 52; + this.label29.Text = "Target flow high [m3/h]:"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(318, 98); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(89, 13); + this.label20.TabIndex = 53; + this.label20.Text = "Target volume [l]:"; + // + // label30 + // + this.label30.AutoSize = true; + this.label30.Location = new System.Drawing.Point(315, 140); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(92, 13); + this.label30.TabIndex = 54; + this.label30.Text = "Estimated time [s]:"; + // + // targetFlowLowLabel + // + this.targetFlowLowLabel.AutoSize = true; + this.targetFlowLowLabel.Location = new System.Drawing.Point(410, 58); + this.targetFlowLowLabel.Name = "targetFlowLowLabel"; + this.targetFlowLowLabel.Size = new System.Drawing.Size(76, 13); + this.targetFlowLowLabel.TabIndex = 55; + this.targetFlowLowLabel.Text = "targetFlowLow"; + // + // targetFlowHighLabel + // + this.targetFlowHighLabel.AutoSize = true; + this.targetFlowHighLabel.Location = new System.Drawing.Point(410, 78); + this.targetFlowHighLabel.Name = "targetFlowHighLabel"; + this.targetFlowHighLabel.Size = new System.Drawing.Size(78, 13); + this.targetFlowHighLabel.TabIndex = 56; + this.targetFlowHighLabel.Text = "targetFlowHigh"; + // + // targetVolumeLabel + // + this.targetVolumeLabel.AutoSize = true; + this.targetVolumeLabel.Location = new System.Drawing.Point(410, 98); + this.targetVolumeLabel.Name = "targetVolumeLabel"; + this.targetVolumeLabel.Size = new System.Drawing.Size(69, 13); + this.targetVolumeLabel.TabIndex = 57; + this.targetVolumeLabel.Text = "targetVolume"; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Location = new System.Drawing.Point(318, 119); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(89, 13); + this.label31.TabIndex = 58; + this.label31.Text = "Target ref. count:"; + // + // targetRefCountLabel + // + this.targetRefCountLabel.AutoSize = true; + this.targetRefCountLabel.Location = new System.Drawing.Point(410, 119); + this.targetRefCountLabel.Name = "targetRefCountLabel"; + this.targetRefCountLabel.Size = new System.Drawing.Size(79, 13); + this.targetRefCountLabel.TabIndex = 59; + this.targetRefCountLabel.Text = "targetRefCount"; + // + // estmtdTimeLabel + // + this.estmtdTimeLabel.AutoSize = true; + this.estmtdTimeLabel.Location = new System.Drawing.Point(410, 140); + this.estmtdTimeLabel.Name = "estmtdTimeLabel"; + this.estmtdTimeLabel.Size = new System.Drawing.Size(61, 13); + this.estmtdTimeLabel.TabIndex = 60; + this.estmtdTimeLabel.Text = "estmtdTime"; + // + // label32 + // + this.label32.AutoSize = true; + this.label32.Location = new System.Drawing.Point(66, 58); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(101, 13); + this.label32.TabIndex = 61; + this.label32.Text = "Air temperature [°C]:"; + // + // label33 + // + this.label33.AutoSize = true; + this.label33.Location = new System.Drawing.Point(69, 78); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(98, 13); + this.label33.TabIndex = 62; + this.label33.Text = "Air pressure [mBar]:"; + // + // label34 + // + this.label34.AutoSize = true; + this.label34.Location = new System.Drawing.Point(87, 98); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(80, 13); + this.label34.TabIndex = 63; + this.label34.Text = "Air humidity [%]:"; + // + // airTempLabel + // + this.airTempLabel.AutoSize = true; + this.airTempLabel.Location = new System.Drawing.Point(169, 58); + this.airTempLabel.Name = "airTempLabel"; + this.airTempLabel.Size = new System.Drawing.Size(45, 13); + this.airTempLabel.TabIndex = 64; + this.airTempLabel.Text = "airTemp"; + // + // airPressLabel + // + this.airPressLabel.AutoSize = true; + this.airPressLabel.Location = new System.Drawing.Point(169, 78); + this.airPressLabel.Name = "airPressLabel"; + this.airPressLabel.Size = new System.Drawing.Size(44, 13); + this.airPressLabel.TabIndex = 65; + this.airPressLabel.Text = "airPress"; + // + // airHumiLabel + // + this.airHumiLabel.AutoSize = true; + this.airHumiLabel.Location = new System.Drawing.Point(169, 98); + this.airHumiLabel.Name = "airHumiLabel"; + this.airHumiLabel.Size = new System.Drawing.Size(42, 13); + this.airHumiLabel.TabIndex = 66; + this.airHumiLabel.Text = "airHumi"; + // + // ProcessTabPageCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Controls.Add(this.airHumiLabel); + this.Controls.Add(this.airPressLabel); + this.Controls.Add(this.airTempLabel); + this.Controls.Add(this.label34); + this.Controls.Add(this.label33); + this.Controls.Add(this.label32); + this.Controls.Add(this.estmtdTimeLabel); + this.Controls.Add(this.targetRefCountLabel); + this.Controls.Add(this.label31); + this.Controls.Add(this.targetVolumeLabel); + this.Controls.Add(this.targetFlowHighLabel); + this.Controls.Add(this.targetFlowLowLabel); + this.Controls.Add(this.label30); + this.Controls.Add(this.label20); + this.Controls.Add(this.label29); + this.Controls.Add(this.label28); + this.Controls.Add(this.refErrorLabel); + this.Controls.Add(this.label27); + this.Controls.Add(this.volumeCtvLabel); + this.Controls.Add(this.label26); + this.Controls.Add(this.refVolumeLabel); + this.Controls.Add(this.label25); + this.Controls.Add(this.massDiffLabel); + this.Controls.Add(this.label23); + this.Controls.Add(this.massLabel); + this.Controls.Add(this.label22); + this.Controls.Add(this.scaleCmpntLabel); + this.Controls.Add(this.tDivCmpntLabel); + this.Controls.Add(this.tDivLabel); + this.Controls.Add(this.label24); + this.Controls.Add(this.label21); + this.Controls.Add(this.regValvePosLabel); + this.Controls.Add(this.regValveCmpntLabel); + this.Controls.Add(this.refFlowCmpntLabel); + this.Controls.Add(this.refPulsesLabel); + this.Controls.Add(this.label19); + this.Controls.Add(this.refFreqLabel); + this.Controls.Add(this.label16); + this.Controls.Add(this.refFlowLabel); + this.Controls.Add(this.prInCmpntLabel); + this.Controls.Add(this.prOutCmpntLabel); + this.Controls.Add(this.tOutCmpntLabel); + this.Controls.Add(this.tInCmpntLabel); + this.Controls.Add(this.label15); + this.Controls.Add(this.prOutLabel); + this.Controls.Add(this.tOutLabel); + this.Controls.Add(this.label17); + this.Controls.Add(this.label18); + this.Controls.Add(this.prInLabel); + this.Controls.Add(this.tInLabel); + this.Controls.Add(this.label14); + this.Controls.Add(this.label13); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.Name = "ProcessTabPageCtrl"; + this.Size = new System.Drawing.Size(984, 498); + this.Load += new System.EventHandler(this.ProcessTabPageCtrl_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label sensor1Label; + private System.Windows.Forms.Label pulses1Label; + private System.Windows.Forms.Label refPulses1Label; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label volume1Label; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label error1Label; + private System.Windows.Forms.Label passed1Label; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label passed2Label; + private System.Windows.Forms.Label error2Label; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label volume2Label; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label refPulses2Label; + private System.Windows.Forms.Label pulses2Label; + private System.Windows.Forms.Label sensor2Label; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.Label passed3Label; + private System.Windows.Forms.Label error3Label; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label volume3Label; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label refPulses3Label; + private System.Windows.Forms.Label pulses3Label; + private System.Windows.Forms.Label sensor3Label; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label tInLabel; + private System.Windows.Forms.Label prInLabel; + private System.Windows.Forms.Label prOutLabel; + private System.Windows.Forms.Label tOutLabel; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label tInCmpntLabel; + private System.Windows.Forms.Label tOutCmpntLabel; + private System.Windows.Forms.Label prOutCmpntLabel; + private System.Windows.Forms.Label prInCmpntLabel; + private System.Windows.Forms.Label refFlowLabel; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label refFreqLabel; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label refPulsesLabel; + private System.Windows.Forms.Label refFlowCmpntLabel; + private System.Windows.Forms.Label regValveCmpntLabel; + private System.Windows.Forms.Label regValvePosLabel; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Label tDivCmpntLabel; + private System.Windows.Forms.Label tDivLabel; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Label scaleCmpntLabel; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label massLabel; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.Label massDiffLabel; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.Label refVolumeLabel; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.Label volumeCtvLabel; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.Label refErrorLabel; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label30; + private System.Windows.Forms.Label targetFlowLowLabel; + private System.Windows.Forms.Label targetFlowHighLabel; + private System.Windows.Forms.Label targetVolumeLabel; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.Label targetRefCountLabel; + private System.Windows.Forms.Label estmtdTimeLabel; + private System.Windows.Forms.Label label32; + private System.Windows.Forms.Label label33; + private System.Windows.Forms.Label label34; + private System.Windows.Forms.Label airTempLabel; + private System.Windows.Forms.Label airPressLabel; + private System.Windows.Forms.Label airHumiLabel; + + + } +} diff --git a/TestBenchFramework/Screens/ProcessTabPageCtrl.cs b/TestBenchFramework/Screens/ProcessTabPageCtrl.cs new file mode 100644 index 000000000..21f5653cc --- /dev/null +++ b/TestBenchFramework/Screens/ProcessTabPageCtrl.cs @@ -0,0 +1,280 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.UiBridge; + +namespace TBF.Screens +{ + public partial class ProcessTabPageCtrl : UserControl + { + static readonly ILog log = LogManager.GetLogger(typeof(ProcessTabPageCtrl)); + + public ProcessTabPageCtrl() + { + InitializeComponent(); + + Bridge.ProcedureSelectedHandler += delegate(object sender, ProcedureSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnProcedureSelected), sender, args); + } + else OnProcedureSelected(sender, args); + }; + Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestSelected), sender, args); + } + else OnTestSelected(sender, args); + }; + Bridge.TestProgressHandler += delegate(object sender, TestProgressEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestProgress), sender, args); + } + else OnTestProgress(sender, args); + }; + Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestCompleted), sender, args); + } + else OnTestCompleted(sender, args); + }; + Bridge.ProcedureCompletedHandler += delegate(object sender, ProcedureCompletedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnProcedureCompleted), sender, args); + } + else OnProcedureCompleted(sender, args); + }; + } + + private void ProcessTabPageCtrl_Load(object sender, EventArgs e) + { + Once(); + Reset(); + } + + void Once() + { + + } + + void Reset() + { + prInCmpntLabel.Text = "---"; + prOutCmpntLabel.Text = "---"; + tInCmpntLabel.Text = "---"; + tOutCmpntLabel.Text = "---"; + tDivCmpntLabel.Text = "---"; + refFlowCmpntLabel.Text = "---"; + regValveCmpntLabel.Text = "---"; + scaleCmpntLabel.Text = "---"; + sensor1Label.Text = "---"; + sensor2Label.Text = "---"; + sensor3Label.Text = "---"; + + targetFlowLowLabel.Text = "---"; + targetFlowHighLabel.Text= "---"; + targetVolumeLabel.Text = "---"; + targetRefCountLabel.Text= "---"; + estmtdTimeLabel.Text = "---"; + + pulses1Label.Text = "---"; + pulses2Label.Text = "---"; + pulses3Label.Text = "---"; + refPulses1Label.Text = "---"; + refPulses2Label.Text = "---"; + refPulses3Label.Text = "---"; + volume1Label.Text = "---"; + volume2Label.Text = "---"; + volume3Label.Text = "---"; + error1Label.Text = "---"; + error2Label.Text = "---"; + error3Label.Text = "---"; + tInLabel.Text = "---"; + tOutLabel.Text = "---"; + tDivLabel.Text = "---"; + prInLabel.Text = "---"; + prOutLabel.Text = "---"; + airTempLabel.Text = "---"; + airPressLabel.Text = "---"; + airHumiLabel.Text = "---"; + + refPulsesLabel.Text = "---"; + //refFreqLabel.Text = "---"; + refFlowLabel.Text = "---"; + refVolumeLabel.Text = "---"; + //regValvePosLabel.Text = "---"; + //massLabel.Text = "---"; + } + + void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args) + { + Reset(); + } + + void OnTestSelected(object sender, TestSelectedEventArgs args) + { + /// Names of virtual bench components + prInCmpntLabel.Text = args.BenchPath.PressIn.Cfg.Name; + prOutCmpntLabel.Text = args.BenchPath.PressOut.Cfg.Name; + tInCmpntLabel.Text = args.BenchPath.TempIn.Cfg.Name; + tOutCmpntLabel.Text = args.BenchPath.TempOut.Cfg.Name; + tDivCmpntLabel.Text = args.OutputPath.TempDiv.Cfg.Name; + refFlowCmpntLabel.Text = args.OutputPath.FlowMeter.Cfg.Name; + regValveCmpntLabel.Text = args.OutputPath.RegulValve.Cfg.Name; + scaleCmpntLabel.Text = args.OutputPath.Balance.Cfg.Name; + sensor1Label.Text = (args.MetersPath.RegisterReaders[0] == null) ? "" : args.MetersPath.RegisterReaders[0].Cfg.Name; + sensor2Label.Text = (args.MetersPath.RegisterReaders[1] == null) ? "" : args.MetersPath.RegisterReaders[1].Cfg.Name; + sensor3Label.Text = (args.MetersPath.RegisterReaders[2] == null) ? "" : args.MetersPath.RegisterReaders[2].Cfg.Name; + + /// Target values + targetFlowLowLabel.Text = args.Test.Qfrom.ToString("F3"); + targetFlowHighLabel.Text = args.Test.Qto.ToString("F3"); + targetVolumeLabel.Text = args.Test.Volume.ToString("F1"); + targetRefCountLabel.Text = args.TotalPulses.ToString(); + estmtdTimeLabel.Text = args.Test.TstTime.ToString("F1"); + + /// Invalidate other values + pulses1Label.Text = "---"; + pulses2Label.Text = "---"; + pulses3Label.Text = "---"; + refPulses1Label.Text = "---"; + refPulses2Label.Text = "---"; + refPulses3Label.Text = "---"; + volume1Label.Text = "---"; + volume2Label.Text = "---"; + volume3Label.Text = "---"; + error1Label.Text = "---"; + error2Label.Text = "---"; + error3Label.Text = "---"; + tInLabel.Text = "---"; + tOutLabel.Text = "---"; + tDivLabel.Text = "---"; + prInLabel.Text = "---"; + prOutLabel.Text = "---"; + airTempLabel.Text = "---"; + airPressLabel.Text = "---"; + airHumiLabel.Text = "---"; + + refPulsesLabel.Text = "---"; + //refFreqLabel.Text = "---"; + refFlowLabel.Text = "---"; + refVolumeLabel.Text = "---"; + //regValvePosLabel.Text = "---"; + //massLabel.Text = "---"; + } + + void OnTestProgress(object sender, TestProgressEventArgs args) + { + targetFlowLowLabel.Text = args.TestResult.Qfrom.ToString("F3"); + targetFlowHighLabel.Text = args.TestResult.Qto.ToString("F3"); + estmtdTimeLabel.Text = args.TestResult.TstTime.ToString("F1"); + + pulses1Label.Text = args.WmPulses[0].ToString(); + pulses2Label.Text = args.WmPulses[1].ToString(); + pulses3Label.Text = args.WmPulses[2].ToString(); + refPulses1Label.Text = args.WmRefPulses[0].ToString(); + refPulses2Label.Text = args.WmRefPulses[1].ToString(); + refPulses3Label.Text = args.WmRefPulses[2].ToString(); + volume1Label.Text = args.WmVolume[0].ToString("F2"); + volume2Label.Text = args.WmVolume[1].ToString("F2"); + volume3Label.Text = args.WmVolume[2].ToString("F2"); + error1Label.Text = args.WmErrPct[0].ToString("F2"); + error2Label.Text = args.WmErrPct[1].ToString("F2"); + error3Label.Text = args.WmErrPct[2].ToString("F2"); + tInLabel.Text = args.Tin.ToString("F2"); + tOutLabel.Text = args.Tout.ToString("F2"); + tDivLabel.Text = args.Tdiv.ToString("F2"); + prInLabel.Text = args.Pin.ToString("F1"); + prOutLabel.Text = args.Pout.ToString("F1"); + airTempLabel.Text = args.AmbientTemp.ToString("F1"); + airPressLabel.Text = args.AmbientPressure.ToString("F1"); + airHumiLabel.Text = args.AmbientHumidity.ToString("F1"); + + refPulsesLabel.Text = args.RefPulses.ToString(); + //refFreqLabel.Text = args. + refFlowLabel.Text = args.Flow.ToString("F2"); + refVolumeLabel.Text = args.Volume.ToString("F2"); + //regValvePosLabel.Text = args. + //massLabel.Text = args. + } + + void OnTestCompleted(object sender, TestCompletedEventArgs args) + { + Entities.TestResult tRes = args.TestResult; + + if (tRes.MetersKind == Entities.MetersKind.Single) + { + pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0"); + pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0"); + pulses3Label.Text = tRes.Meters[2].PulsesMeter.ToString("F0"); + refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0"); + refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0"); + refPulses3Label.Text = tRes.Meters[2].PulsesMaster.ToString("F0"); + volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2"); + volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2"); + volume3Label.Text = tRes.Meters[2].VolumeMeter.ToString("F2"); + error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2"); + error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2"); + error3Label.Text = tRes.Meters[2].VolumeErrorPct.ToString("F2"); + tInLabel.Text = tRes.TempInAvrg.ToString("F2"); + tOutLabel.Text = tRes.TempOutAvrg.ToString("F2"); + tDivLabel.Text = tRes.TempDivAvrg.ToString("F2"); + prInLabel.Text = tRes.PressInAvrg.ToString("F1"); + prOutLabel.Text = tRes.PressOutAvrg.ToString("F1"); + airTempLabel.Text = tRes.AmbientTempAve.ToString("F1"); + airPressLabel.Text = tRes.AmbientPressAve.ToString("F1"); + airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1"); + + refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0"); + //refFreqLabel.Text = tstRslt. + refFlowLabel.Text = tRes.FlowMass.ToString("F2"); + refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2"); + //regValvePosLabel.Text = tstRslt. + //massLabel.Text = tstRslt. + } + else if (tRes.MetersKind == Entities.MetersKind.Combined) + { + pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0"); + pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0"); + pulses3Label.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0"); + refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0"); + refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0"); + refPulses3Label.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0"); + volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2"); + volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2"); + volume3Label.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2"); + error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2"); + error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2"); + error3Label.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2"); + tInLabel.Text = tRes.TempInAvrg.ToString("F2"); + tOutLabel.Text = tRes.TempOutAvrg.ToString("F2"); + tDivLabel.Text = tRes.TempDivAvrg.ToString("F2"); + prInLabel.Text = tRes.PressInAvrg.ToString("F1"); + prOutLabel.Text = tRes.PressOutAvrg.ToString("F1"); + airTempLabel.Text = tRes.AmbientTempAve.ToString("F1"); + airPressLabel.Text = tRes.AmbientPressAve.ToString("F1"); + airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1"); + + refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0"); + //refFreqLabel.Text = tstRslt. + refFlowLabel.Text = tRes.FlowMass.ToString("F2"); + refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2"); + //regValvePosLabel.Text = tstRslt. + //massLabel.Text = tstRslt. + } + } + + void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args) + { + } + } +} diff --git a/TestBenchFramework/Screens/ProcessTabPageCtrl.resx b/TestBenchFramework/Screens/ProcessTabPageCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Screens/ProcessTabPageCtrl.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/TestBenchFramework/Screens/ResultsTabPageCtrl.Designer.cs b/TestBenchFramework/Screens/ResultsTabPageCtrl.Designer.cs new file mode 100644 index 000000000..e09e542ef --- /dev/null +++ b/TestBenchFramework/Screens/ResultsTabPageCtrl.Designer.cs @@ -0,0 +1,118 @@ +namespace TBF.Screens +{ + partial class ResultsTabPageCtrl + { + /// + /// 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() + { + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.clearResultsButton = new System.Windows.Forms.Button(); + this.configureButton = new System.Windows.Forms.Button(); + this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer.IsSplitterFixed = true; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control; + this.splitContainer.Panel1.Controls.Add(this.clearResultsButton); + this.splitContainer.Panel1.Controls.Add(this.configureButton); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.flowLayoutPanel); + this.splitContainer.Size = new System.Drawing.Size(1057, 706); + this.splitContainer.SplitterDistance = 42; + this.splitContainer.TabIndex = 0; + // + // clearResultsButton + // + this.clearResultsButton.Location = new System.Drawing.Point(126, 10); + this.clearResultsButton.Name = "clearResultsButton"; + this.clearResultsButton.Size = new System.Drawing.Size(100, 30); + this.clearResultsButton.TabIndex = 1; + this.clearResultsButton.Text = "Clear results"; + this.clearResultsButton.UseVisualStyleBackColor = true; + this.clearResultsButton.Click += new System.EventHandler(this.clearResultsButton_Click); + // + // configureButton + // + this.configureButton.Location = new System.Drawing.Point(20, 10); + this.configureButton.Name = "configureButton"; + this.configureButton.Size = new System.Drawing.Size(100, 30); + this.configureButton.TabIndex = 0; + this.configureButton.Text = "Configure"; + this.configureButton.UseVisualStyleBackColor = true; + this.configureButton.Click += new System.EventHandler(this.configureButton_Click); + // + // flowLayoutPanel + // + this.flowLayoutPanel.AutoScroll = true; + this.flowLayoutPanel.BackColor = System.Drawing.SystemColors.Control; + this.flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel.Location = new System.Drawing.Point(0, 0); + this.flowLayoutPanel.Name = "flowLayoutPanel"; + this.flowLayoutPanel.Size = new System.Drawing.Size(1057, 660); + this.flowLayoutPanel.TabIndex = 0; + // + // ResultsTabPageCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Silver; + this.Controls.Add(this.splitContainer); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.Name = "ResultsTabPageCtrl"; + this.Size = new System.Drawing.Size(1057, 706); + this.Load += new System.EventHandler(this.ResultsTabPageCtrl_Load); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.Button clearResultsButton; + private System.Windows.Forms.Button configureButton; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel; + } +} diff --git a/TestBenchFramework/Screens/ResultsTabPageCtrl.cs b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs new file mode 100644 index 000000000..c4e3fddd8 --- /dev/null +++ b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs @@ -0,0 +1,421 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using log4net; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.Screens +{ + public partial class ResultsTabPageCtrl : UserControl + { + static readonly ILog log = LogManager.GetLogger(typeof(ResultsTabPageCtrl)); + + public TBF.Forms.ResultsConfig.Meters MetersArrangement; + public TBF.Forms.ResultsConfig.TestsAre TestsArrangement; + + IList tests; + IList testResults; + + int lvWidth; + int lvHeight; + + /// + /// Constructor + /// + public ResultsTabPageCtrl() + { + InitializeComponent(); + + Bridge.ProcedureSelectedHandler += delegate(object sender, ProcedureSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnProcedureSelected), sender, args); + } + else OnProcedureSelected(sender, args); + }; + Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestCompleted), sender, args); + } + else OnTestCompleted(sender, args); + }; + } + + private void ResultsTabPageCtrl_Load(object sender, EventArgs e) + { + // Localization + configureButton.Text = Strings.Configure; + clearResultsButton.Text = Strings.Clear_results; + + MetersArrangement = Program.LocalSettings.ResultsConfigMeters; + TestsArrangement = Program.LocalSettings.ResultsConfigTests; + + RedrawAll(); + } + + /// + /// Invoke a configuration dialog + /// + private void configureButton_Click(object sender, EventArgs e) + { + TBF.Forms.ResultsConfig dlg = new TBF.Forms.ResultsConfig(); + dlg.TestsArrangement = TestsArrangement; + dlg.MetersArrangement = MetersArrangement; + if (DialogResult.OK == dlg.ShowDialog()) + { + MetersArrangement = dlg.MetersArrangement; + TestsArrangement = dlg.TestsArrangement; + + Program.LocalSettings.ResultsConfigMeters = MetersArrangement; + Program.LocalSettings.ResultsConfigTests = TestsArrangement; + Program.LocalSettings.Save(); + } + RedrawAll(); + } + + /// + /// Clear the results + /// + private void clearResultsButton_Click(object sender, EventArgs e) + { + } + + #region Redraw + + /// + /// Re-draw the results. Apply new settings if they changed. + /// + void RedrawAll() + { + this.SuspendLayout(); + lvWidth = flowLayoutPanel.Width - 10; + lvHeight = flowLayoutPanel.Height - 10; + + if (MetersArrangement == Forms.ResultsConfig.Meters.Horizontally) + { + flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight; + lvWidth = (lvWidth + 5) / Program.WMsCount - 5; + } + else + { + flowLayoutPanel.FlowDirection = FlowDirection.TopDown; + lvHeight = (lvHeight + 5) / Program.WMsCount - 5; + } + flowLayoutPanel.Controls.Clear(); + flowLayoutPanel.WrapContents = false; + flowLayoutPanel.AutoScroll = true; + + /// + /// Determine whether combined meter results are displayed + /// + bool combined = ((testResults != null) && + (testResults.Count > 0) && + (testResults[0].MetersKind == Entities.MetersKind.Combined)); + + for (int mtr = 0; mtr < (combined ? Program.WMsCount / 2 : Program.WMsCount); mtr++) + { + if (TestsArrangement == Forms.ResultsConfig.TestsAre.Rows) + { + ListView lview = GetResultsTestsAreRows(mtr, combined); + if (lview != null) flowLayoutPanel.Controls.Add(lview); + } + else + { + ListView lview = GetResultsTestsAreColumns(mtr, combined); + if (lview != null) flowLayoutPanel.Controls.Add(lview); + } + } + this.ResumeLayout(false); + } + + /// + /// Get an empty ListView control with appropriate parameters. + /// + /// ListView control + ListView GetListView() + { + ListView lview = new ListView(); + lview.AllowColumnReorder = false; + lview.Dock = System.Windows.Forms.DockStyle.None; + lview.FullRowSelect = true; + lview.GridLines = true; + lview.Location = new System.Drawing.Point(0, 0); + lview.Size = new System.Drawing.Size(lvWidth, lvHeight); + lview.TabIndex = 0; + lview.UseCompatibleStateImageBehavior = false; + lview.View = System.Windows.Forms.View.Details; + return lview; + } + + /// + /// Pre-fetch the test results corresponding to the columns or rows in the ListView + /// + /// Ordered list of test results containing null-s for missing results + IList GetCurrentTestResults() + { + IList rslts = new List(); + + foreach (var test in tests) + { + for (int rpt = 1; rpt <= test.Repeats; rpt++) + { + bool added = false; + if (testResults != null) + { + foreach (var testRslt in testResults) + { + if (testRslt.TestName.Equals(test.Name) && (testRslt.RepetitionNr == rpt) && !testRslt.DoNotPublish) + { + rslts.Add(testRslt); + added = true; + break; + } + } + } + if (!added) rslts.Add(null); + } + } + return rslts; + } + + IList GetAllDecoratedTestNames() + { + IList rslt = new List(); + foreach (var test in tests) + { + if (test.Repeats == 1) + { + rslt.Add(test.Name); + continue; + } + for (int rpt = 1; rpt <= test.Repeats; rpt++) + { + rslt.Add(test.Name + string.Format(" ({0}/{1})", rpt, test.Repeats)); + } + } + return rslt; + } + + IList GetAllResultNames(bool combined) + { + IList rslt = new List(); + if (combined) + { + rslt.Add("Q [l/h]"); + rslt.Add("Ref.volume [l]"); + rslt.Add("WM1 volume [l]"); + rslt.Add("WM2 volume [l]"); + rslt.Add("WM volume [l]"); + rslt.Add("Error [%]"); + rslt.Add("Result"); + } + else + { + rslt.Add("Q [l/h]"); + rslt.Add("Ref.volume [l]"); + rslt.Add("WM volume [l]"); + rslt.Add("Error [%]"); + rslt.Add("Result"); + } + return rslt; + } + + /// + /// Get a ListView control filled with results of the meter 'mtr' + /// + /// Water meter number: 0..Program.WMsCount + /// ListView object + ListView GetResultsTestsAreRows(int mtr, bool combined) + { + if (tests == null) return null; + + ListView lview = GetListView(); + + // Header + lview.Columns.Add((mtr + 1).ToString()); + foreach (var str in GetAllResultNames(combined)) lview.Columns.Add(str); + + IList testNames = GetAllDecoratedTestNames(); + int ix = 0; + foreach (var testRslt in GetCurrentTestResults()) + { + ListViewItem lvi = new ListViewItem(testNames[ix++]); + if (testRslt != null) + { + if (combined) + { + lvi.SubItems.Add(testRslt.FlowMass.ToString("F1")); + lvi.SubItems.Add(testRslt.VolumeCTV.ToString("F2")); + lvi.SubItems.Add(testRslt.Meters[2 * mtr].VolumeMeter.ToString("F2")); + lvi.SubItems.Add(testRslt.Meters[2 * mtr + 1].VolumeMeter.ToString("F2")); + lvi.SubItems.Add(testRslt.CombinedMeters[mtr].VolumeMeter.ToString("F2")); + lvi.SubItems.Add(testRslt.CombinedMeters[mtr].VolumeErrorPct.ToString("F2")); + lvi.SubItems.Add(testRslt.CombinedMeters[mtr].Passed ? Strings.Passed : Strings.Failed); + lvi.UseItemStyleForSubItems = false; + lvi.SubItems[7].BackColor = (testRslt.CombinedMeters[mtr].Passed ? Color.Green : Color.Red); + } + else + { + lvi.SubItems.Add(testRslt.FlowMass.ToString("F1")); + lvi.SubItems.Add(testRslt.VolumeCTV.ToString("F2")); + lvi.SubItems.Add(testRslt.Meters[mtr].VolumeMeter.ToString("F2")); + lvi.SubItems.Add(testRslt.Meters[mtr].VolumeErrorPct.ToString("F2")); + lvi.SubItems.Add(testRslt.Meters[mtr].Passed ? Strings.Passed : Strings.Failed); + lvi.UseItemStyleForSubItems = false; + lvi.SubItems[5].BackColor = (testRslt.Meters[mtr].Passed ? Color.Green : Color.Red); + } + } + lview.Items.Add(lvi); + } + + return lview; + } + + /// + /// Get a ListView control filled with results of the meter 'mtr' + /// + /// Water meter number: 0..Program.WMsCount + /// ListView object + ListView GetResultsTestsAreColumns(int mtr, bool combined) + { + if (tests == null) return null; + + ListView lview = GetListView(); + + // Header + lview.Columns.Add((mtr + 1).ToString()); + foreach (var str in GetAllDecoratedTestNames()) lview.Columns.Add(str); + + IList trs = GetCurrentTestResults(); + + int rsltId = 0; + foreach (var rsltName in GetAllResultNames(combined)) + { + ListViewItem lvi = new ListViewItem(rsltName); + if (combined) + { + switch (rsltId++) + { + case 0: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.FlowMass.ToString("F1") : string.Empty); + break; + case 1: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.VolumeCTV.ToString("F2") : string.Empty); + break; + case 2: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.Meters[2 * mtr].VolumeMeter.ToString("F2") : string.Empty); + break; + case 3: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.Meters[2 * mtr + 1].VolumeMeter.ToString("F2") : string.Empty); + break; + case 4: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.CombinedMeters[mtr].VolumeMeter.ToString("F2") : string.Empty); + break; + case 5: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.CombinedMeters[mtr].VolumeErrorPct.ToString("F2") : string.Empty); + break; + case 6: + int i = 1; + lvi.UseItemStyleForSubItems = false; + foreach (var tr in trs) + { + if (tr == null) + { + lvi.SubItems.Add(string.Empty); + } + else if (tr.CombinedMeters[mtr].Passed) + { + lvi.SubItems.Add(Strings.Passed); + lvi.SubItems[i].BackColor = Color.Green; + } + else + { + lvi.SubItems.Add(Strings.Failed); + lvi.SubItems[i].BackColor = Color.Red; + } + i++; + } + break; + } + } + else + { + switch (rsltId++) + { + case 0: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.FlowMass.ToString("F1") : string.Empty); + break; + case 1: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.VolumeCTV.ToString("F2") : string.Empty); + break; + case 2: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.Meters[mtr].VolumeMeter.ToString("F2") : string.Empty); + break; + case 3: + foreach (var tr in trs) lvi.SubItems.Add((tr != null) ? tr.Meters[mtr].VolumeErrorPct.ToString("F2") : string.Empty); + break; + case 4: + int i = 1; + lvi.UseItemStyleForSubItems = false; + foreach (var tr in trs) + { + if (tr == null) + { + lvi.SubItems.Add(string.Empty); + } + else if (tr.Meters[mtr].Passed) + { + lvi.SubItems.Add(Strings.Passed); + lvi.SubItems[i].BackColor = Color.Green; + } + else + { + lvi.SubItems.Add(Strings.Failed); + lvi.SubItems[i].BackColor = Color.Red; + } + i++; + } + break; + } + } + lview.Items.Add(lvi); + } + + return lview; + } + + #endregion + + void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args) + { + tests = args.Procedure.Tests; + testResults = new List(); + RedrawAll(); + } + + void OnTestCompleted(object sender, TestCompletedEventArgs args) + { + if (args.TestResult != null) + { + /// Delete an existing testResults with the same test name and repetition number + try + { + Entities.TestResult tr = testResults + .First(x => x.Name.Equals(args.TestResult.Name)); + testResults.Remove(tr); + } + catch { }; + + /// Add the new test results + testResults.Add(args.TestResult); + RedrawAll(); + } + } + } +} diff --git a/TestBenchFramework/Screens/ResultsTabPageCtrl.resx b/TestBenchFramework/Screens/ResultsTabPageCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/Screens/ResultsTabPageCtrl.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/TestBenchFramework/SelectComponentClassDlg.Designer.cs b/TestBenchFramework/SelectComponentClassDlg.Designer.cs new file mode 100644 index 000000000..a8efa674e --- /dev/null +++ b/TestBenchFramework/SelectComponentClassDlg.Designer.cs @@ -0,0 +1,95 @@ +namespace TBF +{ + partial class SelectComponentClassDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SelectComponentClassDlg)); + this.availCmpntsLstBox = new System.Windows.Forms.ListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // availCmpntsLstBox + // + resources.ApplyResources(this.availCmpntsLstBox, "availCmpntsLstBox"); + this.availCmpntsLstBox.FormattingEnabled = true; + this.availCmpntsLstBox.Name = "availCmpntsLstBox"; + this.availCmpntsLstBox.DoubleClick += new System.EventHandler(this.availCmpntsLstBox_DoubleClick); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ImageKey = global::TBF.Resources.Strings.String1; + this.label1.Name = "label1"; + // + // cancelButton + // + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1; + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // okButton + // + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.ImageKey = global::TBF.Resources.Strings.String1; + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // ComponentAddDlg + // + this.AcceptButton = this.okButton; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.availCmpntsLstBox); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ComponentAddDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Load += new System.EventHandler(this.AddComponentDlg_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ListBox availCmpntsLstBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button okButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/SelectComponentClassDlg.cs b/TestBenchFramework/SelectComponentClassDlg.cs new file mode 100644 index 000000000..661eb15ed --- /dev/null +++ b/TestBenchFramework/SelectComponentClassDlg.cs @@ -0,0 +1,63 @@ +using System; +using System.Windows.Forms; +using TBF.BenchControl.Generic; + +namespace TBF +{ + public partial class SelectComponentClassDlg : Form + { + /// This is the main result of this dialog + public IComponentFactory SlctdCmpntFactory = null; + + int selectedIndex = -1; + + /// Constructor + public SelectComponentClassDlg() + { + InitializeComponent(); + + foreach (var componentFactory in BenchControl.TbfComponents.Factories) + { + availCmpntsLstBox.Items.Add(componentFactory.ClassName); + } + } + + /// Load components from BenchControl.SupportedComponents + private void AddComponentDlg_Load(object sender, EventArgs e) + { + if (selectedIndex >= 0 && selectedIndex < BenchControl.TbfComponents.Factories.Count) + { + availCmpntsLstBox.SelectedIndex = selectedIndex; + } + } + + /// Double click - Add the clicked component + private void availCmpntsLstBox_DoubleClick(object sender, EventArgs e) + { + okButton_Click(sender, e); + } + + /// OK - Add the selected component + private void okButton_Click(object sender, EventArgs e) + { + int ix = availCmpntsLstBox.SelectedIndex; + if (ix >= 0 && ix < BenchControl.TbfComponents.Factories.Count) + { + selectedIndex = ix; + SlctdCmpntFactory = BenchControl.TbfComponents.Factories[ix]; + DialogResult = DialogResult.OK; + Close(); + return; + } + } + + /// Cancel - Do nothing + private void cancelButton_Click(object sender, EventArgs e) + { + SlctdCmpntFactory = null; + DialogResult = DialogResult.Cancel; + Close(); + return; + } + } +} diff --git a/TestBenchFramework/SelectComponentClassDlg.de.resx b/TestBenchFramework/SelectComponentClassDlg.de.resx new file mode 100644 index 000000000..d3dae13f3 --- /dev/null +++ b/TestBenchFramework/SelectComponentClassDlg.de.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 128, 13 + + + Verfügbare Komponenten + + + &Abbrechen + + + Komponenten Auswahl + + \ No newline at end of file diff --git a/TestBenchFramework/SelectComponentClassDlg.resx b/TestBenchFramework/SelectComponentClassDlg.resx new file mode 100644 index 000000000..c6763ee4b --- /dev/null +++ b/TestBenchFramework/SelectComponentClassDlg.resx @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 1 + + + cancelButton + + + + 6, 13 + + + 1 + + + 99, 25 + + + 12, 34 + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Available Components: + + + 0 + + + 8 + + + availCmpntsLstBox + + + 0 + + + ComponentAddDlg + + + 200, 310 + + + 311, 347 + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + + CenterParent + + + label1 + + + &Cancel + + + $this + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + okButton + + + 95, 310 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + &OK + + + 288, 264 + + + 115, 13 + + + 9, 9 + + + 7 + + + 99, 25 + + + $this + + + $this + + + 3 + + + Select Component + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + True + + \ No newline at end of file diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj new file mode 100644 index 000000000..5225b6a28 --- /dev/null +++ b/TestBenchFramework/TBF.csproj @@ -0,0 +1,1176 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48} + WinExe + Properties + TBF + TBF + v4.0 + + + 2.0 + + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;DN100 + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;DN100 + prompt + 4 + AnyCPU + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + TBF.Program + + + + ..\packages\ControlBoard\ControlCom2VB.dll + + + ..\packages\FluentNHibernate.1.3.0.733\lib\FluentNHibernate.dll + + + ..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll + + + False + ..\packages\log4net.2.0.2\lib\net40-full\log4net.dll + + + True + + + True + ..\packages\MySql.Data.6.6.5\lib\net20\MySql.Data.dll + + + ..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll + + + + + ..\packages\System.Data.SQLite.1.0.90.0\lib\net40\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.1.0.90.0\lib\net40\System.Data.SQLite.Linq.dll + + + + + + + + + + + UserControl + + + ComponentCfgCtrl.cs + + + + + + UserControl + + + CameraRoiCfgCtrl.cs + + + + + + + + + + + + + + + + UserControl + + + IdcCameraCfgCtrl.cs + + + + + + + + + + + + + + + Form + + + CycleBeginningForm.cs + + + Form + + + CycleEndForm.cs + + + + + UserControl + + + EntryFormCfgCtrl.cs + + + + + + + UserControl + + + PumpCfgCtrl.cs + + + + + + + + + + + UserControl + + + DiverterCfgCtrl.cs + + + UserControl + + + FlowMeterCfgCtrl.cs + + + + + + + + UserControl + + + PressureMeterCfgCtrl.cs + + + + + + + UserControl + + + PumpCfgCtrl.cs + + + + + + UserControl + + + RegisterReaderCfgCtrl.cs + + + + UserControl + + + RegulValveCfgCtrl.cs + + + UserControl + + + TempMeterCfgCtrl.cs + + + + + + + + + + + + + + + + + + + + + UserControl + + + AmbientCfgCtrl.cs + + + UserControl + + + ValveCfgCtrl.cs + + + UserControl + + + BalanceCfgCtrl.cs + + + + + + Form + + + AskYesNoForm.cs + + + + + + + + + + + + + + UserControl + + + PrinterCfgCtrl.cs + + + + Component + + + Component + + + + + UserControl + + + PrinterCfgCtrl.cs + + + + + + + UserControl + + + WriterCfgCtrl.cs + + + + + + + + UserControl + + + + + + + UserControl + + + + + + + + + UserControl + + + TestMethodCfgCtrl.cs + + + + + + + UserControl + + + + + + + + + UserControl + + + WaterMeterCfgCtrl.cs + + + + + + + Form + + + ClosingProgram.cs + + + Form + + + EmergencyStopForm.cs + + + Form + + + ResultsConfig.cs + + + Form + + + TabNameDlg.cs + + + + + UserControl + + + PicturesTabPageCtrl.cs + + + Form + + + SelectComponentClassDlg.cs + + + + + UserControl + + + ControlBoardCfgCtrl.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + ComponentParametersDlg.cs + + + Form + + + ComponentsManagerDlg.cs + + + + + + + + + + + + + + + Form + + + AboutDlg.cs + + + + + + + + + + + + + + + + + + Form + + + BenchesDlg.cs + + + Form + + + DatabaseSettingsDlg.cs + + + + + + + + + + Form + + + EditUsers.cs + + + Form + + + EditSelectedUser.cs + + + Form + + + ErrorDlg.cs + + + Form + + + NoBenchOrDatabaseDlg.cs + + + Form + + + EnterPasswordDlg.cs + + + + + + + + + + + + + Form + + + MetrologyDlg.cs + + + Form + + + PathsDlg.cs + + + + + + + + + + + + + Form + + + LoginDlgWithBenchSelection.cs + + + Form + + + PreferencesDlg.cs + + + + Form + + + LoginDlg.cs + + + Form + + + MainWnd.cs + + + Form + + + ProcedureDlg.cs + + + Form + + + ProceduresDlg.cs + + + + + + + + + + + True + True + Strings.de.resx + + + True + True + Strings.resx + + + UserControl + + + ProcessTabPageCtrl.cs + + + UserControl + + + LogsTabPageCtrl.cs + + + UserControl + + + MeasurementTabPageCtrl.cs + + + UserControl + + + ResultsTabPageCtrl.cs + + + + Form + + + FlowSelection.cs + + + Form + + + MethodSelection.cs + + + Form + + + SensorsSelection.cs + + + Form + + + VolumeAndErrorSelection.cs + + + + + + Form + + + TransitionsDlg.cs + + + + + + + + + + + + + + + + + Component + + + UserControl + + + BenchControlPanel.cs + + + UserControl + + + CameraPictureCtrl.cs + + + + + + UserControl + + + MetrologyDlgFlowMeterTab.cs + + + UserControl + + + MetrologyDlgBalanceTab.cs + + + UserControl + + + MetrologyDlgPressMeterTab.cs + + + Component + + + Component + + + Component + + + Component + + + Component + + + UserControl + + + ProcedureParamsCtrl.cs + + + Component + + + UserControl + + + SharedButtons.cs + + + UserControl + + + TestParamsCtrl.cs + + + UserControl + + + TestProgressCtrl.cs + + + Component + + + + ComponentCfgCtrl.cs + + + CameraRoiCfgCtrl.cs + + + IdcCameraCfgCtrl.cs + + + CycleBeginningForm.cs + + + CycleEndForm.cs + + + EntryFormCfgCtrl.cs + + + DiverterCfgCtrl.cs + + + FlowMeterCfgCtrl.cs + + + PressureMeterCfgCtrl.cs + + + PumpCfgCtrl.cs + + + PumpCfgCtrl.cs + + + RegisterReaderCfgCtrl.cs + + + RegulValveCfgCtrl.cs + + + TempMeterCfgCtrl.cs + + + AmbientCfgCtrl.cs + + + ValveCfgCtrl.cs + + + BalanceCfgCtrl.cs + + + AskYesNoForm.cs + + + PrinterCfgCtrl.cs + + + PrinterCfgCtrl.cs + + + WriterCfgCtrl.cs + + + RoiDetectionCfgCtrl.cs + + + + TestMethodCfgCtrl.cs + + + + WaterMeterCfgCtrl.cs + + + ClosingProgram.cs + + + EmergencyStopForm.cs + + + ResultsConfig.cs + + + TabNameDlg.cs + + + PicturesTabPageCtrl.cs + + + SelectComponentClassDlg.cs + + + SelectComponentClassDlg.cs + + + ControlBoardCfgCtrl.cs + + + ComponentParametersDlg.cs + + + ComponentParametersDlg.cs + + + ComponentsManagerDlg.cs + + + BenchesDlg.cs + + + AboutDlg.cs + + + Designer + AboutDlg.cs + + + Designer + BenchesDlg.cs + + + Designer + DatabaseSettingsDlg.cs + + + EditSelectedUser.cs + + + EditUsers.cs + + + EditUsers.cs + + + EditSelectedUser.cs + + + ErrorDlg.cs + + + ErrorDlg.cs + + + NoBenchOrDatabaseDlg.cs + + + EnterPasswordDlg.cs + + + LoginDlg.cs + + + LoginDlg.cs + Designer + + + LoginDlgWithBenchSelection.cs + + + LoginDlgWithBenchSelection.cs + + + LoginDlgWithBenchSelection.cs + + + MainWnd.cs + Designer + + + MainWnd.cs + Designer + + + MetrologyDlg.cs + + + PathsDlg.cs + + + PathsDlg.cs + + + PreferencesDlg.cs + + + Designer + PreferencesDlg.cs + + + ProcedureDlg.cs + + + ProcedureDlg.cs + + + ProceduresDlg.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + ResXFileCodeGenerator + Strings.de.Designer.cs + Designer + + + ResXFileCodeGenerator + Strings.Designer.cs + + + + ProcessTabPageCtrl.cs + + + LogsTabPageCtrl.cs + + + MeasurementTabPageCtrl.cs + + + ResultsTabPageCtrl.cs + + + FlowSelection.cs + + + MethodSelection.cs + + + SensorsSelection.cs + + + VolumeAndErrorSelection.cs + + + TransitionsDlg.cs + + + TransitionsDlg.cs + + + BenchControlPanel.cs + + + BenchControlPanel.cs + + + CameraPictureCtrl.cs + + + MetrologyDlgFlowMeterTab.cs + + + MetrologyDlgBalanceTab.cs + + + MetrologyDlgPressMeterTab.cs + + + ListViewEx.cs + + + ProcedureParamsCtrl.cs + + + SharedButtons.cs + + + TestParamsCtrl.cs + + + TestProgressCtrl.cs + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + Always + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 4.5 + true + + + + + + + + + + + + Always + + + Always + + + + Always + + + Always + + + + + + \ No newline at end of file diff --git a/TestBenchFramework/TestProgressControls.cs b/TestBenchFramework/TestProgressControls.cs new file mode 100644 index 000000000..b1247bee1 --- /dev/null +++ b/TestBenchFramework/TestProgressControls.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using TBF.UiBridge; + +namespace TBF +{ + public class TestProgressControls + { + System.Windows.Forms.Control parent; /// parent is progressFlowLayoutPanel of the only MainWnd instance + IList progresses; + UiControls.TestProgressCtrl currentProgress; + + public TestProgressControls(Control parent) + { + this.parent = parent; + progresses = null; + currentProgress = null; + + Bridge.ProcedureSelectedHandler += delegate(object sender, ProcedureSelectedEventArgs args) + { + if (Program.MainWnd.InvokeRequired) + { + Program.MainWnd.Invoke(new EventHandler(OnProcedureSelected), sender, args); + } + else OnProcedureSelected(sender, args); + }; + Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args) + { + if (Program.MainWnd.InvokeRequired) + { + Program.MainWnd.Invoke(new EventHandler(OnTestSelected), sender, args); + } + else OnTestSelected(sender, args); + }; + Bridge.TestProgressHandler += delegate(object sender, TestProgressEventArgs args) + { + if (Program.MainWnd.InvokeRequired) + { + Program.MainWnd.Invoke(new EventHandler(OnTestProgress), sender, args); + } + else OnTestProgress(sender, args); + }; + Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args) + { + if (Program.MainWnd.InvokeRequired) + { + Program.MainWnd.Invoke(new EventHandler(OnTestCompleted), sender, args); + } + else OnTestCompleted(sender, args); + }; + Bridge.ProcedureCompletedHandler += delegate(object sender, ProcedureCompletedEventArgs args) + { + if (Program.MainWnd.InvokeRequired) + { + Program.MainWnd.Invoke(new EventHandler(OnProcedureCompleted), sender, args); + } + else OnProcedureCompleted(sender, args); + }; + } + + public void ProcedureSelectedInUI(object sender, ProcedureSelectedEventArgs args) + { + OnProcedureSelected(sender, args); + } + + void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args) + { + currentProgress = null; + parent.Controls.Clear(); + progresses = new List(); + foreach (var test in args.Procedure.Tests) + { + /// Single test + if (test.Repeats == 1) + { + UiControls.TestProgressCtrl prgrs = new UiControls.TestProgressCtrl(test.Name); + progresses.Add(prgrs); + parent.Controls.Add(prgrs); + continue; + } + /// More test repetitions + for (int i = 1; i <= test.Repeats; i++) + { + UiControls.TestProgressCtrl prgrs = new UiControls.TestProgressCtrl(test.Name, i, test.Repeats); + progresses.Add(prgrs); + parent.Controls.Add(prgrs); + } + } + } + + void OnTestSelected(object sender, TestSelectedEventArgs args) + { + if (progresses != null) + { + foreach (var prgrs in progresses) + { + if (prgrs.TestName.Equals(args.Test.Name) && prgrs.RepetitionNr == args.RepetitionNr) + { + currentProgress = prgrs; + currentProgress.Progress = 0; + currentProgress.TestResult = UiControls.TestProgressCtrl.Result.NotDone; + return; + } + } + } + currentProgress = null; + } + + void OnTestProgress(object sender, TestProgressEventArgs args) + { + if (currentProgress != null) currentProgress.Progress = args.Progress; + } + + void OnTestCompleted(object sender, TestCompletedEventArgs args) + { + if (currentProgress != null) + { + // Test is 'failed' if any meter failed + foreach (var meterTestResult in args.TestResult.Meters) + { + if (!meterTestResult.Passed) + { + currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed; + return; + } + } + currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed; + } + } + + void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args) + { + } + } +} diff --git a/TestBenchFramework/TestWizard/FlowSelection.Designer.cs b/TestBenchFramework/TestWizard/FlowSelection.Designer.cs new file mode 100644 index 000000000..85d28c68f --- /dev/null +++ b/TestBenchFramework/TestWizard/FlowSelection.Designer.cs @@ -0,0 +1,192 @@ +namespace TBF.TestWizard +{ + partial class FlowSelection + { + /// + /// 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 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.horizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.qToTextBox = new System.Windows.Forms.TextBox(); + this.qFromTextBox = new System.Windows.Forms.TextBox(); + this.testNameTextBox = new System.Windows.Forms.TextBox(); + this.qToLabel = new System.Windows.Forms.Label(); + this.qFromLabel = new System.Windows.Forms.Label(); + this.testNameLabel = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.nextButton = new System.Windows.Forms.Button(); + this.backButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); + this.horizSplitContainer.Panel1.SuspendLayout(); + this.horizSplitContainer.Panel2.SuspendLayout(); + this.horizSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // horizSplitContainer + // + this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); + this.horizSplitContainer.Name = "horizSplitContainer"; + this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // horizSplitContainer.Panel1 + // + this.horizSplitContainer.Panel1.Controls.Add(this.qToTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.qFromTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.testNameTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.qToLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.qFromLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.testNameLabel); + // + // horizSplitContainer.Panel2 + // + this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); + this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); + this.horizSplitContainer.Panel2.Controls.Add(this.backButton); + this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); + this.horizSplitContainer.SplitterDistance = 182; + this.horizSplitContainer.TabIndex = 1; + // + // qToTextBox + // + this.qToTextBox.Location = new System.Drawing.Point(126, 86); + this.qToTextBox.Name = "qToTextBox"; + this.qToTextBox.Size = new System.Drawing.Size(97, 20); + this.qToTextBox.TabIndex = 5; + this.qToTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // qFromTextBox + // + this.qFromTextBox.Location = new System.Drawing.Point(126, 56); + this.qFromTextBox.Name = "qFromTextBox"; + this.qFromTextBox.Size = new System.Drawing.Size(97, 20); + this.qFromTextBox.TabIndex = 4; + this.qFromTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // testNameTextBox + // + this.testNameTextBox.Location = new System.Drawing.Point(126, 26); + this.testNameTextBox.Name = "testNameTextBox"; + this.testNameTextBox.Size = new System.Drawing.Size(97, 20); + this.testNameTextBox.TabIndex = 3; + this.testNameTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // qToLabel + // + this.qToLabel.AutoSize = true; + this.qToLabel.Location = new System.Drawing.Point(24, 89); + this.qToLabel.Name = "qToLabel"; + this.qToLabel.Size = new System.Drawing.Size(61, 13); + this.qToLabel.TabIndex = 2; + this.qToLabel.Text = "Q to [m3/h]"; + // + // qFromLabel + // + this.qFromLabel.AutoSize = true; + this.qFromLabel.Location = new System.Drawing.Point(24, 59); + this.qFromLabel.Name = "qFromLabel"; + this.qFromLabel.Size = new System.Drawing.Size(72, 13); + this.qFromLabel.TabIndex = 1; + this.qFromLabel.Text = "Q from [m3/h]"; + // + // testNameLabel + // + this.testNameLabel.AutoSize = true; + this.testNameLabel.Location = new System.Drawing.Point(24, 29); + this.testNameLabel.Name = "testNameLabel"; + this.testNameLabel.Size = new System.Drawing.Size(57, 13); + this.testNameLabel.TabIndex = 0; + this.testNameLabel.Text = "Test name"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(186, 17); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 42); + this.cancelButton.TabIndex = 27; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // nextButton + // + this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.nextButton.Location = new System.Drawing.Point(105, 17); + this.nextButton.Name = "nextButton"; + this.nextButton.Size = new System.Drawing.Size(75, 42); + this.nextButton.TabIndex = 26; + this.nextButton.Text = "&Next >"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // backButton + // + this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; + this.backButton.Location = new System.Drawing.Point(24, 17); + this.backButton.Name = "backButton"; + this.backButton.Size = new System.Drawing.Size(75, 42); + this.backButton.TabIndex = 25; + this.backButton.Text = "< &Back"; + this.backButton.UseVisualStyleBackColor = true; + this.backButton.Click += new System.EventHandler(this.backButton_Click); + // + // FlowSelection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.horizSplitContainer); + this.Name = "FlowSelection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FlowSelection"; + this.Load += new System.EventHandler(this.FlowSelection_Load); + this.horizSplitContainer.Panel1.ResumeLayout(false); + this.horizSplitContainer.Panel1.PerformLayout(); + this.horizSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); + this.horizSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer horizSplitContainer; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button nextButton; + private System.Windows.Forms.Button backButton; + private System.Windows.Forms.TextBox qToTextBox; + private System.Windows.Forms.TextBox qFromTextBox; + private System.Windows.Forms.TextBox testNameTextBox; + private System.Windows.Forms.Label qToLabel; + private System.Windows.Forms.Label qFromLabel; + private System.Windows.Forms.Label testNameLabel; + + } +} \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/FlowSelection.cs b/TestBenchFramework/TestWizard/FlowSelection.cs new file mode 100644 index 000000000..f0e238df4 --- /dev/null +++ b/TestBenchFramework/TestWizard/FlowSelection.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.TestWizard +{ + public partial class FlowSelection : Form + { + Entities.Test test; + + public FlowSelection() + { + InitializeComponent(); + } + + public FlowSelection(Entities.Test test) + : this() + { + this.test = test; + } + + private void FlowSelection_Load(object sender, EventArgs e) + { + if (test == null) return; + + backButton.Visible = false; + + Text = Strings.Flow_selection; + testNameLabel.Text = Strings.Test_name; + qFromLabel.Text = Strings.Q_from_m3h; + qToLabel.Text = Strings.Q_to_m3h; + backButton.Text = Strings.BackBtnText; + nextButton.Text = Strings.NextBtnText; + cancelButton.Text = Strings.CancelBtnText; + + RefreshWizardPage(); + } + + void RefreshWizardPage() + { + testNameTextBox.Text = test.Name; + qFromTextBox.Text = test.Qfrom.ToString(); + qToTextBox.Text = test.Qto.ToString(); + nextButton.Enabled = IsFormValid(); + } + + void UpdateTest() + { + test.Name = testNameTextBox.Text; + test.Qfrom = Utils.ParseUFloat(qFromTextBox.Text); + test.Qto = Utils.ParseUFloat(qToTextBox.Text); + } + + bool IsFormValid() + { + float dummy; + return Utils.TryParseUFloat(qFromTextBox.Text, out dummy) && + Utils.TryParseUFloat(qToTextBox.Text, out dummy); + } + + private void backButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Retry; + Close(); + } + + private void nextButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) + { + UpdateTest(); + DialogResult = DialogResult.OK; + Close(); + } + else + { + DialogResult = DialogResult.None; + } + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void anyTextBox_TextChanged(object sender, EventArgs e) + { + nextButton.Enabled = IsFormValid(); + } + } +} diff --git a/TestBenchFramework/TestWizard/FlowSelection.resx b/TestBenchFramework/TestWizard/FlowSelection.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/TestWizard/FlowSelection.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/TestBenchFramework/TestWizard/MethodSelection.Designer.cs b/TestBenchFramework/TestWizard/MethodSelection.Designer.cs new file mode 100644 index 000000000..649afd3c4 --- /dev/null +++ b/TestBenchFramework/TestWizard/MethodSelection.Designer.cs @@ -0,0 +1,170 @@ +namespace TBF.TestWizard +{ + partial class MethodSelection + { + /// + /// 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 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.horizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.sensorsComboBox = new System.Windows.Forms.ComboBox(); + this.sensorsLabel = new System.Windows.Forms.Label(); + this.testMethodComboBox = new System.Windows.Forms.ComboBox(); + this.testMethodLabel = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.nextButton = new System.Windows.Forms.Button(); + this.backButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); + this.horizSplitContainer.Panel1.SuspendLayout(); + this.horizSplitContainer.Panel2.SuspendLayout(); + this.horizSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // horizSplitContainer + // + this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); + this.horizSplitContainer.Name = "horizSplitContainer"; + this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // horizSplitContainer.Panel1 + // + this.horizSplitContainer.Panel1.Controls.Add(this.sensorsComboBox); + this.horizSplitContainer.Panel1.Controls.Add(this.sensorsLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.testMethodComboBox); + this.horizSplitContainer.Panel1.Controls.Add(this.testMethodLabel); + // + // horizSplitContainer.Panel2 + // + this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); + this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); + this.horizSplitContainer.Panel2.Controls.Add(this.backButton); + this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); + this.horizSplitContainer.SplitterDistance = 182; + this.horizSplitContainer.TabIndex = 0; + // + // sensorsComboBox + // + this.sensorsComboBox.FormattingEnabled = true; + this.sensorsComboBox.Location = new System.Drawing.Point(96, 84); + this.sensorsComboBox.Name = "sensorsComboBox"; + this.sensorsComboBox.Size = new System.Drawing.Size(165, 21); + this.sensorsComboBox.TabIndex = 3; + this.sensorsComboBox.TextChanged += new System.EventHandler(this.sensorsComboBox_TextChanged); + // + // sensorsLabel + // + this.sensorsLabel.AutoSize = true; + this.sensorsLabel.Location = new System.Drawing.Point(12, 87); + this.sensorsLabel.Name = "sensorsLabel"; + this.sensorsLabel.Size = new System.Drawing.Size(45, 13); + this.sensorsLabel.TabIndex = 2; + this.sensorsLabel.Text = "Sensors"; + // + // testMethodComboBox + // + this.testMethodComboBox.FormattingEnabled = true; + this.testMethodComboBox.Location = new System.Drawing.Point(96, 48); + this.testMethodComboBox.Name = "testMethodComboBox"; + this.testMethodComboBox.Size = new System.Drawing.Size(165, 21); + this.testMethodComboBox.TabIndex = 1; + this.testMethodComboBox.TextChanged += new System.EventHandler(this.testMethodComboBox_TextChanged); + // + // testMethodLabel + // + this.testMethodLabel.AutoSize = true; + this.testMethodLabel.Location = new System.Drawing.Point(12, 51); + this.testMethodLabel.Name = "testMethodLabel"; + this.testMethodLabel.Size = new System.Drawing.Size(66, 13); + this.testMethodLabel.TabIndex = 0; + this.testMethodLabel.Text = "Test method"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(186, 17); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 42); + this.cancelButton.TabIndex = 27; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // nextButton + // + this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.nextButton.Location = new System.Drawing.Point(105, 17); + this.nextButton.Name = "nextButton"; + this.nextButton.Size = new System.Drawing.Size(75, 42); + this.nextButton.TabIndex = 26; + this.nextButton.Text = "&Next >"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // backButton + // + this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; + this.backButton.Location = new System.Drawing.Point(24, 17); + this.backButton.Name = "backButton"; + this.backButton.Size = new System.Drawing.Size(75, 42); + this.backButton.TabIndex = 25; + this.backButton.Text = "< &Back"; + this.backButton.UseVisualStyleBackColor = true; + this.backButton.Click += new System.EventHandler(this.backButton_Click); + // + // MethodSelection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.horizSplitContainer); + this.Name = "MethodSelection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "MethodSelection"; + this.Load += new System.EventHandler(this.MethodSelection_Load); + this.horizSplitContainer.Panel1.ResumeLayout(false); + this.horizSplitContainer.Panel1.PerformLayout(); + this.horizSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); + this.horizSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer horizSplitContainer; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button nextButton; + private System.Windows.Forms.Button backButton; + private System.Windows.Forms.ComboBox testMethodComboBox; + private System.Windows.Forms.Label testMethodLabel; + private System.Windows.Forms.ComboBox sensorsComboBox; + private System.Windows.Forms.Label sensorsLabel; + } +} \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/MethodSelection.cs b/TestBenchFramework/TestWizard/MethodSelection.cs new file mode 100644 index 000000000..99c3faa4d --- /dev/null +++ b/TestBenchFramework/TestWizard/MethodSelection.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.TestWizard +{ + public partial class MethodSelection : Form + { + Entities.Test test; + IList methods; + IList sensorPaths; + + public MethodSelection() + { + InitializeComponent(); + } + + public MethodSelection(Entities.Test test, + IList methods, + IList sensorPaths) + : this() + { + this.test = test; + this.methods = methods; + this.sensorPaths = sensorPaths; + } + + private void MethodSelection_Load(object sender, EventArgs e) + { + if (test == null) return; + + Text = Strings.Method_selection; + testMethodLabel.Text = Strings.Test_method; + sensorsLabel.Text = Strings.Sensors; + backButton.Text = Strings.BackBtnText; + nextButton.Text = Strings.NextBtnText; + cancelButton.Text = Strings.CancelBtnText; + + foreach (var method in methods) testMethodComboBox.Items.Add(method.Cfg.Name); + foreach (var path in sensorPaths) sensorsComboBox.Items.Add(path.Name); + + RefreshWizardPage(); + } + + void RefreshWizardPage() + { + nextButton.Enabled = IsFormValid(); + } + + void UpdateTest() + { + if (testMethodComboBox.Items.Contains(testMethodComboBox.Text)) + { + test.Method = testMethodComboBox.Text; + } + if (sensorsComboBox.Items.Contains(sensorsComboBox.Text)) + { + test.MetersPath = sensorsComboBox.Text; + } + } + + bool IsFormValid() + { + return testMethodComboBox.Items.Contains(testMethodComboBox.Text) && + sensorsComboBox.Items.Contains(sensorsComboBox.Text); + } + + private void backButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) UpdateTest(); + DialogResult = DialogResult.Retry; + Close(); + } + + private void nextButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) + { + UpdateTest(); + DialogResult = DialogResult.OK; + Close(); + } + else + { + DialogResult = DialogResult.None; + } + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void testMethodComboBox_TextChanged(object sender, EventArgs e) + { + nextButton.Enabled = IsFormValid(); + } + + private void sensorsComboBox_TextChanged(object sender, EventArgs e) + { + nextButton.Enabled = IsFormValid(); + } + } +} diff --git a/TestBenchFramework/TestWizard/MethodSelection.resx b/TestBenchFramework/TestWizard/MethodSelection.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/TestWizard/MethodSelection.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/TestBenchFramework/TestWizard/SensorsSelection.Designer.cs b/TestBenchFramework/TestWizard/SensorsSelection.Designer.cs new file mode 100644 index 000000000..c1998bc98 --- /dev/null +++ b/TestBenchFramework/TestWizard/SensorsSelection.Designer.cs @@ -0,0 +1,116 @@ +namespace TBF.TestWizard +{ + partial class SensorsSelection + { + /// + /// 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 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.horizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.cancelButton = new System.Windows.Forms.Button(); + this.nextButton = new System.Windows.Forms.Button(); + this.backButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); + this.horizSplitContainer.Panel2.SuspendLayout(); + this.horizSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // horizSplitContainer + // + this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); + this.horizSplitContainer.Name = "horizSplitContainer"; + this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // horizSplitContainer.Panel2 + // + this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); + this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); + this.horizSplitContainer.Panel2.Controls.Add(this.backButton); + this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); + this.horizSplitContainer.SplitterDistance = 182; + this.horizSplitContainer.TabIndex = 1; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(186, 17); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 42); + this.cancelButton.TabIndex = 27; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // nextButton + // + this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.nextButton.Location = new System.Drawing.Point(105, 17); + this.nextButton.Name = "nextButton"; + this.nextButton.Size = new System.Drawing.Size(75, 42); + this.nextButton.TabIndex = 26; + this.nextButton.Text = "&Next >"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // backButton + // + this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; + this.backButton.Location = new System.Drawing.Point(24, 17); + this.backButton.Name = "backButton"; + this.backButton.Size = new System.Drawing.Size(75, 42); + this.backButton.TabIndex = 25; + this.backButton.Text = "< &Back"; + this.backButton.UseVisualStyleBackColor = true; + this.backButton.Click += new System.EventHandler(this.backButton_Click); + // + // SensorsSelection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.horizSplitContainer); + this.Name = "SensorsSelection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "SensorsSelection"; + this.Load += new System.EventHandler(this.SensorsSelection_Load); + this.horizSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); + this.horizSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer horizSplitContainer; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button nextButton; + private System.Windows.Forms.Button backButton; + } +} \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/SensorsSelection.cs b/TestBenchFramework/TestWizard/SensorsSelection.cs new file mode 100644 index 000000000..a7af5899c --- /dev/null +++ b/TestBenchFramework/TestWizard/SensorsSelection.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.TestWizard +{ + public partial class SensorsSelection : Form + { + Entities.Test test; + + public SensorsSelection() + { + InitializeComponent(); + } + + public SensorsSelection(Entities.Test test) + : this() + { + this.test = test; + } + + private void SensorsSelection_Load(object sender, EventArgs e) + { + if (test == null) return; + + backButton.Text = Strings.BackBtnText; + nextButton.Text = Strings.NextBtnText; + cancelButton.Text = Strings.CancelBtnText; + + RefreshWizardPage(); + } + + void RefreshWizardPage() + { + nextButton.Enabled = IsFormValid(); + } + + void UpdateTest() + { + } + + bool IsFormValid() + { + return true; + } + + private void backButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) UpdateTest(); + DialogResult = DialogResult.Retry; + Close(); + } + + private void nextButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) + { + UpdateTest(); + DialogResult = DialogResult.OK; + Close(); + } + else + { + DialogResult = DialogResult.None; + } + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/TestBenchFramework/TestWizard/SensorsSelection.resx b/TestBenchFramework/TestWizard/SensorsSelection.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/TestWizard/SensorsSelection.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/TestBenchFramework/TestWizard/VolumeAndErrorSelection.Designer.cs b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.Designer.cs new file mode 100644 index 000000000..c498f4937 --- /dev/null +++ b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.Designer.cs @@ -0,0 +1,214 @@ +namespace TBF.TestWizard +{ + partial class VolumeAndErrorSelection + { + /// + /// 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 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.horizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.errLoPctTextBox = new System.Windows.Forms.TextBox(); + this.errHiPctTextBox = new System.Windows.Forms.TextBox(); + this.durationTextBox = new System.Windows.Forms.TextBox(); + this.volumeTextBox = new System.Windows.Forms.TextBox(); + this.errHiPctLabel = new System.Windows.Forms.Label(); + this.errLoPctLabel = new System.Windows.Forms.Label(); + this.durationLabel = new System.Windows.Forms.Label(); + this.volumeLabel = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.nextButton = new System.Windows.Forms.Button(); + this.backButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); + this.horizSplitContainer.Panel1.SuspendLayout(); + this.horizSplitContainer.Panel2.SuspendLayout(); + this.horizSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // horizSplitContainer + // + this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); + this.horizSplitContainer.Name = "horizSplitContainer"; + this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // horizSplitContainer.Panel1 + // + this.horizSplitContainer.Panel1.Controls.Add(this.errLoPctTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.errHiPctTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.durationTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.volumeTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.errHiPctLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.errLoPctLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.durationLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.volumeLabel); + // + // horizSplitContainer.Panel2 + // + this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); + this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); + this.horizSplitContainer.Panel2.Controls.Add(this.backButton); + this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); + this.horizSplitContainer.SplitterDistance = 182; + this.horizSplitContainer.TabIndex = 1; + // + // errLoPctTextBox + // + this.errLoPctTextBox.Location = new System.Drawing.Point(150, 85); + this.errLoPctTextBox.Name = "errLoPctTextBox"; + this.errLoPctTextBox.Size = new System.Drawing.Size(86, 20); + this.errLoPctTextBox.TabIndex = 7; + this.errLoPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // errHiPctTextBox + // + this.errHiPctTextBox.Location = new System.Drawing.Point(150, 117); + this.errHiPctTextBox.Name = "errHiPctTextBox"; + this.errHiPctTextBox.Size = new System.Drawing.Size(86, 20); + this.errHiPctTextBox.TabIndex = 6; + this.errHiPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // durationTextBox + // + this.durationTextBox.Location = new System.Drawing.Point(150, 53); + this.durationTextBox.Name = "durationTextBox"; + this.durationTextBox.Size = new System.Drawing.Size(86, 20); + this.durationTextBox.TabIndex = 5; + this.durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged); + // + // volumeTextBox + // + this.volumeTextBox.Location = new System.Drawing.Point(150, 24); + this.volumeTextBox.Name = "volumeTextBox"; + this.volumeTextBox.Size = new System.Drawing.Size(86, 20); + this.volumeTextBox.TabIndex = 4; + this.volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged); + // + // errHiPctLabel + // + this.errHiPctLabel.AutoSize = true; + this.errHiPctLabel.Location = new System.Drawing.Point(35, 117); + this.errHiPctLabel.Name = "errHiPctLabel"; + this.errHiPctLabel.Size = new System.Drawing.Size(89, 13); + this.errHiPctLabel.TabIndex = 3; + this.errHiPctLabel.Text = "Error high limit [%]"; + // + // errLoPctLabel + // + this.errLoPctLabel.AutoSize = true; + this.errLoPctLabel.Location = new System.Drawing.Point(35, 88); + this.errLoPctLabel.Name = "errLoPctLabel"; + this.errLoPctLabel.Size = new System.Drawing.Size(85, 13); + this.errLoPctLabel.TabIndex = 2; + this.errLoPctLabel.Text = "Error low limit [%]"; + // + // timeLabel + // + this.durationLabel.AutoSize = true; + this.durationLabel.Location = new System.Drawing.Point(35, 56); + this.durationLabel.Name = "timeLabel"; + this.durationLabel.Size = new System.Drawing.Size(83, 13); + this.durationLabel.TabIndex = 1; + this.durationLabel.Text = "Test duration [s]"; + // + // volumeLabel + // + this.volumeLabel.AutoSize = true; + this.volumeLabel.Location = new System.Drawing.Point(35, 27); + this.volumeLabel.Name = "volumeLabel"; + this.volumeLabel.Size = new System.Drawing.Size(53, 13); + this.volumeLabel.TabIndex = 0; + this.volumeLabel.Text = "Volume [l]"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(186, 17); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 42); + this.cancelButton.TabIndex = 27; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // nextButton + // + this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.nextButton.Location = new System.Drawing.Point(105, 17); + this.nextButton.Name = "nextButton"; + this.nextButton.Size = new System.Drawing.Size(75, 42); + this.nextButton.TabIndex = 26; + this.nextButton.Text = "&Next >"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // backButton + // + this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; + this.backButton.Location = new System.Drawing.Point(24, 17); + this.backButton.Name = "backButton"; + this.backButton.Size = new System.Drawing.Size(75, 42); + this.backButton.TabIndex = 25; + this.backButton.Text = "< &Back"; + this.backButton.UseVisualStyleBackColor = true; + this.backButton.Click += new System.EventHandler(this.backButton_Click); + // + // VolumeAndErrorSelection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.horizSplitContainer); + this.Name = "VolumeAndErrorSelection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "VolumeAndErrorSelection"; + this.Load += new System.EventHandler(this.VolumeAndErrorSelection_Load); + this.horizSplitContainer.Panel1.ResumeLayout(false); + this.horizSplitContainer.Panel1.PerformLayout(); + this.horizSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); + this.horizSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer horizSplitContainer; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button nextButton; + private System.Windows.Forms.Button backButton; + private System.Windows.Forms.TextBox errLoPctTextBox; + private System.Windows.Forms.TextBox errHiPctTextBox; + private System.Windows.Forms.TextBox durationTextBox; + private System.Windows.Forms.TextBox volumeTextBox; + private System.Windows.Forms.Label errHiPctLabel; + private System.Windows.Forms.Label errLoPctLabel; + private System.Windows.Forms.Label durationLabel; + private System.Windows.Forms.Label volumeLabel; + } +} \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/VolumeAndErrorSelection.cs b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.cs new file mode 100644 index 000000000..680937240 --- /dev/null +++ b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.TestWizard +{ + public partial class VolumeAndErrorSelection : Form + { + Entities.Test test; + + public VolumeAndErrorSelection() + { + InitializeComponent(); + } + + public VolumeAndErrorSelection(Entities.Test test) + : this() + { + this.test = test; + } + + private void VolumeAndErrorSelection_Load(object sender, EventArgs e) + { + if (test == null) return; + + Text = Strings.Volume_and_error_selection; + volumeLabel.Text = Strings.Volume_ltr_chdr; + durationLabel.Text = Strings.Duration_s; + errLoPctLabel.Text = Strings.Err_limit_neg_pct_chdr; + errHiPctLabel.Text = Strings.Err_limit_pos_pct_chdr; + backButton.Text = Strings.BackBtnText; + nextButton.Text = Strings.FinishBtnText; + cancelButton.Text = Strings.CancelBtnText; + + RefreshWizardPage(); + } + + void RefreshWizardPage() + { + volumeTextBox.Text = test.Volume.ToString(); + durationTextBox.Text = test.TstTime.ToString(); + errLoPctTextBox.Text = test.ErrLimLo.ToString(); + errHiPctTextBox.Text = test.ErrLimHi.ToString(); + + nextButton.Enabled = IsFormValid(); + } + + bool IsFormValid() + { + float dummy; + return Utils.TryParseUFloat(volumeTextBox.Text, out dummy) && + Utils.TryParseUFloat(durationTextBox.Text, out dummy) && + Utils.TryParseSFloat(errLoPctTextBox.Text, out dummy) && + Utils.TryParseSFloat(errHiPctTextBox.Text, out dummy); + } + + void UpdateTest() + { + test.Volume = Utils.ParseUFloat(volumeTextBox.Text); + test.TstTime = Utils.ParseUFloat(durationTextBox.Text); + test.ErrLimLo = Utils.ParseSFloat(errLoPctTextBox.Text); + test.ErrLimHi = Utils.ParseSFloat(errHiPctTextBox.Text); + } + + private void backButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) UpdateTest(); + DialogResult = DialogResult.Retry; + Close(); + } + + private void nextButton_Click(object sender, EventArgs e) + { + if (test != null && IsFormValid()) + { + UpdateTest(); + DialogResult = DialogResult.OK; + Close(); + } + else + { + DialogResult = DialogResult.None; + } + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void anyTextBox_TextChanged(object sender, EventArgs e) + { + nextButton.Enabled = IsFormValid(); + } + + private void volumeTextBox_TextChanged(object sender, EventArgs e) + { + float Qave_lps = (test.Qfrom + test.Qto) / 7.2f; + float volume; + if (Utils.TryParseUFloat(volumeTextBox.Text, out volume)) + { + durationTextBox.TextChanged -= new System.EventHandler(this.durationTextBox_TextChanged); + durationTextBox.Text = (volume / Qave_lps).ToString(); + durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged); + } + anyTextBox_TextChanged(sender, e); + } + + private void durationTextBox_TextChanged(object sender, EventArgs e) + { + float Qave_lps = (test.Qfrom + test.Qto) / 7.2f; + float testTime; + if (Utils.TryParseUFloat(durationTextBox.Text, out testTime)) + { + volumeTextBox.TextChanged -= new System.EventHandler(this.volumeTextBox_TextChanged); + volumeTextBox.Text = (testTime * Qave_lps).ToString(); + volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged); + } + anyTextBox_TextChanged(sender, e); + } + } +} diff --git a/TestBenchFramework/TestWizard/VolumeAndErrorSelection.resx b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/TestWizard/VolumeAndErrorSelection.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/TestBenchFramework/Tools/ByteFormatter.cs b/TestBenchFramework/Tools/ByteFormatter.cs new file mode 100644 index 000000000..361834027 --- /dev/null +++ b/TestBenchFramework/Tools/ByteFormatter.cs @@ -0,0 +1,59 @@ +using System; +using System.Globalization; + +namespace TBF.Tools +{ + public class ByteFormatter : IFormatProvider, ICustomFormatter + { + public ByteFormatter() + { + } + + public object GetFormat(Type formatType) + { + if (formatType == typeof(ICustomFormatter)) + return this; + else + return null; + } + + public string Format(string fmt, object arg, IFormatProvider formatProvider) + { + if (arg.GetType() != typeof(byte)) + { + try + { + return HandleOtherFormats(fmt, arg); + } + catch (FormatException e) + { + throw new FormatException(String.Format("The format of '{0}' is invalid.", fmt), e); + } + } + + /// + /// Convert one byte to string + /// + byte b = (byte)arg; + if ((32 <= b) && (b <= 127)) return "'" + ((char)b).ToString() + "'"; + if ((char)b == '\r') return "'\\r'"; + if ((char)b == '\n') return "'\\n'"; + if ((char)b == '\t') return "'\\t'"; + if (b == 17) return "XON"; + if (b == 19) return "XOFF"; + if (b == 26) return "Ctrl-Z"; + return b.ToString(); + } + + + private string HandleOtherFormats(string format, object arg) + { + if (arg is IFormattable) + return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture); + else if (arg != null) + return arg.ToString(); + else + return String.Empty; + } + } +} diff --git a/TestBenchFramework/Tools/IniUtil.cs b/TestBenchFramework/Tools/IniUtil.cs new file mode 100644 index 000000000..9b81fdae5 --- /dev/null +++ b/TestBenchFramework/Tools/IniUtil.cs @@ -0,0 +1,105 @@ +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Specialized; + +namespace TBF.Tools +{ + /// + /// The class use the WinApi GetPrivateProfileSectionNames, + /// GetPrivateProfileSection, GetPrivateProfileString, WritePrivateProfileString + /// and present easy methods to work from a NET point of view. + /// Usage: + /// IniUtil ini = new IniUtil(@"C:\program files (x86)\myapp\myapp.ini"); + /// string country = ini.GetValue("Carrier","Country","NoCountry"); + /// + public class IniUtil + { + [DllImport("kernel32.dll")] + private static extern int GetPrivateProfileSectionNames(byte[] lpszReturnBuffer, int nSize, string lpFileName); + [DllImport("kernel32.dll")] + private static extern int GetPrivateProfileSection(string lpAppName, byte[] lpReturnedString, int nSize, string lpFileName); + [DllImport("kernel32.dll")] + private static extern int GetPrivateProfileString(string lpApplicationName, string lpKeyName, string lpDefault, byte[] lpReturnedString, int nSize, string lpFileName); + [DllImport("kernel32.dll")] + private static extern bool WritePrivateProfileString(string lpApplicationName, string lpKeyName, string lpString, string lpFileName); + + private const int VALUE_BUFFER = 511; + private const int SECTION_BUFFER = (1024 * 16); + private string m_sIniFile; + + /// + /// .ctor with INI file name + /// + /// Fullpath to the INI file + public IniUtil(string fileName) + { + m_sIniFile = fileName; + } + + /// + /// Set the value for a specific key in a section + /// + /// Section containing the key to write to + /// Key to insert/update + /// Value for the key + /// True if OK + public bool SetValue(string section, string key, string keyvalue) + { + return WritePrivateProfileString(section, key, keyvalue, m_sIniFile); + } + + /// + /// Gets the value of the specidied key in the specified section, + /// If the key doesn't exists returns the default value + /// + /// Section containing the key to read from + /// Required key + /// Value to return in case the key is missing + /// string value of the key or missing value + public string GetValue(string section, string key, string ifMissing) + { + byte[] by = new byte[VALUE_BUFFER]; + int n = GetPrivateProfileString(section, key, ifMissing, by, VALUE_BUFFER, m_sIniFile); + string s = Encoding.ASCII.GetString(by); + return s.Substring(0, n); + } + + /// + /// Returns the NameValueCollection for every key in the section + /// + /// Section name + /// NameValueCollection with nake=Key and value=value + public NameValueCollection GetSectionKeysvalues(string section) + { + NameValueCollection n = new NameValueCollection(); + if(section.Length > 0) + { + byte[] by = new byte[SECTION_BUFFER]; + int x = GetPrivateProfileSection(section, by, SECTION_BUFFER, m_sIniFile); + if(x > 0) x--; + string keysvalues = Encoding.ASCII.GetString(by, 0, x); + string[] temp = keysvalues.Split('\0'); + foreach(string s in temp) + { + string[] t = s.Split('='); + n.Add(t[0], t[1]); + } + } + return n; + } + + /// + /// Get the names of all sections in .INI + /// + /// string array with all the key names + public string[] GetSectionNames() + { + byte[] by = new byte[SECTION_BUFFER]; + int x = GetPrivateProfileSectionNames(by, SECTION_BUFFER, m_sIniFile); + if(x > 0) x--; + string keys = Encoding.ASCII.GetString(by, 0, x); + return keys.Split('\0'); + } + } +} diff --git a/TestBenchFramework/Tools/XmlTools.cs b/TestBenchFramework/Tools/XmlTools.cs new file mode 100644 index 000000000..99ed51328 --- /dev/null +++ b/TestBenchFramework/Tools/XmlTools.cs @@ -0,0 +1,27 @@ +using System.IO; +using System.Xml.Serialization; + +namespace TBF.Tools +{ + public static class XmlTools + { + public static string ToXmlString(this T input) + { + using (var writer = new StringWriter()) + { + input.ToXml(writer); + return writer.ToString(); + } + } + + public static void ToXml(this T objectToSerialize, Stream stream) + { + new XmlSerializer(typeof(T)).Serialize(stream, objectToSerialize); + } + + public static void ToXml(this T objectToSerialize, StringWriter writer) + { + new XmlSerializer(typeof(T)).Serialize(writer, objectToSerialize); + } + } +} diff --git a/TestBenchFramework/TransitionsDlg.Designer.cs b/TestBenchFramework/TransitionsDlg.Designer.cs new file mode 100644 index 000000000..b0e2095fa --- /dev/null +++ b/TestBenchFramework/TransitionsDlg.Designer.cs @@ -0,0 +1,88 @@ +namespace TBF +{ + partial class TransitionsDlg + { + /// + /// 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 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TransitionsDlg)); + this.mainSplitContainer = new System.Windows.Forms.SplitContainer(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.sharedButtons = new TBF.UiControls.SharedButtons(); + ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit(); + this.mainSplitContainer.Panel1.SuspendLayout(); + this.mainSplitContainer.Panel2.SuspendLayout(); + this.mainSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // mainSplitContainer + // + resources.ApplyResources(this.mainSplitContainer, "mainSplitContainer"); + this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.mainSplitContainer.Name = "mainSplitContainer"; + // + // mainSplitContainer.Panel1 + // + this.mainSplitContainer.Panel1.Controls.Add(this.tabControl); + // + // mainSplitContainer.Panel2 + // + this.mainSplitContainer.Panel2.Controls.Add(this.sharedButtons); + // + // tabControl + // + resources.ApplyResources(this.tabControl, "tabControl"); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); + // + // sharedButtons + // + resources.ApplyResources(this.sharedButtons, "sharedButtons"); + this.sharedButtons.Name = "sharedButtons"; + // + // TransitionsDlg + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.mainSplitContainer); + this.Name = "TransitionsDlg"; + this.Load += new System.EventHandler(this.ProcedureDlg_Load); + this.mainSplitContainer.Panel1.ResumeLayout(false); + this.mainSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).EndInit(); + this.mainSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer mainSplitContainer; + private System.Windows.Forms.TabControl tabControl; + private UiControls.SharedButtons sharedButtons; + } +} \ No newline at end of file diff --git a/TestBenchFramework/TransitionsDlg.cs b/TestBenchFramework/TransitionsDlg.cs new file mode 100644 index 000000000..5f37c1938 --- /dev/null +++ b/TestBenchFramework/TransitionsDlg.cs @@ -0,0 +1,276 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using log4net; +using NHibernate; + +using TBF.BenchControl.Generic; +using TBF.BenchControl.GenericDevices; +using TBF.Entities; +using TBF.Resources; +using TBF.UiControls; + +namespace TBF +{ + public partial class TransitionsDlg : Form, IParentOfListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(TransitionsDlg)); + + /// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi + public readonly int Dpi; + public const int Dpi100pct = 96; + + /// + /// Fluent-NHibernate database session + /// + public ISession Session; + + /// + /// Procedure to be updated by this dialog. + /// Set by the constructor or updated by the parent after creation and before loading. + /// + public IList LoadedSequences; + + /// + /// A list of tests to be deleted after closing this dialog + /// + public IList ToBeDeletedSteps; + + + /// Auxiliary public lists used also by user controls in tab pages + public IList TbfComponents; + public IList Valves; + public IList RegulValves; + + + IList transStepsCtrls; + + bool unlocked; + + public TransitionsDlg() + { + /// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi. + Dpi = (int)this.CreateGraphics().DpiX; + + InitializeComponent(); + + /// SharedDlgButtons configuration + sharedButtons.RequiredGroupMembership = Grp.GID.Metrologists; + sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove | + SharedButtons.Buttons.Up | SharedButtons.Buttons.Down | + SharedButtons.Buttons.NewTab | SharedButtons.Buttons.RenameTab | + SharedButtons.Buttons.RemoveTab; + sharedButtons.Unlocked += Unlocked; + sharedButtons.OKClicked += okButton_Click; + sharedButtons.CancelClicked += cancelButton_Click; + sharedButtons.AddClicked += addButton_Click; + sharedButtons.RemoveClicked += removeButton_Click; + sharedButtons.UpClicked += upButton_Click; + sharedButtons.DownClicked += downButton_Click; + sharedButtons.NewTabClicked += newTabButton_Click; + sharedButtons.RenameTabClicked += renameTabButton_Click; + sharedButtons.RemoveTabClicked += removeTabButton_Click; + + transStepsCtrls = new List(); + ToBeDeletedSteps = new List(); + } + + void Localize() + { + Text = Strings.Transitions; + } + + private void ProcedureDlg_Load(object sender, EventArgs e) + { + /// Load the procedures + Session = FluentCommon.CreateSession(Database.Procedures); + LoadedSequences = Session.CreateQuery("FROM TransitionSequence ORDER BY ItemNr") + .List(); + + /// Prepare a list of components and a list of all valves in the test bench + TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Session); + Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents); + RegulValves = new List(); + foreach (var cmpnt in TbfComponents) + { + if (cmpnt is IRegulValve) RegulValves.Add(cmpnt as IRegulValve); + } + + /// Create a tab with a TestParamsCtrl control for each used test method + foreach (var sequence in LoadedSequences) AddTab(sequence); + + /// Now refresh the content of the dialog + RefreshAllTabs(); + } + + void AddTab(TransitionSequence sequence) + { + TabPage nwTab = new TabPage(sequence.Name); + TransitionStepsCtrl newCtrl = new TransitionStepsCtrl(); + transStepsCtrls.Add(newCtrl); + nwTab.Controls.Add(newCtrl); + this.tabControl.TabPages.Add(nwTab); + newCtrl.Initialize(sequence, this, this.tabControl.TabPages[this.tabControl.TabPages.Count - 1]); + } + + void RefreshAllTabs() + { + foreach (var ctrl in transStepsCtrls) ctrl.Refresh(); + } + + private void Unlocked(object sender, EventArgs e) + { + unlocked = true; + foreach (var ctrl in transStepsCtrls) ctrl.Unlock(); + } + + private void newTabButton_Click(object sender, EventArgs e) + { + int tabId = LoadedSequences.Count; + Forms.TabNameDlg dlg = new Forms.TabNameDlg(); + dlg.TabNameLabel = Strings.New_transition_name; + dlg.TabName = "Tr1"; + dlg.ShowDialog(); + TransitionSequence sequence = new TransitionSequence(dlg.TabName, tabId); + LoadedSequences.Add(sequence); + AddTab(sequence); + transStepsCtrls[tabId].Unlock(); + tabControl.SelectTab(tabId); + } + + private void renameTabButton_Click(object sender, EventArgs e) + { + } + + private void removeTabButton_Click(object sender, EventArgs e) + { + } + + private void okButton_Click(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) transStepsCtrls[slctdTab].OkBtnClicked(); + + using (var transaction = Session.BeginTransaction()) + { + foreach (var sequence in LoadedSequences) + { + Session.SaveOrUpdate(sequence); + } + try { transaction.Commit(); } + catch { } + } + + DialogResult = DialogResult.OK; + Close(); + return; + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + return; + } + + int slctdTab; + + private void tabControl_SelectedIndexChanged(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) + { + transStepsCtrls[slctdTab].OkBtnClicked(); + } + slctdTab = tabControl.SelectedIndex; + sharedButtons.SetEnabled(SharedButtons.Buttons.Add, true); + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove); + RefreshAllTabs(); + } + + private void addButton_Click(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) transStepsCtrls[slctdTab].AddOne(); + } + + private void removeButton_Click(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) transStepsCtrls[slctdTab].RemoveSelected(); + } + + private void upButton_Click(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) transStepsCtrls[slctdTab].MoveUpSelected(); + } + + private void downButton_Click(object sender, EventArgs e) + { + if (transStepsCtrls.Count > slctdTab) transStepsCtrls[slctdTab].MoveDownSelected(); + } + + public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos) + { + if (selectedItemPos == SharedButtons.SelectedItemPos.None) + { + sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.First) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.Last) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up); + sharedButtons.DisableButtons(SharedButtons.Buttons.Down); + } + else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast) + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove); + sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + else + { + sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down); + } + } + + private void purgeStartCtrl_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged(sender, e); + } + + private void purgeEndCtrl_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged(sender, e); + } + + /// + /// Common part for three xxxListViewEx_SelectedIndexChanged event handlers + /// + /// + void SelectedIndexChanged(object sender, EventArgs e) + { + ListViewEx listViewEx = sender as ListViewEx; + if (listViewEx.SelectedItems.Count != 1) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + else if (listViewEx.Items.Count == 1) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.First); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + UpdateButtonStates(SharedButtons.SelectedItemPos.Last); + } + else + { + UpdateButtonStates(SharedButtons.SelectedItemPos.Middle); + } + } + } +} diff --git a/TestBenchFramework/TransitionsDlg.de.resx b/TestBenchFramework/TransitionsDlg.de.resx new file mode 100644 index 000000000..97779cd88 --- /dev/null +++ b/TestBenchFramework/TransitionsDlg.de.resx @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 139, 269 + + + 139, 237 + + + 139, 203 + + + 24, 272 + + + 24, 240 + + + 24, 206 + + + 348, 205 + + + 281, 208 + + + 61, 13 + + + Bemerkung + + + 139, 162 + + + 526, 20 + + + 24, 165 + + + 348, 120 + + + 291, 123 + + + 38, 13 + + + Datum + + + 140, 121 + + + 24, 123 + + + 102, 13 + + + letzte Änderung von + + + 348, 87 + + + 291, 90 + + + 38, 13 + + + Datum + + + 139, 87 + + + 24, 90 + + + 62, 13 + + + Errstellt von + + + 139, 53 + + + 526, 20 + + + 24, 56 + + + 92, 13 + + + Kurzbeschreibung + + + 75, 13 + + + Prüfungsname + + + 814, 406 + + + Allgemein + + + Benutzername + + + Datum + + + Kurzbeschreibung + + + 808, 400 + + + 814, 406 + + + Änderungen + + + 808, 400 + + + 814, 406 + + + Metrologie I. + + + 808, 400 + + + 814, 406 + + + Metrologie II. + + + 808, 400 + + + 814, 406 + + + Prozess + + + 3, 3 + + + 808, 400 + + + + 3, 3, 3, 3 + + + 814, 406 + + + Spülung - Start + + + 814, 406 + + + 814, 406 + + + Spülung - Ende + + + 822, 444 + + + 925, 444 + + + + 822 + + + 925, 444 + + + Prüfung + + \ No newline at end of file diff --git a/TestBenchFramework/TransitionsDlg.resx b/TestBenchFramework/TransitionsDlg.resx new file mode 100644 index 000000000..f2190cf21 --- /dev/null +++ b/TestBenchFramework/TransitionsDlg.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Fill + + + + True + + + + 0, 0 + + + Fill + + + 58, 30 + + + 0, 0 + + + 760, 366 + + + 1 + + + tabControl + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer.Panel1 + + + 0 + + + mainSplitContainer.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer + + + 0 + + + -1, 0 + + + 100, 636 + + + 0 + + + sharedButtons + + + TBF.UiControls.SharedButtons, TBF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + mainSplitContainer.Panel2 + + + 0 + + + mainSplitContainer.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainSplitContainer + + + 1 + + + 863, 366 + + + 760 + + + 1 + + + mainSplitContainer + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 863, 366 + + + NoControl + + + CenterParent + + + Transitions + + + TransitionsDlg + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/UiBridge/ActivityEventArgs.cs b/TestBenchFramework/UiBridge/ActivityEventArgs.cs new file mode 100644 index 000000000..bfa8c855d --- /dev/null +++ b/TestBenchFramework/UiBridge/ActivityEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace TBF.UiBridge +{ + public class ActivityEventArgs : EventArgs + { + public string Activity; + + public ActivityEventArgs(string activity) + { + Activity = activity; + } + } +} diff --git a/TestBenchFramework/UiBridge/Bridge.cs b/TestBenchFramework/UiBridge/Bridge.cs new file mode 100644 index 000000000..d832c96f5 --- /dev/null +++ b/TestBenchFramework/UiBridge/Bridge.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using log4net; + +namespace TBF.UiBridge +{ + /// + /// Provides separation of the UI and the state machine. + /// + static class Bridge + { + static readonly ILog log = LogManager.GetLogger(typeof(Bridge)); + + static Queue ui2machineQueue; + public static Queue Ui2MachineQueue { get { return ui2machineQueue; } } + + public static string SelectedProcedureName + { + get { return Program.MainWnd.ProcedureName; } + } + + public static string SelectedTestName + { + get { return Program.MainWnd.BenchControlPanel.TestName; } + } + + + static Bridge() + { + ui2machineQueue = new Queue(); + } + + /// + /// This function should be called from the UI + /// + /// + public static void Ui2Bench(UI2BenchCmd cmd) + { + lock (Ui2MachineQueue) + { + ui2machineQueue.Enqueue(cmd); + } + } + + /// + /// This function should be called from state machine operations + /// + public static void Bench2UI(ButtonsEtc flags) + { + if (ButtonsEtcHandler == null) return; + try { ButtonsEtcHandler(null, new ButtonsEtcEventArgs(flags)); } + catch (Exception e) { log.Error("UiEventHandler(...) failed", e); } + } + public static event EventHandler ButtonsEtcHandler; + + + /// + /// Called from the state machine when a procedure is selected and UI needs to be updated. + /// + public static void OnProcedureSelected(object sender, ProcedureSelectedEventArgs data) + { + if (ProcedureSelectedHandler == null) return; + try { ProcedureSelectedHandler(sender, data); } + catch (Exception e) { log.Error("ProcedureSelectedHandler(...) failed", e); } + } + public static event EventHandler ProcedureSelectedHandler; + + + /// + /// Called from the state machine when a test is selected and UI needs to be updated. + /// + public static void OnTestSelected(object sender, TestSelectedEventArgs data) + { + if (TestSelectedHandler == null) return; + try { TestSelectedHandler(sender, data); } + catch (Exception e) { log.Error("TestSelectedHandler(...) failed", e); } + } + public static event EventHandler TestSelectedHandler; + + + /// + /// Called from the state machine when test process data change and UI needs to be updated. + /// + public static void OnTestProgress(object sender, TestProgressEventArgs data) + { + if (TestProgressHandler == null) return; + try { TestProgressHandler(sender, data); } + catch (Exception e) { log.Error("TestProgressHandler(...) failed", e); } + } + public static event EventHandler TestProgressHandler; + + + /// + /// Called from the state machine when the test is completed and UI needs to be updated. + /// + public static void OnTestCompleted(object sender, TestCompletedEventArgs data) + { + if (TestCompletedHandler == null) return; + try { TestCompletedHandler(sender, data); } + catch (Exception e) { log.Error("TestCompletedHandler(...) failed", e); } + } + public static event EventHandler TestCompletedHandler; + + + /// + /// Called from the state machine when the procedure is completed and UI needs to be updated. + /// + public static void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs data) + { + if (ProcedureCompletedHandler == null) return; + try { ProcedureCompletedHandler(sender, data); } + catch (Exception e) { log.Error("ProcedureCompletedHandler(...) failed", e); } + } + public static event EventHandler ProcedureCompletedHandler; + + + /// + /// Called from the state machine when the procedure is completed and UI needs to be updated. + /// + public static void OnCameraStateChanged(object sender, CameraStateChangedEventArgs data) + { + if (CameraStateChangedHandler == null) return; + try { CameraStateChangedHandler(sender, data); } + catch (Exception e) { log.Error("CameraStateChangedHandler(...) failed", e); } + } + public static event EventHandler CameraStateChangedHandler; + + + /// + /// Called from the state machine when the procedure is completed and UI needs to be updated. + /// + public static void OnImageUpdated(object sender, ImageUpdatedEventArgs data) + { + if (ImageUpdatedHandler == null) return; + try { ImageUpdatedHandler(sender, data); } + catch (Exception e) { log.Error("ImageUpdatedHandler(...) failed", e); } + } + public static event EventHandler ImageUpdatedHandler; + + + /// + /// Called from the state machine when there is and information to be logged. + /// + public static void OnLog(object sender, string message) + { + if (LogHandler == null) return; + try { LogHandler(sender, new LogEventArgs(message)); } + catch (Exception e) { log.Error("LogHandler(...) failed", e); } + } + public static event EventHandler LogHandler; + + + /// + /// Called from the state machine when 'Activity' information changes. + /// + public static void OnActivity(object sender, string activity) + { + if (ActivityHandler == null) return; + try { ActivityHandler(sender, new ActivityEventArgs(activity)); } + catch (Exception e) { log.Error("ActivityHandler(...) failed", e); } + } + public static event EventHandler ActivityHandler; + + + /// + /// 'State machine state has changed' event handler + /// + public static void OnStateChanged(object sender, string stateChangedMsg) + { + if (StateChangedHandler == null) return; + try { StateChangedHandler(sender, new StateChangedEventArgs(stateChangedMsg)); } + catch (Exception e) { string s = e.ToString(); } + } + public static event EventHandler StateChangedHandler; + + + /// + /// Called from the state machine when 'Activity' information changes. + /// + public static void OnEmergencyStopChanged(object sender, EmergencyStopEventArgs.State state) + { + if (EmergencyStopChangedHandler == null) return; + try { EmergencyStopChangedHandler(sender, new EmergencyStopEventArgs(state)); } + catch (Exception e) { log.Error("EmergencyStopHandler(...) failed", e); } + } + public static event EventHandler EmergencyStopChangedHandler; + } +} diff --git a/TestBenchFramework/UiBridge/ButtonsEtcEventArgs.cs b/TestBenchFramework/UiBridge/ButtonsEtcEventArgs.cs new file mode 100644 index 000000000..3dfa0753e --- /dev/null +++ b/TestBenchFramework/UiBridge/ButtonsEtcEventArgs.cs @@ -0,0 +1,17 @@ +using System; + +namespace TBF.UiBridge +{ + /// + /// Argument of UiBridgeEventHandler. + /// + public class ButtonsEtcEventArgs : EventArgs + { + public ButtonsEtc Flags; /// Flags to be passed to the UI. + + public ButtonsEtcEventArgs(ButtonsEtc flags) + { + this.Flags = flags; + } + } +} diff --git a/TestBenchFramework/UiBridge/CameraStateChangedEventArgs.cs b/TestBenchFramework/UiBridge/CameraStateChangedEventArgs.cs new file mode 100644 index 000000000..63c18b3d5 --- /dev/null +++ b/TestBenchFramework/UiBridge/CameraStateChangedEventArgs.cs @@ -0,0 +1,17 @@ +using System; +using TBF.BenchControl; + +namespace TBF.UiBridge +{ + class CameraStateChangedEventArgs : EventArgs + { + public int CameraIdx; + public BenchControl.Cameras.IdcCamera.IdcState State; + + public CameraStateChangedEventArgs(int cameraIdx, BenchControl.Cameras.IdcCamera.IdcState state) + { + CameraIdx = cameraIdx; + State = state; + } + } +} diff --git a/TestBenchFramework/UiBridge/EmergencyStopEventArgs.cs b/TestBenchFramework/UiBridge/EmergencyStopEventArgs.cs new file mode 100644 index 000000000..bde79a31e --- /dev/null +++ b/TestBenchFramework/UiBridge/EmergencyStopEventArgs.cs @@ -0,0 +1,22 @@ +using System; + +namespace TBF.UiBridge +{ + public class EmergencyStopEventArgs : EventArgs + { + public enum State + { + Unknown, + Inactive, + Active, + CloseForm, + } + + public State EmergencyStopState; + + public EmergencyStopEventArgs(State emergencyStopState) + { + this.EmergencyStopState = emergencyStopState; + } + } +} diff --git a/TestBenchFramework/UiBridge/Enums.cs b/TestBenchFramework/UiBridge/Enums.cs new file mode 100644 index 000000000..bf00f7897 --- /dev/null +++ b/TestBenchFramework/UiBridge/Enums.cs @@ -0,0 +1,52 @@ + +namespace TBF.UiBridge +{ + /// UI command ID-s used by UiBridge + public enum UI2BenchCmd + { + None = 0, + StartTest, + StartQ1, + StartQ2, + StartQ3, + StartCycle, + Stop, + PurgeBegin, + PurgeEnd, + EmptyTank1, + EmptyTank2, + TryOpticalHeads, + ResetResults, + AcceptResults, + Calibration, + SensitivityTest, + CameraTest, + B1, + B2, + B3, + Next, /// Used for debugging + } + + public enum ButtonsEtc + { + None = 0, + ProcedureCmbBoxEn = 0x1, + TestCmbBoxEn = 0x2, + StopBtnEn = 0x4, + StartTestBtnsEn = 0x8, + StartCycleBtnEn = 0x10, + PurgeBeginBtnEn = 0x20, + PurgeEndBtnEn = 0x40, + EmptyTankBtnsEn = 0x80, + TryOpticalHeadsBtnEn = 0x100, + ResetResultsBtnEn = 0x200, + AcceptResultsBtnEn = 0x300, + CalibrationBtnEn = 0x800, + SensitivityTestBtnEn = 0x1000, + + /// If one of the following flags is set, flags 0x1 through 0x1000 are ignored + /// + ShowBenchEmpty = 0x2000, + ShowBenchFilled = 0x4000, + } +} diff --git a/TestBenchFramework/UiBridge/ImageUpdatedEventArgs.cs b/TestBenchFramework/UiBridge/ImageUpdatedEventArgs.cs new file mode 100644 index 000000000..19bd5c9dc --- /dev/null +++ b/TestBenchFramework/UiBridge/ImageUpdatedEventArgs.cs @@ -0,0 +1,17 @@ +using System; +using TBF.BenchControl; + +namespace TBF.UiBridge +{ + public class ImageUpdatedEventArgs : EventArgs + { + public int CameraIdx; + public string ImageLocation; + + public ImageUpdatedEventArgs(int cameraIdx, string imageLocation) + { + CameraIdx = cameraIdx; + ImageLocation = imageLocation; + } + } +} diff --git a/TestBenchFramework/UiBridge/LogEventArgs.cs b/TestBenchFramework/UiBridge/LogEventArgs.cs new file mode 100644 index 000000000..5f6d61912 --- /dev/null +++ b/TestBenchFramework/UiBridge/LogEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace TBF.UiBridge +{ + public class LogEventArgs : EventArgs + { + public string LogMessage; + + public LogEventArgs(string logMessage) + { + this.LogMessage = logMessage; + } + } +} diff --git a/TestBenchFramework/UiBridge/ProcedureCompletedEventArgs.cs b/TestBenchFramework/UiBridge/ProcedureCompletedEventArgs.cs new file mode 100644 index 000000000..547488bf6 --- /dev/null +++ b/TestBenchFramework/UiBridge/ProcedureCompletedEventArgs.cs @@ -0,0 +1,15 @@ +using System; +using TBF.BenchControl; + +namespace TBF.UiBridge +{ + public class ProcedureCompletedEventArgs : EventArgs + { + public Entities.Procedure Procedure; + + public ProcedureCompletedEventArgs(Entities.Procedure procedure) + { + Procedure = procedure; + } + } +} diff --git a/TestBenchFramework/UiBridge/ProcedureSelectedEventArgs.cs b/TestBenchFramework/UiBridge/ProcedureSelectedEventArgs.cs new file mode 100644 index 000000000..20fa5ded0 --- /dev/null +++ b/TestBenchFramework/UiBridge/ProcedureSelectedEventArgs.cs @@ -0,0 +1,15 @@ +using System; +using TBF.BenchControl; + +namespace TBF.UiBridge +{ + public class ProcedureSelectedEventArgs : EventArgs + { + public Entities.Procedure Procedure; + + public ProcedureSelectedEventArgs(Entities.Procedure procedure) + { + this.Procedure = procedure; + } + } +} diff --git a/TestBenchFramework/UiBridge/StateChangedEventArgs.cs b/TestBenchFramework/UiBridge/StateChangedEventArgs.cs new file mode 100644 index 000000000..1c277273d --- /dev/null +++ b/TestBenchFramework/UiBridge/StateChangedEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace TBF.UiBridge +{ + public class StateChangedEventArgs : EventArgs + { + public string StateChangedMsg; + + public StateChangedEventArgs(string stateChangedMsg) + { + StateChangedMsg = stateChangedMsg; + } + } +} diff --git a/TestBenchFramework/UiBridge/TestCompletedEventArgs.cs b/TestBenchFramework/UiBridge/TestCompletedEventArgs.cs new file mode 100644 index 000000000..89fac7f52 --- /dev/null +++ b/TestBenchFramework/UiBridge/TestCompletedEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace TBF.UiBridge +{ + public class TestCompletedEventArgs : EventArgs + { + public Entities.TestResult TestResult; + + public TestCompletedEventArgs(Entities.TestResult testResult) + { + this.TestResult = testResult; + } + } +} diff --git a/TestBenchFramework/UiBridge/TestProgressEventArgs.cs b/TestBenchFramework/UiBridge/TestProgressEventArgs.cs new file mode 100644 index 000000000..b16717bb0 --- /dev/null +++ b/TestBenchFramework/UiBridge/TestProgressEventArgs.cs @@ -0,0 +1,30 @@ +using System; + +namespace TBF.UiBridge +{ + public class TestProgressEventArgs : EventArgs + { + public int RefPulses; + public float Flow; + public float Volume; + public float Time; + public float Progress; + public float OveralProgress; + + public float Tin; + public float Tout; + public float Tdiv; + public float Pin; + public float Pout; + public float AmbientTemp; + public float AmbientPressure; + public float AmbientHumidity; + + public int[] WmPulses = new int[Program.WMsCount]; + public int[] WmRefPulses = new int[Program.WMsCount]; + public float[] WmVolume = new float[Program.WMsCount]; + public float[] WmErrPct = new float[Program.WMsCount]; + + public Entities.TestResult TestResult; + } +} diff --git a/TestBenchFramework/UiBridge/TestSelectedEventArgs.cs b/TestBenchFramework/UiBridge/TestSelectedEventArgs.cs new file mode 100644 index 000000000..8d620caa6 --- /dev/null +++ b/TestBenchFramework/UiBridge/TestSelectedEventArgs.cs @@ -0,0 +1,27 @@ +using System; +using TBF.BenchControl; + +namespace TBF.UiBridge +{ + public class TestSelectedEventArgs : EventArgs + { + public Entities.Test Test; + public int RepetitionNr; + public FeedingPath FeedingPath; + public BenchPath BenchPath; + public OutputPath OutputPath; + public MetersPath MetersPath; + public int TotalPulses; + + public TestSelectedEventArgs(Entities.Test test, int repetitionNr, FeedingPath f, BenchPath b, OutputPath o, MetersPath m, int tp) + { + Test = test; + RepetitionNr = repetitionNr; + FeedingPath = f; + BenchPath = b; + OutputPath = o; + MetersPath = m; + TotalPulses = tp; + } + } +} diff --git a/TestBenchFramework/UiControls/BaseWithListViewEx.cs b/TestBenchFramework/UiControls/BaseWithListViewEx.cs new file mode 100644 index 000000000..b3692a14b --- /dev/null +++ b/TestBenchFramework/UiControls/BaseWithListViewEx.cs @@ -0,0 +1,203 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace TBF.UiControls +{ + public class BaseWithListViewEx : ListViewEx + { + /// + /// List of items to be edited + /// + public IList MyItems; + + /// + /// Number of items/rows with lowest ItemNr = 0,... + /// that cannot be deleted, moved down, renamed, etc. + /// + public int FixedRowsCount; + + /// + /// List of removed items that have to be removed from the database + /// when completed with OK. + /// + public IList ToBeRemovedItems; + + /// + /// true = editing was unlocked + /// + public bool Unlocked { get { return unlocked; } } /// read only + bool unlocked; + + public BaseWithListViewEx() + : base() + { + ToBeRemovedItems = new List(); + + /// Initialize the base (ListViewEx) + this.SuspendLayout(); + AllowColumnReorder = false; + Dock = System.Windows.Forms.DockStyle.Fill; + DoubleClickActivation = false; + FullRowSelect = true; + GridLines = true; + Location = new System.Drawing.Point(0, 0); + Name = "baseWithListViewEx"; + Size = new System.Drawing.Size(150, 150); + TabIndex = 0; + UseCompatibleStateImageBehavior = false; + View = System.Windows.Forms.View.Details; + ResumeLayout(false); + } + + public void Unlock() + { + unlocked = true; + + if (base.SelectedItems.Count == 1) + { + int ix = SelectedIndices[0]; + Focus(); + Items[ix].Selected = true; + Items[ix].EnsureVisible(); + } + } + + protected void RedrawAll() + { + Items.Clear(); + foreach (var myItem in MyItems) + { + DrawOne(myItem); + } + } + + public virtual void DrawOne(object myItem) + { + } + + void UpdateAll() + { + if (MyItems == null || (MyItems.Count != Items.Count)) return; + + foreach (ListViewItem lvi in Items) + { + UpdateOne(lvi, (MyItem)lvi.Tag); + } + } + + public virtual void UpdateOne(ListViewItem lvi, object myItem) + { + } + + public void OkBtnClicked() + { + UpdateAll(); + } + + public void CancelBtnClicked() + { + } + + public void AddOne(MyItem myItem) + { + MyItems.Add(myItem); + DrawOne(myItem); + + Focus(); + SelectedItems.Clear(); + Items[Items.Count - 1].Selected = true; + Items[Items.Count - 1].EnsureVisible(); + } + + /// + /// Called when 'Remove' button was clicked. + /// + /// true when the last item was removed and 'Remove' button should be disabled + public bool RemoveSelected() + { + if (SelectedItems.Count != 1) return false; + + UpdateAll(); + + int removeItemNr = SelectedIndices[0]; + if (removeItemNr < FixedRowsCount) return false; + + MyItem selectedItem = (MyItem)SelectedItems[0].Tag; + + if ((selectedItem as Entities.IHasItemNr).Id != 0) ToBeRemovedItems.Add(selectedItem); + MyItems.RemoveAt(removeItemNr); + if (selectedItem is Entities.IHasItemNr) + { + for (int i = removeItemNr; i < MyItems.Count; i++) + { + (MyItems[i] as Entities.IHasItemNr).ItemNr--; + } + } + + RedrawAll(); + + if (removeItemNr < base.Items.Count) + { + Focus(); + Items[removeItemNr].Selected = true; + Items[removeItemNr].EnsureVisible(); + return false; + } + else + { + return true; + } + } + + public void MoveUpSelected() + { + if (SelectedItems.Count != 1) + { + return; + } + int ix = base.SelectedIndices[0]; + if (ix <= FixedRowsCount || ix >= MyItems.Count) return; + + UpdateAll(); + + MyItem item1 = (MyItem)(Items[ix - 1].Tag); + MyItem item2 = (MyItem)(Items[ix].Tag); + (item1 as Entities.IHasItemNr).ItemNr++; + (item2 as Entities.IHasItemNr).ItemNr--; + MyItems.RemoveAt(ix); + MyItems.Insert(ix - 1, item2); + + RedrawAll(); + + Focus(); + Items[ix - 1].Selected = true; + Items[ix - 1].EnsureVisible(); + } + + public void MoveDownSelected() + { + if (base.SelectedItems.Count != 1) + { + return; + } + int ix = base.SelectedIndices[0]; + if (ix < FixedRowsCount || ix >= MyItems.Count - 1) return; + + UpdateAll(); + + MyItem item1 = (MyItem)(Items[ix].Tag); + MyItem item2 = (MyItem)(Items[ix + 1].Tag); + (item1 as Entities.IHasItemNr).ItemNr++; + (item2 as Entities.IHasItemNr).ItemNr--; + MyItems.RemoveAt(ix + 1); + MyItems.Insert(ix, item2); + + RedrawAll(); + + Focus(); + Items[ix + 1].Selected = true; + Items[ix + 1].EnsureVisible(); + } + } +} diff --git a/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs b/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs new file mode 100644 index 000000000..6db3b2eda --- /dev/null +++ b/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs @@ -0,0 +1,289 @@ +namespace TBF.UiControls +{ + partial class BenchControlPanel + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BenchControlPanel)); + this.stopBtn = new System.Windows.Forms.Button(); + this.startTestBtn = new System.Windows.Forms.Button(); + this.startCycleBtn = new System.Windows.Forms.Button(); + this.purgeBeginBtn = new System.Windows.Forms.Button(); + this.purgeEndBtn = new System.Windows.Forms.Button(); + this.tryHeadsBtn = new System.Windows.Forms.Button(); + this.resetResultsBtn = new System.Windows.Forms.Button(); + this.calibrationBtn = new System.Windows.Forms.Button(); + this.emptyTank1Btn = new System.Windows.Forms.Button(); + this.sensitivityTestBtn = new System.Windows.Forms.Button(); + this.emptyTank2Btn = new System.Windows.Forms.Button(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.startQ3Btn = new System.Windows.Forms.Button(); + this.startQ2Btn = new System.Windows.Forms.Button(); + this.startQ1Btn = new System.Windows.Forms.Button(); + this.testComboBox = new System.Windows.Forms.ComboBox(); + this.purgeGroupBox = new System.Windows.Forms.GroupBox(); + this.emptyGroupBox = new System.Windows.Forms.GroupBox(); + this.otherGroupBox = new System.Windows.Forms.GroupBox(); + this.nextButton = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.acceptResultsBtn = new System.Windows.Forms.Button(); + this.testGroupBox.SuspendLayout(); + this.purgeGroupBox.SuspendLayout(); + this.emptyGroupBox.SuspendLayout(); + this.otherGroupBox.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // stopBtn + // + this.stopBtn.BackColor = System.Drawing.Color.Tomato; + resources.ApplyResources(this.stopBtn, "stopBtn"); + this.stopBtn.Name = "stopBtn"; + this.stopBtn.UseVisualStyleBackColor = false; + this.stopBtn.Click += new System.EventHandler(this.stopBtn_Click); + // + // startTestBtn + // + this.startTestBtn.BackColor = System.Drawing.Color.DarkSeaGreen; + resources.ApplyResources(this.startTestBtn, "startTestBtn"); + this.startTestBtn.Name = "startTestBtn"; + this.startTestBtn.UseVisualStyleBackColor = false; + this.startTestBtn.Click += new System.EventHandler(this.startTestBtn_Click); + // + // startCycleBtn + // + this.startCycleBtn.BackColor = System.Drawing.Color.LightSeaGreen; + resources.ApplyResources(this.startCycleBtn, "startCycleBtn"); + this.startCycleBtn.Name = "startCycleBtn"; + this.startCycleBtn.UseVisualStyleBackColor = false; + this.startCycleBtn.Click += new System.EventHandler(this.startCycleBtn_Click); + // + // purgeBeginBtn + // + this.purgeBeginBtn.BackColor = System.Drawing.Color.LightSteelBlue; + resources.ApplyResources(this.purgeBeginBtn, "purgeBeginBtn"); + this.purgeBeginBtn.Name = "purgeBeginBtn"; + this.purgeBeginBtn.UseVisualStyleBackColor = false; + this.purgeBeginBtn.Click += new System.EventHandler(this.purgeBeginBtn_Click); + // + // purgeEndBtn + // + this.purgeEndBtn.BackColor = System.Drawing.Color.LightSteelBlue; + resources.ApplyResources(this.purgeEndBtn, "purgeEndBtn"); + this.purgeEndBtn.Name = "purgeEndBtn"; + this.purgeEndBtn.UseVisualStyleBackColor = false; + this.purgeEndBtn.Click += new System.EventHandler(this.purgeEndBtn_Click); + // + // tryHeadsBtn + // + this.tryHeadsBtn.BackColor = System.Drawing.Color.DarkGray; + resources.ApplyResources(this.tryHeadsBtn, "tryHeadsBtn"); + this.tryHeadsBtn.Name = "tryHeadsBtn"; + this.tryHeadsBtn.UseVisualStyleBackColor = false; + this.tryHeadsBtn.Click += new System.EventHandler(this.tryHeadsBtn_Click); + // + // resetResultsBtn + // + this.resetResultsBtn.BackColor = System.Drawing.Color.Tomato; + resources.ApplyResources(this.resetResultsBtn, "resetResultsBtn"); + this.resetResultsBtn.Name = "resetResultsBtn"; + this.resetResultsBtn.UseVisualStyleBackColor = false; + this.resetResultsBtn.Click += new System.EventHandler(this.resetResultsBtn_Click); + // + // calibrationBtn + // + this.calibrationBtn.BackColor = System.Drawing.Color.DarkGray; + resources.ApplyResources(this.calibrationBtn, "calibrationBtn"); + this.calibrationBtn.Name = "calibrationBtn"; + this.calibrationBtn.UseVisualStyleBackColor = false; + this.calibrationBtn.Click += new System.EventHandler(this.calibrationBtn_Click); + // + // emptyTank1Btn + // + this.emptyTank1Btn.BackColor = System.Drawing.Color.LightSteelBlue; + resources.ApplyResources(this.emptyTank1Btn, "emptyTank1Btn"); + this.emptyTank1Btn.Name = "emptyTank1Btn"; + this.emptyTank1Btn.UseVisualStyleBackColor = false; + this.emptyTank1Btn.Click += new System.EventHandler(this.emptyTank1Btn_Click); + // + // sensitivityTestBtn + // + this.sensitivityTestBtn.BackColor = System.Drawing.Color.DarkGray; + resources.ApplyResources(this.sensitivityTestBtn, "sensitivityTestBtn"); + this.sensitivityTestBtn.Name = "sensitivityTestBtn"; + this.sensitivityTestBtn.UseVisualStyleBackColor = false; + this.sensitivityTestBtn.Click += new System.EventHandler(this.sensitivityTestBtn_Click); + // + // emptyTank2Btn + // + this.emptyTank2Btn.BackColor = System.Drawing.Color.LightSteelBlue; + resources.ApplyResources(this.emptyTank2Btn, "emptyTank2Btn"); + this.emptyTank2Btn.Name = "emptyTank2Btn"; + this.emptyTank2Btn.UseVisualStyleBackColor = false; + this.emptyTank2Btn.Click += new System.EventHandler(this.emptyTank2Btn_Click); + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.startQ3Btn); + this.testGroupBox.Controls.Add(this.startQ2Btn); + this.testGroupBox.Controls.Add(this.startQ1Btn); + this.testGroupBox.Controls.Add(this.testComboBox); + this.testGroupBox.Controls.Add(this.startTestBtn); + this.testGroupBox.Controls.Add(this.startCycleBtn); + this.testGroupBox.Controls.Add(this.stopBtn); + resources.ApplyResources(this.testGroupBox, "testGroupBox"); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.TabStop = false; + // + // startQ3Btn + // + this.startQ3Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + resources.ApplyResources(this.startQ3Btn, "startQ3Btn"); + this.startQ3Btn.Name = "startQ3Btn"; + this.startQ3Btn.UseVisualStyleBackColor = false; + this.startQ3Btn.Click += new System.EventHandler(this.startQ3Btn_Click); + // + // startQ2Btn + // + this.startQ2Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + resources.ApplyResources(this.startQ2Btn, "startQ2Btn"); + this.startQ2Btn.Name = "startQ2Btn"; + this.startQ2Btn.UseVisualStyleBackColor = false; + this.startQ2Btn.Click += new System.EventHandler(this.startQ2Btn_Click); + // + // startQ1Btn + // + this.startQ1Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + resources.ApplyResources(this.startQ1Btn, "startQ1Btn"); + this.startQ1Btn.Name = "startQ1Btn"; + this.startQ1Btn.UseVisualStyleBackColor = false; + this.startQ1Btn.Click += new System.EventHandler(this.startQ1Btn_Click); + // + // testComboBox + // + resources.ApplyResources(this.testComboBox, "testComboBox"); + this.testComboBox.FormattingEnabled = true; + this.testComboBox.Name = "testComboBox"; + this.testComboBox.SelectedIndexChanged += new System.EventHandler(this.testComboBox_SelectedIndexChanged); + // + // purgeGroupBox + // + this.purgeGroupBox.BackColor = System.Drawing.SystemColors.Control; + this.purgeGroupBox.Controls.Add(this.purgeEndBtn); + this.purgeGroupBox.Controls.Add(this.purgeBeginBtn); + resources.ApplyResources(this.purgeGroupBox, "purgeGroupBox"); + this.purgeGroupBox.Name = "purgeGroupBox"; + this.purgeGroupBox.TabStop = false; + // + // emptyGroupBox + // + this.emptyGroupBox.Controls.Add(this.emptyTank1Btn); + this.emptyGroupBox.Controls.Add(this.emptyTank2Btn); + resources.ApplyResources(this.emptyGroupBox, "emptyGroupBox"); + this.emptyGroupBox.Name = "emptyGroupBox"; + this.emptyGroupBox.TabStop = false; + // + // otherGroupBox + // + this.otherGroupBox.Controls.Add(this.sensitivityTestBtn); + this.otherGroupBox.Controls.Add(this.nextButton); + this.otherGroupBox.Controls.Add(this.calibrationBtn); + this.otherGroupBox.Controls.Add(this.tryHeadsBtn); + resources.ApplyResources(this.otherGroupBox, "otherGroupBox"); + this.otherGroupBox.Name = "otherGroupBox"; + this.otherGroupBox.TabStop = false; + // + // nextButton + // + resources.ApplyResources(this.nextButton, "nextButton"); + this.nextButton.Name = "nextButton"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.acceptResultsBtn); + this.groupBox1.Controls.Add(this.resetResultsBtn); + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // acceptResultsBtn + // + this.acceptResultsBtn.BackColor = System.Drawing.Color.ForestGreen; + resources.ApplyResources(this.acceptResultsBtn, "acceptResultsBtn"); + this.acceptResultsBtn.Name = "acceptResultsBtn"; + this.acceptResultsBtn.UseVisualStyleBackColor = false; + this.acceptResultsBtn.Click += new System.EventHandler(this.acceptResultsBtn_Click); + // + // BenchControlPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.otherGroupBox); + this.Controls.Add(this.emptyGroupBox); + this.Controls.Add(this.purgeGroupBox); + this.Controls.Add(this.testGroupBox); + this.Name = "BenchControlPanel"; + this.Load += new System.EventHandler(this.BenchControlPanel_Load); + this.testGroupBox.ResumeLayout(false); + this.purgeGroupBox.ResumeLayout(false); + this.emptyGroupBox.ResumeLayout(false); + this.otherGroupBox.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button stopBtn; + private System.Windows.Forms.Button startTestBtn; + private System.Windows.Forms.Button startCycleBtn; + private System.Windows.Forms.Button purgeBeginBtn; + private System.Windows.Forms.Button purgeEndBtn; + private System.Windows.Forms.Button tryHeadsBtn; + private System.Windows.Forms.Button resetResultsBtn; + private System.Windows.Forms.Button calibrationBtn; + private System.Windows.Forms.Button emptyTank1Btn; + private System.Windows.Forms.Button sensitivityTestBtn; + private System.Windows.Forms.Button emptyTank2Btn; + private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.ComboBox testComboBox; + private System.Windows.Forms.Button startQ1Btn; + private System.Windows.Forms.Button startQ3Btn; + private System.Windows.Forms.Button startQ2Btn; + private System.Windows.Forms.GroupBox purgeGroupBox; + private System.Windows.Forms.GroupBox emptyGroupBox; + private System.Windows.Forms.GroupBox otherGroupBox; + private System.Windows.Forms.Button nextButton; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button acceptResultsBtn; + } +} diff --git a/TestBenchFramework/UiControls/BenchControlPanel.cs b/TestBenchFramework/UiControls/BenchControlPanel.cs new file mode 100644 index 000000000..fedd0fabe --- /dev/null +++ b/TestBenchFramework/UiControls/BenchControlPanel.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using NHibernate; +using log4net; +using TBF.Entities; +using TBF.UiBridge; + +namespace TBF.UiControls +{ + public partial class BenchControlPanel : UserControl + { + static readonly ILog log = LogManager.GetLogger(typeof(BenchControlPanel)); + + public string TestName; + + // Original (enabled) colors of buttons and empty bench + Color colorStopEn; + Color colorTestsEn; + Color colorCycleEn; + Color colorPurgeEn; + Color colorAcceptEn; + Color colorEmptyEn; + Color colorOtherEn; + + Color colorBenchEmpty; + + // Colors of disabled buttons + Color colorStopDis; + Color colorTestsDis; + Color colorCycleDis; + Color colorPurgeDis; + Color colorAcceptDis; + Color colorEmptyDis; + Color colorOtherDis; + + public BenchControlPanel() + { + InitializeComponent(); + + Bridge.ButtonsEtcHandler += delegate(object sender, ButtonsEtcEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnButtonsEtc), sender, args); + } + else OnButtonsEtc(sender, args); + }; + + Bridge.ProcedureSelectedHandler += delegate(object sender, ProcedureSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnProcedureSelected), sender, args); + } + else OnProcedureSelected(sender, args); + }; + + Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnTestSelected), sender, args); + } + else OnTestSelected(sender, args); + }; + +#if DEBUG + nextButton.Visible = true; + nextButton.Enabled = true; +#endif + } + + int Lghtr(int component) + { + return 255 - (255 - component) / 2; + } + + private void BenchControlPanel_Load(object sender, EventArgs e) + { + // Original (enabled) colors of buttons + colorStopEn = stopBtn.BackColor; + colorTestsEn = startTestBtn.BackColor; + colorCycleEn = startCycleBtn.BackColor; + colorPurgeEn = purgeBeginBtn.BackColor; + colorAcceptEn = acceptResultsBtn.BackColor; + colorEmptyEn = emptyTank1Btn.BackColor; + colorOtherEn = tryHeadsBtn.BackColor; + colorBenchEmpty = emptyGroupBox.BackColor; + + // Colors of disabled buttons + colorStopDis = Color.FromArgb(Lghtr(colorStopEn.R), Lghtr(colorStopEn.G), Lghtr(colorStopEn.B)); + colorTestsDis = Color.FromArgb(Lghtr(colorTestsEn.R), Lghtr(colorTestsEn.G), Lghtr(colorTestsEn.B)); + colorCycleDis = Color.FromArgb(Lghtr(colorCycleEn.R), Lghtr(colorCycleEn.G), Lghtr(colorCycleEn.B)); + colorPurgeDis = Color.FromArgb(Lghtr(colorPurgeEn.R), Lghtr(colorPurgeEn.G), Lghtr(colorPurgeEn.B)); + colorAcceptDis = Color.FromArgb(Lghtr(colorAcceptEn.R), Lghtr(colorAcceptEn.G), Lghtr(colorAcceptEn.B)); + colorEmptyDis = Color.FromArgb(Lghtr(colorEmptyEn.R), Lghtr(colorEmptyEn.G), Lghtr(colorEmptyEn.B)); + colorOtherDis = Color.FromArgb(Lghtr(colorOtherEn.R), Lghtr(colorOtherEn.G), Lghtr(colorOtherEn.B)); + } + + + /// + /// Read the database and re-initialize testComboBox items. + /// Try to preserve the original selection. + /// + public void ReloadTests() + { + if (Program.MainWnd.ProcedureName == null) return; + + string oriTestName = testComboBox.Text; + + IList procedures = FluentCommon.CreateSession(Database.Procedures) + .CreateQuery("FROM Procedure WHERE Name = :name") + .SetParameter("name", Program.MainWnd.ProcedureName) + .List(); + + if (procedures.Count != 1) + { + testComboBox.Text = string.Empty; + TestName = null; + Program.MainWnd.CurrentProcedure = null; + return; + } + + Program.MainWnd.CurrentProcedure = procedures[0]; + + testComboBox.Items.Clear(); + foreach (var test in procedures[0].Tests) testComboBox.Items.Add(test.Name); + + if (testComboBox.Items.Contains(oriTestName)) + { + testComboBox.Text = oriTestName; + TestName = oriTestName; + } + else if (procedures[0].Tests.Count > 0) + { + testComboBox.Text = procedures[0].Tests[0].Name; + TestName = procedures[0].Tests[0].Name; + } + else + { + testComboBox.Text = string.Empty; + TestName = null; + } + } + + private void testComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + TestName = testComboBox.Text; + startTestBtn.Select(); + } + + + private void startTestBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.StartTest); } + private void startQ1Btn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.StartQ1); } + private void startQ2Btn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.StartQ2); } + private void startQ3Btn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.StartQ3); } + private void startCycleBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.StartCycle); } + private void stopBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.Stop); } + private void purgeBeginBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.PurgeBegin); } + private void purgeEndBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.PurgeEnd); } + private void emptyTank1Btn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.EmptyTank1); } + private void emptyTank2Btn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.EmptyTank2); } + private void tryHeadsBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.TryOpticalHeads); } + private void resetResultsBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.ResetResults); } + private void acceptResultsBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.AcceptResults); } + private void calibrationBtn_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.CameraTest); } + private void sensitivityTestBtn_Click(object sender, EventArgs e){ Bridge.Ui2Bench(UI2BenchCmd.SensitivityTest); } + private void button1_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.B1); } + private void button2_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.B2); } + private void nextButton_Click(object sender, EventArgs e) { Bridge.Ui2Bench(UI2BenchCmd.Next); } + + /// + /// Processes a pressed keys. + /// + /// key (char) + /// true when the key is handled, otherwise false + public bool ProcessKey(char key) + { + switch (key) + { + case '0': if (stopBtn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.Stop); } return true; + case '1': if (startQ1Btn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.StartQ1); } return true; + case '2': if (startQ2Btn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.StartQ2); } return true; + case '3': if (startQ3Btn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.StartQ3); } return true; + case '4': if (startTestBtn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.StartTest); } return true; + case '5': if (startCycleBtn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.StartCycle); } return true; + case '6': if (purgeBeginBtn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.PurgeBegin); } return true; + case '7': if (purgeEndBtn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.PurgeEnd); } return true; + case '8': if (emptyTank1Btn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.EmptyTank1); } return true; + case '9': if (emptyTank2Btn.Enabled) { Bridge.Ui2Bench(UI2BenchCmd.EmptyTank2); } return true; + default: + return false; + } + } + + + public void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args) + { + ReloadTests(); + } + + public void OnTestSelected(object sender, TestSelectedEventArgs args) + { + testComboBox.Text = args.Test.Name; + } + + + public void OnButtonsEtc(object sender, ButtonsEtcEventArgs args) + { + if ((args.Flags & ButtonsEtc.ShowBenchEmpty) != 0) + { + purgeGroupBox.BackColor = colorBenchEmpty; + return; + } + else if ((args.Flags & ButtonsEtc.ShowBenchFilled) != 0) + { + purgeGroupBox.BackColor = Color.RoyalBlue; + return; + } + + testComboBox.Enabled = ((args.Flags & ButtonsEtc.TestCmbBoxEn) != 0); + + stopBtn.Enabled = ((args.Flags & ButtonsEtc.StopBtnEn) != 0); + stopBtn.BackColor = stopBtn.Enabled ? colorStopEn : colorStopDis; + + startTestBtn.Enabled = ((args.Flags & ButtonsEtc.StartTestBtnsEn) != 0); + startTestBtn.BackColor = startTestBtn.Enabled ? colorTestsEn : colorTestsDis; + + startQ1Btn.Enabled = ((args.Flags & ButtonsEtc.StartTestBtnsEn) != 0); + startQ1Btn.BackColor = startQ1Btn.Enabled ? colorTestsEn : colorTestsDis; + + startQ2Btn.Enabled = ((args.Flags & ButtonsEtc.StartTestBtnsEn) != 0); + startQ2Btn.BackColor = startQ2Btn.Enabled ? colorTestsEn : colorTestsDis; + + startQ3Btn.Enabled = ((args.Flags & ButtonsEtc.StartTestBtnsEn) != 0); + startQ3Btn.BackColor = startQ3Btn.Enabled ? colorTestsEn : colorTestsDis; + + startCycleBtn.Enabled = ((args.Flags & ButtonsEtc.StartCycleBtnEn) != 0); + startCycleBtn.BackColor = startCycleBtn.Enabled ? colorCycleEn : colorCycleDis; + + purgeBeginBtn.Enabled = ((args.Flags & ButtonsEtc.PurgeBeginBtnEn) != 0); + purgeBeginBtn.BackColor = purgeBeginBtn.Enabled ? colorPurgeEn : colorPurgeDis; + + purgeEndBtn.Enabled = ((args.Flags & ButtonsEtc.PurgeEndBtnEn) != 0); + purgeEndBtn.BackColor = purgeEndBtn.Enabled ? colorPurgeEn : colorPurgeDis; + + emptyTank1Btn.Enabled = ((args.Flags & ButtonsEtc.EmptyTankBtnsEn) != 0); + emptyTank1Btn.BackColor = emptyTank1Btn.Enabled ? colorEmptyEn : colorEmptyDis; + + emptyTank2Btn.Enabled = ((args.Flags & ButtonsEtc.EmptyTankBtnsEn) != 0); + emptyTank2Btn.BackColor = emptyTank2Btn.Enabled ? colorEmptyEn : colorEmptyDis; + + resetResultsBtn.Enabled = ((args.Flags & ButtonsEtc.ResetResultsBtnEn) != 0); + resetResultsBtn.BackColor = resetResultsBtn.Enabled ? colorStopEn : colorStopDis; + + acceptResultsBtn.Enabled = ((args.Flags & ButtonsEtc.AcceptResultsBtnEn) != 0); + acceptResultsBtn.BackColor = acceptResultsBtn.Enabled ? colorAcceptEn : colorAcceptDis; + + tryHeadsBtn.Enabled = ((args.Flags & ButtonsEtc.TryOpticalHeadsBtnEn) != 0); + tryHeadsBtn.BackColor = tryHeadsBtn.Enabled ? colorOtherEn : colorOtherDis; + + calibrationBtn.Enabled = ((args.Flags & ButtonsEtc.CalibrationBtnEn) != 0); + calibrationBtn.BackColor = calibrationBtn.Enabled ? colorOtherEn : colorOtherDis; + + sensitivityTestBtn.Enabled = ((args.Flags & ButtonsEtc.SensitivityTestBtnEn) != 0); + sensitivityTestBtn.BackColor = sensitivityTestBtn.Enabled ? colorOtherEn : colorOtherDis; + } + } +} diff --git a/TestBenchFramework/UiControls/BenchControlPanel.de.resx b/TestBenchFramework/UiControls/BenchControlPanel.de.resx new file mode 100644 index 000000000..8ef361b7d --- /dev/null +++ b/TestBenchFramework/UiControls/BenchControlPanel.de.resx @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Verdana, 14.25pt + + + 104, 167 + + + 94, 70 + + + 0 Stopp + + + Verdana, 14.25pt + + + 8, 66 + + + 4 Start Prüfpunkt + + + Verdana, 14.25pt + + + 8, 167 + + + 5 Start Prüfung + + + Verdana, 14.25pt + + + 93, 35 + + + 6 Anf. + + + Verdana, 14.25pt + + + 104, 23 + + + 94, 35 + + + 7 Ende + + + Verdana, 11.25pt + + + 8, 77 + + + Opt.Köpfe testen + + + Verdana, 12pt + + + zurücks. + + + Verdana, 11.25pt + + + 104, 26 + + + Kalibrieren + + + Verdana, 14.25pt + + + 8, 23 + + + 8 Beh.1 + + + Verdana, 11.25pt + + + 9, 26 + + + Empfind- lichkeit + + + Verdana, 14.25pt + + + 104, 23 + + + 94, 35 + + + 9 Beh.2 + + + Verdana, 14.25pt + + + 138, 116 + + + 3 + + + Verdana, 14.25pt + + + 73, 116 + + + 2 + + + Verdana, 14.25pt + + + 8, 116 + + + 1 + + + 13, 3 + + + Prüfpunkt + + + 13, 252 + + + Spülen + + + 13, 397 + + + Leeren + + + 13, 470 + + + 207, 130 + + + Zubehör + + + Verdana, 10pt + + + bestätigen + + + 13, 325 + + + Ergebnisse + + + 235, 1000 + + \ No newline at end of file diff --git a/TestBenchFramework/UiControls/BenchControlPanel.resx b/TestBenchFramework/UiControls/BenchControlPanel.resx new file mode 100644 index 000000000..06514cf23 --- /dev/null +++ b/TestBenchFramework/UiControls/BenchControlPanel.resx @@ -0,0 +1,786 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + Verdana, 15.75pt + + + + NoControl + + + 106, 168 + + + 92, 70 + + + + 5 + + + Stop + + + stopBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 6 + + + Verdana, 15.75pt + + + NoControl + + + 8, 67 + + + 190, 45 + + + 4 + + + Start Test + + + startTestBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 4 + + + Verdana, 15.75pt + + + NoControl + + + 8, 168 + + + 92, 70 + + + 7 + + + Start Cycle + + + startCycleBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 5 + + + Verdana, 15.75pt + + + NoControl + + + 8, 23 + + + 92, 35 + + + 8 + + + Begin + + + purgeBeginBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + purgeGroupBox + + + 1 + + + Verdana, 15.75pt + + + NoControl + + + 106, 23 + + + 92, 35 + + + 9 + + + End + + + purgeEndBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + purgeGroupBox + + + 0 + + + Verdana, 12pt + + + NoControl + + + 8, 26 + + + 92, 45 + + + 10 + + + Try heads + + + tryHeadsBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + otherGroupBox + + + 3 + + + Verdana, 15.75pt + + + NoControl + + + 8, 20 + + + 92, 42 + + + 11 + + + Reset + + + resetResultsBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + Verdana, 12pt + + + NoControl + + + 106, 26 + + + 92, 45 + + + 12 + + + Calib- ration + + + calibrationBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + otherGroupBox + + + 2 + + + Verdana, 15.75pt + + + NoControl + + + 8, 26 + + + 92, 35 + + + 13 + + + Tank 1 + + + emptyTank1Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + emptyGroupBox + + + 0 + + + Verdana, 12pt + + + NoControl + + + 8, 77 + + + 92, 45 + + + 14 + + + Sensi- tivity + + + sensitivityTestBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + otherGroupBox + + + 0 + + + Verdana, 15.75pt + + + NoControl + + + 106, 26 + + + 92, 35 + + + 15 + + + Tank 2 + + + emptyTank2Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + emptyGroupBox + + + 1 + + + Verdana, 15.75pt + + + NoControl + + + 138, 117 + + + 60, 45 + + + 9 + + + Q3 + + + startQ3Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 0 + + + Verdana, 15.75pt + + + NoControl + + + 73, 117 + + + 60, 45 + + + 8 + + + Q2 + + + startQ2Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 1 + + + Verdana, 15.75pt + + + NoControl + + + 8, 117 + + + 60, 45 + + + 7 + + + Q1 + + + startQ1Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 2 + + + Verdana, 15.75pt + + + 8, 25 + + + 190, 33 + + + 6 + + + testComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testGroupBox + + + 3 + + + Verdana, 12pt + + + 7, 3 + + + 207, 246 + + + 17 + + + Test + + + testGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + Verdana, 12pt + + + 7, 253 + + + 207, 68 + + + 18 + + + Purge + + + purgeGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + Verdana, 12pt + + + 7, 397 + + + 207, 68 + + + 19 + + + Empty + + + emptyGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + False + + + Lucida Console, 8.25pt + + + 106, 77 + + + 91, 25 + + + 21 + + + Next + + + False + + + nextButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + otherGroupBox + + + 1 + + + Verdana, 12pt + + + 7, 469 + + + 207, 128 + + + 20 + + + Auxiliary + + + otherGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Verdana, 15.75pt + + + NoControl + + + 106, 20 + + + 92, 42 + + + 15 + + + Accept + + + acceptResultsBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Verdana, 12pt + + + 7, 325 + + + 207, 68 + + + 22 + + + Results + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 9, 18 + + + Verdana, 11.25pt + + + 4, 4, 4, 4 + + + 224, 736 + + + BenchControlPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs b/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs new file mode 100644 index 000000000..43d3a2edb --- /dev/null +++ b/TestBenchFramework/UiControls/CameraPictureCtrl.Designer.cs @@ -0,0 +1,141 @@ +namespace TBF.UiControls +{ + partial class CameraPictureCtrl + { + /// + /// 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() + { + this.pictureBox = new System.Windows.Forms.PictureBox(); + this.groupBox = new System.Windows.Forms.GroupBox(); + this.ledPictureBox = new System.Windows.Forms.PictureBox(); + this.trackBar = new System.Windows.Forms.TrackBar(); + this.liveButton = new System.Windows.Forms.Button(); + this.focusButton = new System.Windows.Forms.Button(); + this.grabButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + this.groupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox + // + this.pictureBox.Location = new System.Drawing.Point(6, 19); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(320, 240); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox.TabIndex = 0; + this.pictureBox.TabStop = false; + // + // groupBox + // + this.groupBox.Controls.Add(this.ledPictureBox); + this.groupBox.Controls.Add(this.trackBar); + this.groupBox.Controls.Add(this.liveButton); + this.groupBox.Controls.Add(this.focusButton); + this.groupBox.Controls.Add(this.grabButton); + this.groupBox.Controls.Add(this.pictureBox); + this.groupBox.Location = new System.Drawing.Point(0, 0); + this.groupBox.Name = "groupBox"; + this.groupBox.Size = new System.Drawing.Size(332, 315); + this.groupBox.TabIndex = 1; + this.groupBox.TabStop = false; + this.groupBox.Text = "Camera "; + // + // ledPictureBox + // + this.ledPictureBox.Location = new System.Drawing.Point(6, 279); + this.ledPictureBox.Name = "ledPictureBox"; + this.ledPictureBox.Size = new System.Drawing.Size(15, 15); + this.ledPictureBox.TabIndex = 5; + this.ledPictureBox.TabStop = false; + // + // trackBar + // + this.trackBar.Location = new System.Drawing.Point(200, 264); + this.trackBar.Name = "trackBar"; + this.trackBar.Size = new System.Drawing.Size(126, 45); + this.trackBar.TabIndex = 4; + this.trackBar.Scroll += new System.EventHandler(this.trackBar_Scroll); + // + // liveButton + // + this.liveButton.Location = new System.Drawing.Point(81, 264); + this.liveButton.Name = "liveButton"; + this.liveButton.Size = new System.Drawing.Size(56, 45); + this.liveButton.TabIndex = 3; + this.liveButton.Text = "Live"; + this.liveButton.UseVisualStyleBackColor = true; + this.liveButton.Click += new System.EventHandler(this.liveButton_Click); + // + // focusButton + // + this.focusButton.Location = new System.Drawing.Point(138, 264); + this.focusButton.Name = "focusButton"; + this.focusButton.Size = new System.Drawing.Size(56, 45); + this.focusButton.TabIndex = 2; + this.focusButton.Text = "Focus"; + this.focusButton.UseVisualStyleBackColor = true; + this.focusButton.Click += new System.EventHandler(this.focusButton_Click); + // + // grabButton + // + this.grabButton.Location = new System.Drawing.Point(24, 264); + this.grabButton.Name = "grabButton"; + this.grabButton.Size = new System.Drawing.Size(56, 45); + this.grabButton.TabIndex = 1; + this.grabButton.Text = "Grab"; + this.grabButton.UseVisualStyleBackColor = true; + this.grabButton.Click += new System.EventHandler(this.grabButton_Click); + // + // CameraPictureCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ButtonShadow; + this.Controls.Add(this.groupBox); + this.Name = "CameraPictureCtrl"; + this.Size = new System.Drawing.Size(334, 320); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + this.groupBox.ResumeLayout(false); + this.groupBox.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ledPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox; + private System.Windows.Forms.GroupBox groupBox; + private System.Windows.Forms.Button liveButton; + private System.Windows.Forms.Button focusButton; + private System.Windows.Forms.Button grabButton; + private System.Windows.Forms.PictureBox ledPictureBox; + private System.Windows.Forms.TrackBar trackBar; + } +} diff --git a/TestBenchFramework/UiControls/CameraPictureCtrl.cs b/TestBenchFramework/UiControls/CameraPictureCtrl.cs new file mode 100644 index 000000000..65dce8d66 --- /dev/null +++ b/TestBenchFramework/UiControls/CameraPictureCtrl.cs @@ -0,0 +1,63 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using TBF.BenchControl.Cameras.IdcCamera; + +namespace TBF.UiControls +{ + public partial class CameraPictureCtrl : UserControl + { + public PictureBox PictureBox { get { return pictureBox; } } + + /// + /// Setting the state updated the background color + /// + public IdcState CameraState + { + set + { + switch (value) + { + case IdcState.NotConnected: + ledPictureBox.BackColor = Color.Gray; + break; + case IdcState.Busy: + ledPictureBox.BackColor = Color.Orange; + break; + case IdcState.Idle: + case IdcState.OpCompleted: + ledPictureBox.BackColor = Color.LawnGreen; + break; + default: + ledPictureBox.BackColor = Color.Tomato; + break; + } + } + } + + public CameraPictureCtrl() + { + InitializeComponent(); + } + + private void grabButton_Click(object sender, EventArgs e) + { + + } + + private void liveButton_Click(object sender, EventArgs e) + { + + } + + private void focusButton_Click(object sender, EventArgs e) + { + + } + + private void trackBar_Scroll(object sender, EventArgs e) + { + + } + } +} diff --git a/TestBenchFramework/UiControls/CameraPictureCtrl.resx b/TestBenchFramework/UiControls/CameraPictureCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/CameraPictureCtrl.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/TestBenchFramework/UiControls/IMetrologyDlgTab.cs b/TestBenchFramework/UiControls/IMetrologyDlgTab.cs new file mode 100644 index 000000000..38b5aca4a --- /dev/null +++ b/TestBenchFramework/UiControls/IMetrologyDlgTab.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace TBF.UiControls +{ + interface IMetrologyDlgTab : ITabWithListViewEx + { + /// + /// Component entity that has a list of 'measurement-correction' pairs + /// to be updated in the database on OK. + /// + Entities.Component MeterEntity { get; set; } + + /// + /// A list of 'measurement-correction' pairs to be deleted from the database on OK. + /// + IList ToBeRemoved { get; set; } + } +} diff --git a/TestBenchFramework/UiControls/IParentOfListViewEx.cs b/TestBenchFramework/UiControls/IParentOfListViewEx.cs new file mode 100644 index 000000000..e10d88435 --- /dev/null +++ b/TestBenchFramework/UiControls/IParentOfListViewEx.cs @@ -0,0 +1,8 @@ + +namespace TBF.UiControls +{ + interface IParentOfListViewEx + { + void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos); + } +} diff --git a/TestBenchFramework/UiControls/ITabWithListViewEx.cs b/TestBenchFramework/UiControls/ITabWithListViewEx.cs new file mode 100644 index 000000000..06bce12ec --- /dev/null +++ b/TestBenchFramework/UiControls/ITabWithListViewEx.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TBF.UiControls +{ + interface ITabWithListViewEx + { + void Unlock(); + void OkBtnClicked(); + void CancelBtnClicked(); + void AddOne(); + void RemoveSelected(); + void MoveUpSelected(); + void MoveDownSelected(); + } +} diff --git a/TestBenchFramework/UiControls/ListViewEx.cs b/TestBenchFramework/UiControls/ListViewEx.cs new file mode 100644 index 000000000..91f5eada6 --- /dev/null +++ b/TestBenchFramework/UiControls/ListViewEx.cs @@ -0,0 +1,451 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace TBF.UiControls +{ + /// + /// Event Handler for SubItem events + /// + public delegate void SubItemEventHandler(object sender, SubItemEventArgs e); + /// + /// Event Handler for SubItemEndEditing events + /// + public delegate void SubItemEndEditingEventHandler(object sender, SubItemEndEditingEventArgs e); + + + /// + /// Inherited ListView to allow in-place editing of subitems + /// + public class ListViewEx : System.Windows.Forms.ListView + { + #region Interop structs, imports and constants + /// + /// MessageHeader for WM_NOTIFY + /// + private struct NMHDR + { + public IntPtr hwndFrom; + public Int32 idFrom; + public Int32 code; + } + + + [DllImport("user32.dll")] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); + [DllImport("user32.dll", CharSet=CharSet.Ansi)] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int len, ref int [] order); + + // ListView messages + private const int LVM_FIRST = 0x1000; + private const int LVM_GETCOLUMNORDERARRAY = (LVM_FIRST + 59); + + // Windows Messages that will abort editing + private const int WM_HSCROLL = 0x114; + private const int WM_VSCROLL = 0x115; + private const int WM_SIZE = 0x05; + private const int WM_NOTIFY = 0x4E; + + private const int HDN_FIRST = -300; + private const int HDN_BEGINDRAG = (HDN_FIRST-10); + private const int HDN_ITEMCHANGINGA = (HDN_FIRST-0); + private const int HDN_ITEMCHANGINGW = (HDN_FIRST-20); + #endregion + + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + public event SubItemEventHandler SubItemClicked; + public event SubItemEventHandler SubItemBeginEditing; + public event SubItemEndEditingEventHandler SubItemEndEditing; + + public ListViewEx() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + + base.FullRowSelect = true; + base.View = View.Details; + base.AllowColumnReorder = true; + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if( 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(); + } + #endregion + + private bool _doubleClickActivation = false; + /// + /// Is a double click required to start editing a cell? + /// + public bool DoubleClickActivation + { + get { return _doubleClickActivation; } + set { _doubleClickActivation = value; } + } + + + /// + /// Retrieve the order in which columns appear + /// + /// Current display order of column indices + public int[] GetColumnOrder() + { + IntPtr lPar = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * Columns.Count); + + IntPtr res = SendMessage(Handle, LVM_GETCOLUMNORDERARRAY, new IntPtr(Columns.Count), lPar); + if (res.ToInt32() == 0) // Something went wrong + { + Marshal.FreeHGlobal(lPar); + return null; + } + + int [] order = new int[Columns.Count]; + Marshal.Copy(lPar, order, 0, Columns.Count); + + Marshal.FreeHGlobal(lPar); + + return order; + } + + + /// + /// Find ListViewItem and SubItem Index at position (x,y) + /// + /// relative to ListView + /// relative to ListView + /// Item at position (x,y) + /// SubItem index + public int GetSubItemAt(int x, int y, out ListViewItem item) + { + item = this.GetItemAt(x, y); + + if (item != null) + { + int[] order = GetColumnOrder(); + Rectangle lviBounds; + int subItemX; + + lviBounds = item.GetBounds(ItemBoundsPortion.Entire); + subItemX = lviBounds.Left; + for (int i=0; i + /// Get bounds for a SubItem + /// + /// Target ListViewItem + /// Target SubItem index + /// Bounds of SubItem (relative to ListView) + public Rectangle GetSubItemBounds(ListViewItem Item, int SubItem) + { + int[] order = GetColumnOrder(); + + Rectangle subItemRect = Rectangle.Empty; + if (SubItem >= order.Length) + throw new IndexOutOfRangeException("SubItem "+SubItem+" out of range"); + + if (Item == null) + throw new ArgumentNullException("Item"); + + Rectangle lviBounds = Item.GetBounds(ItemBoundsPortion.Entire); + int subItemX = lviBounds.Left; + + ColumnHeader col; + int i; + for (i=0; i + /// Fire SubItemClicked + /// + ///Point of click/doubleclick + private void EditSubitemAt(Point p) + { + ListViewItem item; + int idx = GetSubItemAt(p.X, p.Y, out item); + if (idx >= 0) + { + OnSubItemClicked(new SubItemEventArgs(item, idx)); + } + } + + #endregion + + #region In-place editing functions + // The control performing the actual editing + private Control _editingControl; + // The LVI being edited + private ListViewItem _editItem; + // The SubItem being edited + private int _editSubItem; + + protected void OnSubItemBeginEditing(SubItemEventArgs e) + { + if (SubItemBeginEditing != null) SubItemBeginEditing(this, e); + } + + protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e) + { + if (SubItemEndEditing != null) SubItemEndEditing(this, e); + } + + protected void OnSubItemClicked(SubItemEventArgs e) + { + if (SubItemClicked != null) SubItemClicked(this, e); + } + + + /// + /// Begin in-place editing of given cell + /// + /// Control used as cell editor + /// ListViewItem to edit + /// SubItem index to edit + public void StartEditing(Control c, ListViewItem Item, int SubItem) + { + OnSubItemBeginEditing(new SubItemEventArgs(Item, SubItem)); + + Rectangle rcSubItem = GetSubItemBounds(Item, SubItem); + + if (rcSubItem.X < 0) + { + // Left edge of SubItem not visible - adjust rectangle position and width + rcSubItem.Width += rcSubItem.X; + rcSubItem.X=0; + } + if (rcSubItem.X+rcSubItem.Width > this.Width) + { + // Right edge of SubItem not visible - adjust rectangle width + rcSubItem.Width = this.Width-rcSubItem.Left; + } + + // Subitem bounds are relative to the location of the ListView! + rcSubItem.Offset(Left, Top); + + // In case the editing control and the listview are on different parents, + // account for different origins + Point origin = new Point(0,0); + Point lvOrigin = this.Parent.PointToScreen(origin); + Point ctlOrigin = c.Parent.PointToScreen(origin); + + rcSubItem.Offset(lvOrigin.X-ctlOrigin.X, lvOrigin.Y-ctlOrigin.Y); + + // Position and show editor + c.Bounds = rcSubItem; + c.Text = Item.SubItems[SubItem].Text; + c.Visible = true; + c.BringToFront(); + c.Focus(); + + _editingControl = c; + _editingControl.Leave += new EventHandler(_editControl_Leave); + _editingControl.KeyPress += new KeyPressEventHandler(_editControl_KeyPress); + + _editItem = Item; + _editSubItem = SubItem; + } + + + private void _editControl_Leave(object sender, EventArgs e) + { + // cell editor losing focus + EndEditing(true); + } + + private void _editControl_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) + { + switch (e.KeyChar) + { + case (char)(int)Keys.Escape: + { + EndEditing(false); + break; + } + + case (char)(int)Keys.Enter: + { + EndEditing(true); + break; + } + } + } + + /// + /// Accept or discard current value of cell editor control + /// + /// Use the _editingControl's Text as new SubItem text or discard changes? + public void EndEditing(bool AcceptChanges) + { + if (_editingControl == null) + return; + + SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs( + _editItem, // The item being edited + _editSubItem, // The subitem index being edited + AcceptChanges ? + _editingControl.Text : // Use editControl text if changes are accepted + _editItem.SubItems[_editSubItem].Text, // or the original subitem's text, if changes are discarded + !AcceptChanges // Cancel? + ); + + OnSubItemEndEditing(e); + + _editItem.SubItems[_editSubItem].Text = e.DisplayText; + + _editingControl.Leave -= new EventHandler(_editControl_Leave); + _editingControl.KeyPress -= new KeyPressEventHandler(_editControl_KeyPress); + + _editingControl.Visible = false; + + _editingControl = null; + _editItem = null; + _editSubItem = -1; + } + #endregion + } + + + /// + /// Event Args for SubItemClicked event + /// + public class SubItemEventArgs : EventArgs + { + int subItem = -1; /// Sub-item index + ListViewItem item = null; + + public int SubItem { get { return subItem; } } + public ListViewItem Item { get { return item; } } + + public SubItemEventArgs(ListViewItem item, int subItem) + { + this.subItem = subItem; + this.item = item; + } + } + + + /// + /// Event Args for SubItemEndEditingClicked event + /// + public class SubItemEndEditingEventArgs : SubItemEventArgs + { + string displayText = string.Empty; + bool cancel = true; + + public SubItemEndEditingEventArgs(ListViewItem item, int subItem, string displayText, bool cancel) : + base(item, subItem) + { + this.displayText = displayText; + this.cancel = cancel; + } + public string DisplayText + { + get { return displayText; } + set { displayText = value; } + } + public bool Cancel + { + get { return cancel; } + set { cancel = value; } + } + } +} diff --git a/TestBenchFramework/UiControls/ListViewEx.resx b/TestBenchFramework/UiControls/ListViewEx.resx new file mode 100644 index 000000000..7e323966c --- /dev/null +++ b/TestBenchFramework/UiControls/ListViewEx.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs new file mode 100644 index 000000000..6fa35dcd5 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs @@ -0,0 +1,179 @@ +namespace TBF.UiControls +{ + partial class MetrologyDlgBalanceTab + { + /// + /// 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() + { + this.cmpntNameLabel = new System.Windows.Forms.Label(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.measuredLabel = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.correctedLabel = new System.Windows.Forms.Label(); + this.measuredTextBox = new System.Windows.Forms.TextBox(); + this.correctedTextBox = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.testGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // cmpntNameLabel + // + this.cmpntNameLabel.AutoSize = true; + this.cmpntNameLabel.Location = new System.Drawing.Point(97, 12); + this.cmpntNameLabel.Name = "cmpntNameLabel"; + this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); + this.cmpntNameLabel.TabIndex = 0; + this.cmpntNameLabel.Text = "componentName"; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.label1); + this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.listViewEx); + this.splitContainer1.Size = new System.Drawing.Size(420, 300); + this.splitContainer1.SplitterDistance = 80; + this.splitContainer1.TabIndex = 1; + // + // measuredLabel + // + this.measuredLabel.AutoSize = true; + this.measuredLabel.Location = new System.Drawing.Point(6, 20); + this.measuredLabel.Name = "measuredLabel"; + this.measuredLabel.Size = new System.Drawing.Size(54, 13); + this.measuredLabel.TabIndex = 2; + this.measuredLabel.Text = "Measured"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Component:"; + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(420, 216); + this.listViewEx.TabIndex = 0; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.correctedTextBox); + this.testGroupBox.Controls.Add(this.measuredTextBox); + this.testGroupBox.Controls.Add(this.correctedLabel); + this.testGroupBox.Controls.Add(this.measuredLabel); + this.testGroupBox.Location = new System.Drawing.Point(245, 7); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.Size = new System.Drawing.Size(157, 64); + this.testGroupBox.TabIndex = 3; + this.testGroupBox.TabStop = false; + this.testGroupBox.Text = "Test"; + // + // correctedLabel + // + this.correctedLabel.AutoSize = true; + this.correctedLabel.Location = new System.Drawing.Point(7, 41); + this.correctedLabel.Name = "correctedLabel"; + this.correctedLabel.Size = new System.Drawing.Size(53, 13); + this.correctedLabel.TabIndex = 3; + this.correctedLabel.Text = "Corrected"; + // + // measuredTextBox + // + this.measuredTextBox.Location = new System.Drawing.Point(74, 13); + this.measuredTextBox.Name = "measuredTextBox"; + this.measuredTextBox.Size = new System.Drawing.Size(73, 20); + this.measuredTextBox.TabIndex = 4; + this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); + // + // correctedTextBox + // + this.correctedTextBox.Location = new System.Drawing.Point(74, 38); + this.correctedTextBox.Name = "correctedTextBox"; + this.correctedTextBox.ReadOnly = true; + this.correctedTextBox.Size = new System.Drawing.Size(73, 20); + this.correctedTextBox.TabIndex = 5; + // + // MetrologyDlgBalanceTab + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "MetrologyDlgBalanceTab"; + this.Size = new System.Drawing.Size(420, 300); + this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.testGroupBox.ResumeLayout(false); + this.testGroupBox.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label cmpntNameLabel; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Label label1; + private ListViewEx listViewEx; + private System.Windows.Forms.Label measuredLabel; + private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.TextBox correctedTextBox; + private System.Windows.Forms.TextBox measuredTextBox; + private System.Windows.Forms.Label correctedLabel; + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs new file mode 100644 index 000000000..aaa052735 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.Resources; + +namespace TBF.UiControls +{ + public partial class MetrologyDlgBalanceTab : UserControl, IMetrologyDlgTab + { + static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgBalanceTab)); + + /// + /// Component entity that has a list of 'measurement-correction' pairs + /// to be updated in the database on OK. + /// + public Entities.Component MeterEntity + { + get { return meterEntity; } + set { meterEntity = value; } + } + Entities.Component meterEntity; + + /// + /// A list of 'measurement-correction' pairs to be deleted from the database on OK. + /// + public IList ToBeRemoved + { + get { return toBeRemoved; } + set { toBeRemoved = value; } + } + IList toBeRemoved; + + MetrologyDlg parent; + bool unlocked; + Control measurementTextBox; + Control correctionTextBox; + + public MetrologyDlgBalanceTab() + { + InitializeComponent(); + toBeRemoved = new List(); + unlocked = false; + } + + private void MetrologyDlgBalanceTab_Load(object sender, System.EventArgs e) + { + if (meterEntity == null) return; + + parent = ParentForm as MetrologyDlg; + + /// Panel1 + cmpntNameLabel.Text = meterEntity.Name; + + testGroupBox.Text = Strings.Test_measured_corrected; + measuredLabel.Text = Strings.Measured; + correctedLabel.Text = Strings.Corrected; + measuredTextBox.Text = string.Empty; + correctedTextBox.Text = string.Empty; + + /// Panel2 + measurementTextBox = new TextBox(); + correctionTextBox = new TextBox(); + this.Controls.Add(measurementTextBox); + this.Controls.Add(correctionTextBox); + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Mass_kg, Width = 100 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Correction_g, Width = 100 }); + + RefreshAll(); + } + + void RefreshAll() + { + listViewEx.Items.Clear(); + foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr); + } + + void AddOneLVI(Entities.MeasurementCorrection corr) + { + int nr = listViewEx.Items.Count + 1; + ListViewItem lvi = new ListViewItem(nr.ToString()); + lvi.SubItems.Add(corr.Measurement.ToString()); + lvi.SubItems.Add((corr.Correction * 1000.0f).ToString()); + lvi.Tag = corr; + listViewEx.Items.Add(lvi); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (unlocked && e.SubItem == 1) + { + listViewEx.StartEditing(measurementTextBox, e.Item, e.SubItem); + } + else if (unlocked && e.SubItem == 2) + { + listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); + } + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + float value; + if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0) + { + (e.Item.Tag as Entities.MeasurementCorrection).Measurement = value; + return; + } + else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value)) + { + (e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f; + return; + } + + e.DisplayText = e.Item.Text; + e.Cancel = true; + } + + public void Unlock() + { + unlocked = true; + + if (listViewEx.SelectedItems.Count == 1) + { + int ix = listViewEx.SelectedIndices[0]; + listViewEx.Focus(); + listViewEx.Items[ix].Selected = true; + listViewEx.Items[ix].EnsureVisible(); + } + } + + public void OkBtnClicked() + { + } + + public void CancelBtnClicked() + { + } + + public void AddOne() + { + Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection(); + MeterEntity.Corrections.Add(corr); + AddOneLVI(corr); + + listViewEx.Focus(); + listViewEx.SelectedItems.Clear(); + listViewEx.Items[listViewEx.Items.Count - 1].Selected = true; + listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible(); + } + + public void RemoveSelected() + { + if (listViewEx.SelectedItems.Count != 1) return; + + int removeItemNr = listViewEx.SelectedIndices[0]; + + Entities.MeasurementCorrection selected = + (Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag; + if (selected.Id != 0) toBeRemoved.Add(selected); + MeterEntity.Corrections.RemoveAt(removeItemNr); + RefreshAll(); + + if (removeItemNr < listViewEx.Items.Count) + { + listViewEx.Focus(); + listViewEx.Items[removeItemNr].Selected = true; + listViewEx.Items[removeItemNr].EnsureVisible(); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + + public void MoveUpSelected() + { + } + + public void MoveDownSelected() + { + } + + /// + /// Event handler that indicates the selected item position + /// and updates 'Remove', 'Up' and 'Down' buttons in the parent dialog. + /// + private void listViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + if (listViewEx.SelectedItems.Count != 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + else if (listViewEx.Items.Count == 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.First); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Last); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Middle); + } + } + + private void measuredTextBox_TextChanged(object sender, EventArgs e) + { + float measured; + if (float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.CurrentCulture, + out measured) || + float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.InvariantCulture, + out measured)) + { + float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections); + correctedTextBox.Text = corrected.ToString(); + } + } + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.resx b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.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/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs new file mode 100644 index 000000000..8c0881a68 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs @@ -0,0 +1,180 @@ +namespace TBF.UiControls +{ + partial class MetrologyDlgFlowMeterTab + { + /// + /// 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() + { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.label1 = new System.Windows.Forms.Label(); + this.cmpntNameLabel = new System.Windows.Forms.Label(); + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.correctedTextBox = new System.Windows.Forms.TextBox(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.measuredTextBox = new System.Windows.Forms.TextBox(); + this.correctedLabel = new System.Windows.Forms.Label(); + this.measuredLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.testGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.label1); + this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.listViewEx); + this.splitContainer1.Size = new System.Drawing.Size(420, 300); + this.splitContainer1.SplitterDistance = 80; + this.splitContainer1.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Component:"; + // + // cmpntNameLabel + // + this.cmpntNameLabel.AutoSize = true; + this.cmpntNameLabel.Location = new System.Drawing.Point(97, 12); + this.cmpntNameLabel.Name = "cmpntNameLabel"; + this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); + this.cmpntNameLabel.TabIndex = 0; + this.cmpntNameLabel.Text = "componentName"; + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(420, 216); + this.listViewEx.TabIndex = 0; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); + // + // correctedTextBox + // + this.correctedTextBox.Location = new System.Drawing.Point(74, 38); + this.correctedTextBox.Name = "correctedTextBox"; + this.correctedTextBox.ReadOnly = true; + this.correctedTextBox.Size = new System.Drawing.Size(73, 20); + this.correctedTextBox.TabIndex = 5; + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.correctedTextBox); + this.testGroupBox.Controls.Add(this.measuredTextBox); + this.testGroupBox.Controls.Add(this.correctedLabel); + this.testGroupBox.Controls.Add(this.measuredLabel); + this.testGroupBox.Location = new System.Drawing.Point(245, 7); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.Size = new System.Drawing.Size(157, 64); + this.testGroupBox.TabIndex = 4; + this.testGroupBox.TabStop = false; + this.testGroupBox.Text = "Test"; + // + // measuredTextBox + // + this.measuredTextBox.Location = new System.Drawing.Point(74, 13); + this.measuredTextBox.Name = "measuredTextBox"; + this.measuredTextBox.Size = new System.Drawing.Size(73, 20); + this.measuredTextBox.TabIndex = 4; + this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); + // + // correctedLabel + // + this.correctedLabel.AutoSize = true; + this.correctedLabel.Location = new System.Drawing.Point(7, 41); + this.correctedLabel.Name = "correctedLabel"; + this.correctedLabel.Size = new System.Drawing.Size(53, 13); + this.correctedLabel.TabIndex = 3; + this.correctedLabel.Text = "Corrected"; + // + // measuredLabel + // + this.measuredLabel.AutoSize = true; + this.measuredLabel.Location = new System.Drawing.Point(6, 20); + this.measuredLabel.Name = "measuredLabel"; + this.measuredLabel.Size = new System.Drawing.Size(54, 13); + this.measuredLabel.TabIndex = 2; + this.measuredLabel.Text = "Measured"; + // + // MetrologyDlgFlowMeterTab + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "MetrologyDlgFlowMeterTab"; + this.Size = new System.Drawing.Size(420, 300); + this.Load += new System.EventHandler(this.MetrologyDlgFlowMeterTab_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.testGroupBox.ResumeLayout(false); + this.testGroupBox.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label cmpntNameLabel; + private ListViewEx listViewEx; + private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.TextBox correctedTextBox; + private System.Windows.Forms.TextBox measuredTextBox; + private System.Windows.Forms.Label correctedLabel; + private System.Windows.Forms.Label measuredLabel; + + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs new file mode 100644 index 000000000..4ad75a05a --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.Resources; + +namespace TBF.UiControls +{ + public partial class MetrologyDlgFlowMeterTab : UserControl, IMetrologyDlgTab + { + static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgFlowMeterTab)); + + /// + /// Component entity that has a list of 'measurement-correction' pairs + /// to be updated in the database on OK. + /// + Entities.Component meterEntity; + public Entities.Component MeterEntity + { + get { return meterEntity; } + set { meterEntity = value; } + } + + /// + /// A list of 'measurement-correction' pairs to be deleted from the database on OK. + /// + public IList ToBeRemoved + { + get { return toBeRemoved; } + set { toBeRemoved = value; } + } + IList toBeRemoved; + + MetrologyDlg parent; + bool unlocked; + Control measurementTextBox; + Control correctionTextBox; + + public MetrologyDlgFlowMeterTab() + { + InitializeComponent(); + toBeRemoved = new List(); + } + + private void MetrologyDlgFlowMeterTab_Load(object sender, System.EventArgs e) + { + if (meterEntity == null) return; + + parent = ParentForm as MetrologyDlg; + + /// Panel1 + cmpntNameLabel.Text = meterEntity.Name; + + testGroupBox.Text = Strings.Test_measured_corrected; + measuredLabel.Text = Strings.Measured; + correctedLabel.Text = Strings.Corrected; + measuredTextBox.Text = string.Empty; + correctedTextBox.Text = string.Empty; + + /// Panel2 + measurementTextBox = new TextBox(); + correctionTextBox = new TextBox(); + this.Controls.Add(measurementTextBox); + this.Controls.Add(correctionTextBox); + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Flow_m3h, Width = 100 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Correction_lph, Width = 100 }); + + RefreshAll(); + } + + void RefreshAll() + { + listViewEx.Items.Clear(); + foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr); + } + + void AddOneLVI(Entities.MeasurementCorrection corr) + { + int nr = listViewEx.Items.Count + 1; + ListViewItem lvi = new ListViewItem(nr.ToString()); + lvi.SubItems.Add(corr.Measurement.ToString()); + lvi.SubItems.Add((corr.Correction * 1000.0f).ToString()); + lvi.Tag = corr; + listViewEx.Items.Add(lvi); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (unlocked && e.SubItem == 1) + { + listViewEx.StartEditing(measurementTextBox, e.Item, e.SubItem); + } + else if (unlocked && e.SubItem == 2) + { + listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); + } + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + float value; + if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0) + { + (e.Item.Tag as Entities.MeasurementCorrection).Measurement = value; + return; + } + else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value)) + { + (e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f; + return; + } + + e.DisplayText = e.Item.Text; + e.Cancel = true; + } + + public void Unlock() + { + unlocked = true; + + if (listViewEx.SelectedItems.Count == 1) + { + int ix = listViewEx.SelectedIndices[0]; + listViewEx.Focus(); + listViewEx.Items[ix].Selected = true; + listViewEx.Items[ix].EnsureVisible(); + } + } + + public void OkBtnClicked() + { + } + + public void CancelBtnClicked() + { + } + + public void AddOne() + { + Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection(); + MeterEntity.Corrections.Add(corr); + AddOneLVI(corr); + + listViewEx.Focus(); + listViewEx.SelectedItems.Clear(); + listViewEx.Items[listViewEx.Items.Count - 1].Selected = true; + listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible(); + } + + public void RemoveSelected() + { + if (listViewEx.SelectedItems.Count != 1) return; + + int removeItemNr = listViewEx.SelectedIndices[0]; + + Entities.MeasurementCorrection selected = + (Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag; + if (selected.Id != 0) toBeRemoved.Add(selected); + MeterEntity.Corrections.RemoveAt(removeItemNr); + RefreshAll(); + + if (removeItemNr < listViewEx.Items.Count) + { + listViewEx.Focus(); + listViewEx.Items[removeItemNr].Selected = true; + listViewEx.Items[removeItemNr].EnsureVisible(); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + + public void MoveUpSelected() + { + } + + public void MoveDownSelected() + { + } + + /// + /// Event handler that indicates the selected item position + /// and updates 'Remove', 'Up' and 'Down' buttons in the parent dialog. + /// + private void listViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + if (listViewEx.SelectedItems.Count != 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + else if (listViewEx.Items.Count == 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.First); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Last); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Middle); + } + } + + private void measuredTextBox_TextChanged(object sender, EventArgs e) + { + float measured; + if (float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.CurrentCulture, + out measured) || + float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.InvariantCulture, + out measured)) + { + float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections); + correctedTextBox.Text = corrected.ToString(); + } + } + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.resx b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.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/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.Designer.cs new file mode 100644 index 000000000..90fe9a750 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.Designer.cs @@ -0,0 +1,180 @@ +namespace TBF.UiControls +{ + partial class MetrologyDlgPressMeterTab + { + /// + /// 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() + { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.label1 = new System.Windows.Forms.Label(); + this.cmpntNameLabel = new System.Windows.Forms.Label(); + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.correctedTextBox = new System.Windows.Forms.TextBox(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.measuredTextBox = new System.Windows.Forms.TextBox(); + this.correctedLabel = new System.Windows.Forms.Label(); + this.measuredLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.testGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.label1); + this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.listViewEx); + this.splitContainer1.Size = new System.Drawing.Size(420, 300); + this.splitContainer1.SplitterDistance = 80; + this.splitContainer1.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Component:"; + // + // cmpntNameLabel + // + this.cmpntNameLabel.AutoSize = true; + this.cmpntNameLabel.Location = new System.Drawing.Point(97, 12); + this.cmpntNameLabel.Name = "cmpntNameLabel"; + this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); + this.cmpntNameLabel.TabIndex = 0; + this.cmpntNameLabel.Text = "componentName"; + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(420, 216); + this.listViewEx.TabIndex = 0; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); + // + // correctedTextBox + // + this.correctedTextBox.Location = new System.Drawing.Point(74, 38); + this.correctedTextBox.Name = "correctedTextBox"; + this.correctedTextBox.ReadOnly = true; + this.correctedTextBox.Size = new System.Drawing.Size(73, 20); + this.correctedTextBox.TabIndex = 5; + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.correctedTextBox); + this.testGroupBox.Controls.Add(this.measuredTextBox); + this.testGroupBox.Controls.Add(this.correctedLabel); + this.testGroupBox.Controls.Add(this.measuredLabel); + this.testGroupBox.Location = new System.Drawing.Point(245, 7); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.Size = new System.Drawing.Size(157, 64); + this.testGroupBox.TabIndex = 4; + this.testGroupBox.TabStop = false; + this.testGroupBox.Text = "Test"; + // + // measuredTextBox + // + this.measuredTextBox.Location = new System.Drawing.Point(74, 13); + this.measuredTextBox.Name = "measuredTextBox"; + this.measuredTextBox.Size = new System.Drawing.Size(73, 20); + this.measuredTextBox.TabIndex = 4; + this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); + // + // correctedLabel + // + this.correctedLabel.AutoSize = true; + this.correctedLabel.Location = new System.Drawing.Point(7, 41); + this.correctedLabel.Name = "correctedLabel"; + this.correctedLabel.Size = new System.Drawing.Size(53, 13); + this.correctedLabel.TabIndex = 3; + this.correctedLabel.Text = "Corrected"; + // + // measuredLabel + // + this.measuredLabel.AutoSize = true; + this.measuredLabel.Location = new System.Drawing.Point(6, 20); + this.measuredLabel.Name = "measuredLabel"; + this.measuredLabel.Size = new System.Drawing.Size(54, 13); + this.measuredLabel.TabIndex = 2; + this.measuredLabel.Text = "Measured"; + // + // MetrologyDlgPressMeterTab + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "MetrologyDlgPressMeterTab"; + this.Size = new System.Drawing.Size(420, 300); + this.Load += new System.EventHandler(this.MetrologyDlgPressMeterTab_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.testGroupBox.ResumeLayout(false); + this.testGroupBox.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label cmpntNameLabel; + private ListViewEx listViewEx; + private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.TextBox correctedTextBox; + private System.Windows.Forms.TextBox measuredTextBox; + private System.Windows.Forms.Label correctedLabel; + private System.Windows.Forms.Label measuredLabel; + + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.cs b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.cs new file mode 100644 index 000000000..2410a4921 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.Resources; + +namespace TBF.UiControls +{ + public partial class MetrologyDlgPressMeterTab : UserControl, IMetrologyDlgTab + { + static readonly ILog log = LogManager.GetLogger(typeof(MetrologyDlgPressMeterTab)); + + /// + /// Component entity that has a list of 'measurement-correction' pairs + /// to be updated in the database on OK. + /// + Entities.Component meterEntity; + public Entities.Component MeterEntity + { + get { return meterEntity; } + set { meterEntity = value; } + } + + /// + /// A list of 'measurement-correction' pairs to be deleted from the database on OK. + /// + public IList ToBeRemoved + { + get { return toBeRemoved; } + set { toBeRemoved = value; } + } + IList toBeRemoved; + + MetrologyDlg parent; + bool unlocked; + Control measurementTextBox; + Control correctionTextBox; + + public MetrologyDlgPressMeterTab() + { + InitializeComponent(); + toBeRemoved = new List(); + } + + private void MetrologyDlgPressMeterTab_Load(object sender, System.EventArgs e) + { + if (meterEntity == null) return; + + parent = ParentForm as MetrologyDlg; + + /// Panel1 + cmpntNameLabel.Text = meterEntity.Name; + + testGroupBox.Text = Strings.Test_measured_corrected; + measuredLabel.Text = Strings.Measured; + correctedLabel.Text = Strings.Corrected; + measuredTextBox.Text = string.Empty; + correctedTextBox.Text = string.Empty; + + /// Panel2 + measurementTextBox = new TextBox(); + correctionTextBox = new TextBox(); + this.Controls.Add(measurementTextBox); + this.Controls.Add(correctionTextBox); + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Nr, Width = 60 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Pressure_bar, Width = 100 }); + listViewEx.Columns.Add(new ColumnHeader() { Text = Strings.Correction_mbar, Width = 100 }); + + RefreshAll(); + } + + void RefreshAll() + { + listViewEx.Items.Clear(); + foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr); + } + + void AddOneLVI(Entities.MeasurementCorrection corr) + { + int nr = listViewEx.Items.Count + 1; + ListViewItem lvi = new ListViewItem(nr.ToString()); + lvi.SubItems.Add(corr.Measurement.ToString()); + lvi.SubItems.Add((corr.Correction * 1000.0f).ToString()); + lvi.Tag = corr; + listViewEx.Items.Add(lvi); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (unlocked && e.SubItem == 1) + { + listViewEx.StartEditing(measurementTextBox, e.Item, e.SubItem); + } + else if (unlocked && e.SubItem == 2) + { + listViewEx.StartEditing(correctionTextBox, e.Item, e.SubItem); + } + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + float value; + if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0) + { + (e.Item.Tag as Entities.MeasurementCorrection).Measurement = value; + return; + } + else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value)) + { + (e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f; + return; + } + + e.DisplayText = e.Item.Text; + e.Cancel = true; + } + + public void Unlock() + { + unlocked = true; + + if (listViewEx.SelectedItems.Count == 1) + { + int ix = listViewEx.SelectedIndices[0]; + listViewEx.Focus(); + listViewEx.Items[ix].Selected = true; + listViewEx.Items[ix].EnsureVisible(); + } + } + + public void OkBtnClicked() + { + } + + public void CancelBtnClicked() + { + } + + public void AddOne() + { + Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection(); + MeterEntity.Corrections.Add(corr); + AddOneLVI(corr); + + listViewEx.Focus(); + listViewEx.SelectedItems.Clear(); + listViewEx.Items[listViewEx.Items.Count - 1].Selected = true; + listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible(); + } + + public void RemoveSelected() + { + if (listViewEx.SelectedItems.Count != 1) return; + + int removeItemNr = listViewEx.SelectedIndices[0]; + + Entities.MeasurementCorrection selected = + (Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag; + if (selected.Id != 0) toBeRemoved.Add(selected); + MeterEntity.Corrections.RemoveAt(removeItemNr); + RefreshAll(); + + if (removeItemNr < listViewEx.Items.Count) + { + listViewEx.Focus(); + listViewEx.Items[removeItemNr].Selected = true; + listViewEx.Items[removeItemNr].EnsureVisible(); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + + public void MoveUpSelected() + { + } + + public void MoveDownSelected() + { + } + + /// + /// Event handler that indicates the selected item position + /// and updates 'Remove', 'Up' and 'Down' buttons in the parent dialog. + /// + private void listViewEx_SelectedIndexChanged(object sender, EventArgs e) + { + if (listViewEx.SelectedItems.Count != 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + else if (listViewEx.Items.Count == 1) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast); + } + else if (listViewEx.SelectedIndices[0] == 0) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.First); + } + else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1)) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Last); + } + else + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.Middle); + } + } + + private void measuredTextBox_TextChanged(object sender, EventArgs e) + { + float measured; + if (float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.CurrentCulture, + out measured) || + float.TryParse(measuredTextBox.Text, + NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, + CultureInfo.InvariantCulture, + out measured)) + { + float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections); + correctedTextBox.Text = corrected.ToString(); + } + } + } +} diff --git a/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.resx b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/MetrologyDlgPressMeterTab.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/TestBenchFramework/UiControls/PathsBenchCtrl.cs b/TestBenchFramework/UiControls/PathsBenchCtrl.cs new file mode 100644 index 000000000..9835f65f5 --- /dev/null +++ b/TestBenchFramework/UiControls/PathsBenchCtrl.cs @@ -0,0 +1,247 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public class PathsBenchCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(PathsBenchCtrl)); + + /// + /// Fixed ListViewEx columns + /// + enum Column + { + Name, + Qfrom, + Qto, + Tin, + Tout, + Pin, + Pout, + FixedColumnsCount, + } + readonly int fixedColumnsCount = (int)Column.FixedColumnsCount; + + PathsDlg parent; + Control parentControl; + Control[] editors; + + public PathsBenchCtrl() + : base() + { + FixedRowsCount = 1; + } + + public void Initialize(PathsDlg parent, Control parentControl) + { + this.parent = parent; + this.parentControl = parentControl; + + /// Load the paths + MyItems = parent.Session + .CreateQuery("FROM BenchPath ORDER BY ItemNr") + .List(); + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + /// ListViewEx columns + Columns.Add(Strings.Name, 60 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_from_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_to_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.T_in, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.T_out, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.P_in, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.P_out, 50 * parent.Dpi / PathsDlg.Dpi100pct); + foreach (var vlv in parent.Valves) Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / PathsDlg.Dpi100pct); + + /// Temperatures, pressures + ComboBox tInCBox = new ComboBox(); + ComboBox tOutCBox = new ComboBox(); + ComboBox prInCBox = new ComboBox(); + ComboBox prOutCBox = new ComboBox(); + foreach (var cmpnt in parent.TbfComponents) + { + if (cmpnt is BenchControl.GenericDevices.ITempMeter) + { + tInCBox.Items.Add(cmpnt.Cfg.Name); + tOutCBox.Items.Add(cmpnt.Cfg.Name); + } + if (cmpnt is BenchControl.GenericDevices.IPressureMeter) + { + prInCBox.Items.Add(cmpnt.Cfg.Name); + prOutCBox.Items.Add(cmpnt.Cfg.Name); + } + } + + editors = new Control[fixedColumnsCount + 64]; + /// + editors[(int)Column.Name] = new TextBox(); /// Name + editors[(int)Column.Qfrom] = new TextBox(); /// Q_from + editors[(int)Column.Qto] = new TextBox(); /// Q_to + editors[(int)Column.Tin] = tInCBox; + editors[(int)Column.Tout] = tOutCBox; + editors[(int)Column.Pin] = prInCBox; + editors[(int)Column.Pout] = prOutCBox; + /// Prepare valve combo-boxes (max. 64 valves) + for (int i = 0; i < 64; i++) + { + ComboBox cb = new ComboBox(); + cb.Items.Add("---"); + cb.Items.Add(Strings.open); + cb.Items.Add(Strings.close); + editors[fixedColumnsCount + i] = cb; + } + /// + for (int i = 0; i < editors.Length; i++) parent.Controls.Add(editors[i]); + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!Unlocked || e.SubItem >= editors.Length) return; + if ((e.Item.Tag is Entities.IHasItemNr) && + ((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) && + (e.SubItem < fixedColumnsCount)) + { + return; + } + StartEditing(editors[e.SubItem], e.Item, e.SubItem); + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + public override void DrawOne(object myItem) + { + Entities.BenchPath entity =(Entities.BenchPath)myItem; + BenchControl.BenchPath path = new BenchControl.BenchPath(entity, parent.TbfComponents); + + ListViewItem lvi = new ListViewItem(entity.Name); + lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.SubItems.Add(path.Qto.ToString()); + lvi.SubItems.Add(path.TempIn != null ? path.TempIn.Cfg.Name : "---"); + lvi.SubItems.Add(path.TempOut != null ? path.TempOut.Cfg.Name : "---"); + lvi.SubItems.Add(path.PressIn != null ? path.PressIn.Cfg.Name : "---"); + lvi.SubItems.Add(path.PressOut != null ? path.PressOut.Cfg.Name : "---"); + + foreach (var valve in parent.Valves) + { + if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) + { + lvi.SubItems.Add(Strings.open); + } + else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) + { + lvi.SubItems.Add(Strings.close); + } + else + { + lvi.SubItems.Add("---"); + } + } + + lvi.Tag = entity; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.BenchPath entity = (Entities.BenchPath)myItem; + + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qfrom].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); + entity.Qto = Qto; + + entity.TempIn = lvi.SubItems[(int)Column.Tin].Text; + entity.TempOut = lvi.SubItems[(int)Column.Tout].Text; + entity.PressIn = lvi.SubItems[(int)Column.Pin].Text; + entity.PressOut = lvi.SubItems[(int)Column.Pout].Text; + + string valvesOpen = string.Empty; + string valvesClose = string.Empty; + for (int j = 0; j < parent.Valves.Count; j++) + { + string text = lvi.SubItems[fixedColumnsCount + j].Text; + if (text.Equals(Strings.open)) + { + if (valvesOpen != string.Empty) valvesOpen += ";"; + valvesOpen += parent.Valves[j].Cfg.Name; + } + if (text.Equals(Strings.close)) + { + if (valvesClose != string.Empty) valvesClose += ";"; + valvesClose += parent.Valves[j].Cfg.Name; + } + } + entity.ValvesOpen = valvesOpen; + entity.ValvesClose = valvesClose; + } + + /// + /// Update the entities and save them to the database + /// + public new void OkBtnClicked() + { + base.OkBtnClicked(); + + foreach (var entity in ToBeRemovedItems) + { + FluentCommon.DeleteFromDb(parent.Session, entity); + } + foreach (var entity in MyItems) + { + FluentCommon.SaveToDb(parent.Session, entity); + } + } + + public void AddOne() + { + Entities.BenchPath entity; + + if (MyItems.Count < FixedRowsCount) + { + entity = new Entities.BenchPath(new BenchControl.BenchPath(Strings._none_, MyItems.Count)); + } + else + { + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_bench_path_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + entity = new Entities.BenchPath(new BenchControl.BenchPath(newName, MyItems.Count)); + } + + base.AddOne(entity); + } + + public new void RemoveSelected() + { + bool lastOneRemoved = base.RemoveSelected(); + if (lastOneRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + } +} diff --git a/TestBenchFramework/UiControls/PathsFeedingCtrl.cs b/TestBenchFramework/UiControls/PathsFeedingCtrl.cs new file mode 100644 index 000000000..e6abdc80d --- /dev/null +++ b/TestBenchFramework/UiControls/PathsFeedingCtrl.cs @@ -0,0 +1,225 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public class PathsFeedingCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(PathsFeedingCtrl)); + + /// + /// Fixed ListViewEx columns + /// + enum Column + { + Name, + Qfrom, + Qto, + Pump, + FixedColumnsCount, + } + readonly int fixedColumnsCount = (int)Column.FixedColumnsCount; + + PathsDlg parent; + Control parentControl; + Control[] editors; + + public PathsFeedingCtrl() + : base() + { + FixedRowsCount = 1; + } + + public void Initialize(PathsDlg parent, Control parentControl) + { + this.parent = parent; + this.parentControl = parentControl; + + /// Load the paths + MyItems = parent.Session + .CreateQuery("FROM FeedingPath ORDER BY ItemNr") + .List(); + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + /// ListViewEx columns + Columns.Add(Strings.Name, 60 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_from_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_to_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Pump, 60 * parent.Dpi / PathsDlg.Dpi100pct); + foreach (var vlv in parent.Valves) Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / PathsDlg.Dpi100pct); + + /// Pump + ComboBox pumpCBox = new ComboBox(); + pumpCBox.Items.Add("---"); + foreach (var cmpnt in parent.TbfComponents) + { + if (cmpnt is IPump) pumpCBox.Items.Add(cmpnt.Cfg.Name); + } + + editors = new Control[fixedColumnsCount + 64]; + /// + editors[(int)Column.Name] = new TextBox(); /// Name + editors[(int)Column.Qfrom] = new TextBox(); /// Q_from + editors[(int)Column.Qto] = new TextBox(); /// Q_to + editors[(int)Column.Pump] = pumpCBox; + /// Prepare valve combo-boxes (max. 64 valves) + for (int i = 0; i < 64; i++) + { + ComboBox cb = new ComboBox(); + cb.Items.Add("---"); + cb.Items.Add(Strings.open); + cb.Items.Add(Strings.close); + editors[fixedColumnsCount + i] = cb; + } + /// + for (int i = 0; i < editors.Length; i++) parent.Controls.Add(editors[i]); + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!Unlocked || e.SubItem >= editors.Length) return; + if ((e.Item.Tag is Entities.IHasItemNr) && + ((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) && + (e.SubItem < fixedColumnsCount)) + { + return; + } + StartEditing(editors[e.SubItem], e.Item, e.SubItem); + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + public override void DrawOne(object myItem) + { + Entities.FeedingPath entity =(Entities.FeedingPath)myItem; + BenchControl.FeedingPath path = new BenchControl.FeedingPath(entity, parent.TbfComponents); + + ListViewItem lvi = new ListViewItem(entity.Name); + lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.SubItems.Add(path.Qto.ToString()); + lvi.SubItems.Add(path.Pump != null ? path.Pump.Cfg.Name : "---"); + + foreach (var valve in parent.Valves) + { + if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) + { + lvi.SubItems.Add(Strings.open); + } + else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) + { + lvi.SubItems.Add(Strings.close); + } + else + { + lvi.SubItems.Add("---"); + } + } + + lvi.Tag = entity; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.FeedingPath entity = (Entities.FeedingPath)myItem; + + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qfrom].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); + entity.Qto = Qto; + + ComboBox pumpCB = editors[(int)Column.Pump] as ComboBox; + if (pumpCB.Items.Contains(lvi.SubItems[(int)Column.Pump].Text)) + { + entity.Pump = lvi.SubItems[(int)Column.Pump].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)Column.Pump].Text; + } + + string valvesOpen = string.Empty; + string valvesClose = string.Empty; + for (int j = 0; j < parent.Valves.Count; j++) + { + string text = lvi.SubItems[fixedColumnsCount + j].Text; + if (text.Equals(Strings.open)) + { + if (valvesOpen != string.Empty) valvesOpen += ";"; + valvesOpen += parent.Valves[j].Cfg.Name; + } + if (text.Equals(Strings.close)) + { + if (valvesClose != string.Empty) valvesClose += ";"; + valvesClose += parent.Valves[j].Cfg.Name; + } + } + entity.ValvesOpen = valvesOpen; + entity.ValvesClose = valvesClose; + } + + /// + /// Update the entities and save them to the database + /// + public new void OkBtnClicked() + { + base.OkBtnClicked(); + + foreach (var entity in ToBeRemovedItems) + { + FluentCommon.DeleteFromDb(parent.Session, entity); + } + foreach (var entity in MyItems) + { + FluentCommon.SaveToDb(parent.Session, entity); + } + } + + public void AddOne() + { + Entities.FeedingPath entity; + + if (MyItems.Count < FixedRowsCount) + { + entity = new Entities.FeedingPath(new BenchControl.FeedingPath(Strings._none_, MyItems.Count)); + } + else + { + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_feeding_path_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + entity = new Entities.FeedingPath(new BenchControl.FeedingPath(newName, MyItems.Count)); + } + + base.AddOne(entity); + } + + public new void RemoveSelected() + { + bool lastOneRemoved = base.RemoveSelected(); + if (lastOneRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + } +} diff --git a/TestBenchFramework/UiControls/PathsMetersCtrl.cs b/TestBenchFramework/UiControls/PathsMetersCtrl.cs new file mode 100644 index 000000000..473e5de18 --- /dev/null +++ b/TestBenchFramework/UiControls/PathsMetersCtrl.cs @@ -0,0 +1,179 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public class PathsMetersCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(PathsMetersCtrl)); + + /// + /// Fixed ListViewEx columns + /// + enum Column + { + Name, + Qfrom, + Qto, + FixedColumnsCount, + } + readonly int fixedColumnsCount = (int)Column.FixedColumnsCount; + + PathsDlg parent; + Control parentControl; + Control[] editors; + + public PathsMetersCtrl() + : base() + { + } + + public void Initialize(PathsDlg parent, Control parentControl) + { + this.parent = parent; + this.parentControl = parentControl; + + /// Load the paths + MyItems = parent.Session + .CreateQuery("FROM MetersPath ORDER BY ItemNr") + .List(); + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + IList readers = new List(); + foreach (var cmpnt in parent.TbfComponents) + { + if (cmpnt is IRegisterReader) readers.Add(cmpnt as IRegisterReader); + } + + /// ListViewEx columns + Columns.Add(Strings.Name, 60 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_from_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_to_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + for (int i = 0; i < Program.WMsCount; i++) Columns.Add(Strings.Sensor_ + (i+1).ToString()); + + /// Editors + editors = new Control[fixedColumnsCount + Program.WMsCount]; + /// + editors[(int)Column.Name] = new TextBox(); /// Name + editors[(int)Column.Qfrom] = new TextBox(); /// Q_from + editors[(int)Column.Qto] = new TextBox(); /// Q_to + /// Prepare valve combo-boxes (max. 64 valves) + for (int i = 0; i < Program.WMsCount; i++) + { + ComboBox cb = new ComboBox(); + foreach (var rr in readers) cb.Items.Add(rr.Cfg.Name); + editors[fixedColumnsCount + i] = cb; + } + /// + for (int i = 0; i < editors.Length; i++) parent.Controls.Add(editors[i]); + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!Unlocked || e.SubItem >= editors.Length) return; + StartEditing(editors[e.SubItem], e.Item, e.SubItem); + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + public override void DrawOne(object myItem) + { + Entities.MetersPath entity =(Entities.MetersPath)myItem; + BenchControl.MetersPath path = new BenchControl.MetersPath(entity, parent.TbfComponents); + + ListViewItem lvi = new ListViewItem(entity.Name); + lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.SubItems.Add(path.Qto.ToString()); + + for (int i = 0; i < Program.WMsCount; i++) + { + if (path.RegisterReaders != null && path.RegisterReaders[i] != null) + { + lvi.SubItems.Add(path.RegisterReaders[i].Cfg.Name); + } + else + { + lvi.SubItems.Add("---"); + } + } + + lvi.Tag = entity; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.MetersPath entity = (Entities.MetersPath)myItem; + + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qfrom].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); + entity.Qto = Qto; + + for (int j = 0; j < Program.WMsCount; j++) + { + entity.SetSensor(j, lvi.SubItems[fixedColumnsCount + j].Text); + } + } + + /// + /// Update the entities and save them to the database + /// + public new void OkBtnClicked() + { + base.OkBtnClicked(); + + foreach (var entity in ToBeRemovedItems) + { + FluentCommon.DeleteFromDb(parent.Session, entity); + } + foreach (var entity in MyItems) + { + FluentCommon.SaveToDb(parent.Session, entity); + } + } + + public void AddOne() + { + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_sensors_path_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + + Entities.MetersPath entity = new Entities.MetersPath(new BenchControl.MetersPath(newName, MyItems.Count)); + + base.AddOne(entity); + } + + public new void RemoveSelected() + { + bool lastOneRemoved = base.RemoveSelected(); + if (lastOneRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + } +} diff --git a/TestBenchFramework/UiControls/PathsOutputCtrl.cs b/TestBenchFramework/UiControls/PathsOutputCtrl.cs new file mode 100644 index 000000000..ec106407d --- /dev/null +++ b/TestBenchFramework/UiControls/PathsOutputCtrl.cs @@ -0,0 +1,255 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public class PathsOutputCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(PathsOutputCtrl)); + + /// + /// Fixed ListViewEx columns + /// + enum Column + { + Name, + Qfrom, + Qto, + RV, + Ref, + Div, + Tdiv, + Scale, + EmptV, + FixedColumnsCount, + } + readonly int fixedColumnsCount = (int)Column.FixedColumnsCount; + + PathsDlg parent; + Control parentControl; + Control[] editors; + + public PathsOutputCtrl() + : base() + { + FixedRowsCount = 1; + } + + public void Initialize(PathsDlg parent, Control parentControl) + { + this.parent = parent; + this.parentControl = parentControl; + + /// Load the paths + MyItems = parent.Session + .CreateQuery("FROM OutputPath ORDER BY ItemNr") + .List(); + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + /// ListViewEx columns + Columns.Add(Strings.Name, 60 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_from_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Q_to_m3h, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Reg_valve, 80 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Reference, 85 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Diverter, 60 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.T_div, 70 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Balance, 50 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.Emptying_valve, 80 * parent.Dpi / PathsDlg.Dpi100pct); + foreach (var vlv in parent.Valves) Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / PathsDlg.Dpi100pct); + + /// Prepare fixed columns combo boxes + ComboBox regulValveComboBox = new ComboBox(); + ComboBox flowMeterComboBox = new ComboBox(); + ComboBox diverterComboBox = new ComboBox(); + ComboBox balanceComboBox = new ComboBox(); + ComboBox tempMeterDivComboBox = new ComboBox(); + ComboBox emptyValveComboBox = new ComboBox(); + foreach (var cmpnt in parent.TbfComponents) + { + if (cmpnt is IRegulValve) regulValveComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IFlowMeter) flowMeterComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IDiverter) diverterComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IBalance) balanceComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is ITempMeter) tempMeterDivComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IValve && (cmpnt as IValve).CoupledTo == null) emptyValveComboBox.Items.Add(cmpnt.Cfg.Name); + } + + editors = new Control[fixedColumnsCount + 64]; + /// + editors[(int)Column.Name] = new TextBox(); /// Name + editors[(int)Column.Qfrom] = new TextBox(); /// Q_from + editors[(int)Column.Qto] = new TextBox(); /// Q_to + editors[(int)Column.RV] = regulValveComboBox; + editors[(int)Column.Ref] = flowMeterComboBox; + editors[(int)Column.Div] = diverterComboBox; + editors[(int)Column.Tdiv] = tempMeterDivComboBox; + editors[(int)Column.Scale] = balanceComboBox; + editors[(int)Column.EmptV] = emptyValveComboBox; + /// Prepare valve combo-boxes (max. 64 valves) + for (int i = 0; i < 64; i++) + { + ComboBox cb = new ComboBox(); + cb.Items.Add("---"); + cb.Items.Add(Strings.open); + cb.Items.Add(Strings.close); + editors[fixedColumnsCount + i] = cb; + } + /// + for (int i = 0; i < editors.Length; i++) parent.Controls.Add(editors[i]); + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!Unlocked || e.SubItem >= editors.Length) return; + if ((e.Item.Tag is Entities.IHasItemNr) && + ((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) && + (e.SubItem < fixedColumnsCount)) + { + return; + } + StartEditing(editors[e.SubItem], e.Item, e.SubItem); + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + public override void DrawOne(object myItem) + { + Entities.OutputPath entity =(Entities.OutputPath)myItem; + BenchControl.OutputPath path = new BenchControl.OutputPath(entity, parent.TbfComponents); + + ListViewItem lvi = new ListViewItem(entity.Name); + lvi.SubItems.Add(path.Qfrom.ToString()); + lvi.SubItems.Add(path.Qto.ToString()); + lvi.SubItems.Add(path.RegulValve != null ? path.RegulValve.Cfg.Name : "---"); + lvi.SubItems.Add(path.FlowMeter != null ? path.FlowMeter.Cfg.Name : "---"); + lvi.SubItems.Add(path.Diverter != null ? path.Diverter.Cfg.Name : "---"); + lvi.SubItems.Add(path.TempDiv != null ? path.TempDiv.Cfg.Name : "---"); + lvi.SubItems.Add(path.Balance != null ? path.Balance.Cfg.Name : "---"); + lvi.SubItems.Add(path.EmptyTankValve != null ? path.EmptyTankValve.Cfg.Name : "---"); + + foreach (var valve in parent.Valves) + { + if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) + { + lvi.SubItems.Add(Strings.open); + } + else if (path.ValvesClose != null && path.ValvesClose.Contains(valve)) + { + lvi.SubItems.Add(Strings.close); + } + else + { + lvi.SubItems.Add("---"); + } + } + + lvi.Tag = entity; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.OutputPath entity = (Entities.OutputPath)myItem; + + entity.Name = lvi.Text; + + float Qfrom; + bool allOk = Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qfrom].Text, out Qfrom); + entity.Qfrom = Qfrom; + + float Qto; + allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); + entity.Qto = Qto; + + entity.RegulValve = lvi.SubItems[(int)Column.RV].Text; + entity.FlowMeter = lvi.SubItems[(int)Column.Ref].Text; + entity.Diverter = lvi.SubItems[(int)Column.Div].Text; + entity.TempDiv = lvi.SubItems[(int)Column.Tdiv].Text; + entity.Balance = lvi.SubItems[(int)Column.Scale].Text; + entity.EmptyTankValve = lvi.SubItems[(int)Column.EmptV].Text; + + string valvesOpen = string.Empty; + string valvesClose = string.Empty; + for (int j = 0; j < parent.Valves.Count; j++) + { + string text = lvi.SubItems[fixedColumnsCount + j].Text; + if (text.Equals(Strings.open)) + { + if (valvesOpen != string.Empty) valvesOpen += ";"; + valvesOpen += parent.Valves[j].Cfg.Name; + } + if (text.Equals(Strings.close)) + { + if (valvesClose != string.Empty) valvesClose += ";"; + valvesClose += parent.Valves[j].Cfg.Name; + } + } + entity.ValvesOpen = valvesOpen; + entity.ValvesClose = valvesClose; + } + + /// + /// Update the entities and save them to the database + /// + public new void OkBtnClicked() + { + base.OkBtnClicked(); + + foreach (var entity in ToBeRemovedItems) + { + FluentCommon.DeleteFromDb(parent.Session, entity); + } + foreach (var entity in MyItems) + { + FluentCommon.SaveToDb(parent.Session, entity); + } + } + + public void AddOne() + { + Entities.OutputPath entity; + + if (MyItems.Count < FixedRowsCount) + { + entity = new Entities.OutputPath(new BenchControl.OutputPath(Strings._none_, MyItems.Count)); + } + else + { + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_output_path_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + entity = new Entities.OutputPath(new BenchControl.OutputPath(newName, MyItems.Count)); + } + + base.AddOne(entity); + } + + public new void RemoveSelected() + { + bool lastOneRemoved = base.RemoveSelected(); + if (lastOneRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + } +} diff --git a/TestBenchFramework/UiControls/ProcedureParamsCtrl.Designer.cs b/TestBenchFramework/UiControls/ProcedureParamsCtrl.Designer.cs new file mode 100644 index 000000000..ce8d54906 --- /dev/null +++ b/TestBenchFramework/UiControls/ProcedureParamsCtrl.Designer.cs @@ -0,0 +1,62 @@ +namespace TBF.UiControls +{ + partial class ProcedureParamsCtrl + { + /// + /// 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() + { + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.SuspendLayout(); + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(150, 150); + this.listViewEx.TabIndex = 1; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + // + // ProcedureParams + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listViewEx); + this.Name = "ProcedureParams"; + this.ResumeLayout(false); + + } + + #endregion + + private ListViewEx listViewEx; + } +} diff --git a/TestBenchFramework/UiControls/ProcedureParamsCtrl.cs b/TestBenchFramework/UiControls/ProcedureParamsCtrl.cs new file mode 100644 index 000000000..538e49a2b --- /dev/null +++ b/TestBenchFramework/UiControls/ProcedureParamsCtrl.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.UiControls +{ + /// /---------------\ + /// / Path or other \ + /// |------------------------------ + /// | param1 param2 param3 ... + /// Component1 | + /// Component2 | + /// ... | + /// + public partial class ProcedureParamsCtrl : UserControl + { + ProcedureDlg parent; + bool showSensorsColumn; + int nrFixedColumns; + IList selectedCmpnts; + IList cmpntsParams; + + int paramsCount; + Control[] editors; + bool unlocked; + public void Unlock(){ unlocked = true; } + + public ProcedureParamsCtrl() + { + InitializeComponent(); + cmpntsParams = new List(); + } + + public ProcedureParamsCtrl(ProcedureDlg parent, IList selectedCmpnts, bool showSensorsColumn) + : this() + { + this.parent = parent; + this.selectedCmpnts = selectedCmpnts; + this.showSensorsColumn = showSensorsColumn; + nrFixedColumns = (showSensorsColumn ? 2 : 1); + unlocked = false; + + this.SuspendLayout(); + Dock = System.Windows.Forms.DockStyle.Fill; + listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + listViewEx.AllowColumnReorder = false; + listViewEx.DoubleClickActivation = false; + listViewEx.FullRowSelect = true; + listViewEx.GridLines = true; + listViewEx.Location = new System.Drawing.Point(0, 0); + listViewEx.TabIndex = 0; + listViewEx.UseCompatibleStateImageBehavior = false; + listViewEx.View = System.Windows.Forms.View.Details; + ResumeLayout(false); + } + + public void Initialize() + { + if (selectedCmpnts == null) return; + + IParamsProvider sampleToCreateHeader = null; + + foreach (var cmpnt in selectedCmpnts) + { + if (cmpnt != null && cmpnt.Cfg.Factory.HasProcedureParams) + { + IParamsProvider procedureParams = BenchControl.TbfComponents.GetProcedureParams(cmpnt, parent.LoadedProcedure); + if (procedureParams != null) + { + if (sampleToCreateHeader == null) sampleToCreateHeader = procedureParams; + } + else + { + Entities.ComponentProcedure entity = new Entities.ComponentProcedure(); + entity.CmpntName = cmpnt.Cfg.Name; + entity.Procedure = parent.LoadedProcedure; + procedureParams = cmpnt.Cfg.Factory.GetProcedureParams(entity); + } + cmpntsParams.Add(procedureParams); + } + else + { + cmpntsParams.Add(null); + } + } + + if (sampleToCreateHeader != null) + { + if (showSensorsColumn) listViewEx.Columns.Add(Strings.Sensor_, 60); + listViewEx.Columns.Add(Strings.Component, 80); + + paramsCount = sampleToCreateHeader.ParamsCount(); + editors = new Control[paramsCount]; + for (int i = 0; i < paramsCount; i++) + { + listViewEx.Columns.Add(sampleToCreateHeader.ParamName(i), 80); + editors[i] = new TextBox(); + this.Controls.Add(editors[i]); + } + } + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + RedrawAll(); + } + + private void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!unlocked || e.Item.Tag == null || e.SubItem < nrFixedColumns || e.SubItem >= nrFixedColumns + editors.Length) return; + listViewEx.StartEditing(editors[e.SubItem - nrFixedColumns], e.Item, e.SubItem); + } + + private void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + string message; + if ((e.Item.Tag as IParamsProvider).ValidateParam(e.SubItem - nrFixedColumns, e.DisplayText, out message)) + { + (e.Item.Tag as IParamsProvider).UpdateParam(e.SubItem - nrFixedColumns, e.DisplayText); + } + } + + + public void RedrawAll() + { + listViewEx.Items.Clear(); + foreach (var item in cmpntsParams) DrawOne(item); + } + + void DrawOne(IParamsProvider item) + { + if (item == null) + { + listViewEx.Items.Add(new ListViewItem()); + return; + } + + ListViewItem lvi; + if (showSensorsColumn) + { + lvi = new ListViewItem((listViewEx.Items.Count + 1).ToString()); + lvi.SubItems.Add(selectedCmpnts[listViewEx.Items.Count].Cfg.Name); + } + else + { + lvi = new ListViewItem(selectedCmpnts[listViewEx.Items.Count].Cfg.Name); + } + for (int i = 0; i < paramsCount; i++) lvi.SubItems.Add(item.ToString(i)); + lvi.Tag = item; + listViewEx.Items.Add(lvi); + } + + public void UpdateAll() + { + if (!unlocked) return; + + foreach (ListViewItem lvi in listViewEx.Items) + { + if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateDbEntity(); + } + } + } +} diff --git a/TestBenchFramework/UiControls/ProcedureParamsCtrl.resx b/TestBenchFramework/UiControls/ProcedureParamsCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/ProcedureParamsCtrl.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/TestBenchFramework/UiControls/ProceduresCtrl.cs b/TestBenchFramework/UiControls/ProceduresCtrl.cs new file mode 100644 index 000000000..d6ec05f55 --- /dev/null +++ b/TestBenchFramework/UiControls/ProceduresCtrl.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Forms; +using NHibernate; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public class ProceduresCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(ProceduresCtrl)); + + /// + /// ListViewEx columns + /// + enum Column + { + Name, + Description, + ColumnsCount, + } + readonly int columnsCount = (int)Column.ColumnsCount; + + ProceduresDlg parent; + Control parentControl; + Control[] editors; + + ISession session; + + public ProceduresCtrl() + : base() + { + Name = "ProceduresCtrl"; + } + + public void Initialize(ProceduresDlg parent, Control parentControl) + { + this.parent = parent; + this.parentControl = parentControl; + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + /// ListViewEx columns + Columns.Add(Strings.Name, 100 * parent.Dpi / PathsDlg.Dpi100pct); + Columns.Add(Strings.DescriptionColHdr, 300 * parent.Dpi / PathsDlg.Dpi100pct); + + editors = new Control[columnsCount]; + /// + editors[(int)Column.Name] = new TextBox(); /// Name + editors[(int)Column.Description] = new TextBox(); /// Description + /// + for (int i = 0; i < editors.Length; i++) parent.Controls.Add(editors[i]); + + ReloadAndRedrawAll(); + } + + void ReloadAndRedrawAll() + { + /// Load the procedures + session = FluentCommon.CreateSession(Database.Procedures); + MyItems = session.CreateQuery("FROM Procedure ORDER BY ItemNr") + .List(); + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + } + + public override void DrawOne(object myItem) + { + Entities.Procedure entity = (Entities.Procedure)myItem; + + ListViewItem lvi = new ListViewItem(entity.Name); + lvi.SubItems.Add(entity.Description); + lvi.Tag = entity; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.Procedure entity = (Entities.Procedure)myItem; + entity.Name = lvi.Text; + entity.Description = lvi.SubItems[(int)Column.Description].Text; + } + + /// + /// Update the entities and save them to the database + /// + public new void OkBtnClicked() + { + base.OkBtnClicked(); + + foreach (var entity in ToBeRemovedItems) + { + FluentCommon.DeleteFromDb(session, entity); + } + foreach (var entity in MyItems) + { + FluentCommon.SaveToDb(session, entity); + } + + Program.MainWnd.ReloadProcedures(); + } + + public void AddOne() + { + /// Find an unused test name + string newName; + for (int nameId = 1; true; nameId++) + { + newName = Strings.New_procedure_name + nameId.ToString(); + bool notUsed = true; + foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false; + if (notUsed) break; + } + + base.AddOne(new Entities.Procedure(newName, MyItems.Count)); + } + + public new void RemoveSelected() + { + bool lastOneRemoved = base.RemoveSelected(); + if (lastOneRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + + public void editButton_Click(object sender, EventArgs e) + { + if (SelectedItems.Count != 1) return; + int dbId = (SelectedItems[0].Tag as Entities.Procedure).Id; + + if (dbId == 0) + { + session.SaveOrUpdate(SelectedItems[0].Tag as Entities.Procedure); + } + + dbId = (SelectedItems[0].Tag as Entities.Procedure).Id; + + /// + /// Entities.Procedure has to be loaded in a different session otherwise + /// the database would be updated in case the dialog was closed with 'Cancel' button. + /// + using (ISession editSession = FluentCommon.CreateSession(Database.Procedures)) + { + IList procedure = editSession + .CreateQuery("FROM Procedure WHERE Id = :id") + .SetParameter("id", dbId) + .List(); + if (procedure.Count != 1) return; + + ProcedureDlg dlg = new ProcedureDlg(procedure[0]); + if (dlg.ShowDialog() == DialogResult.OK) + { + parent.Unlock(); + using (var transaction = editSession.BeginTransaction()) + { + editSession.SaveOrUpdate(procedure[0]); + transaction.Commit(); + } + + } + } + + ReloadAndRedrawAll(); + } + + public void copyButton_Click(object sender, EventArgs e) + { + if (SelectedItems.Count != 1) return; + + Entities.Procedure selectedProcedure = (Entities.Procedure)SelectedItems[0].Tag; + + /// Make a copy of the selected procedure + Entities.Procedure newProcedure = selectedProcedure.Clone(); + newProcedure.Name = selectedProcedure.Name + Strings.New_name_copy; + newProcedure.CreationUser = Entities.User.CurrentUser.Name; + newProcedure.CreationTime = DateTime.Now; + + if ((new ProcedureDlg(newProcedure)).ShowDialog() == DialogResult.OK) + { + using (var transaction = session.BeginTransaction()) + { + session.SaveOrUpdate(newProcedure); + transaction.Commit(); + } + base.AddOne(newProcedure); + } + } + } +} diff --git a/TestBenchFramework/UiControls/SharedButtons.Designer.cs b/TestBenchFramework/UiControls/SharedButtons.Designer.cs new file mode 100644 index 000000000..c2f28abed --- /dev/null +++ b/TestBenchFramework/UiControls/SharedButtons.Designer.cs @@ -0,0 +1,215 @@ +namespace TBF.UiControls +{ + partial class SharedButtons + { + /// + /// 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() + { + this.removeButton = new System.Windows.Forms.Button(); + this.addButton = new System.Windows.Forms.Button(); + this.unlockButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.upButton = new System.Windows.Forms.Button(); + this.downButton = new System.Windows.Forms.Button(); + this.editButton = new System.Windows.Forms.Button(); + this.copyButton = new System.Windows.Forms.Button(); + this.newTabButton = new System.Windows.Forms.Button(); + this.renameTabButton = new System.Windows.Forms.Button(); + this.removeTabButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // removeButton + // + this.removeButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.removeButton.Location = new System.Drawing.Point(10, 179); + this.removeButton.Name = "removeButton"; + this.removeButton.Size = new System.Drawing.Size(80, 40); + this.removeButton.TabIndex = 4; + this.removeButton.Text = " Remove"; + this.removeButton.UseVisualStyleBackColor = true; + this.removeButton.Click += new System.EventHandler(this.removeBtn_Click); + // + // addButton + // + this.addButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.addButton.Location = new System.Drawing.Point(10, 136); + this.addButton.Name = "addButton"; + this.addButton.Size = new System.Drawing.Size(80, 40); + this.addButton.TabIndex = 3; + this.addButton.Text = " Add"; + this.addButton.UseVisualStyleBackColor = true; + this.addButton.Click += new System.EventHandler(this.addBtn_Click); + // + // unlockButton + // + this.unlockButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.unlockButton.Location = new System.Drawing.Point(10, 7); + this.unlockButton.Name = "unlockButton"; + this.unlockButton.Size = new System.Drawing.Size(80, 40); + this.unlockButton.TabIndex = 0; + this.unlockButton.Text = "Unlock"; + this.unlockButton.UseVisualStyleBackColor = true; + this.unlockButton.Click += new System.EventHandler(this.unlockBtn_Click); + // + // cancelButton + // + this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.cancelButton.Location = new System.Drawing.Point(10, 93); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(80, 40); + this.cancelButton.TabIndex = 2; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelBtn_Click); + // + // okButton + // + this.okButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.okButton.Location = new System.Drawing.Point(10, 50); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(80, 40); + this.okButton.TabIndex = 1; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okBtn_Click); + // + // upButton + // + this.upButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.upButton.Location = new System.Drawing.Point(10, 222); + this.upButton.Name = "upButton"; + this.upButton.Size = new System.Drawing.Size(80, 40); + this.upButton.TabIndex = 5; + this.upButton.Text = " Up"; + this.upButton.UseVisualStyleBackColor = true; + this.upButton.Click += new System.EventHandler(this.upBtn_Click); + // + // downButton + // + this.downButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.downButton.Location = new System.Drawing.Point(10, 265); + this.downButton.Name = "downButton"; + this.downButton.Size = new System.Drawing.Size(80, 40); + this.downButton.TabIndex = 6; + this.downButton.Text = " Down"; + this.downButton.UseVisualStyleBackColor = true; + this.downButton.Click += new System.EventHandler(this.downBtn_Click); + // + // editButton + // + this.editButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.editButton.Location = new System.Drawing.Point(10, 308); + this.editButton.Name = "editButton"; + this.editButton.Size = new System.Drawing.Size(80, 40); + this.editButton.TabIndex = 7; + this.editButton.Text = " Edit"; + this.editButton.UseVisualStyleBackColor = true; + this.editButton.Click += new System.EventHandler(this.editBtn_Click); + // + // copyButton + // + this.copyButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.copyButton.Location = new System.Drawing.Point(10, 351); + this.copyButton.Name = "copyButton"; + this.copyButton.Size = new System.Drawing.Size(80, 40); + this.copyButton.TabIndex = 8; + this.copyButton.Text = " Copy"; + this.copyButton.UseVisualStyleBackColor = true; + this.copyButton.Click += new System.EventHandler(this.copyBtn_Click); + // + // newTabButton + // + this.newTabButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.newTabButton.Location = new System.Drawing.Point(10, 394); + this.newTabButton.Name = "newTabButton"; + this.newTabButton.Size = new System.Drawing.Size(80, 40); + this.newTabButton.TabIndex = 9; + this.newTabButton.Text = "New Tab"; + this.newTabButton.UseVisualStyleBackColor = true; + this.newTabButton.Click += new System.EventHandler(this.newTabButton_Click); + // + // renameTabButton + // + this.renameTabButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.renameTabButton.Location = new System.Drawing.Point(10, 437); + this.renameTabButton.Name = "renameTabButton"; + this.renameTabButton.Size = new System.Drawing.Size(80, 40); + this.renameTabButton.TabIndex = 10; + this.renameTabButton.Text = "Rename Tab"; + this.renameTabButton.UseVisualStyleBackColor = true; + this.renameTabButton.Click += new System.EventHandler(this.renameTabButton_Click); + // + // removeTabButton + // + this.removeTabButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.removeTabButton.Location = new System.Drawing.Point(10, 480); + this.removeTabButton.Name = "removeTabButton"; + this.removeTabButton.Size = new System.Drawing.Size(80, 40); + this.removeTabButton.TabIndex = 11; + this.removeTabButton.Text = "Remove Tab"; + this.removeTabButton.UseVisualStyleBackColor = true; + this.removeTabButton.Click += new System.EventHandler(this.removeTabButton_Click); + // + // SharedButtons + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.removeTabButton); + this.Controls.Add(this.renameTabButton); + this.Controls.Add(this.newTabButton); + this.Controls.Add(this.copyButton); + this.Controls.Add(this.editButton); + this.Controls.Add(this.downButton); + this.Controls.Add(this.upButton); + this.Controls.Add(this.removeButton); + this.Controls.Add(this.addButton); + this.Controls.Add(this.unlockButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Name = "SharedButtons"; + this.Size = new System.Drawing.Size(100, 649); + this.Load += new System.EventHandler(this.SharedDlgButtons_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button removeButton; + private System.Windows.Forms.Button addButton; + private System.Windows.Forms.Button unlockButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button upButton; + private System.Windows.Forms.Button downButton; + private System.Windows.Forms.Button editButton; + private System.Windows.Forms.Button copyButton; + private System.Windows.Forms.Button newTabButton; + private System.Windows.Forms.Button renameTabButton; + private System.Windows.Forms.Button removeTabButton; + } +} diff --git a/TestBenchFramework/UiControls/SharedButtons.cs b/TestBenchFramework/UiControls/SharedButtons.cs new file mode 100644 index 000000000..b49280ad4 --- /dev/null +++ b/TestBenchFramework/UiControls/SharedButtons.cs @@ -0,0 +1,251 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.UiControls +{ + public partial class SharedButtons : UserControl + { + /// + /// Masks to specify the enabled state and the visibility of buttons. + /// Unlock button is hard coded in this control, cannot be set from the parent. + /// + public enum Buttons + { + None = 0, + OK = 1, /// always visible, text = 'Close' when locked + Cancel = 2, /// always visible + Add = 4, /// optional + Remove = 8, /// optional + Up = 16, /// optional + Down = 32, /// optional + Edit = 64, /// optional + Copy = 128, /// optional + NewTab = 256, /// optional + RenameTab = 512, /// optional + RemoveTab = 1024, /// optional + } + + /// + /// Optional buttons are Add, Remove, Up, Down, Edit and Copy. + /// OK and Cancel buttons are always visible (after unlock), but not always enabled. + /// + public Buttons OptionalButtons; + + public enum LockState + { + Locked, /// 'Unlock', 'Close' (=OK) are shown, all the othere are hidden + Unlocked, /// Unlock, Ok, Cancel, Add,Remove and all optional buttons are shown + } + LockState lockState; + + /// + /// Used by controls to indicate which item is selected + /// and to appropriately update Remove, Up and Down Buttons. + /// + public enum SelectedItemPos + { + None, + First, + Last, + FirstAndLast, + Middle, + } + + public Grp.GID RequiredGroupMembership; + + Entities.User originalUser; + + /// + /// Default constructor + /// + public SharedButtons() + { + originalUser = Entities.User.CurrentUser; + lockState = LockState.Locked; + OptionalButtons = Buttons.None; + RequiredGroupMembership = Grp.GID.None; + InitializeComponent(); + } + + /// + /// Initialize the buttons when the dialog is loaded + /// + /// + /// + private void SharedDlgButtons_Load(object sender, EventArgs e) + { + unlockButton.Text = Strings.UnlockBtnText; + okButton.Text = Strings.CloseBtnText; + cancelButton.Text = Strings.CancelBtnText; + addButton.Text = Strings.AddBtnText; + removeButton.Text = Strings.RemoveBtnText; + upButton.Text = Strings.UpBtnText; + downButton.Text = Strings.DownBtnText; + editButton.Text = Strings.EditBtnText; + copyButton.Text = Strings.CopyBtnText; + newTabButton.Text = Strings.NewTabBtnText; + renameTabButton.Text = Strings.RenameTabBtnText; + removeTabButton.Text = Strings.RemoveTabBtnText; + + cancelButton.Hide(); + addButton.Hide(); + removeButton.Hide(); + upButton.Hide(); + downButton.Hide(); + editButton.Hide(); + copyButton.Hide(); + newTabButton.Hide(); + renameTabButton.Hide(); + removeTabButton.Hide(); + + /// Reposition 'Edit' and 'Copy" buttons in case both 'Up' and 'Down' are hidden + if (((OptionalButtons & Buttons.Up) == 0) && + ((OptionalButtons & Buttons.Down) == 0)) + { + editButton.Top = upButton.Top; + copyButton.Top = downButton.Top; + } + + /// Reposition Tab-related button in case both 'Edit' and 'Copy" are hidden + if (((OptionalButtons & Buttons.Edit) == 0) && + ((OptionalButtons & Buttons.Copy) == 0)) + { + removeTabButton.Top = newTabButton.Top + 15; + newTabButton.Top = editButton.Top + 15; + renameTabButton.Top = copyButton.Top + 15; + } + +#if DEBUG + //unlockBtn_Click(sender, e); +#endif + } + + /// + /// Update the visibility of buttons and OK button text when the dialog is unlocked + /// + public void UnlockButtons() + { + unlockButton.Enabled = false; + okButton.Text = Strings.OkBtnText; + cancelButton.Show(); + if ((OptionalButtons & Buttons.Add) != 0) addButton.Show(); + if ((OptionalButtons & Buttons.Remove) != 0) removeButton.Show(); + if ((OptionalButtons & Buttons.Up) != 0) upButton.Show(); + if ((OptionalButtons & Buttons.Down) != 0) downButton.Show(); + if ((OptionalButtons & Buttons.Edit) != 0) editButton.Show(); + if ((OptionalButtons & Buttons.Copy) != 0) copyButton.Show(); + if ((OptionalButtons & Buttons.NewTab) != 0) newTabButton.Show(); + if ((OptionalButtons & Buttons.RenameTab) != 0) renameTabButton.Show(); + if ((OptionalButtons & Buttons.RemoveTab) != 0) removeTabButton.Show(); + + lockState = LockState.Unlocked; + } + + /// + /// Enable specified buttons + /// + public void EnableButtons(Buttons buttons) + { + SetEnabled(buttons, true); + } + + /// + /// Disable specified buttons + /// + public void DisableButtons(Buttons buttons) + { + SetEnabled(buttons, false); + } + + public void SetEnabled(Buttons buttons, bool value) + { + if ((buttons & Buttons.OK) != 0) okButton.Enabled = value; + if ((buttons & Buttons.Cancel) != 0) cancelButton.Enabled = value; + if ((buttons & Buttons.Add) != 0) addButton.Enabled = value; + if ((buttons & Buttons.Remove) != 0) removeButton.Enabled = value; + if ((buttons & Buttons.Up) != 0) upButton.Enabled = value; + if ((buttons & Buttons.Down) != 0) downButton.Enabled = value; + if ((buttons & Buttons.Edit) != 0) editButton.Enabled = value; + if ((buttons & Buttons.Copy) != 0) copyButton.Enabled = value; + if ((buttons & Buttons.NewTab) != 0) newTabButton.Enabled = value; + if ((buttons & Buttons.RenameTab) != 0) renameTabButton.Enabled = value; + if ((buttons & Buttons.RemoveTab) != 0) removeTabButton.Enabled = value; + } + + void RestoreUser() + { + Entities.User.CurrentUser = originalUser; + Program.MainWnd.UpdateUser(); + } + + /// + /// Events invoked when buttons are clicked (and in case of Unlock kbutton also accepted) + /// + public event EventHandler Unlocked; + public event EventHandler OKClicked; + public event EventHandler CancelClicked; + public event EventHandler AddClicked; + public event EventHandler RemoveClicked; + public event EventHandler UpClicked; + public event EventHandler DownClicked; + public event EventHandler EditClicked; + public event EventHandler CopyClicked; + public event EventHandler NewTabClicked; + public event EventHandler RenameTabClicked; + public event EventHandler RemoveTabClicked; + + /// + /// 'Unlock' button handler + /// + /// + /// + private void unlockBtn_Click(object sender, EventArgs e) + { + if (lockState == LockState.Locked) + { + if (!Entities.User.CurrentUser.IsMemberOf(RequiredGroupMembership)) + { + if ((new LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return; + } + else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking) + { + if ((new LoginDlg(Entities.User.CurrentUser.Name, RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return; + } + + UnlockButtons(); + + if (Unlocked != null) Unlocked(sender, e); + } + } + + /// + /// 'OK'/'Close' button handler. Handled as 'Cancel' in the locked state ('Close' button). + /// + private void okBtn_Click(object sender, EventArgs e) + { + if (lockState == LockState.Locked) + { + if (CancelClicked != null) CancelClicked(sender, e); + } + else + { + if (OKClicked != null) OKClicked(sender, e); + } + } + + /// + /// All remaining handlers: + /// + private void cancelBtn_Click(object s, EventArgs e) { if (CancelClicked != null) CancelClicked(s, e); } + private void addBtn_Click(object s, EventArgs e) { if (AddClicked != null) AddClicked(s, e); } + private void removeBtn_Click(object s, EventArgs e) { if (RemoveClicked != null) RemoveClicked(s, e); } + private void upBtn_Click(object s, EventArgs e) { if (UpClicked != null) UpClicked(s, e); } + private void downBtn_Click(object s, EventArgs e) { if (DownClicked != null) DownClicked(s, e); } + private void editBtn_Click(object s, EventArgs e) { if (EditClicked != null) EditClicked(s, e); } + private void copyBtn_Click(object s, EventArgs e) { if (CopyClicked != null) CopyClicked(s, e); } + private void newTabButton_Click(object s, EventArgs e) { if (NewTabClicked != null) NewTabClicked(s, e); } + private void renameTabButton_Click(object s, EventArgs e) { if (RenameTabClicked != null) RenameTabClicked(s, e); } + private void removeTabButton_Click(object s, EventArgs e) { if (RemoveTabClicked != null) RemoveTabClicked(s, e); } + } +} diff --git a/TestBenchFramework/UiControls/SharedButtons.resx b/TestBenchFramework/UiControls/SharedButtons.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/SharedButtons.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/TestBenchFramework/UiControls/TestParamsCtrl.Designer.cs b/TestBenchFramework/UiControls/TestParamsCtrl.Designer.cs new file mode 100644 index 000000000..6d91a66c0 --- /dev/null +++ b/TestBenchFramework/UiControls/TestParamsCtrl.Designer.cs @@ -0,0 +1,62 @@ +namespace TBF.UiControls +{ + partial class TestParamsCtrl + { + /// + /// 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() + { + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.SuspendLayout(); + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(150, 150); + this.listViewEx.TabIndex = 0; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + // + // TestParamsCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listViewEx); + this.Name = "TestParamsCtrl"; + this.ResumeLayout(false); + + } + + #endregion + + private ListViewEx listViewEx; + } +} diff --git a/TestBenchFramework/UiControls/TestParamsCtrl.cs b/TestBenchFramework/UiControls/TestParamsCtrl.cs new file mode 100644 index 000000000..76beb53d2 --- /dev/null +++ b/TestBenchFramework/UiControls/TestParamsCtrl.cs @@ -0,0 +1,193 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.UiControls +{ + // /-----------\ + // / Component \ + // |------------------------------ + // | param1 param2 param3 ... + // Test1 | + // Test2 | + // ... | + // + public partial class TestParamsCtrl : UserControl + { + ProcedureDlg parent; + bool showTestsColumn; + BenchControl.Generic.IComponent cmpnt; + + IList testsParams; + + int paramsCount; + + Control[] editors; + + bool unlocked; + public void Unlock(){ unlocked = true; } + + public TestParamsCtrl() + { + InitializeComponent(); + testsParams = new List(); + } + + public TestParamsCtrl(ProcedureDlg parent, BenchControl.Generic.IComponent cmpnt, bool showTestsColumn) + : this() + { + this.parent = parent; + this.showTestsColumn = showTestsColumn; + this.cmpnt = cmpnt; + unlocked = false; + + this.SuspendLayout(); + Dock = System.Windows.Forms.DockStyle.Fill; + listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + listViewEx.AllowColumnReorder = false; + listViewEx.DoubleClickActivation = false; + listViewEx.FullRowSelect = true; + listViewEx.GridLines = true; + listViewEx.Location = new System.Drawing.Point(0, 0); + listViewEx.TabIndex = 0; + listViewEx.UseCompatibleStateImageBehavior = false; + listViewEx.View = System.Windows.Forms.View.Details; + ResumeLayout(false); + } + + public void Initialize() + { + IParamsProvider sampleToCreateHeader = null; + + /// For each test (with an appropriate method in case of ITestMethod-s) + foreach (var test in parent.LoadedProcedure.Tests) + { + if (!(cmpnt is BenchControl.GenericDevices.ITestMethod) || test.Method == cmpnt.Cfg.Name) + { + /// Load ComponentTest entity or create it if it does not exist + IParamsProvider testParams = BenchControl.TbfComponents.GetTestParams(cmpnt, test); + if (testParams != null) + { + if (sampleToCreateHeader == null) sampleToCreateHeader = testParams; + } + else + { + Entities.ComponentTest entity = new Entities.ComponentTest(); + entity.CmpntName = cmpnt.Cfg.Name; + entity.Test = test; + testParams = cmpnt.Cfg.Factory.GetTestParams(entity); + } + testsParams.Add(testParams); + } + else + { + /// In case of ITestMethod: Insert null for a test without an appropriate method. + testsParams.Add(null); + } + } + + /// Create the header + if (sampleToCreateHeader != null) + { + if (showTestsColumn) listViewEx.Columns.Add(Strings.Test, 70); + + paramsCount = sampleToCreateHeader.ParamsCount(); + editors = new Control[paramsCount]; + for (int i = 0; i < paramsCount; i++) + { + listViewEx.Columns.Add(sampleToCreateHeader.ParamName(i), 90); + editors[i] = new TextBox(); + this.Controls.Add(editors[i]); + } + } + + listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + RedrawAll(); + } + + private void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + int itemNr = showTestsColumn ? (e.SubItem - 1) : e.SubItem; + + if (!unlocked || e.Item.Tag == null || itemNr >= editors.Length || itemNr < 0) return; + listViewEx.StartEditing(editors[itemNr], e.Item, e.SubItem); + } + + private void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + string message; + int itemNr = showTestsColumn ? (e.SubItem - 1) : e.SubItem; + + if ((e.Item.Tag as IParamsProvider).ValidateParam(itemNr, e.DisplayText, out message)) + { + (e.Item.Tag as IParamsProvider).UpdateParam(itemNr, e.DisplayText); + } + } + + public void RedrawAll() + { + listViewEx.Items.Clear(); + for (int i = 0; i < testsParams.Count && i < parent.LoadedProcedure.Tests.Count; i++) + { + DrawOne(testsParams[i], parent.LoadedProcedure.Tests[i].Name); + } + } + + void DrawOne(IParamsProvider item, string testName) + { + if (item == null) + { + listViewEx.Items.Add(new ListViewItem()); + return; + } + + ListViewItem lvi; + if (showTestsColumn) + { + lvi = new ListViewItem(testName); + lvi.SubItems.Add(item.ToString(0)); + } + else + { + lvi = new ListViewItem(item.ToString(0)); + } + for (int i = 1; i < paramsCount; i++) lvi.SubItems.Add(item.ToString(i)); + + lvi.Tag = item; + listViewEx.Items.Add(lvi); + } + + public void AddOne(Entities.Test test) + { + if (test.Method == cmpnt.Cfg.Name) + { + Entities.ComponentTest entity = new Entities.ComponentTest(); + entity.CmpntName = test.Method; + entity.Test = test; + IParamsProvider testParams = + new BenchControl.TestMethods.CombinedWithDetection.CombinedWithDetTestParams(entity, cmpnt.Cfg.Name, test); + testsParams.Add(testParams); + DrawOne(testParams, test.Name); + } + else + { + testsParams.Add(null); + DrawOne(null, null); + } + } + + public void UpdateAll() + { + if (!unlocked) return; + + foreach (ListViewItem lvi in listViewEx.Items) + { + if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateDbEntity(); + } + } + } +} diff --git a/TestBenchFramework/UiControls/TestParamsCtrl.resx b/TestBenchFramework/UiControls/TestParamsCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/TestParamsCtrl.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/TestBenchFramework/UiControls/TestProgressCtrl.Designer.cs b/TestBenchFramework/UiControls/TestProgressCtrl.Designer.cs new file mode 100644 index 000000000..c7a90353c --- /dev/null +++ b/TestBenchFramework/UiControls/TestProgressCtrl.Designer.cs @@ -0,0 +1,73 @@ +namespace TBF.UiControls +{ + partial class TestProgressCtrl + { + /// + /// 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() + { + this.testNameLabel = new System.Windows.Forms.Label(); + this.testProgressBar = new System.Windows.Forms.ProgressBar(); + this.SuspendLayout(); + // + // testNameLabel + // + this.testNameLabel.AutoSize = true; + this.testNameLabel.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.testNameLabel.Location = new System.Drawing.Point(3, 5); + this.testNameLabel.Name = "testNameLabel"; + this.testNameLabel.Size = new System.Drawing.Size(51, 18); + this.testNameLabel.TabIndex = 0; + this.testNameLabel.Text = "label1"; + this.testNameLabel.Click += new System.EventHandler(this.TestProgressCtrl_Click); + // + // testProgressBar + // + this.testProgressBar.Location = new System.Drawing.Point(105, 2); + this.testProgressBar.Name = "testProgressBar"; + this.testProgressBar.Size = new System.Drawing.Size(100, 25); + this.testProgressBar.TabIndex = 1; + this.testProgressBar.Click += new System.EventHandler(this.TestProgressCtrl_Click); + // + // TestProgressCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.testProgressBar); + this.Controls.Add(this.testNameLabel); + this.Name = "TestProgressCtrl"; + this.Size = new System.Drawing.Size(207, 29); + this.Click += new System.EventHandler(this.TestProgressCtrl_Click); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label testNameLabel; + private System.Windows.Forms.ProgressBar testProgressBar; + } +} diff --git a/TestBenchFramework/UiControls/TestProgressCtrl.cs b/TestBenchFramework/UiControls/TestProgressCtrl.cs new file mode 100644 index 000000000..3d778ca19 --- /dev/null +++ b/TestBenchFramework/UiControls/TestProgressCtrl.cs @@ -0,0 +1,77 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace TBF.UiControls +{ + public partial class TestProgressCtrl : UserControl + { + public enum Result + { + NotDone, + Passed, + Failed, + } + + public Result TestResult + { + set + { + //switch (value) + //{ + // case Result.NotDone: resultPictureBox.Image = Properties.Resources.TestNotDoneImage; break; + // case Result.Passed: resultPictureBox.Image = Properties.Resources.TestPassedImage; break; + // case Result.Failed: resultPictureBox.Image = Properties.Resources.TestFailedImage; break; + //} + } + } + + public bool Selected; + + string testName; + public string TestName { get { return testName; } } + + int repetitionNr; + public int RepetitionNr { get { return repetitionNr; } } + + public string Title { set { testNameLabel.Text = value; } } + + public float Progress { set { testProgressBar.Value = (int)(100.499f * value); } } + public ProgressBar TestProgressBar { get { return testProgressBar; } } + + public TestProgressCtrl() + { + InitializeComponent(); + this.Progress = 0; + this.TestResult = UiControls.TestProgressCtrl.Result.NotDone; + } + + public TestProgressCtrl(string testName, int repetitionNr, int testRepeats) + : this() + { + this.testName = testName; + this.repetitionNr = repetitionNr; + this.Title = testName + string.Format(" ({0}/{1})", repetitionNr, testRepeats); + } + + public TestProgressCtrl(string testName) + : this(testName, 1, 1) + { + this.Title = testName; + } + + private void TestProgressCtrl_Click(object sender, System.EventArgs e) + { + if (Selected) + { + Selected = false; + BackColor = Color.Transparent; + } + else + { + Selected = true; + BackColor = Color.Orange; + } + } + } +} diff --git a/TestBenchFramework/UiControls/TestProgressCtrl.resx b/TestBenchFramework/UiControls/TestProgressCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/UiControls/TestProgressCtrl.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/TestBenchFramework/UiControls/TransitionStepsCtrl.cs b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs new file mode 100644 index 000000000..9dff7062f --- /dev/null +++ b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs @@ -0,0 +1,219 @@ +using System.Collections.Generic; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; +using TBF.Resources; + +namespace TBF.UiControls +{ + public partial class TransitionStepsCtrl : BaseWithListViewEx, ITabWithListViewEx + { + static readonly ILog log = LogManager.GetLogger(typeof(TransitionStepsCtrl)); + + /// + /// Fixed ListViewEx columns + /// + enum Column + { + Duration, + FixedColumnsCount, + } + readonly int fixedCount = (int)Column.FixedColumnsCount; + + Entities.TransitionSequence sequence; + + TransitionsDlg parent; + Control parentControl; + Control[] editors; + + int vCount; /// Number of valves + int regvCount; /// Number of regulating valves + + public TransitionStepsCtrl() + : base() + { + } + + public void Initialize(Entities.TransitionSequence sequence, TransitionsDlg parent, Control parentControl) + { + this.sequence = sequence; + this.parent = parent; + this.parentControl = parentControl; + Name = sequence.Name; + MyItems = sequence.TransitionSteps; + + SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked); + SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); + + vCount = parent.Valves.Count; + regvCount = parent.RegulValves.Count; + + /// + /// ListViewEx columns + /// + Columns.Add(Strings.Duration_s, 60 * parent.Dpi / PathsDlg.Dpi100pct); + foreach (var vlv in parent.Valves) + { + Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / PathsDlg.Dpi100pct); + } + foreach (var rvlv in parent.RegulValves) + { + Columns.Add(rvlv.Cfg.Name + " [%]", 50 * parent.Dpi / PathsDlg.Dpi100pct); + } + + /// + /// Prepare valve combo-boxes (max. 64 valves) + /// + editors = new Control[fixedCount + vCount + regvCount]; + + editors[0] = new TextBox(); /// Duration + parent.Controls.Add(editors[0]); + + for (int i = fixedCount; i < fixedCount + vCount; i++) + { + ComboBox cb = new ComboBox(); + cb.Items.Add("---"); + cb.Items.Add(Strings.open); + cb.Items.Add(Strings.close); + editors[i] = cb; + parent.Controls.Add(cb); + } + + for (int i = fixedCount + vCount; i < fixedCount + vCount + regvCount; i++) + { + editors[i] = new TextBox(); + parent.Controls.Add(editors[i]); + } + + base.RedrawAll(); + } + + void listViewEx_SubItemClicked(object sender, SubItemEventArgs e) + { + if (!Unlocked || e.SubItem >= editors.Length) return; + StartEditing(editors[e.SubItem], e.Item, e.SubItem); + } + + void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e) + { + if (e.SubItem == (int)Column.Duration) + { + int duration; + if (!int.TryParse(e.DisplayText, out duration) || duration <= 0) + { + e.DisplayText = e.Item.Text; + e.Cancel = true; + } + } + } + + public override void DrawOne(object myItem) + { + Entities.TransitionStep step = (Entities.TransitionStep)myItem; + + IList valvesOpen = new List(); + if (step.ValvesOpen != null) + { + string[] vOpen = step.ValvesOpen.Split(new char[] { ';' }); + foreach (var vName in vOpen) valvesOpen.Add((IValve)TbfComponents.FindComponent(vName, parent.TbfComponents)); + } + + IList valvesClose = new List(); + if (step.ValvesClose != null) + { + string[] vClose = step.ValvesClose.Split(new char[] { ';' }); + foreach (var vName in vClose) valvesClose.Add((IValve)TbfComponents.FindComponent(vName, parent.TbfComponents)); + } + + ListViewItem lvi = new ListViewItem(step.Duration.ToString()); + + foreach (var valve in parent.Valves) + { + if (valvesOpen != null && valvesOpen.Contains(valve)) + { + lvi.SubItems.Add(Strings.open); + } + else if (valvesClose != null && valvesClose.Contains(valve)) + { + lvi.SubItems.Add(Strings.close); + } + else + { + lvi.SubItems.Add("---"); + } + } + + string[] rvPosStr = (step.RegulValvesPct != null) ? step.RegulValvesPct.Split(new char[] { ';' }) + : new string[0]; + for (int i = 0; i < regvCount; i++) + { + lvi.SubItems.Add((i < rvPosStr.Length) ? rvPosStr[i] : "---"); + } + + lvi.Tag = step; + + Items.Add(lvi); + } + + public override void UpdateOne(ListViewItem lvi, object myItem) + { + Entities.TransitionStep step = (Entities.TransitionStep)myItem; + + /// Duration + try + { + step.Duration = int.Parse(lvi.Text); + if (step.Duration < 2) throw (new System.Exception()); + } + catch { lvi.Text = step.Duration.ToString(); } + + /// Valves + string valvesOpen = string.Empty; + string valvesClose = string.Empty; + for (int j = 0; j < vCount; j++) + { + string text = lvi.SubItems[fixedCount + j].Text; + if (text.Equals(Strings.open)) + { + if (valvesOpen != string.Empty) valvesOpen += ";"; + valvesOpen += parent.Valves[j].Cfg.Name; + } + if (text.Equals(Strings.close)) + { + if (valvesClose != string.Empty) valvesClose += ";"; + valvesClose += parent.Valves[j].Cfg.Name; + } + } + step.ValvesOpen = valvesOpen; + step.ValvesClose = valvesClose; + + string regulValvesPct = string.Empty; + for (int j = fixedCount + vCount; j < fixedCount + vCount + regvCount; j++) + { + if (regulValvesPct.Length > 0) regulValvesPct += ";"; + float fdummy; + if (lvi.SubItems[j].Text.Equals("---") || + (Utils.TryParseUFloat(lvi.SubItems[j].Text, out fdummy) && (fdummy >= 0) && (fdummy <= 100.0f))) + { + regulValvesPct += lvi.SubItems[j].Text; + } + } + step.RegulValvesPct = regulValvesPct; + } + + public void AddOne() + { + base.AddOne(new Entities.TransitionStep(MyItems.Count, sequence)); + } + + public new void RemoveSelected() + { + bool lastItemRemoved = base.RemoveSelected(); + if (lastItemRemoved && parent != null) + { + parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None); + } + } + } +} diff --git a/TestBenchFramework/Utils.cs b/TestBenchFramework/Utils.cs new file mode 100644 index 000000000..f3b188420 --- /dev/null +++ b/TestBenchFramework/Utils.cs @@ -0,0 +1,136 @@ +using System.Collections.Generic; +using System.Globalization; + +namespace TBF +{ + public class Utils + { + /// + /// Parse unsigned float + /// + public static bool TryParseUFloat(string text, out float result) + { + return float.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out result) || + float.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out result); + } + public static float ParseUFloat(string text, float dfltVal) + { + float result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out result)) return result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out result)) return result; + return dfltVal; + } + public static float ParseUFloat(string text) + { + return ParseUFloat(text, 0); + } + + /// + /// Parse float, sign allowed + /// + public static bool TryParseSFloat(string text, out float result) + { + return float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out result) || + float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out result); + } + public static float ParseSFloat(string text, float dfltVal) + { + float result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out result)) return result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out result)) return result; + return dfltVal; + } + public static float ParseSFloat(string text) + { + return ParseSFloat(text, 0); + } + + /// + /// Parse float, sign allowed, exponent allowed + /// + public static bool TryParseEFloat(string text, out float result) + { + return float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, CultureInfo.CurrentCulture, out result) || + float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out result); + } + public static float ParseEFloat(string text, float dfltVal) + { + float result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, CultureInfo.CurrentCulture, out result)) return result; + if (float.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out result)) return result; + return dfltVal; + } + public static float ParseEFloat(string text) + { + return ParseEFloat(text, 0); + } + + /// + /// Get a list of IValve-s from an entity implementing IHasValves + /// + /// Entity implementing IHasValves + /// A list of IValves + public static IList ValvesOpen(Entities.IHasValves entity) + { + var valvesOpen = new List(); + if (entity != null && entity.ValvesOpen != null && entity.ValvesOpen != string.Empty) + { + string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' }); + foreach (var vName in vOpen) + { + valvesOpen.Add((BenchControl.GenericDevices.IValve)BenchControl + .TbfComponents.FindComponent(vName)); + } + } + return valvesOpen; + } + + /// + /// Get a list of IValve-s from an entity implementing IHasValves + /// + /// Entity implementing IHasValves + /// A list of IValves + public static IList ValvesClose(Entities.IHasValves entity) + { + var valvesClose = new List(); + if (entity != null && entity.ValvesClose != null && entity.ValvesClose != string.Empty) + { + string[] vClose = entity.ValvesClose.Split(new char[] { ';' }); + foreach (var vName in vClose) + { + valvesClose.Add((BenchControl.GenericDevices.IValve)BenchControl + .TbfComponents.FindComponent(vName)); + } + } + return valvesClose; + } + + /// + /// Get an array of RegulValve positions from a TransitionStep entity + /// + /// TransitionStep entity + /// float[] of regulation valve positions from 0 to 100.0f + public static float[] RegulValvesPositions(Entities.TransitionStep step) + { + int regvCount = BenchControl.Sequences.SequenceBase.RegulValves.Count; + float[] result = new float[regvCount]; + + string[] rvPosStr = (step.RegulValvesPct != null) ? step.RegulValvesPct.Split(new char[] { ';' }) : new string[0]; + for (int i = 0; i < regvCount; i++) + { + float fdummy; + if ((i < rvPosStr.Length) && Utils.TryParseUFloat(rvPosStr[i], out fdummy) && + (fdummy >= 0) && (fdummy <= 100.0f)) + { + result[i] = fdummy; + } + else // if (rvPosStr[i].Equals("---")) + { + result[i] = -1.0f; /// Negative value means no regulation valve position change + } + } + + return result; + } + } +} diff --git a/TestBenchFramework/app.config b/TestBenchFramework/app.config new file mode 100644 index 000000000..86fcc8b74 --- /dev/null +++ b/TestBenchFramework/app.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/TestBenchFramework/packages.config b/TestBenchFramework/packages.config new file mode 100644 index 000000000..0808d8c6e --- /dev/null +++ b/TestBenchFramework/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/TestBenchFramework/x64/SQLite.Interop.dll b/TestBenchFramework/x64/SQLite.Interop.dll new file mode 100644 index 000000000..30e752000 Binary files /dev/null and b/TestBenchFramework/x64/SQLite.Interop.dll differ diff --git a/TestBenchFramework/x86/SQLite.Interop.dll b/TestBenchFramework/x86/SQLite.Interop.dll new file mode 100644 index 000000000..092ed077a Binary files /dev/null and b/TestBenchFramework/x86/SQLite.Interop.dll differ diff --git a/packages/ControlBoard/ControlCom2VB.dll b/packages/ControlBoard/ControlCom2VB.dll new file mode 100644 index 000000000..74aea19fa Binary files /dev/null and b/packages/ControlBoard/ControlCom2VB.dll differ diff --git a/packages/ControlBoard/ControlComponent3Munich.dll b/packages/ControlBoard/ControlComponent3Munich.dll new file mode 100644 index 000000000..253da9069 Binary files /dev/null and b/packages/ControlBoard/ControlComponent3Munich.dll differ diff --git a/packages/ControlBoard/ControlComponent3U.dll b/packages/ControlBoard/ControlComponent3U.dll new file mode 100644 index 000000000..90078d2e4 Binary files /dev/null and b/packages/ControlBoard/ControlComponent3U.dll differ diff --git a/packages/ControlBoard/GaugeIndicator.dll b/packages/ControlBoard/GaugeIndicator.dll new file mode 100644 index 000000000..37676d894 Binary files /dev/null and b/packages/ControlBoard/GaugeIndicator.dll differ diff --git a/packages/ControlBoard/procedure.txt b/packages/ControlBoard/procedure.txt new file mode 100644 index 000000000..e69de29bb diff --git a/packages/ControlBoard/readme.txt b/packages/ControlBoard/readme.txt new file mode 100644 index 000000000..bfd00f1f7 --- /dev/null +++ b/packages/ControlBoard/readme.txt @@ -0,0 +1,3 @@ +ControlCom2VB . . . . . . . . DN100 test bench in ST +ControlComponent2Munich . . . Munich +ControlComponent3U . . . . . Fuzhou150 diff --git a/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nupkg b/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nupkg new file mode 100644 index 000000000..f92777f6d Binary files /dev/null and b/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nupkg differ diff --git a/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nuspec b/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nuspec new file mode 100644 index 000000000..112c45a46 --- /dev/null +++ b/packages/FluentNHibernate.1.3.0.733/FluentNHibernate.1.3.0.733.nuspec @@ -0,0 +1,21 @@ + + + + FluentNHibernate + 1.3.0.733 + Fluent NHibernate + James Gregory and contributors + James Gregory and contributors + http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt + http://fluentnhibernate.org/ + false + Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate. + + + + orm dal nhibernate conventions + + + + + \ No newline at end of file diff --git a/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.XML b/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.XML new file mode 100644 index 000000000..a80d67751 --- /dev/null +++ b/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.XML @@ -0,0 +1,5766 @@ + + + + FluentNHibernate + + + + + Built-in alteration for altering an AutoPersistenceModel with instance of IAutoMappingOverride<T>. + + + + + Provides a mechanism for altering an AutoPersistenceModel prior to + the generation of mappings. + + + + + Alter the model + + AutoPersistenceModel instance to alter + + + + Constructor for AutoMappingOverrideAlteration. + + Assembly to load overrides from. + + + + Alter the model + + + Finds all types in the assembly (passed in the constructor) that implement IAutoMappingOverride<T>, then + creates an AutoMapping<T> and applies the override to it. + + AutoPersistenceModel instance to alter + + + + A mapping override for an auto mapped entity. + + Entity who's auto-mapping you're overriding + + + + Alter the automapping for this type + + Automapping + + + + Facade over an assembly for retrieving type instances. + + + + + A source for Type instances, acts as a facade for an Assembly or as an alternative Type provider. + + + + + Called when a member is mapped by a builder method. + + Member being mapped. + + + + Create a property mapping. + + Property to map + + Map(x => x.Name); + + + + + Create a property mapping. + + Property to map + Property column name + + Map(x => x.Name, "person_name"); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + + References(x => x.Company); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + Column name + + References(x => x.Company, "company_id"); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + + References(x => x.Company, "company_id"); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + Column name + + References(x => x.Company, "company_id"); + + + + + Create a reference to any other entity. This is an "any" polymorphic relationship. + + Other entity to reference + Property + + + + Create a reference to another entity based exclusively on the primary-key values. + This is sometimes called a one-to-one relationship, in database terms. Generally + you should use + whenever possible. + + Other entity + Property + + HasOne(x => x.ExtendedInfo); + + + + + Create a reference to another entity based exclusively on the primary-key values. + This is sometimes called a one-to-one relationship, in database terms. Generally + you should use + whenever possible. + + Other entity + Property + + HasOne(x => x.ExtendedInfo); + + + + + Create a dynamic component mapping. This is a dictionary that represents + a limited number of columns in the database. + + Property containing component + Component setup action + + DynamicComponent(x => x.Data, comp => + { + comp.Map(x => (int)x["age"]); + }); + + + + + Creates a component reference. This is a place-holder for a component that is defined externally with a + ; the mapping defined in said will be merged + with any options you specify from this call. + + Component type + Property exposing the component + Component reference builder + + + + Maps a component + + Type of component + Component property + Component mapping + + Component(x => x.Address, comp => + { + comp.Map(x => x.Street); + comp.Map(x => x.City); + }); + + + + + Maps a component + + Type of component + Component property + Component mapping + + Component(x => x.Address, comp => + { + comp.Map(x => x.Street); + comp.Map(x => x.City); + }); + + + + + Allows the user to add a custom component mapping to the class mapping. + Note: not a fluent method. + + + In some cases, our users need a way to add an instance of their own implementation of IComponentMappingProvider. + For an example of where this might be necessary, see: http://codebetter.com/blogs/jeremy.miller/archive/2010/02/16/our-extension-properties-story.aspx + + + + + Maps a collection of entities as a one-to-many + + Child entity type + Collection property + + HasMany(x => x.Locations); + + + + + Maps a collection of entities as a one-to-many + + Child entity type + Collection property + + HasMany(x => x.Locations); + + + + + Maps a collection of entities as a many-to-many + + Child entity type + Collection property + + HasManyToMany(x => x.Locations); + + + + + Maps a collection of entities as a many-to-many + + Child entity type + Collection property + + HasManyToMany(x => x.Locations); + + + + + Specify an insert stored procedure + + Stored procedure call + + + + Specify an update stored procedure + + Stored procedure call + + + + Specify an delete stored procedure + + Stored procedure call + + + + Specify an delete all stored procedure + + Stored procedure call + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Inverts the next boolean + + + + + Maps to the Join element in NH 2.0 + + + + + + Specify the key column name + + Column name + + + + Specify the key column name + + Column names + + + + Specify the schema + + Schema name + + + + Inverse the ownership of this relationship + + + + + Specify this relationship as optional + + + + + Specify the catalog + + Catalog + + + + Specify a subselect for fetching this join + + Query + + + + Specify the table name + + Table name + + + + Specify the fetching strategy + + + + + Invert the next boolean operation + + + + + Starting point for automapping your entities. + + + + + Automatically map classes in the assembly that contains . + + Class in the assembly you want to map + + + + Automatically map classes in the assembly that contains . + + Class in the assembly you want to map + Automapping configuration + + + + Automatically map the classes in . + + Assembly containing the classes to map + + + + Automatically map the classes in . + + Assembly containing the classes to map + Automapping configuration + + + + Automatically map the classes in each assembly supplied. + + Assemblies containing classes to map + + + + Automatically map the classes in each assembly supplied. + + Automapping configuration + Assemblies containing classes to map + + + + Automatically map the classes in each assembly supplied. + + Automapping configuration + Assemblies containing classes to map + + + + Automatically map the classes exposed through the supplied . + + containing classes to map + + + + Automatically map the classes exposed through the supplied . + + containing classes to map + Automapping configuration + + + + Automatically map the classes exposed through the supplied . + + containing classes to map + Criteria for selecting a subset of the types in the assembly for mapping + + + + Automatically map the classes in . + + Assembly containing the classes to map + Criteria for selecting a subset of the types in the assembly for mapping + + + + Automatically map classes in the assembly that contains . + + Class in the assembly you want to map + Criteria for selecting a subset of the types in the assembly for mapping + + + + Defines a mapping for an entity. Derive from this class to create a mapping, + and use the constructor to control how your entity is persisted. + + + public class PersonMap : ClassMap<Person> + { + public PersonMap() + { + Id(x => x.PersonId); + Map(x => x.Name); + Map(x => x.Age); + } + } + + Entity type to map + + + + Specify the identifier for this entity. + + Identity property + + Id(x => x.PersonId); + + + + + Specify the identifier for this entity. + + Identity property + Column name + + Id(x => x.PersonId, "id"); + + + + + Create an Id that doesn't have a corresponding property in + the domain object, or a column in the database. This is mainly + for use with read-only access and/or views. Defaults to an int + identity with an "increment" generator. + + + + + Create an Id that doesn't have a corresponding property in + the domain object, or a column in the database. This is mainly + for use with read-only access and/or views. + + Type of the id + + + + Create an Id that doesn't have a corresponding property in + the domain object. + + Type of the id + Name and column name of the id + + + + Create a natural identity. This is a secondary identifier + that has "business meaning" moreso than the primary key. + + + NaturalId() + .Property(x => x.Name); + + + + + Create a composite identity. This is an identity composed of multiple + columns. + Note: Prefer using a surrogate key over a composite key whenever possible. + + + CompositeId() + .KeyProperty(x => x.FirstName) + .KeyProperty(x => x.LastName); + + + + + Create a composite identity represented by an identity class. This is an + identity composed of multiple columns. + Note: Prefer using a surrogate key over a composite key whenever possible. + + Composite id property + + CompositeId(x => x.Id) + .KeyProperty(x => x.FirstName) + .KeyProperty(x => x.LastName); + + + + + Specifies that this class should be versioned/timestamped using the + given property. + + Version/timestamp property + + Version(x => x.Timestamp); + + + + + Specify that this entity should use a discriminator with it's subclasses. + This is a mapping strategy called table-per-inheritance-hierarchy; where all + subclasses are stored in the same table, differenciated by a discriminator + column value. + + Type of the discriminator column + Discriminator column name + Default discriminator value + + + + Specify that this entity should use a discriminator with it's subclasses. + This is a mapping strategy called table-per-inheritance-hierarchy; where all + subclasses are stored in the same table, differenciated by a discriminator + column value. + + Type of the discriminator column + Discriminator column name + + + + Specify that this entity should use a discriminator with it's subclasses. + This is a mapping strategy called table-per-inheritance-hierarchy; where all + subclasses are stored in the same table, differenciated by a discriminator + column value. + + Discriminator column name + + + + Specifies that any subclasses of this entity should be treated as union-subclass + mappings. Don't use this in combination with a discriminator, as they are mutually + exclusive. + + + + + Sets the schema for this class. + + Schema name + + + + Sets the table for the class. + + Table name + + + + Sets this entity to be lazy-loaded (overrides the default lazy load configuration). + + + + + Links this entity to another table, to create a composite entity from two or + more tables. + + Joined table name + Joined table mapping + + Join("another_table", join => + { + join.Map(x => x.Name); + join.Map(x => x.Age); + }); + + + + + Imports an existing type for use in the mapping. + + Type to import. + + + + Set the mutability of this class, sets the mutable attribute. + + + + + Sets this entity to be dynamic update + + + + + Sets this entity to be dynamic insert + + + + + Sets the query batch size for this entity. + + Batch size + + + + Specifies a check constraint + + Constraint name + + + + Specifies a persister to be used with this entity + + Persister type + + + + Specifies a persister to be used with this entity + + Persister type + + + + Specifies a persister to be used with this entity + + Persister type + + + + Specifies a proxy class for this entity. + + Proxy type + + + + Specifies a proxy class for this entity. + + Proxy type + + + + Specifies a proxy class for this entity. + + Proxy type + + + + Specifies that a select should be performed before updating + this entity + + + + + Defines a SQL 'where' clause used when retrieving objects of this type. + + + + + Sets the SQL statement used in subselect fetching. + + Subselect SQL Query + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Applies a filter to this entity given its name. + + The filter's name + The condition to apply + + + + Applies a filter to this entity given its name. + + The filter's name + + + + Applies a named filter to this entity. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to this entity. + + + The type of a implementation + defining the filter to apply. + + + + + Configures the tuplizer for this entity. The tuplizer defines how to transform + a Property-Value to its persistent representation, and viceversa a Column-Value + to its in-memory representation, and the EntityMode defines which tuplizer is in use. + + Tuplizer entity-mode + Tuplizer type + + + + Specify the caching for this entity. + + + Cache.ReadWrite(); + + + + + Specify settings for the container/hibernate-mapping for this class. + Note: Avoid using this, if possible prefer using conventions. + + + HibernateMapping.Schema("dto"); + + + + + Inverts the next boolean option + + + + + Sets the optimistic locking strategy + + + + + Sets the polymorphism behaviour + + + + + Sets the schema action behaviour + + + + + Flags a type as already mapped, stop it from being auto-mapped. + + + + + Creates an instance of an IAutoMappingAlteration from a type instance, then adds it to the alterations collection. + + Type of an IAutoMappingAlteration + + + + Creates an instance of an IAutoMappingAlteration from a generic type parameter, then adds it to the alterations collection. + + Type of an IAutoMappingAlteration + Container + + + + Adds an alteration + + Alteration to add + Container + + + + Adds all alterations from an assembly + + Assembly to search + Container + + + + Adds all alterations from an assembly that contains T. + + Type who's assembly to search + Container + + + + Apply alterations to an AutoPersisteceModel + + AutoPersistenceModel instance to apply alterations to + + + + Determines whether a member is to be automapped. + + + + + Determines whether a member is the identity of an entity. + + + + + Determines whether an abstract class is a layer supertype or part of a mapped inheritance hierarchy. + + + + + Specifies the value column used in a table of simple types. + + + + + Implement this interface to control how the automapper behaves. + Typically you're better off deriving from the + class, which is pre-configured with the default settings; you can then + just override specific methods that you'd like to alter. + + + + + Determines whether a type should be auto-mapped. + Override to restrict which types are mapped in your domain. + + + You normally want to override this method and restrict via something known, like + Namespace. + + + return type.Namespace.EndsWith("Domain"); + + Type to map + Should map type + + + + Determines whether a member of a type should be auto-mapped. + Override to restrict which members are considered in automapping. + + + You normally want to override this method to restrict which members will be + used for mapping. This method will be called for every property, field, and method + on your types. + + + // all writable public properties: + return member.IsProperty && member.IsPublic && member.CanWrite; + + Member to map + Should map member + + + + Determines whether a member is the id of an entity. + + + This method is called for each member that ShouldMap(Type) returns true for. + + Member + Member is id + + + + Gets the access strategy to be used for a read-only property. This method is + called for every setterless property and private-setter autoproperty in your + domain that has been accepted through . + + Member to get access strategy for + Access strategy + + + + Controls which side of a many-to-many relationship is considered the "parent". + + Left side of the relationship + Right side of the relationship + left or right + + + + Determines whether a type is a concrete, or instantiatable, base class. This + affects how the inheritance mappings are built, specifically that any types + this method returns true for will not be mapped as a subclass. + + Type + Base type is concrete? + + + + Specifies that a particular type should be mapped as a component rather than + an entity. + + Type + Type is a component? + + + + Gets the column prefix for a component. + + Member defining the component + Component column prefix + + + + Specifies whether a particular type is mapped with a discriminator. + This method will be called for every type that has already been + approved by . + + Type to check + Whether the type is to be discriminated + + + + Gets the column name of the discriminator. + + Type + Discriminator column name + + + + Specifies whether an abstract type is considered a Layer Supertype + (http://martinfowler.com/eaaCatalog/layerSupertype.html). Defaults to + true for all abstract classes. Override this method if you have an + abstract class that you want mapping as a regular entity. + + Abstract class type + Whether the type is a Layer Supertype + + + + Gets the value column for a collection of simple types. + + + This is the name of the <element> column. + + Collection property + Value column name + + + + Specifies whether the current member is a version property + + Candidate member + Is member a version + + + + Gets the steps that are executed to map a type. + + Collection of mapping steps + + + + Gets or sets whether validation of mappings is performed. + + + + + Specify alterations to be used with this AutoPersisteceModel + + Lambda to declare alterations + AutoPersistenceModel + + + + Use auto mapping overrides defined in the assembly of T. + + Type to get assembly from + AutoPersistenceModel + + + + Use auto mapping overrides defined in the assembly of T. + + Assembly to scan + AutoPersistenceModel + + + + Alter some of the configuration options that control how the automapper works. + Depreciated in favour of supplying your own IAutomappingConfiguration instance to AutoMap: . + Cannot be used in combination with a user-defined configuration. + + + + + Supply a criteria for which types will be mapped. + Cannot be used in combination with a user-defined configuration. + + Where clause + + + + Adds all entities from a specific assembly. + + Assembly to load from + + + + Adds all entities from the . + + to load from + + + + Override the mapping of a specific entity. + + This may affect subclasses, depending on the alterations you do. + Entity who's mapping to override + Lambda performing alterations + + + + Adds an IAutoMappingOverride reflectively + + Override type, expected to be an IAutoMappingOverride + + + + Override all mappings. + + Currently only supports ignoring properties on all entities. + Lambda performing alterations + + + + Ignore a base type. This removes it from any mapped inheritance hierarchies, good for non-abstract layer + supertypes. + + Type to ignore + + + + Ignore a base type. This removes it from any mapped inheritance hierarchies, good for non-abstract layer + supertypes. + + Type to ignore + + + + Explicitly includes a type to be used as part of a mapped inheritance hierarchy. + + + Abstract classes are probably what you'll be using this method with. Fluent NHibernate considers abstract + classes to be layer supertypes, so doesn't automatically map them as part of an inheritance hierarchy. You + can use this method to override that behavior for a specific type; otherwise you should consider using the + setting. + + Type to include + + + + Explicitly includes a type to be used as part of a mapped inheritance hierarchy. + + + Abstract classes are probably what you'll be using this method with. Fluent NHibernate considers abstract + classes to be layer supertypes, so doesn't automatically map them as part of an inheritance hierarchy. You + can use this method to override that behavior for a specific type; otherwise you should consider using the + setting. + + Type to include + + + + Alter convention discovery + + + + + Sets whether this subclass is lazy loaded + + + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Inverts the next boolean + + + + + Sets the database dialect. This shouldn't be necessary + if you've used one of the provided database configurations. + + Configuration builder + + + + Sets the database dialect. This shouldn't be necessary + if you've used one of the provided database configurations. + + Configuration builder + + + + Sets the default database schema + + Default schema name + Configuration builder + + + + Enables the outer-join option. + + Configuration builder + + + + Sets the max fetch depth. + + Max fetch depth + Configuration builder + + + + Enables the reflection optimizer. + + Configuration builder + + + + Sets any query stubstitutions that NHibernate should + perform. + + Substitutions + Configuration builder + + + + Enables the show SQL option. + + Configuration builder + + + + Enables the format SQL option. + + Configuration builder + + + + Sets the database provider. This shouldn't be necessary + if you're using one of the provided database configurations. + + Provider type + Configuration builder + + + + Sets the database provider. This shouldn't be necessary + if you're using one of the provided database configurations. + + Provider type + Configuration builder + + + + Specify the database driver. This isn't necessary + if you're using one of the provided database configurations. + + Driver type + Configuration builder + + + + Specify the database driver. This isn't necessary + if you're using one of the provided database configurations. + + Driver type + Configuration builder + + + + Configure the connection string + + + ConnectionString(x => + { + x.Server("db_server"); + x.Database("Products"); + }); + + Closure for building the connection string + Configuration builder + + + + Set the connection string. + + Connection string to use + Configuration builder + + + + Sets a raw property on the NHibernate configuration. Use this method + if there isn't a specific option available in the API. + + Setting key + Setting value + Configuration builder + + + + Sets the adonet.batch_size property. + + Batch size + Configuration + + + + Sets the connection isolation level. NHibernate setting: connection.isolation + + Isolation level + Configuration builder + + + + Sets the connection isolation level. NHibernate setting: connection.isolation + + Isolation level + Configuration builder + + + + Negates the next boolean option. + + + + + Provides types for mapping from multiple assemblies + + + + + Basic convention interface. Don't use directly. + + Inspector instance for use in retrieving values and setting expectations + Apply instance + + + + Ignore - this is used for generic restrictions only + + + + + Apply changes to the target + + + + + Whether this convention will be applied to the target. + + Instace that could be supplied + Apply on this target? + + + + Represents a string identifier for the model instance, used in conventions for a lazy + shortcut. + + e.g. for a ColumnMapping the StringIdentifierForModel would be the Name attribute, + this allows the user to find any columns with the matching name. + + + + + Diagnostic logging configuration + + + + + Conditionally enable logging + + Enable logging + + + + Enable logging + + + + + Disable logging + + + + + Register a logging listener + + Listener + + + + Register a default Console.Write listener + + + + + + Register a Console.Write listener with a custom result formatter + + Result formatter + + + + Register a default file output listener + + Output path + + + + Register a file output listener with a custom result formatter + + Result formatter + Output path + + + + Base class for attribute based conventions. Create a subclass of this to supply your own + attribute based conventions. + + Attribute identifier + + + + Apply changes to a property with an attribute matching T. + + Instance of attribute found on property. + Property with attribute + + + + Convention for identities, implement this interface to apply changes to + identity mappings. + + + + + Version convention, implement this interface to apply changes to vesion mappings. + + + + + Property convention, implement this interface to apply changes to + property mappings. + + + + + Convention for a component mapping. Implement this interface to + apply changes to components. + + + + + Convention for dynamic components. Implement this member to apply changes + to dynamic components. + + + + + Reference convention, implement this interface to apply changes to Reference/many-to-one + relationships. + + + + + HasOne convention, used for applying changes to one-to-one relationships. + + + + + Convention for the hibernate-mapping container for a class, this can be used to + set some class-wide settings such as lazy-load and access strategies. + + + + + Joined subclass convention, implement this interface to alter joined-subclass mappings. + + + + + Join convention, implement this interface to alter join mappings. + + + + + Convention for a single class mapping. Implement this interface to apply + changes to class mappings. + + + + + Subclass convention, implement this interface to alter subclass mappings. + + + + + Apply changes to the target + + + + + Apply changes to the target + + + + + Apply changes to the target + + + + + Apply changes to the target + + + + + Apply changes to the target + + + + + Represents a string identifier for the model instance, used in conventions for a lazy + shortcut. + + e.g. for a ColumnMapping the StringIdentifierForModel would be the Name attribute, + this allows the user to find any columns with the matching name. + + + + + Gets the requested value off the first column, as all columns are (currently) created equal + + + + + + + Applies to the joining table for this many-to-many. + + + + + Applies to the joining table for this many-to-many. + + + + + generates identifiers of any integral type that are unique only when no other + process is inserting data into the same table. Do not use in a cluster. + + + + + + generates identifiers of any integral type that are unique only when no other + process is inserting data into the same table. Do not use in a cluster. + + Params configuration + + + + supports identity columns in DB2, MySQL, MS SQL Server and Sybase. + The identifier returned by the database is converted to the property type using + Convert.ChangeType. Any integral property type is thus supported. + + + + + + supports identity columns in DB2, MySQL, MS SQL Server and Sybase. + The identifier returned by the database is converted to the property type using + Convert.ChangeType. Any integral property type is thus supported. + + Params configuration + + + + uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. + The identifier returned by the database is converted to the property type + using Convert.ChangeType. Any integral property type is thus supported. + + + + + + + uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. + The identifier returned by the database is converted to the property type + using Convert.ChangeType. Any integral property type is thus supported. + + + Params configuration + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + The table. + The column. + The max lo. + The where. + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + Params configuration + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + Params configuration + + + + uses an Oracle-style sequence (where supported) + + + + + + + + uses an Oracle-style sequence (where supported) + + + + Params configuration + + + + uses System.Guid and its ToString(string format) method to generate identifiers + of type string. The length of the string returned depends on the configured format. + + http://msdn.microsoft.com/en-us/library/97af8hh4.aspx + + + + + uses System.Guid and its ToString(string format) method to generate identifiers + of type string. The length of the string returned depends on the configured format. + + http://msdn.microsoft.com/en-us/library/97af8hh4.aspx + Params configuration + + + + uses a new System.Guid to create a byte[] that is converted to a string. + + + + + + uses a new System.Guid to create a byte[] that is converted to a string. + + Params configuration + + + + uses a new System.Guid as the identifier. + + + + + + uses a new System.Guid as the identifier. + + Params configuration + + + + Recommended for Guid identifiers! + uses the algorithm to generate a new System.Guid described by Jimmy Nilsson + in the article http://www.informit.com/articles/article.asp?p=25862. + + + + + + Recommended for Guid identifiers! + uses the algorithm to generate a new System.Guid described by Jimmy Nilsson + in the article http://www.informit.com/articles/article.asp?p=25862. + + Params configuration + + + + Generator that uses the RDBMS native function to generate a GUID. + The behavior is similar to the “sequence” generator. When a new + object is saved NH run two queries: the first to retrieve the GUID + value and the second to insert the entity using the Guid retrieved + from the RDBMS. Your entity Id must be System.Guid and the SQLType + will depend on the dialect (RAW(16) in Oracle, UniqueIdentifier in + MsSQL for example). + + + + + Generator that uses the RDBMS native function to generate a GUID. + The behavior is similar to the “sequence” generator. When a new + object is saved NH run two queries: the first to retrieve the GUID + value and the second to insert the entity using the Guid retrieved + from the RDBMS. Your entity Id must be System.Guid and the SQLType + will depend on the dialect (RAW(16) in Oracle, UniqueIdentifier in + MsSQL for example). + + + GuidNative(x => + { + x.AddParam("key", "value"); + }); + + Parameter builder closure + + + + A deviation of the trigger-identity. This generator works + together with the feature. + The difference with trigger-identity is that the POID value + is retrieved by a SELECT using the natural-id fields as filter. + + + + + A deviation of the trigger-identity. This generator works + together with the feature. + The difference with trigger-identity is that the POID value + is retrieved by a SELECT using the natural-id fields as filter. + + + Select(x => + { + x.AddParam("key", "value"); + }); + + Parameter builder closure + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Custom sequence name + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Parameter builder closure + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Custom sequence name + Parameter builder closure + + + + trigger-identity is a NHibernate specific feature where the POID + is generated by the RDBMS with an INSERT query through a + BEFORE INSERT trigger. In this case you can use any supported type, + including a custom type, with the limitation of a single column usage. + + + + + trigger-identity is a NHibernate specific feature where the POID + is generated by the RDBMS with an INSERT query through a + BEFORE INSERT trigger. In this case you can use any supported type, + including a custom type, with the limitation of a single column usage. + + Parameter builder closure + + + + lets the application to assign an identifier to the object before Save() is called. + + + + + + lets the application to assign an identifier to the object before Save() is called. + + Params configuration + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + Params configuration + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association. + + + + + + + uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association. + + + Params configuration + + + + Applies to the joining table for this many-to-many. + + + + + Applies to the joining table for this many-to-many. + + + + + Applies a filter to this relationship given its name. + + The filter's name + The condition to apply + + + + Applies a filter to this relationship given its name. + + The filter's name + + + + Applies a named filter to this relationship. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to this relationship. + + + The type of a implementation + defining the filter to apply. + + + + + Applies a filter to this entity given its name. + + The filter's name + The condition to apply + + + + Applies a filter to this entity given its name. + + The filter's name + + + + Applies a named filter to this entity. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to this entity. + + + The type of a implementation + defining the filter to apply. + + + + + Specify the lazy behaviour of this relationship. + + + Defaults to Proxy lazy-loading. Use the modifier to disable + lazy-loading, and use the + overload to specify alternative lazy strategies. + + + LazyLoad(); + Not.LazyLoad(); + + + + + Specify the lazy behaviour of this relationship. Cannot be used + with the modifier. + + Laziness strategy + + LazyLoad(Laziness.NoProxy); + + + + + Adds a column to the index if columns have not yet been specified + + The column name to add + + + + Adds a column to the index if columns have not yet been specified + + The column name to add + + + + Specify the lazy behaviour of this relationship. + + + Defaults to Proxy lazy-loading. Use the modifier to disable + lazy-loading, and use the + overload to specify alternative lazy strategies. + + + LazyLoad(); + Not.LazyLoad(); + + + + + Specify the lazy behaviour of this relationship. Cannot be used + with the modifier. + + Laziness strategy + + LazyLoad(Laziness.NoProxy); + + + + + Applies a filter to this relationship given its name. + + The filter's name + The condition to apply + + + + Applies a filter to this relationship given its name. + + The filter's name + + + + Applies a named filter to this relationship. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to this relationship. + + + The type of a implementation + defining the filter to apply. + + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + Checks whether a collection contains an inspector identified by the string value. + + + + + + + + + Checks whether a collection contains an inspector identified by a predicate. + + + + + + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + Base convention for specifying your own many-to-many table naming style. Implement + the abstract members defined by this class to control how your join tables are named + for uni and bi-directional many-to-many's. + + + + + Gets the name used for bi-directional many-to-many tables. Implement this member to control how + your join table is named for bi-directional relationships. + + + This method will be called once per bi-directional relationship; once one side of the relationship + has been saved, then the other side will assume that name aswell. + + Main collection + Inverse collection + Many-to-many table name + + + + Gets the name used for uni-directional many-to-many tables. Implement this member to control how + your join table is named for uni-directional relationships. + + Main collection + Many-to-many table name + + + + A component that is declared external to a class mapping. + + + + + Determines the lazy-loading strategy for a collection mapping. + + + + + Collection will be eager loaded (lazy=false). + + + + + Collection will lazy loaded (lazy=true). + + + + + collection will be extra lazy loaded (lazy=extra). + + + "Extra" lazy collections are mostly similar to lazy=true, except certain operations on the collection will not load the whol collection + but issue a smarter SQL statement. For example, invoking Count on an extra-lazy collection will issue a "SELECT COUNT(*)..." rather than selecting + and loading the whole collection of entities. + + + + + This bad boy is the entry point to the visitor + + + + + + offset added to index in column + + mutual exclusive with Type() + offset + + + + Specifies the column name for the index or key of the dictionary. + + Column name + + + + Specifies the type of the index/key column + + mutual exclusive with offset + Index type + + + + Specifies the type of the index/key column + + mutual exclusive with offset + Type + + + + Specifies the type of the index/key column + + mutual exclusive with offset + Type + + + + Laziness strategy for relationships + + + + + No lazy loading + + + + + Proxy-based lazy-loading + + + + + No proxy lazy loading + + + + + Defines a property to be used for this natural-id. + + A member access lambda expression for the property + The natural id part fluent interface + + + + Defines a property to be used for this natural-id with an explicit column name. + + A member access lambda expression for the property + The column name in the database to use for this natural id, or null to use the property name + The natural id part fluent interface + + + + Defines a reference to be used as a many-to-one key for this natural-id with an explicit column name. + + A member access lambda expression for the property + The natural ID part fluent interface + + + + Defines a reference to be used as a many-to-one key for this natural-id with an explicit column name. + + A member access lambda expression for the property + The column name in the database to use for this key, or null to use the property name + The natural id part fluent interface + + + + Specifies that this id is read-only + + This is the same as setting the mutable attribute to false + + + + Inverts the next boolean operation + + + + + Sets the tuplizer type. + + Type + + + + Sets the tuplizer type. + + Type + + + + Sets the tuplizer type. + + Type + + + + Sets the tuplizer mode + + Mode + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + Computes the Levenshtein Edit Distance between two enumerables. + The type of the items in the enumerables. + The first enumerable. + The second enumerable. + The edit distance. + + + + A reference to a component which is declared externally. Contains properties + that can't be declared externally (property name, for example) + + + + + Specify the column name + + Column name + + + + Specify the column length + + Column length + + + + Specify the nullability of the column + + + + + Specify the uniquness of the column + + + + + Specify the unique key constraint name + + Constraint name + + + + Specify the SQL type for the column + + SQL type + + + + Specify the index name + + Index name + + + + Inverts the next boolean + + + + + Defines a mapping for a component. Derive from this class to create a mapping, + and use the constructor to control how your component is persisted. + + + public class AddressMap : ComponentMap<Address> + { + public AddressMap() + { + Map(x => x.Street); + Map(x => x.City); + } + } + + Component type to map + + + + Specify a parent reference for this component + + Parent property + + ParentReference(x => x.Parent); + + + + + Specifies that this component is read-only + + + This is the same as calling both Not.Insert() and Not.Update() + + + + + Specifies that this component is insertable. + + + + + Specifies that this component is updatable + + + + + Specifies the uniqueness of this component + + + + + Specify that this component should be optimistically locked on access + + + + + Set the access and naming strategy for this component. + + + + + Invert the next boolean operation + + + + + Creates a component reference. This is a place-holder for a component that is defined externally with a + ; the mapping defined in said will be merged + with any options you specify from this call. + + Component type + Property exposing the component + Component reference builder + + + + The fluent-interface part for a external component reference. These are + components which have their bulk/body declared external to a class mapping + and are reusable. + + Component type + + + + Sets the prefix for any columns defined within the component. To refer to the property + that exposes this component use {property}. + + + // Entity using Address component + public class Person + { + public Address PostalAddress { get; set; } + } + + ColumnPrefix("{property}_") will result in any columns of Person.Address being prefixed with "PostalAddress_". + + Prefix for column names + + + + Maps to the Filter element in NH 2.0 + + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Inverts the next boolean + + + + + Defines how NHibernate will access the object for persisting/hydrating (Defaults to Property) + + + + + Implicit polymorphism + + + + + Explicit polymorphism + + + + + Takes a type that represents the level in the class/subclass-hiearchy that we're starting from, the parent, + this can be a class or subclass; also takes a list of subclass providers. The providers are then iterated + and added to a dictionary key'd by the types "distance" from the parentType; distance being the number of levels + between parentType and the subclass-type. + + By default if the Parent type is an interface the level will always be zero. At this time there is no check for + hierarchical interface inheritance. + + Starting point, parent type. + List of subclasses + Dictionary key'd by the distance from the parentType. + + + + The evalType starts out as the original subclass. The class hiearchy is only + walked if the subclass inherits from a class that is included in the subclassProviders. + + + + + + + + + The evalType is always one class higher in the hiearchy starting from the original subclass. The class + hiearchy is walked until the IsTopLevel (base class is Object) is met. The level is only incremented if + the subclass inherits from a class that is also in the subclassProviders. + + + + + + + + + Defines a mapping for an entity subclass. Derive from this class to create a mapping, + and use the constructor to control how your entity is persisted. + + + public class EmployeeMap : SubclassMap<Employee> + { + public EmployeeMap() + { + Map(x => x.Name); + Map(x => x.Age); + } + } + + Entity type to map + + + + (optional) Specifies that this subclass is abstract + + + + + Sets the dynamic insert behaviour + + + + + Sets the dynamic update behaviour + + + + + Specifies that this entity should be lazy loaded + + + + + Specify a proxy type for this entity + + Proxy type + + + + Specify a proxy type for this entity + + Proxy type + + + + Specify that a select should be performed before an update of this entity + + + + + Set the discriminator value, if this entity is in a table-per-class-hierarchy + mapping strategy. + + Discriminator value + + + + Sets the table name + + Table name + + + + Sets the schema + + Schema + + + + Specifies a check constraint + + Constraint name + + + + Adds a column to the key for this subclass, if used + in a table-per-subclass strategy. + + Column name + + + + Subselect query + + Subselect query + + + + Specifies a persister for this entity + + Persister type + + + + Specifies a persister for this entity + + Persister type + + + + Specifies a persister for this entity + + Persister type + + + + Set the query batch size + + Batch size + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Links this entity to another table, to create a composite entity from two or + more tables. This only works if you're in a table-per-inheritance-hierarchy + strategy. + + Joined table name + Joined table mapping + + Join("another_table", join => + { + join.Map(x => x.Name); + join.Map(x => x.Age); + }); + + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + (optional) Specifies the entity from which this subclass descends/extends. + + Type of the entity to extend + + + + Inverts the next boolean setting + + + + + Container for automatic mappings + + + + + Add automatic mappings + + Lambda returning an auto mapping setup + Auto mappings configuration + + + + Add automatic mappings + + Auto mapping setup + Auto mappings configuration + + + + Sets the export location for generated mappings + + Path to folder for mappings + Auto mappings configuration + + + + Sets the text writer to write the generated mappings to. + + Fluent mappings configuration + + + + Applies any added mappings to the NHibernate Configuration + + NHibernate Configuration instance + + + + + Gets whether any mappings were added + + + + + Initializes a new instance of the class using the + MS Oracle Client (System.Data.OracleClient) library specifying the Oracle 9i dialect. + + + + + Initializes a new instance of the class using the + MS Oracle Client (System.Data.OracleClient) library specifying the Oracle 10g dialect. + This allows for ANSI join syntax. + + + + + Initializes a new instance of the class using the + Oracle Data Provider (Oracle.DataAccess) library specifying the Oracle 8i dialect. + The Oracle.DataAccess library must be available to the calling application/library. + + + + + Initializes a new instance of the class using the + Oracle Data Provider (Oracle.DataAccess) library specifying the Oracle 9i dialect. + The Oracle.DataAccess library must be available to the calling application/library. + + + + + Initializes a new instance of the class using the + Oracle Data Provider (Oracle.DataAccess) library specifying the Oracle 10g dialect. + The Oracle.DataAccess library must be available to the calling application/library. + This allows for ANSI join syntax. + + + + + Specifies the server to connect. This can be either the DNS name of the + server or the IP (as a string). + + The server. + + + + + Specifies the instance (database name) to use. This can be the short name or the + fully qualified name (Oracle service name). + + The instance. + + + + + Specifies the name of the user account accessing the database. + + The username. + + + + + Specifies the password of the user account accessing the database. + + The password. + + + + + Optional. Ports the specified port the oracle database is running on. This defaults to 1521. + + The port. + + + + + Enable or disable pooling connections for this data configuration. + + if set to true enable pooling. + + + + + Specifies the SQL statement cache size to use for this connection. + + Size of the cache. + + + + + Specifies, as a string, other Oracle options to pass to the connection. + + The other options. + + + + + Initializes a new instance of the class using the + Oracle Data Provider (Oracle.DataAccess) library specifying the Oracle 9i dialect. + The Oracle.DataAccess library must be available to the calling application/library. + + + + + Initializes a new instance of the class using the + Oracle Data Provider (Oracle.DataAccess) library specifying the Oracle 10g dialect. + The Oracle.DataAccess library must be available to the calling application/library. + + + + + The type of authentication to be used. Acceptable values: + + + SERVER + + + SERVER_ENCRYPT + + + DATA_ENCRYPT + + + KERBEROS + + + GSSPLUGIN + + + + + IfxDRDAConnectionStringBuilder object + + + + The name of the database within the server instance. + + + IfxSQLIConnectionStringBuilder object + + + + + + true + - host variable (:param) support enabled. + + + false (default) + - host variable support disabled. + + + + + IfxSQLIConnectionStringBuilder object + + + + Isolation level for the connection. Possible values: + + + ReadCommitted + + + ReadUncommitted + + + RepeatableRead + + + Serializable + + + Transaction + + + This keyword is only supported for applications participating in a + distributed transaction. + + + IfxDRDAConnectionStringBuilder object + + + + The maximum number of connections allowed in the pool. + + + IfxDRDAConnectionStringBuilder object + + + + The minimum number of connections allowed in the pool. Default value 0. + + + IfxDRDAConnectionStringBuilder object + + + + The password associated with the User ID. + + + IfxDRDAConnectionStringBuilder object + + + + When set to true, the IfxConnection object is drawn from + the appropriate pool, or if necessary, it is created and added + to the appropriate pool. Default value 'true'. + + + IfxDRDAConnectionStringBuilder object + + + + Server name with optional port number for direct connection using either + IPv4 notation ([:]]]>) or IPv6 notation. + + + IfxDRDAConnectionStringBuilder object + + + + The login account. + + + IfxDRDAConnectionStringBuilder object + + + + Other options: Connection Lifetime, Connection Reset, Connection Timeout, CurrentSchema, Enlist, + Interrupt, Persist Security Info, ResultArrayAsReturnValue, Security, TrustedContextSystemUserID, + TrustedContextSystemPassword + + + IfxDRDAConnectionStringBuilder object + + + + Client locale, default value is en_us.CP1252 (Windows) + + + IfxSQLIConnectionStringBuilder object + + + + The name of the database within the server instance. + + + IfxSQLIConnectionStringBuilder object + + + + The language locale of the database. Default value is en_US.8859-1 + + + IfxSQLIConnectionStringBuilder object + + + + When set to true or y for yes, any string within double + quotes (") is treated as an identifier, and any string within + single quotes (') is treated as a string literal. Default value 'y'. + + + IfxSQLIConnectionStringBuilder object + + + + The name or IP address of the machine on which the + Informix server is running. Required. + + + IfxSQLIConnectionStringBuilder object + + + + The maximum number of connections allowed in the pool. Default value 100. + + + IfxSQLIConnectionStringBuilder object + + + + The minimum number of connections allowed in the pool. Default value 0. + + + IfxSQLIConnectionStringBuilder object + + + + The password associated with the User ID. Required if the + client machine or user account is not trusted by the host. + Prohibited if a User ID is not given. + + + IfxSQLIConnectionStringBuilder object + + + + When set to true, the IfxConnection object is drawn from + the appropriate pool, or if necessary, it is created and added + to the appropriate pool. Default value 'true'. + + + IfxSQLIConnectionStringBuilder object + + + + The name or alias of the instance of the Informix server to + which to connect. Required. + + + IfxSQLIConnectionStringBuilder object + + + + The service name or port number through which the server + is listening for connection requests. + + + IfxSQLIConnectionStringBuilder object + + + + The login account. Required, unless the client machine is + trusted by the host machine. + + + IfxSQLIConnectionStringBuilder object + + + + Other options like: Connection Lifetime, Enlist, Exclusive, Optimize OpenFetchClose, + Fetch Buffer Size, Persist Security Info, Protocol, Single Threaded, Skip Parsing + + + IfxSQLIConnectionStringBuilder object + + + + Fluent configuration API for NHibernate + + + + + Configure diagnostic logging + + Diagnostic configuration + + + + Apply database settings + + Lambda returning database configuration + Fluent configuration + + + + Apply database settings + + Database configuration instance + Fluent configuration + + + + Configure caching. + + + Cache(x => + { + x.UseQueryCache(); + x.UseMinimalPuts(); + }); + + Closure for configuring caching + Configuration builder + + + + Sets the collectiontype.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the collectiontype.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the collectiontype.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the proxyfactory.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the proxyfactory.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the proxyfactory.factory_class property. + NOTE: NHibernate 2.1 only + + factory class + Configuration + + + + Sets the current_session_context_class property. + + current session context class + Configuration + + + + Sets the current_session_context_class property. + + Implementation of ICurrentSessionContext to use + Configuration + + + + Apply mappings to NHibernate + + Lambda used to apply mappings + Fluent configuration + + + + Allows altering of the raw NHibernate Configuration object before creation + + Lambda used to alter Configuration + Fluent configuration + + + + Verify's the configuration and instructs NHibernate to build a SessionFactory. + + ISessionFactory from supplied settings. + + + + Verifies the configuration and populates the NHibernate Configuration instance. + + NHibernate Configuration instance + + + + Creates an exception based on the current state of the configuration. + + Inner exception + FluentConfigurationException with state + + + + Fluently configure NHibernate + + + + + Begin fluently configuring NHibernate + + Fluent Configuration + + + + Begin fluently configuring NHibernate + + Instance of an NHibernate Configuration + Fluent Configuration + + + + Container for fluent mappings + + + + + Add all fluent mappings in the assembly that contains T. + + Type from the assembly + Fluent mappings configuration + + + + Add all fluent mappings in the assembly + + Assembly to add mappings from + Fluent mappings configuration + + + + Adds a single represented by the specified type. + + Fluent mappings configuration + + + + Adds a single represented by the specified type. + + The type. + Fluent mappings configuration + + + + Sets the export location for generated mappings + + Path to folder for mappings + Fluent mappings configuration + + + + Sets the text writer to write the generated mappings to. + + Fluent mappings configuration + + + + Applies any added mappings to the NHibernate Configuration + + PersistenceModel to alter + + + + Alter convention discovery + + + + + Gets whether any mappings were added + + + + + Container for Hbm mappings + + + + + Add explicit classes with Hbm mappings + + List of types to map + Hbm mappings configuration + + + + Add all Hbm mappings in the assembly that contains T. + + Type from the assembly + Hbm mappings configuration + + + + Add all Hbm mappings in the assembly + + Assembly to add mappings from + Hbm mappings configuration + + + + Applies any added mappings to the NHibernate Configuration + + NHibernate Configuration instance + + + + Gets whether any mappings were added + + + + + Fluent mapping configuration + + + + + Applies any mappings to the NHibernate Configuration + + NHibernate Configuration instance + + + + Fluent mappings + + + + + Automatic mapping configurations + + + + + Hbm mappings + + + + + Get whether any mappings of any kind were added + + + + + Convention finder - used to search through assemblies for types that implement a specific convention interface. + + + + + Add a source to be queried. + + Source to query + + + + Add an assembly to be queried. + + + All convention types must have a parameterless constructor, or a single parameter of . + + Assembly instance to query + + + + Adds all conventions found in the assembly that contains . + + + All convention types must have a parameterless constructor, or a single parameter of . + + + + + Add a single convention by type. + + + Type must have a parameterless constructor, or a single parameter of . + + Convention type + + + + Add a single convention by type. + + + Types must have a parameterless constructor, or a single parameter of . + + Type of convention + + + + Add an instance of a convention. + + + Useful for supplying conventions that require extra constructor parameters. + + Convention type + Instance of convention + + + + Find any conventions implementing T. + + Convention interface type + IEnumerable of T + + + + Default convention finder - doesn't do anything special. + + + + + Find any conventions implementing T. + + Convention interface type + IEnumerable of T + + + + Add an assembly to be queried. + + + All convention types must have a parameterless constructor, or a single parameter of IConventionFinder. + + Assembly instance to query + + + + Adds all conventions found in the assembly that contains T. + + + All convention types must have a parameterless constructor, or a single parameter of IConventionFinder. + + + + + Add a single convention by type. + + + Type must have a parameterless constructor, or a single parameter of IConventionFinder. + + Convention type + + + + Add a single convention by type. + + + Types must have a parameterless constructor, or a single parameter of . + + Type of convention + + + + Add an instance of a convention. + + + Useful for supplying conventions that require extra constructor parameters. + + Convention type + Instance of convention + + + + Indicates whether the current is equal to another . + + + true if the current object is equal to the parameter; otherwise, false. + + An Entity to compare with this object. + + + + Determines whether the specified is equal to the current . + + + true if the specified is equal to the current ; otherwise, false. + + The to compare with the current . + The parameter is null.2 + + + + Serves as a hash function for a Entity. + + + A hash code for the current . + + 2 + + + + Set which type this subclass extends. + Note: This doesn't actually get output into the XML, it's + instead used as a marker for the + to pair things up. + + + + + Represents the "Any" mapping in NHibernate. It is impossible to specify a foreign key constraint for this kind of association. For more information + please reference chapter 5.2.4 in the NHibernate online documentation + + + + + Sets the meta-type value for this any mapping. + + Meta type + + + + Sets the meta-type value for this any mapping. + + Meta type + + + + Sets the meta-type value for this any mapping. + + Meta type + + + + Defines how NHibernate will access the object for persisting/hydrating (Defaults to Property) + + + + + Cascade style (Defaults to none) + + + + + Access strategy mapping builder. + + + + + Access strategy mapping builder. + + + + + Sets the access-strategy to property. + + + + + Sets the access-strategy to field. + + + + + Sets the access-strategy to use the backing-field of an auto-property. + + + + + Sets the access-strategy to readonly. + + + + + Sets the access-strategy to field and the naming-strategy to camelcase (field.camelcase). + + + + + Sets the access-strategy to field and the naming-strategy to camelcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to field and the naming-strategy to lowercase. + + + + + Sets the access-strategy to field and the naming-strategy to lowercase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to field and the naming-strategy to pascalcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to camelcase. + + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to camelcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to lowercase. + + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to lowercase. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to pascalcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to use the type referenced. + + Assembly qualified name of the type to use as the access-strategy + + + + Sets the access-strategy to use the type referenced. + + Type to use as the access-strategy + + + + Sets the access-strategy to use the type referenced. + + Type to use as the access-strategy + + + + Force NHibernate to always select using the discriminator value, even when selecting all subclasses. This + can be useful when your table contains more discriminator values than you have classes (legacy). + + Sets the "force" attribute. + + + + Set this discriminator as read-only. Call this if your discriminator column is also part of a mapped composite identifier. + + Sets the "insert" attribute. + + + + An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based discrimination. + + SQL expression + + + + Sets the precision for decimals + + Decimal precision + + + + Specifies the scale for decimals + + Decimal scale + + + + Specify the column length + + Column length + + + + Specify the nullability of this column + + + + + Specifies the uniqueness of this column + + + + + Specifies the unique key constraint name + + Constraint columns + + + + Specifies the index name + + Index name + + + + Specifies a check constraint name + + Constraint name + + + + Specifies the default value for the discriminator + + Default value + + + + Specifies a custom type for the discriminator + + + This is often used with + + Custom type + + + + Specifies a custom type for the discriminator + + + This is often used with + + Custom type + + + + Specifies a custom type for the discriminator + + + This is often used with + + Custom type + + + + Specifies a custom SQL type for the discriminator. + + Custom SQL type. + + + + Invert the next boolean operation + + + + + Pre-defined discriminator values + + + + + Null discriminator value + + + + + Non-null discriminator value + + + + + Specify the element column name + + Column name + + + + Specify the element type + + Element type + + + + Specify the element column length + + Column length + + + + Specify the element column formula + + Formula + + + + Modify the columns for this element + + + + + Sets caching to read-write + + + + + Sets caching to non-strict read-write + + + + + Sets caching to read-only + + + + + Sets caching to transactional + + + + + Specifies a custom cache behaviour + + Custom behaviour + + + + Specifies the cache region + + + + + + Include all properties for caching + + + + + + Include only non-lazy properties for caching + + + + + Specify a custom property inclusion strategy + + Inclusion strategy + + + + Base class for user type conventions. Create a subclass of this to automatically + map all properties that the user type can be used against. Override Accept or + Apply to alter the behavior. + + IUserType implementation + + + + Base class for attribute based conventions. Create a subclass of this to supply your own + attribute based conventions. + + Attribute identifier + + + + Apply changes to a property with an attribute matching T. + + Instance of attribute found on property. + Property with attribute + + + + Cascade all actions + + + + + Cascade no actions + + + + + Cascade saves and updates + + + + + Cascade deletes + + + + + Cascade deletes + + + + + Cascade all actions, deleting any orphaned records + + + + + Cascade deletes, deleting any orphaned records + + + + + Map a property + + Dictionary key + + Map("Age"); + + + + + Map a property + + Dictionary key + Property type + + Map<int>("Age"); + + + + + Join fetching + + + + + Select fetching + + + + + Subselect/subquery fetching + + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Thrown when a prefix is specified for an access-strategy that isn't supported. + + + + + Naming strategy prefix. + + + + + Property is never database generated + + + + + Property is only generated on insert + + + + + Property is always database generated + + + + + Checks a list of components for validity. + + Entity type + Type of list element + Persistence specification + Property + Value to save + Equality comparer + + + + Converts an expression to a best guess SQL string + + + + + Converts a Func expression to a best guess SQL string + + + + + Converts a boolean Func expression to a best guess SQL string + + + + + Gets the value of a method call. + + Method call expression + + + + Specify an alternative name for the type + + Alternative name + + + + Used to set the Not-Found attribute to ignore. This tells NHibernate to + return a null object rather then throw an exception when the join fails + + + + + Used to set the Not-Found attribute to exception (Nhibernate default). This + tells NHibernate to throw an exception when the join fails + + + + + Specifies the child class + + Child + + + + Specifies the child class + + Child + + + + Specifies that this relationship should be created with a default-named + foreign-key + + + + + Specify the foreign-key constraint name + + Foreign-key constraint + + + + Sets the property reference + + Property + + + + Sets the property reference + + Property + + + + Specifies that this relationship is constrained + + + + + Specify the lazy behaviour of this relationship. + + + Defaults to Proxy lazy-loading. Use the modifier to disable + lazy-loading, and use the + overload to specify alternative lazy strategies. + + + LazyLoad(); + Not.LazyLoad(); + + + + + Specify the lazy behaviour of this relationship. Cannot be used + with the modifier. + + Laziness strategy + + LazyLoad(Laziness.NoProxy); + + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Sets the fetch behaviour for this relationship + + + Fetch.Select(); + + + + + Sets the cascade behaviour for this relationship + + + Cascade.All(); + + + + + Specifies the access strategy for this relationship + + + Access.Field(); + + + + + Inverts the next boolean operation + + + + + No optimistic locking + + + + + Version locking + + + + + Dirty locking + + + + + Lock on everything + + + + + Use no locking strategy + + + + + Use version locking + + + + + Use dirty locking + + + + + Use all locking + + + + + This method is used to set a different key column in this table to be used for joins. + The output is set as the property-ref attribute in the "key" subelement of the collection + + The name of the column in this table which is linked to the foreign key + OneToManyPart + + + + Specify the lazy-load behaviour + + + + + Specify extra lazy loading + + + + + Inverse the ownership of this entity. Make the other side of the relationship + responsible for saving. + + + + + Use a set collection + + + + + Use a set collection + + Sorting + + + + Use a set collection + + Item comparer + + + + Use a bag collection + + + + + Use a list collection + + + + + Use a list collection with an index + + Index mapping + + + + Use a map collection + + Index type + Index property + + + + Use a map collection + + Index type + Index property + Sorting + + + + Use a map collection + + Index column name + + + + Use a map collection + + Index column name + Sorting + + + + Use a map collection + + Index type + Index column name + + + + Use a map collection + + Index type + Index column name + Sorting + + + + Use a map collection + + Index type + Comparer + Index column name + + + + Use a map collection + + Index type + Index property + Index mapping + + + + Use a map collection + + Index type + Index property + Index mapping + Sorting + + + + Use a map collection + + Index type + Index mapping + Element mapping + + + + Use an array + + Index type + Index property + + + + Use an array + + Index type + Index property + Index mapping + + + + Make this collection indexed + + Index type + Index property + Index mapping + + + + Make this collection index + + Index type + Index column + Index mapping + + + + Map an element/value type + + Column name + + + + Map an element/value type + + Column name + Custom mapping + + + + Maps this collection as a collection of components. + + Component mapping + + + + Sets the table name for this one-to-many. + + Table name + + + + Specify that the deletes should be cascaded + + + + + Specifies whether this collection should be optimistically locked. + + + + + Specify a custom persister + + Persister + + + + Specify a check constraint + + Constraint name + + + + Specify that this collection is generic (optional) + + + + + Sets the where clause for this one-to-many relationship. + + + + + Specify the select batch size + + Batch size + + + + Sets a custom collection type + + + + + Sets a custom collection type + + + + + Sets a custom collection type + + + + + Sets a custom collection type + + + + + Specify the table schema + + Schema name + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Applies a filter to this entity given it's name. + + + Applies a filter to this entity given it's name. + + The filter's name + The condition to apply + + + + Applies a filter to this entity given it's name. + + + Applies a filter to this entity given it's name. + + The filter's name + + + + Applies a named filter to this one-to-many. + + + Applies a named filter to this one-to-many. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to this one-to-many. + + + The type of a implementation + defining the filter to apply. + + + + + Return the type of the owning entity + + Type + + + + Specify caching for this entity. + + + + + Specify the cascade behaviour + + + + + Specify the fetching behaviour + + + + + Set the access and naming strategy for this one-to-many. + + + + + Inverts the next boolean operation + + + + + Access strategy mapping builder. + + Mapping part to be applied to + + + + Access strategy mapping builder. + + Instance of the parent mapping part. + Setter for altering the model + + + + Sets the access-strategy to property. + + + + + Sets the access-strategy to field. + + + + + Sets the access-strategy to use the backing-field of an auto-property. + + + + + Sets the access-strategy to readonly. + + + + + + Sets the access-strategy to field and the naming-strategy to camelcase (field.camelcase). + + + + + Sets the access-strategy to field and the naming-strategy to camelcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to field and the naming-strategy to lowercase. + + + + + Sets the access-strategy to field and the naming-strategy to lowercase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to field and the naming-strategy to pascalcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to camelcase. + + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to camelcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to lowercase. + + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to lowercase. + + Naming-strategy prefix + + + + Sets the access-strategy to read-only property (nosetter) and the naming-strategy to pascalcase, with the specified prefix. + + Naming-strategy prefix + + + + Sets the access-strategy to use the type referenced. + + Assembly qualified name of the type to use as the access-strategy + + + + Sets the access-strategy to use the type referenced. + + Type to use as the access-strategy + + + + Sets the access-strategy to use the type referenced. + + Type to use as the access-strategy + + + + Specify the lazy-load behaviour + + + + + Component-element for component HasMany's. + + Component type + + + + Map a property + + Property + + Map(x => x.Age); + + + + + Map a property + + Property + Column name + + Map(x => x.Age, "person_age"); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + + References(x => x.Company); + + + + + Create a reference to another entity. In database terms, this is a many-to-one + relationship. + + Other entity + Property on the current entity + Column name + + References(x => x.Company, "person_company_id"); + + + + + Maps a property of the component class as a reference back to the containing entity + + Parent reference property + Component being mapped + + + + Create a nested component mapping. + + Component property + Action for creating the component + + HasMany(x => x.Locations) + .Component(c => + { + c.Map(x => x.Name); + c.Component(x => x.Address, addr => + { + addr.Map(x => x.Street); + addr.Map(x => x.PostCode); + }); + }); + + + + + Defines a property to be used as a key for this composite-id. + + A member access lambda expression for the property + The composite identity part fluent interface + + + + Defines a property to be used as a key for this composite-id with an explicit column name. + + A member access lambda expression for the property + The column name in the database to use for this key, or null to use the property name + The composite identity part fluent interface + + + + Defines a property to be used as a key for this composite-id with an explicit column name. + + A member access lambda expression for the property + Additional settings for the key property + The composite identity part fluent interface + + + + Defines a reference to be used as a many-to-one key for this composite-id with an explicit column name. + + A member access lambda expression for the property + The composite identity part fluent interface + + + + Defines a reference to be used as a many-to-one key for this composite-id with an explicit column name. + + A member access lambda expression for the property + A list of column names used for this key + The composite identity part fluent interface + + + + Defines a reference to be used as a many-to-one key for this composite-id with an explicit column name. + + A member access lambda expression for the property + A lambda expression specifying additional settings for the key reference + A list of column names used for this key + The composite identity part fluent interface + + + + Specifies that this composite id is "mapped"; aka, a composite id where + the properties exist in the identity class as well as in the entity itself + + + + + Specifies the unsaved value for the identity + + Unsaved value + + + + You may use a component as an identifier of an entity class. Your component class must + satisfy certain requirements: + + * It must be Serializable. + * It must re-implement Equals() and GetHashCode(), consistently with the database's + notion of composite key equality. + + You can't use an IIdentifierGenerator to generate composite keys. Instead the application + must assign its own identifiers. Since a composite identifier must be assigned to the object + before saving it, we can't use unsaved-value of the identifier to distinguish between newly + instantiated instances and instances saved in a previous session. You may instead implement + IInterceptor.IsUnsaved() if you wish to use SaveOrUpdate() or cascading save / update. As an + alternative, you may also set the unsaved-value attribute on a version or timestamp to specify + a value that indicates a new transient instance. In this case, the version of the entity is + used instead of the (assigned) identifier and you don't have to implement + IInterceptor.IsUnsaved() yourself. + + The property of component type that holds the composite identifier. + + Your persistent class must override Equals() and GetHashCode() to implement composite identifier + equality. It must also be Serializable. + + + + + Set the access and naming strategy for this identity. + + + + + Invert the next boolean operation + + + + + generates identifiers of any integral type that are unique only when no other + process is inserting data into the same table. Do not use in a cluster. + + + + + + generates identifiers of any integral type that are unique only when no other + process is inserting data into the same table. Do not use in a cluster. + + Params configuration + + + + supports identity columns in DB2, MySQL, MS SQL Server and Sybase. + The identifier returned by the database is converted to the property type using + Convert.ChangeType. Any integral property type is thus supported. + + + + + + supports identity columns in DB2, MySQL, MS SQL Server and Sybase. + The identifier returned by the database is converted to the property type using + Convert.ChangeType. Any integral property type is thus supported. + + Params configuration + + + + uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. + The identifier returned by the database is converted to the property type + using Convert.ChangeType. Any integral property type is thus supported. + + + + + + + uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. + The identifier returned by the database is converted to the property type + using Convert.ChangeType. Any integral property type is thus supported. + + + Params configuration + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + The table. + The column. + The max lo. + The where. + + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + Params configuration + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + + + + + uses a hi/lo algorithm to efficiently generate identifiers of any integral type, + given a table and column (by default hibernate_unique_key and next_hi respectively) + as a source of hi values. The hi/lo algorithm generates identifiers that are unique + only for a particular database. Do not use this generator with a user-supplied connection. + requires a "special" database table to hold the next available "hi" value + + + Params configuration + + + + uses an Oracle-style sequence (where supported) + + + + + + + + uses an Oracle-style sequence (where supported) + + + + Params configuration + + + + uses System.Guid and its ToString(string format) method to generate identifiers + of type string. The length of the string returned depends on the configured format. + + http://msdn.microsoft.com/en-us/library/97af8hh4.aspx + + + + + uses System.Guid and its ToString(string format) method to generate identifiers + of type string. The length of the string returned depends on the configured format. + + http://msdn.microsoft.com/en-us/library/97af8hh4.aspx + Params configuration + + + + uses a new System.Guid to create a byte[] that is converted to a string. + + + + + + uses a new System.Guid to create a byte[] that is converted to a string. + + Params configuration + + + + uses a new System.Guid as the identifier. + + + + + + uses a new System.Guid as the identifier. + + Params configuration + + + + Recommended for Guid identifiers! + uses the algorithm to generate a new System.Guid described by Jimmy Nilsson + in the article http://www.informit.com/articles/article.asp?p=25862. + + + + + + Recommended for Guid identifiers! + uses the algorithm to generate a new System.Guid described by Jimmy Nilsson + in the article http://www.informit.com/articles/article.asp?p=25862. + + Params configuration + + + + lets the application to assign an identifier to the object before Save() is called. + + + + + + lets the application to assign an identifier to the object before Save() is called. + + Params configuration + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + Params configuration + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + picks identity, sequence or hilo depending upon the capabilities of the underlying database. + + + + + uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association. + + + + + + + uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association. + + + Params configuration + + + + Generator that uses the RDBMS native function to generate a GUID. + The behavior is similar to the “sequence” generator. When a new + object is saved NH run two queries: the first to retrieve the GUID + value and the second to insert the entity using the Guid retrieved + from the RDBMS. Your entity Id must be System.Guid and the SQLType + will depend on the dialect (RAW(16) in Oracle, UniqueIdentifier in + MsSQL for example). + + + + + Generator that uses the RDBMS native function to generate a GUID. + The behavior is similar to the “sequence” generator. When a new + object is saved NH run two queries: the first to retrieve the GUID + value and the second to insert the entity using the Guid retrieved + from the RDBMS. Your entity Id must be System.Guid and the SQLType + will depend on the dialect (RAW(16) in Oracle, UniqueIdentifier in + MsSQL for example). + + + GuidNative(x => + { + x.AddParam("key", "value"); + }); + + Parameter builder closure + + + + A deviation of the trigger-identity. This generator works + together with the feature. + The difference with trigger-identity is that the POID value + is retrieved by a SELECT using the natural-id fields as filter. + + + + + A deviation of the trigger-identity. This generator works + together with the feature. + The difference with trigger-identity is that the POID value + is retrieved by a SELECT using the natural-id fields as filter. + + + Select(x => + { + x.AddParam("key", "value"); + }); + + Parameter builder closure + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Custom sequence name + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Parameter builder closure + + + + Based on sequence but works like an identity. The POID + value is retrieved with an INSERT query. Your entity Id must + be an integral type. + "hibernate_sequence" is the default name for the sequence, unless + another is provided. + + Custom sequence name + Parameter builder closure + + + + trigger-identity is a NHibernate specific feature where the POID + is generated by the RDBMS with an INSERT query through a + BEFORE INSERT trigger. In this case you can use any supported type, + including a custom type, with the limitation of a single column usage. + + + + + trigger-identity is a NHibernate specific feature where the POID + is generated by the RDBMS with an INSERT query through a + BEFORE INSERT trigger. In this case you can use any supported type, + including a custom type, with the limitation of a single column usage. + + Parameter builder closure + + + + Sets the unsaved-value of the identity. + + Value that represents an unsaved value. + + + + Sets the column name for the identity field. + + Column name + + + + Specify the identity column length + + Column length + + + + Specify the decimal precision + + Decimal precision + + + + Specify the decimal scale + + Decimal scale + + + + Specify the nullability of the identity column + + + + + Specify the uniqueness of the identity column + + + + + Specify a unique key constraint + + Constraint columns + + + + Specify a custom SQL type + + SQL type + + + + Specify an index name + + Index name + + + + Specify a check constraint + + Constraint name + + + + Specify a default value + + Default value + + + + Specify a custom type + + + This is usually used with an + + Custom type + + + + Specify a custom type + + + This is usually used with an + + Custom type + + + + Specify a custom type + + + This is usually used with an + + Custom type + + + + Specify the generator + + + Id("PersonId") + .GeneratedBy.Assigned(); + + + + + Set the access and naming strategy for this identity. + + + + + Invert the next boolean operation + + + + + Sets a single child key column. If there are multiple columns, use ChildKeyColumns.Add + + + + + Sets a single parent key column. If there are multiple columns, use ParentKeyColumns.Add + + + + + Sets the order-by clause on the collection element. + + + + + Sets the order-by clause on the many-to-many element. + + + + + Applies a filter to the child element of this entity given it's name. + + + Applies a filter to the child element of this entity given it's name. + + The filter's name + The condition to apply + + + + Applies a filter to the child element of this entity given it's name. + + + Applies a filter to the child element of this entity given it's name. + + The filter's name + + + + Applies a named filter to the child element of this many-to-many. + + + Applies a named filter to the child element of this many-to-many. + + The condition to apply + + The type of a implementation + defining the filter to apply. + + + + + Applies a named filter to the child element of this many-to-many. + + + The type of a implementation + defining the filter to apply. + + + + + Sets the where clause for this relationship, on the many-to-many element. + + + + + Sets the where clause for this relationship, on the many-to-many element. + Note: This only supports simple cases, use the string overload for more complex clauses. + + + + + Sets whether this relationship is unique + + + Unique(); + Not.Unique(); + + + + + Specifies the name of a multi-column unique constraint. + + Name of constraint + + + + Specifies the index name + + Index name + + + + Specifies the child class of this relationship + + Child + + + + Specifies the child class of this relationship + + Child + + + + Sets this relationship to read-only + + + This is the same as calling both Not.Insert() and Not.Update() + + + ReadOnly(); + Not.ReadOnly(); + + + + + Specify the lazy behaviour of this relationship. + + + Defaults to Proxy lazy-loading. Use the modifier to disable + lazy-loading, and use the + overload to specify alternative lazy strategies. + + + LazyLoad(); + Not.LazyLoad(); + + + + + Specify the lazy behaviour of this relationship. Cannot be used + with the modifier. + + Laziness strategy + + LazyLoad(Laziness.NoProxy); + + + + + Specifies this relationship should be created with a default-named + foreign key. + + + + + Specifies the foreign-key constraint name + + Constraint name + + + + Specifies that this relationship is insertable + + + + + Specifies that this relationship is updatable + + + + + Sets the single column used in this relationship. Use + if you need to specify more than one column. + + Column name + + + + Specifies the columns used in this relationship + + Columns + + + + Specifies the columns used in this relationship + + Columns + + + + Specifies the sql formula used for this relationship + + Formula + + + + Specifies the property reference + + Property + + + + Specifies the property reference + + Property + + + + Sets this relationship to nullable + + + Nullable(); + Not.Nullable(); + + + + + Specifies an entity-name. + + See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx + + + + Set the fetching strategy + + + Fetch.Select(); + + + + + Set the behaviour for when this relationship is null in the database + + + NotFound.Exception(); + + + + + Specifies the cascade behaviour for this relationship + + + Cascade.All(); + + + + + Specifies the access strategy for this relationship + + + Access.Field(); + + + + + Inverts the next boolean + + + + + Specify that this is a ternary association + + + + + Specify that this is a ternary association + + Index column + + + + Specify this as an entity map + + + + + Specify this as an entity map + + Index column + + + + Specify the key column name + + Column name + + + + Specify a foreign key constraint + + Constraint name + + + + Sets the order-by clause for this one-to-many relationship. + + + + + Specify that this collection is read-only + + + + + Specify a sub-select query for fetching this collection + + Query + + + + Specify that the key is updatable + + + + + Specify that the key is nullable + + + + + Sets the where clause for this one-to-many relationship. + Note: This only supports simple cases, use the string overload for more complex clauses. + + + + + Specifies the behaviour for if this collection is not found + + + + + Specify the cascade behaviour + + + + + Modify the key columns collection + + + + + Specify the property column name + + Column name + + + + Specify that this property is insertable + + + + + Specify that this property is updatable + + + + + Specify the column length + + Column length + + + + Specify the nullability of this property + + + + + Specify that this property is read-only + + + + + Specify the property formula + + Formula + + + + Specify the lazy-loading behaviour + + + + + Specify an index name + + Index name + + + + Specifies that a custom type (an implementation of ) should be used for this property for mapping it to/from one or more database columns whose format or type doesn't match this .NET property. + + A type which implements . + This property mapping to continue the method chain + + + + Specifies that a custom type (an implementation of ) should be used for this property for mapping it to/from one or more database columns whose format or type doesn't match this .NET property. + + A type which implements . + This property mapping to continue the method chain + + + + Specifies that a custom type (an implementation of ) should be used for this property for mapping it to/from one or more database columns whose format or type doesn't match this .NET property. + + A type which implements . + This property mapping to continue the method chain + + + + Specifies that a custom type (an implementation of ) should be used for this property for mapping it to/from one or more database columns whose format or type doesn't match this .NET property. + + A function which returns a type which implements . The argument of the function is the mapped property type + This property mapping to continue the method chain + + + + Specify a custom SQL type + + SQL type + + + + Specify that this property has a unique constranit + + + + + Specify decimal precision + + Decimal precision + + + + Specify decimal scale + + Decimal scale + + + + Specify a default value + + Default value + + + + Specifies the name of a multi-column unique constraint. + + Name of constraint + + + + Specify that this property is optimistically locked + + + + + Specify a check constraint + + Constraint name + + + + Specify if this property is database generated + + + Generated.Insert(); + + + + + Modify the columns collection + + + + + Set the access and naming strategy for this property. + + + + + Inverts the next boolean + + + + + Specify the column name + + Column name + + + + Specify the unsaved value + + Unsaved value + + + + Specify the column length + + Column length + + + + Specify decimal precision + + Decimal precision + + + + Specify decimal scale + + Decimal scale + + + + Specify the nullability of the column + + + + + Specify the uniqueness of the column + + + + + Specify a unique key constraint + + Constraint columns + + + + Specify an index name + + Index name + + + + Specify a check constraint + + Constraint name + + + + Specify a default value + + Default value + + + + Specify a custom type + + Usually used with an + Custom type + + + + Specify a custom type + + Usually used with an + Custom type + + + + Specify a custom type + + Usually used with an + Custom type + + + + Specify a custom SQL type + + SQL type + + + + Specify if this version is database generated + + + + + Specify the access strategy + + + + + Invert the next boolean operation + + + + + Reveals a hidden property or field for use instead of expressions. + + Entity type + Name of property or field + Expression for the hidden property or field + + + + Reveals a hidden property or field with a specific return type for use instead of expressions. + + Entity type + Property or field return type + Name of property or field + Expression for the hidden property or field + + + + Visitor that performs validation against the mapping model. + + + + + Gets or sets whether validation is performed. + + + + diff --git a/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.dll b/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.dll new file mode 100644 index 000000000..ed634c292 Binary files /dev/null and b/packages/FluentNHibernate.1.3.0.733/lib/FluentNHibernate.dll differ diff --git a/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nupkg b/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nupkg new file mode 100644 index 000000000..8783eb64e Binary files /dev/null and b/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nupkg differ diff --git a/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nuspec b/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nuspec new file mode 100644 index 000000000..547886bfc --- /dev/null +++ b/packages/Iesi.Collections.3.2.0.4000/Iesi.Collections.3.2.0.4000.nuspec @@ -0,0 +1,16 @@ + + + + Iesi.Collections + 3.2.0.4000 + Iesi.Collections + Aidant Systems, Jason Smith, NHibernate community + Aidant Systems, Jason Smith, NHibernate community + false + The System.Collections namespace in the .NET Framework provides a number of collection + types that are extremely useful for manipulating data in memory. However, there is one + type of collection that is conspicuously missing from System.Collections: the Set. + The System.Collections namespace in the .NET Framework provides a number of collection types that are extremely useful for manipulating data in memory. However, there is one type of collection that is conspicuously missing from System.Collections: the Set. + Collections + + \ No newline at end of file diff --git a/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.dll b/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.dll new file mode 100644 index 000000000..3537f7c9a Binary files /dev/null and b/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.dll differ diff --git a/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.xml b/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.xml new file mode 100644 index 000000000..0f9ca81ce --- /dev/null +++ b/packages/Iesi.Collections.3.2.0.4000/lib/Net35/Iesi.Collections.xml @@ -0,0 +1,1903 @@ + + + + Iesi.Collections + + + + +

DictionarySet is an abstract class that supports the creation of new Set + types where the underlying data store is an IDictionary instance.

+ +

You can use any object that implements the IDictionary interface to hold set data. + You can define your own, or you can use one of the objects provided in the Framework. + The type of IDictionary you choose will affect both the performance and the behavior + of the Set using it.

+ +

To make a Set typed based on your own IDictionary, simply derive a + new class with a constructor that takes no parameters. Some Set implmentations + cannot be defined with a default constructor. If this is the case for your class, + you will need to override Clone() as well.

+ +

It is also standard practice that at least one of your constructors takes an ICollection or + an ISet as an argument.

+
+
+ +

A collection that contains no duplicate elements. This class models the mathematical + Set abstraction, and is the base class for all other Set implementations. + The order of elements in a set is dependant on (a)the data-structure implementation, and + (b)the implementation of the various Set methods, and thus is not guaranteed.

+ +

None of the Set implementations in this library are guranteed to be thread-safe + in any way unless wrapped in a SynchronizedSet.

+ +

The following table summarizes the binary operators that are supported by the Set class.

+ + + Operation + Description + Method + Operator + + + Union (OR) + Element included in result if it exists in either A OR B. + Union() + | + + + Intersection (AND) + Element included in result if it exists in both A AND B. + InterSect() + & + + + Exclusive Or (XOR) + Element included in result if it exists in one, but not both, of A and B. + ExclusiveOr() + ^ + + + Minus (n/a) + Take all the elements in A. Now, if any of them exist in B, remove + them. Note that unlike the other operators, A - B is not the same as B - A. + Minus() + - + + +
+
+ + +

A collection that contains no duplicate elements. This interface models the mathematical + Set abstraction. + The order of elements in a set is dependant on (a)the data-structure implementation, and + (b)the implementation of the various Set methods, and thus is not guaranteed.

+ +

None of the Set implementations in this library are guranteed to be thread-safe + in any way unless wrapped in a SynchronizedSet.

+ +

The following table summarizes the binary operators that are supported by the Set class.

+ + + Operation + Description + Method + + + Union (OR) + Element included in result if it exists in either A OR B. + Union() + + + Intersection (AND) + Element included in result if it exists in both A AND B. + InterSect() + + + Exclusive Or (XOR) + Element included in result if it exists in one, but not both, of A and B. + ExclusiveOr() + + + Minus (n/a) + Take all the elements in A. Now, if any of them exist in B, remove + them. Note that unlike the other operators, A - B is not the same as B - A. + Minus() + + +
+
+ + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a Clone() of this set with the extra elements added in. + + A collection of elements. + A new Set containing the union of this Set with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Returns if this set contains no elements. + + + + +

A collection that contains no duplicate elements. This interface models the mathematical + Set abstraction. + The order of elements in a set is dependant on (a)the data-structure implementation, and + (b)the implementation of the various Set methods, and thus is not guaranteed.

+ +

None of the Set implementations in this library are guranteed to be thread-safe + in any way unless wrapped in a SynchronizedSet.

+ +

The following table summarizes the binary operators that are supported by the Set class.

+ + + Operation + Description + Method + + + Union (OR) + Element included in result if it exists in either A OR B. + Union() + + + Intersection (AND) + Element included in result if it exists in both A AND B. + InterSect() + + + Exclusive Or (XOR) + Element included in result if it exists in one, but not both, of A and B. + ExclusiveOr() + + + Minus (n/a) + Take all the elements in A. Now, if any of them exist in B, remove + them. Note that unlike the other operators, A - B is not the same as B - A. + Minus() + + +
+
+ + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a Clone() of this set with the extra elements added in. + + A collection of elements. + A new Set containing the union of this Set with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Removes all objects from the set. + + + + + Returns if this set contains no elements. + + + + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a Clone() of this set with the extra elements added in. + + A collection of elements. + A new Set containing the union of this Set with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs a "union" of two sets, where all the elements + in both are present. That is, the element is included if it is in either a or b. + The return value is a Clone() of one of the sets (a if it is not ) with elements of the other set + added in. Neither of the input sets is modified by the operation. + + A set of elements. + A set of elements. + A set containing the union of the input sets. if both sets are . + + + + Performs a "union" of two sets, where all the elements + in both are present. That is, the element is included if it is in either a or b. + The return value is a Clone() of one of the sets (a if it is not ) with elements of the other set + added in. Neither of the input sets is modified by the operation. + + A set of elements. + A set of elements. + A set containing the union of the input sets. if both sets are . + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included only if it exists in + both a and b. Neither input object is modified by the operation. + The result object is a Clone() of one of the input objects (a if it is not ) containing the + elements from the intersect operation. + + A set of elements. + A set of elements. + The intersection of the two input sets. if both sets are . + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included only if it exists in + both a and b. Neither input object is modified by the operation. + The result object is a Clone() of one of the input objects (a if it is not ) containing the + elements from the intersect operation. + + A set of elements. + A set of elements. + The intersection of the two input sets. if both sets are . + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of set a containing the elements from the operation. + + A set of elements. + A set of elements. + A set containing A - B elements. if a is . + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of set a containing the elements from the operation. + + A set of elements. + A set of elements. + A set containing A - B elements. if a is . + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of one of the sets + (a if it is not ) containing + the elements from the exclusive-or operation. + + A set of elements. + A set of elements. + A set containing the result of a ^ b. if both sets are . + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of one of the sets + (a if it is not ) containing + the elements from the exclusive-or operation. + + A set of elements. + A set of elements. + A set containing the result of a ^ b. if both sets are . + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Returns a clone of the Set instance. This will work for derived Set + classes if the derived class implements a constructor that takes no arguments. + + A clone of this object. + + + + Copies the elements in the Set to an array. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Gets an enumerator for the elements in the Set. + + An IEnumerator over the elements in the Set. + + + + Performs CopyTo when called trhough non-generic ISet (ICollection) interface + + + + + + + Performs Union when called trhough non-generic ISet interface + + + + + + + Performs Minus when called trhough non-generic ISet interface + + + + + + + Performs Intersect when called trhough non-generic ISet interface + + + + + + + Performs ExclusiveOr when called trhough non-generic ISet interface + + + + + + + Returns if this set contains no elements. + + + + + The number of elements currently contained in this collection. + + + + + Returns if the Set is synchronized across threads. Note that + enumeration is inherently not thread-safe. Use the SyncRoot to lock the + object during enumeration. + + + + + An object that can be used to synchronize this collection to make it thread-safe. + When implementing this, if your object uses a base object, like an IDictionary, + or anything that has a SyncRoot, return that object instead of "this". + + + + + Indicates whether the given instance is read-only or not + + + if the ISet is read-only; otherwise, . + In the default implementation of Set, this property always returns false. + + + + + Provides the storage for elements in the Set, stored as the key-set + of the IDictionary object. Set this object in the constructor + if you create your own Set class. + + + + + Adds the specified element to this set if it is not already present. + + The to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Copies the elements in the Set to an array of T. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Gets an enumerator for the elements in the Set. + + An IEnumerator over the elements in the Set. + + + + Copies the elements in the Set to an array. The type of array needs + to be compatible with the objects in the Set, obviously. Needed for + non-generic ISet methods implementation + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + The placeholder object used as the value for the IDictionary instance. + + + There is a single instance of this object globally, used for all Sets. + + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + None of the objects based on DictionarySet are synchronized. Use the + SyncRoot property instead. + + + + + Returns an object that can be used to synchronize the Set between threads. + + + + + Indicates wether the Set is read-only or not + + + + + Implements a Set based on a Dictionary (which is equivalent of + non-genric HashTable) This will give the best lookup, add, and remove + performance for very large data-sets, but iteration will occur in no particular order. + + + + + Creates a new set instance based on a Dictinary. + + + + + Creates a new set instance based on a Dictinary and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + +

Implements an immutable (read-only) Set wrapper.

+

Although this is advertised as immutable, it really isn't. Anyone with access to the + basisSet can still change the data-set. So GetHashCode() is not implemented + for this Set, as is the case for all Set implementations in this library. + This design decision was based on the efficiency of not having to Clone() the + basisSet every time you wrap a mutable Set.

+
+
+ + + Constructs an immutable (read-only) Set wrapper. + + The Set that is wrapped. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + nothing + is always thrown + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + nothing + is always thrown + + + + Removes all objects from the set. + + is always thrown + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + nothing + is always thrown + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + nothing + is always thrown + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + nothing + is always thrown + + + + Copies the elements in the Set to an array of T. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Gets an enumerator for the elements in the Set. + + An IEnumerator over the elements in the Set. + + + + Returns a clone of the Set instance. + + A clone of this object. + + + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a Clone() of this set with the extra elements added in. + + A collection of elements. + A new Set containing the union of this Set with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Performs CopyTo when called trhough non-generic ISet (ICollection) interface + + + + + + + Performs Union when called trhough non-generic ISet interface + + + + + + + Performs Minus when called trhough non-generic ISet interface + + + + + + + Performs Intersect when called trhough non-generic ISet interface + + + + + + + Performs ExclusiveOr when called trhough non-generic ISet interface + + + + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + Returns an object that can be used to synchronize use of the Set across threads. + + + + + Returns an object that can be used to synchronize the Set between threads. + + + + + Indicates that the given instance is read-only + + + + + Implements an ordered Set based on a dictionary. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A collection of elements that defines the initial set contents. + + + + Implements a Set based on a sorted tree. This gives good performance for operations on very + large data-sets, though not as good - asymptotically - as a HashedSet. However, iteration + occurs in order. Elements that you put into this type of collection must implement IComparable, + and they must actually be comparable. You can't mix string and int values, for example. + + + + + Creates a new set instance based on a sorted tree. + + + + + Creates a new set instance based on a sorted tree. + + The to use for sorting. + + + + Creates a new set instance based on a sorted tree and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + + Creates a new set instance based on a sorted tree and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + + Creates a new set instance based on a sorted tree and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + The to use for sorting. + + + +

Implements a thread-safe Set wrapper. The implementation is extremely conservative, + serializing critical sections to prevent possible deadlocks, and locking on everything. + The one exception is for enumeration, which is inherently not thread-safe. For this, you + have to lock the SyncRoot object for the duration of the enumeration.

+
+
+ + + Constructs a thread-safe Set wrapper. + + The Set object that this object will wrap. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Copies the elements in the Set to an array. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Enumeration is, by definition, not thread-safe. Use a lock on the SyncRoot + to synchronize the entire enumeration process. + + + + + + Returns a clone of the Set instance. + + A clone of this object. + + + + Performs CopyTo when called trhough non-generic ISet (ICollection) interface + + + + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + Returns , indicating that this object is thread-safe. The exception to this + is enumeration, which is inherently not thread-safe. Use the SyncRoot object to + lock this object for the entire duration of the enumeration. + + + + + Returns an object that can be used to synchronize the Set between threads. + + + + + Indicates whether given instace is read-only or not + + + + +

DictionarySet is an abstract class that supports the creation of new Set + types where the underlying data store is an IDictionary instance.

+ +

You can use any object that implements the IDictionary interface to hold set data. + You can define your own, or you can use one of the objects provided in the Framework. + The type of IDictionary you choose will affect both the performance and the behavior + of the Set using it.

+ +

To make a Set typed based on your own IDictionary, simply derive a + new class with a constructor that takes no parameters. Some Set implmentations + cannot be defined with a default constructor. If this is the case for your class, + you will need to override Clone() as well.

+ +

It is also standard practice that at least one of your constructors takes an ICollection or + an ISet as an argument.

+
+
+ + A collection that contains no duplicate elements. + + + This class models the mathematical set abstraction, and is the base class for all + other set implementations. The order of elements in a set is dependant on + (a) the data-structure implementation, and (b) the implementation of the various + methods, and thus is not guaranteed. + + + None of the implementations in this library are guranteed to be thread-safe + in any way unless wrapped in a . + + + The following table summarizes the binary operators that are supported by the + type. + + + + Operation + Description + Method + Operator + + + Union (OR) + Element included in result if it exists in either A OR B. + Union() + | + + + Intersection (AND) + Element included in result if it exists in both A AND B. + InterSect() + & + + + Exclusive Or (XOR) + Element included in result if it exists in one, but not both, of A and B. + ExclusiveOr() + ^ + + + Minus (n/a) + Take all the elements in A. Now, if any of them exist in B, remove + them. Note that unlike the other operators, A - B is not the same as B - A. + Minus() + - + + + + + + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a clone of this set with the extra elements added in. + + A collection of elements. + A new instance containing the union of this instance with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs a "union" of two sets, where all the elements + in both are present. That is, the element is included if it is in either a or b. + The return value is a clone of one of the sets (a if it is not ) with elements of the other set + added in. Neither of the input sets is modified by the operation. + + A set of elements. + A set of elements. + A set containing the union of the input sets. if both sets are . + + + + Performs a "union" of two sets, where all the elements + in both are present. That is, the element is included if it is in either a or b. + The return value is a clone of one of the sets (a if it is not ) with elements of the other set + added in. Neither of the input sets is modified by the operation. + + A set of elements. + A set of elements. + A set containing the union of the input sets. if both sets are . + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included only if it exists in + both a and b. Neither input object is modified by the operation. + The result object is a Clone() of one of the input objects (a if it is not ) containing the + elements from the intersect operation. + + A set of elements. + A set of elements. + The intersection of the two input sets. if both sets are . + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included only if it exists in + both a and b. Neither input object is modified by the operation. + The result object is a Clone() of one of the input objects (a if it is not ) containing the + elements from the intersect operation. + + A set of elements. + A set of elements. + The intersection of the two input sets. if both sets are . + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of set a containing the elements from the operation. + + A set of elements. + A set of elements. + A set containing A - B elements. if a is . + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of set a containing the elements from the operation. + + A set of elements. + A set of elements. + A set containing A - B elements. if a is . + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a clone of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a clone of one of the sets + (a if it is not ) containing + the elements from the exclusive-or operation. + + A set of elements. + A set of elements. + A set containing the result of a ^ b. if both sets are . + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a clone of one of the sets + (a if it is not ) containing + the elements from the exclusive-or operation. + + A set of elements. + A set of elements. + A set containing the result of a ^ b. if both sets are . + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Returns a clone of the set instance. This will work for derived set + classes if the derived class implements a constructor that takes no arguments. + + A clone of this object. + + + + Copies the elements in the set to an array. The type of array needs + to be compatible with the objects in the set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Returns an enumerator that iterates through the set. + + + An object that can be used to iterate through the set. + + + + + Returns if this set contains no elements. + + + + + The number of elements currently contained in this collection. + + + + + Returns if the set is synchronized across threads. Note that + enumeration is inherently not thread-safe. Use the to lock the + object during enumeration. + + + + + An object that can be used to synchronize this collection to make it thread-safe. + When implementing this, if your object uses a base object, like an , + or anything that has a , return that object instead + of . + + + + + Provides the storage for elements in the Set, stored as the key-set + of the IDictionary object. Set this object in the constructor + if you create your own Set class. + + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Copies the elements in the Set to an array. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Gets an enumerator for the elements in the Set. + + An IEnumerator over the elements in the Set. + + + + The placeholder object used as the value for the IDictionary instance. + + + There is a single instance of this object globally, used for all Sets. + + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + None of the objects based on DictionarySet are synchronized. Use the + SyncRoot property instead. + + + + + Returns an object that can be used to synchronize the Set between threads. + + + + + Implements a Set based on a hash table. This will give the best lookup, add, and remove + performance for very large data-sets, but iteration will occur in no particular order. + + + + + Creates a new set instance based on a hash table. + + + + + Creates a new set instance based on a hash table and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + + Implements a Set that automatically changes from a list to a hash table + when the size reaches a certain threshold. This is good if you are unsure about + whether you data-set will be tiny or huge. Because this uses a dual implementation, + iteration order is not guaranteed! + + + + + Creates a new set instance based on either a list or a hash table, depending on which + will be more efficient based on the data-set size. + + + + + Creates a new set instance based on either a list or a hash table, depending on which + will be more efficient based on the data-set size, and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + +

Implements an immutable (read-only) Set wrapper.

+

Although this is advertised as immutable, it really isn't. Anyone with access to the + basisSet can still change the data-set. So GetHashCode() is not implemented + for this Set, as is the case for all Set implementations in this library. + This design decision was based on the efficiency of not having to Clone() the + basisSet every time you wrap a mutable Set.

+
+
+ + + Constructs an immutable (read-only) Set wrapper. + + The Set that is wrapped. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Copies the elements in the Set to an array. The type of array needs + to be compatible with the objects in the Set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Gets an enumerator for the elements in the Set. + + An IEnumerator over the elements in the Set. + + + + Returns a clone of the Set instance. + + A clone of this object. + + + + Performs a "union" of the two sets, where all the elements + in both sets are present. That is, the element is included if it is in either a or b. + Neither this set nor the input set are modified during the operation. The return value + is a Clone() of this set with the extra elements added in. + + A collection of elements. + A new Set containing the union of this Set with the specified collection. + Neither of the input objects is modified by the union. + + + + Performs an "intersection" of the two sets, where only the elements + that are present in both sets remain. That is, the element is included if it exists in + both sets. The Intersect() operation does not modify the input sets. It returns + a Clone() of this set with the appropriate elements removed. + + A set of elements. + The intersection of this set with a. + + + + Performs a "minus" of set b from set a. This returns a set of all + the elements in set a, removing the elements that are also in set b. + The original sets are not modified during this operation. The result set is a Clone() + of this Set containing the elements from the operation. + + A set of elements. + A set containing the elements from this set with the elements in a removed. + + + + Performs an "exclusive-or" of the two sets, keeping only the elements that + are in one of the sets, but not in both. The original sets are not modified + during this operation. The result set is a Clone() of this set containing + the elements from the exclusive-or operation. + + A set of elements. + A set containing the result of a ^ b. + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + Returns an object that can be used to synchronize use of the Set across threads. + + + + + Returns an object that can be used to synchronize the Set between threads. + + + + + Implements a Set based on a list. Performance is much better for very small lists + than either HashedSet or SortedSet. However, performance degrades rapidly as + the data-set gets bigger. Use a HybridSet instead if you are not sure your data-set + will always remain very small. Iteration produces elements in the order they were added. + However, element order is not guaranteed to be maintained by the various Set + mathematical operators. + + + + + Creates a new set instance based on a list. + + + + + Creates a new set instance based on a list and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + + Implements a set based on a sorted tree. This gives good performance for operations on very + large data-sets, though not as good - asymptotically - as a . + However, iteration occurs in order. Elements that you put into this type of collection must + implement , and they must actually be comparable. You can't mix + and values, for example. + + + + + Creates a new set instance based on a sorted tree. + + + + + Creates a new set instance based on a sorted tree. + + The to use for sorting. + + + + Creates a new set instance based on a sorted tree and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + + + + Creates a new set instance based on a sorted tree and + initializes it based on a collection of elements. + + A collection of elements that defines the initial set contents. + The to use for sorting. + + + + Implements a thread-safe wrapper. + + + The implementation is extremely conservative, serializing critical sections + to prevent possible deadlocks, and locking on everything. The one exception + is for enumeration, which is inherently not thread-safe. For this, you have + to the object for the duration + of the enumeration. + + + + + Constructs a thread-safe wrapper. + + The object that this object will wrap. + + + + Adds the specified element to this set if it is not already present. + + The object to add to the set. + is the object was added, if it was already present. + + + + Adds all the elements in the specified collection to the set if they are not already present. + + A collection of objects to add to the set. + is the set changed as a result of this operation, if not. + + + + Removes all objects from the set. + + + + + Returns if this set contains the specified element. + + The element to look for. + if this set contains the specified element, otherwise. + + + + Returns if the set contains all the elements in the specified collection. + + A collection of objects. + if the set contains all the elements in the specified collection, otherwise. + + + + Removes the specified element from the set. + + The element to be removed. + if the set contained the specified element, otherwise. + + + + Remove all the specified elements from this set, if they exist in this set. + + A collection of elements to remove. + if the set was modified as a result of this operation. + + + + Retains only the elements in this set that are contained in the specified collection. + + Collection that defines the set of elements to be retained. + if this set changed as a result of this operation. + + + + Copies the elements in the set to an array. The type of array needs + to be compatible with the objects in the set, obviously. + + An array that will be the target of the copy operation. + The zero-based index where copying will start. + + + + Returns an enumerator that iterates through the set. + + + An object that can be used to iterate through the set. + + + Enumeration is, by definition, not thread-safe. Use a on the + to synchronize the entire enumeration process. + + + + + Returns a clone of this instance. + + A clone of this object. + + + + Returns if this set contains no elements. + + + + + The number of elements contained in this collection. + + + + + Returns , indicating that this object is thread-safe. The exception to this + is enumeration, which is inherently not thread-safe. Use the object to + lock this object for the entire duration of the enumeration. + + + + + Returns an object that can be used to synchronize the set between threads. + + +
+
diff --git a/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.dll b/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.dll new file mode 100644 index 000000000..8c06fb280 Binary files /dev/null and b/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.dll differ diff --git a/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.xml b/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.xml new file mode 100644 index 000000000..40fe6450e --- /dev/null +++ b/packages/MSVisualBasic/lib/net40/Microsoft.VisualBasic.xml @@ -0,0 +1,10708 @@ + + + + Microsoft.VisualBasic + + + + Indicates the window style to use for the invoked program when calling the Shell function. + 2 + + + Window is hidden and focus is passed to the hidden window. This member is equivalent to the Visual Basic constant vbHide. + + + Window has focus and is restored to its original size and position. This member is equivalent to the Visual Basic constant vbNormalFocus. + + + Window is displayed as an icon with focus. This member is equivalent to the Visual Basic constant vbMinimizedFocus. + + + Window is maximized with focus. This member is equivalent to the Visual Basic constant vbMaximizedFocus. + + + Window is restored to its most recent size and position. The currently active window remains active. This member is equivalent to the Visual Basic constant vbNormalNoFocus. + + + Window is displayed as an icon. The currently active window remains active. This member is equivalent to the Visual Basic constant vbMinimizedNoFocus. + + + Indicates how to play sounds when calling audio methods. + 1 + + + Causes the My.Computer.Audio.Play method to play the sound, and waits until it completes before calling code continues. + + + Causes the My.Computer.Audio.Play method to play the sound in the background. The calling code continues to execute. + + + Causes the My.Computer.Audio.Play method to play the sound in the background until the method is called. The calling code continues to execute. + + + Indicates the type of procedure being invoked when calling the CallByName function. + 1 + + + A method is being invoked. This member is equivalent to the Visual Basic constant vbMethod. + + + A property value is being retrieved. This member is equivalent to the Visual Basic constant vbGet. + + + An Object property value is being determined. This member is equivalent to the Visual Basic constant vbLet. + + + A property value is being determined. This member is equivalent to the Visual Basic constant vbSet. + + + A Visual Basic Collection is an ordered set of items that can be referred to as a unit. + 1 + + + Creates and returns a new Visual Basic  object. + + + Adds an element to a Collection object. + Required. An object of any type that specifies the element to add to the collection. + Optional. A unique String expression that specifies a key string that can be used instead of a positional index to access this new element in the collection. + Optional. An expression that specifies a relative position in the collection. The element to be added is placed in the collection before the element identified by the argument. If is a numeric expression, it must be a number from 1 through the value of the collection's property. If is a String expression, it must correspond to the key string specified when the element being referred to was added to the collection. You cannot specify both and . + Optional. An expression that specifies a relative position in the collection. The element to be added is placed in the collection after the element identified by the argument. If is a numeric expression, it must be a number from 1 through the value of the collection's Count property. If is a String expression, it must correspond to the key string specified when the element referred to was added to the collection. You cannot specify both and . + 1 + + + + + + Deletes all elements of a Visual Basic Collection object. + 1 + + + Returns a Boolean value indicating whether a Visual Basic Collection object contains an element with a specific key. + Returns a Boolean value indicating whether a Visual Basic Collection object contains an element with a specific key. + Required. A String expression that specifies the key for which to search the elements of the collection. + 1 + + + Returns an Integer containing the number of elements in a collection. Read-only. + Returns an Integer containing the number of elements in a collection. Read-only. + 1 + + + Returns a reference to an enumerator object, which is used to iterate over a object. + Returns a reference to an enumerator object, which is used to iterate over a object. + 1 + + + Returns the data needed to serialize the object. Implements the interface. + A object containing the information required to serialize the object. + A object containing the source and destination of the serialized stream associated with the object. + + + Copies the elements of the to an , starting at a particular index. Implements the interface. + The one-dimensional that is the destination of the elements copied from object. The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + is less than zero. + + is multidimensional.-or- The number of elements in the source object is greater than the available space from to the end of the destination . + The type of the source object cannot be cast automatically to the type of the destination . + + + Gets the number of items in this collection. Implements the interface. + The number of items in this collection. + + + Returns an enumerator that iterates through the collection. Implements the interface. + An object that can be used to iterate through the collection. + + + Gets a value indicating whether access to the object is synchronized (thread safe). Implements the interface. + Returns True if access to the object is synchronized (thread safe); otherwise, False. + + + Gets an object that can be used to synchronize access to the object. Implements the interface. + An object that can be used to synchronize access to the object. + + + Adds an item to the object. Implements the interface. + The position into which the new element was inserted. + The to add to the object. + The object is read-only.-or- The object has a fixed size. + + + Removes all items from the object. Implements the interface. + The is read-only. + + + Determines whether the object contains a specific value. Implements the interface. + Returns True if the is found in the object; otherwise, False. + The to locate in the object. + + + Determines the index of a specific item in the object. Implements the interface. + The index of if found in the collection; otherwise, -1. + The to locate in the object. + + + Inserts an item to the object at the specified index. Implements the interface. + The zero-based index at which should be inserted. + The to insert into the object. + + is not a valid index in the object. + The object is read-only.-or- The object has a fixed size. + + is null reference in the object. + + + Gets a value indicating whether the object has a fixed size. Implements the interface. + Returns True if the object has a fixed size; otherwise, False. + + + Gets a value indicating whether the object is read-only. Implements the interface. + Returns True if the object is read-only; otherwise, False. + + + Gets or sets the element at the specified index. Implements the interface + The element at the specified index. + The zero-based index of the element to get or set. + + is not a valid index in the object. + The property is set and the object is read-only. + + + Removes the first occurrence of a specific object from the object. Implements the interface. + The to remove from the object. + The object is read-only.-or- The object has a fixed size. + + + Removes the object item at the specified index. Implements the interface. + The zero-based index of the item to remove. + + is not a valid index in the object. + The object is read-only.-or- The object has a fixed size. + + + Returns a specific element of a Collection object either by position or by key. Read-only. + Returns a specific element of a Collection object either by position or by key. Read-only. + (A) A numeric expression that specifies the position of an element of the collection. must be a number from 1 through the value of the collection's property. Or (B) An Object expression that specifies the position or key string of an element of the collection. + 1 + + + + + + Returns a specific element of a Collection object either by position or by key. Read-only. + Returns a specific element of a Collection object either by position or by key. Read-only. + (A) A numeric expression that specifies the position of an element of the collection. must be a number from 1 through the value of the collection's property. Or (B) An Object expression that specifies the position or key string of an element of the collection. + 1 + + + + + + Returns a specific element of a Collection object either by position or by key. Read-only. + Returns a specific element of a Collection object either by position or by key. Read-only. + A unique String expression that specifies a key string that can be used, instead of a positional index, to access an element of the collection. must correspond to the argument specified when the element was added to the collection. + 1 + + + + + + Runs after the entire object graph has been deserialized. Implements the interface. + The object that initiated the callback. + + + Removes an element from a Collection object. + A numeric expression that specifies the position of an element of the collection. must be a number from 1 through the value of the collection's property. + 1 + + + Removes an element from a Collection object. + A unique String expression that specifies a key string that can be used, instead of a positional index, to access an element of the collection. must correspond to the argument specified when the element was added to the collection. + 1 + + + The ComClassAttribute attribute instructs the compiler to add metadata that allows a class to be exposed as a COM object. + 1 + + + Initializes a new instance of the ComClassAttribute class. + + + Initializes a new instance of the ComClassAttribute class. + Initializes the value of the ClassID property that is used to uniquely identify a class. + + + Initializes a new instance of the ComClassAttribute class. + Initializes the value of the ClassID property that is used to uniquely identify a class. + Initializes the value of the InterfaceID property that is used to uniquely identify an interface. + + + Initializes a new instance of the ComClassAttribute class. + Initializes the value of the ClassID property that is used to uniquely identify a class. + Initializes the value of the InterfaceID property that is used to uniquely identify an interface. + Initializes the value of the EventID property that is used to uniquely identify an event. + + + Gets a class ID used to uniquely identify a class. + Read-only. A string that can be used by the compiler to uniquely identify the class when a COM object is created. + 1 + + + Gets an event ID used to uniquely identify an event. + Read only. A string that can be used by the compiler to uniquely identify an event for the class when a COM object is created. + 1 + + + Gets an interface ID used to uniquely identify an interface. + Read-only. A string that can be used by the compiler to uniquely identify an interface for the class when a COM object is created. + 1 + + + Indicates that the COM interface name shadows another member of the class or base class. + A Boolean value that indicates that the COM interface name shadows another member of the class or base class. + 1 + + + Indicates how to compare strings when calling comparison functions. + 1 + + + Performs a binary comparison. This member is equivalent to the Visual Basic constant vbBinaryCompare. + + + Performs a textual comparison. This member is equivalent to the Visual Basic constant vbTextCompare. + + + The Constants module contains miscellaneous constants. These constants can be used anywhere in your code. + 1 + + + Indicates that the Abort button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the Abort, Retry, and Ignore buttons will be displayed when the MsgBox function is called. + 1 + + + Indicates that the message box will be displayed as a modal dialog box when the MsgBox function is called. + 1 + + + Indicates that the file has changed since the last backup operation for file-access functions. + 1 + + + Indicates that the type of a variant object is an array. Returned by the VarType function. + 1 + + + Represents a backspace character for print and display functions. + 1 + + + Specifies that a binary comparison should be performed when comparison functions are called. + 1 + + + Indicates that the type of a variant object is Boolean. Returned by the VarType function. + 1 + + + Indicates that the type of a variant object is Byte. Returned by the VarType function. + 1 + + + Indicates that the Cancel button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Represents a carriage-return character for print and display functions. + 1 + + + Indicates that the critical message icon will be displayed when the MsgBox function is called. + 1 + + + Represents a carriage-return character combined with a linefeed character for print and display functions. + 1 + + + Indicates that the type of a variant object is Currency. Returned by the VarType function. + 1 + + + Indicates that the type of a variant object is Date. Returned by the VarType function. + 1 + + + Indicates that the type of a variant object is Decimal. Returned by the VarType function. + 1 + + + Indicates that the leftmost button is selected as the default button when the message box appears. + 1 + + + Indicates that the second button from the left is selected as the default button when the message box appears. + 1 + + + Indicates that the third button from the left is selected as the default button when the message box appears. + 1 + + + Indicates that the file is a directory or folder for file-access functions. + 1 + + + Indicates that the type of a variant object is Double. Returned by the VarType function. + 1 + + + Indicates that the type of a variant object is Empty. Returned by the VarType function. + 1 + + + Indicates that the exclamation icon will be displayed when the MsgBox function is called. + 1 + + + Indicates that a Boolean value of False should be used when number-formatting functions are called. + 1 + + + Indicates that the first week of the year that has at least four days should be used when date-related functions are called. + 1 + + + Indicates that the first full week of the year should be used when date-related functions are called. + 1 + + + Indicates that the week of the year in which January 1 occurs should be used when date-related functions are called. + 1 + + + Represents a form-feed character for print functions. + 1 + + + Specifies that Friday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that the general date format for the current culture should be used when the FormatDateTime function is called. + 1 + + + Specifies that a property value should be retrieved when the CallByName function is called. + 1 + + + Indicates that the file is a hidden file for file-access functions. + 1 + + + Indicates that the window style is hidden for the invoked program when the Shell function is called. + 1 + + + Indicates Hiragana characters should be converted to Katakana characters when the StrConv function is called. + 1 + + + Indicates that the Ignore button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the information icon will display when the MsgBox function is called. + 1 + + + Indicates that the type of a variant object is Integer. Returned by the VarType function. + 1 + + + Indicates that Katakana characters should be converted to Hiragana characters when the StrConv function is called. + 1 + + + Indicates that a property value should be set to an object instance when the CallByName function is called. + 1 + + + Represents a linefeed character for print and display functions. + 1 + + + Indicates that characters should be converted to use linguistic rules for casing instead of file system rules for casing to when the StrConv function is called. + 1 + + + Indicates the type of a variant object is Long. Returned by the VarType function. + 1 + + + Indicates that the long date format for the current culture should be used when the FormatDateTime function is called. + 1 + + + Indicates that the long time format for the current culture should be used when the FormatDateTime function is called. + 1 + + + Indicates that characters should be converted to lowercase when the StrConv function is called. + 1 + + + Indicates that the window style is maximized with focus for the invoked program when the Shell function is called. + 1 + + + Specifies that a method should be called when the CallByName function is called. + 1 + + + Indicates that the window style is minimized with focus for the invoked program when the Shell function is called. + 1 + + + Indicates that the window style is minimized without focus for the invoked program when the Shell function is called. + 1 + + + Specifies that Monday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that the Help button will be displayed when the MsgBox function is called. + 1 + + + Indicates that text will be right-aligned when the MsgBox function is called. + 1 + + + Indicates that right-to-left reading text (Hebrew and Arabic systems) will be displayed when the MsgBox function is called. + 1 + + + Indicates that the message box will display in the foreground when the MsgBox function is called. + 1 + + + Indicates that wide (double-byte) characters should be converted to narrow (single-byte) characters when the StrConv function is called. + 1 + + + Represents a newline character for print and display functions. + 1 + + + Indicates that the No button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the file is a normal file for file-access functions. + 1 + + + Indicates that the window style is normal with focus for the invoked program when the Shell function is called. + 1 + + + Indicates that the window style is normal without focus for the invoked program when the Shell function is called. + 1 + + + Indicates that the type of a variant object is Nothing. Returned by the VarType function. + 1 + + + Represents a null character for print and display functions. + 1 + + + Represents a zero-length string for print and display functions, and for calling external procedures. + 1 + + + Indicates that the type of a variant object is Object. Returned by the VarType function. + 1 + + + Represents the object error number. User-defined error numbers should be greater than this value. + 1 + + + Indicates that the OK button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the OK and Cancel buttons will be displayed when the MsgBox function is called. + 1 + + + Indicates that only the OK button will be displayed when the MsgBox function is called. + 1 + + + Indicates that the first letter of every word in a string should be converted to uppercase and the remaining characters to lowercase when the StrConv function is called. + 1 + + + Indicates that the question icon will be displayed when the MsgBox function is called. + 1 + + + Indicates that the file is a read-only file for file-access functions. + 1 + + + Indicates that the Retry button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the Retry and Cancel buttons will be displayed when the MsgBox function is called. + 1 + + + Specifies that Saturday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that a property value should be set when the CallByName function is called. + 1 + + + Indicates that the short-date format for the current culture should be used when the FormatDateTime function is called. + 1 + + + Indicates that the short-time format for the current culture should be used when the FormatDateTime function is called. + 1 + + + Indicates that characters should be converted to Simplified Chinese when the StrConv function is called. + 1 + + + Indicates that the type of a variant object is Single. Returned by the VarType function. + 1 + + + Indicates that the type of a variant object is String. Returned by the VarType function. + 1 + + + Specifies that Sunday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that the file is a system file for file-access functions. + 1 + + + Indicates that the message box will be displayed as a modal dialog box when the MsgBox function is called. + 1 + + + Represents a tab character for print and display functions. + 1 + + + Indicates that a text comparison should be performed when comparison functions are called. + 1 + + + Specifies that Thursday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that characters should be converted to Traditional Chinese when the StrConv function is called. + 1 + + + Indicates that a Boolean value of True should be used when number-formatting functions are called. + 1 + + + Specifies that Tuesday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that characters should be converted to uppercase when the StrConv function is called. + 1 + + + Indicates that the default Boolean value should be used when number-formatting functions are called. + 1 + + + Indicates that the type of a variant object is a user-defined type. Returned by the VarType function. + 1 + + + Indicates that the week specified by your system as the first week of the year should be used when date-related functions are called. + 1 + + + Indicates that the day specified by your system as the first day of the week should be used when date-related functions are called. + 1 + + + Indicates that the type of a variant object is Variant. Returned by the VarType function. + 1 + + + Represents a carriage-return character for print functions. + 1 + + + Indicates the volume label file attribute for file-access functions. + 1 + + + Specifies that Wednesday should be used as the first day of the week when date-related functions are called. + 1 + + + Indicates that narrow (single-byte) characters should be converted to wide (double-byte) characters when the StrConv function is called. + 1 + + + Indicates that the Yes button was clicked in a message box. Returned by the MsgBox function. + 1 + + + Indicates that the Yes and No buttons will be displayed when the MsgBox function is called. + 1 + + + Indicates that the Yes, No, and Cancel buttons will be displayed when the MsgBox function is called. + 1 + + + The ControlChars module contains constants used as control characters. These constants can be used anywhere in your code. + 1 + + + Initializes a new instance of the class. + + + Represents a backspace character (vbBack). + 1 + + + Represents a carriage return character (vbCr). + 1 + + + Represents a carriage return/linefeed character combination (vbCrLf). + 1 + + + Represents a form feed character for print functions (vbFormFeed). + 1 + + + Represents a line feed character (vbLf). + 1 + + + Represents a new line character (vbNewLine). + 1 + + + Represents a null character (vbNullChar). + 1 + + + Represents a double-quote character. + 1 + + + Represents a tab character (vbTab). + 1 + + + Represents a vertical tab character (vbVerticalTab). + 1 + + + The Conversion module contains the procedures used to perform various conversion operations. + 1 + + + Converts an object to the specified generic type. + An object statically typed as the requested generic type. + The object to convert. + The type to which to convert the object. + + + Converts an object to the specified type. + An object whose type at run time is the requested target type. + The object to convert. + The type to which to convert the object. + + + Returns the error message that corresponds to a given error number. + The error message that corresponds to the most recent run-time error. + + is out of range. + 1 + + + Returns the error message that corresponds to a given error number. + The error message that corresponds to a given error number. + Optional. Any valid error number. + + is out of range. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the hexadecimal value of a number. + Returns a string representing the hexadecimal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Return the integer portion of a number. + Return the integer portion of a number. + Required. A number of type Double or any valid numeric expression. If contains Nothing, Nothing is returned. + Number is not specified. + Number is not a numeric type. + 1 + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a string representing the octal value of a number. + Returns a string representing the octal value of a number. + Required. Any valid numeric expression or String expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns a String representation of a number. + Returns a String representation of a number. + Required. An Object containing any valid numeric expression. + + is not specified. + + is not a numeric type. + 1 + + + + + + Returns the numbers contained in a string as a numeric value of appropriate type. + Returns the numbers contained in a string as a numeric value of appropriate type. + Required. Any valid String expression, Object variable, or Char value. If is of type Object, its value must be convertible to String or an error occurs. + + is too large. + + is an Object type expression that is not convertible to String. + 1 + + + + + + Returns the numbers contained in a string as a numeric value of appropriate type. + Returns the numbers contained in a string as a numeric value of appropriate type. + Required. Any valid String expression, Object variable, or Char value. If is of type Object, its value must be convertible to String or an error occurs. + + is too large. + + is an Object type expression that is not convertible to String. + 1 + + + + + + Returns the numbers contained in a string as a numeric value of appropriate type. + Returns the numbers contained in a string as a numeric value of appropriate type. + Required. Any valid String expression, Object variable, or Char value. If is of type Object, its value must be convertible to String or an error occurs. + + is too large. + + is an Object type expression that is not convertible to String. + 1 + + + + + + The DateAndTime module contains the procedures and properties used in date and time operations. + 1 + + + Returns a Date value containing a date and time value to which a specified time interval has been added. + Returns a Date value containing a date and time value to which a specified time interval has been added. + Required. DateInterval enumeration value or String expression representing the time interval you want to add. + Required. Double. Floating-point expression representing the number of intervals you want to add. can be positive (to get date/time values in the future) or negative (to get date/time values in the past). It can contain a fractional part when specifies hours, minutes, or seconds. For other values of , any fractional part of is ignored. + Required. Date. An expression representing the date and time to which the interval is to be added. itself is not changed in the calling program. + + is not coercible to Date. + Interval is invalid. + Calculated date is before 00:00:00 on January 1 of the year 1, or later than 23:59:59 on December 31, 9999. + 1 + + + + + + Returns a Date value containing a date and time value to which a specified time interval has been added. + Returns a Date value containing a date and time value to which a specified time interval has been added. + Required. DateInterval enumeration value or String expression representing the time interval you want to add. + Required. Double. Floating-point expression representing the number of intervals you want to add. can be positive (to get date/time values in the future) or negative (to get date/time values in the past). It can contain a fractional part when specifies hours, minutes, or seconds. For other values of , any fractional part of is ignored. + Required. Date. An expression representing the date and time to which the interval is to be added. itself is not changed in the calling program. + + is not coercible to Date. + Interval is invalid. + Calculated date is before 00:00:00 on January 1 of the year 1, or later than 23:59:59 on December 31, 9999. + 1 + + + + + + Returns a Long value specifying the number of time intervals between two Date values. + Returns a Long value specifying the number of time intervals between two Date values. + Required. DateInterval enumeration value or String expression representing the time interval you want to use as the unit of difference between and . + Required. Date. The first date/time value you want to use in the calculation. + Required. Date. The second date/time value you want to use in the calculation. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used. + Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used. + Invalid . + + , , or is out of range. + + or is of an invalid type. + 1 + + + + + + Returns a Long value specifying the number of time intervals between two Date values. + Returns a Long value specifying the number of time intervals between two Date values. + Required. DateInterval enumeration value or String expression representing the time interval you want to use as the unit of difference between and . + Required. Date. The first date/time value you want to use in the calculation. + Required. Date. The second date/time value you want to use in the calculation. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used. + Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used. + Invalid . + + , , or is out of range. + + or is of an invalid type. + 1 + + + + + + Returns an Integer value containing the specified component of a given Date value. + Returns an Integer value containing the specified component of a given Date value. + Required. DateInterval enumeration value or String expression representing the part of the date/time value you want to return. + Required. Date value that you want to evaluate. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used. + Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used. + + is invalid. + + is not coercible to Date. + 1 + + + + + + Returns an Integer value containing the specified component of a given Date value. + Returns an Integer value containing the specified component of a given Date value. + Required. DateInterval enumeration value or String expression representing the part of the date/time value you want to return. + Required. Date value that you want to evaluate. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used. + Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used. + + is invalid. + + is not coercible to Date. + 1 + + + + + + Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00). + Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00). + Required. Integer expression from 1 through 9999. However, values below this range are also accepted. If is 0 through 99, it is interpreted as being between 1930 and 2029, as explained in the "Remarks" section below. If is less than 1, it is subtracted from the current year. + Required. Integer expression from 1 through 12. However, values outside this range are also accepted. The value of is offset by 1 and applied to January of the calculated year. In other words, ( - 1) is added to January. The year is recalculated if necessary. The following results illustrate this effect:If is 1, the result is January of the calculated year.If is 0, the result is December of the previous year.If is -1, the result is November of the previous year.If is 13, the result is January of the following year. + Required. Integer expression from 1 through 31. However, values outside this range are also accepted. The value of is offset by 1 and applied to the first day of the calculated month. In other words, ( - 1) is added to the first of the month. The month and year are recalculated if necessary. The following results illustrate this effect:If is 1, the result is the first day of the calculated month.If is 0, the result is the last day of the previous month.If is -1, the result is the penultimate day of the previous month.If is past the end of the current month, the result is the appropriate day of the following month. For example, if is 4 and is 31, the result is May 1. + 1 + + + Returns or sets a String value representing the current date according to your system. + Returns or sets a String value representing the current date according to your system. + Invalid format used to set value of DateString. + 1 + + + + + + Returns a Date value containing the date information represented by a string, with the time information set to midnight (00:00:00). + Date value containing the date information represented by a string, with the time information set to midnight (00:00:00). + Required. String expression representing a date/time value from 00:00:00 on January 1 of the year 1 through 23:59:59 on December 31, 9999. + + includes invalid time information. + 1 + + + Returns an Integer value from 1 through 31 representing the day of the month. + Returns an Integer value from 1 through 31 representing the day of the month. + Required. Date value from which you want to extract the day. + 1 + + + Returns an Integer value from 0 through 23 representing the hour of the day. + Returns an Integer value from 0 through 23 representing the hour of the day. + Required. Date value from which you want to extract the hour. + 1 + + + Returns an Integer value from 0 through 59 representing the minute of the hour. + Returns an Integer value from 0 through 59 representing the minute of the hour. + Required. Date value from which you want to extract the minute. + 1 + + + Returns an Integer value from 1 through 12 representing the month of the year. + Returns an Integer value from 1 through 12 representing the month of the year. + Required. Date value from which you want to extract the month. + 1 + + + Returns a String value containing the name of the specified month. + Returns a String value containing the name of the specified month. + Required. Integer. The numeric designation of the month, from 1 through 13; 1 indicates January and 12 indicates December. You can use the value 13 with a 13-month calendar. If your system is using a 12-month calendar and is 13, MonthName returns an empty string. + Optional. Boolean value that indicates if the month name is to be abbreviated. If omitted, the default is False, which means the month name is not abbreviated. + + is less than 1 or greater than 13. + 1 + + + Returns a Date value containing the current date and time according to your system. + Returns a Date value containing the current date and time according to your system. + 1 + + + Returns an Integer value from 0 through 59 representing the second of the minute. + Returns an Integer value from 0 through 59 representing the second of the minute. + Required. Date value from which you want to extract the second. + 1 + + + Returns or sets a Date value containing the current time of day according to your system. + Returns or sets a Date value containing the current time of day according to your system. + 1 + + + + + + Returns a Double value representing the number of seconds elapsed since midnight. + Returns a Double value representing the number of seconds elapsed since midnight. + 1 + + + Returns a Date value representing a specified hour, minute, and second, with the date information set relative to January 1 of the year 1. + Returns a Date value representing a specified hour, minute, and second, with the date information set relative to January 1 of the year 1. + Required. Integer expression from 0 through 23. However, values outside this range are also accepted. + Required. Integer expression from 0 through 59. However, values outside this range are also accepted. The value of is added to the calculated hour, so a negative value specifies minutes before that hour. + Required. Integer expression from 0 through 59. However, values outside this range are also accepted. The value of is added to the calculated minute, so a negative value specifies seconds before that minute. + Argument is outside the range -2,147,483,648 through 2,147,483,647 + Calculated time is less than negative 24 hours. + 1 + + + Returns or sets a String value representing the current time of day according to your system. + Returns or sets a String value representing the current time of day according to your system. + Invalid format used to set value of TimeString. + 1 + + + + + + Returns a Date value containing the time information represented by a string, with the date information set to January 1 of the year 1. + Returns a Date value containing the time information represented by a string, with the date information set to January 1 of the year 1. + Required. String expression representing a date/time value from 00:00:00 on January 1 of the year 1 through 23:59:59 on December 31, 9999. + + includes invalid date information. + 1 + + + Returns or sets a Date value containing the current date according to your system. + Returns or sets a Date value containing the current date according to your system. + 1 + + + + + + Returns an Integer value containing a number representing the day of the week. + Returns an Integer value containing a number representing the day of the week. + Required. Date value for which you want to determine the day of the week. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used. + + is less than 0 or more than 7. + 1 + + + Returns a String value containing the name of the specified weekday. + Returns a String value containing the name of the specified weekday. + Required. Integer. The numeric designation for the weekday, from 1 through 7; 1 indicates the first day of the week and 7 indicates the last day of the week. The identities of the first and last days depend on the setting of . + Optional. Boolean value that indicates if the weekday name is to be abbreviated. If omitted, the default is False, which means the weekday name is not abbreviated. + Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.System is used. + + is less than 1 or greater than 7, or is less than 0 or greater than 7. + 1 + + + Returns an Integer value from 1 through 9999 representing the year. + Returns an Integer value from 1 through 9999 representing the year. + Required. Date value from which you want to extract the year. + 1 + + + Indicates how to display dates when calling the FormatDateTime function. + 1 + + + For real numbers, displays a date and time. If the number has no fractional part, displays only a date. If the number has no integer part, displays time only. Date and time display is determined by your computer's regional settings. This member is equivalent to the Visual Basic constant vbGeneralDate. + + + Displays a date using the long-date format specified in your computer's regional settings. This member is equivalent to the Visual Basic constant vbLongDate. + + + Displays a date using the short-date format specified in your computer's regional settings. This member is equivalent to the Visual Basic constant vbShortDate. + + + Displays a time using the long-time format specified in your computer's regional settings. This member is equivalent to the Visual Basic constant vbLongTime. + + + Displays a time using the short-time format specified in your computer's regional settings. This member is equivalent to the Visual Basic constant vbShortTime. + + + Indicates how to determine and format date intervals when calling date-related functions. + 1 + + + Year + + + Quarter of year (1 through 4) + + + Month (1 through 12) + + + Day of year (1 through 366) + + + Day of month (1 through 31) + + + Week of year (1 through 53) + + + Day of week (1 through 7) + + + Hour (1 through 24) + + + Minute (1 through 60) + + + Second (1 through 60) + + + Indicates when payments are due when calling financial methods. + 1 + + + Falls at the end of the date interval + + + Falls at the beginning of the date interval + + + The ErrObject module contains properties and procedures used to identify and handle run-time errors using the Err object. + 1 + + + Clears all property settings of the Err object. + 1 + + + Returns or sets a String expression containing a descriptive string associated with an error. Read/write. + Returns or sets a String expression containing a descriptive string associated with an error. Read/write. + 1 + + + Returns an integer indicating the line number of the last executed statement. Read-only. + Returns an integer indicating the line number of the last executed statement. Read-only. + 1 + + + Returns the exception representing the error that occurred. + Returns the exception representing the error that occurred. + 1 + + + Returns or sets an Integer containing the context ID for a topic in a Help file. Read/write. + Returns or sets an Integer containing the context ID for a topic in a Help file. Read/write. + 1 + + + Returns or sets a String expression containing the fully qualified path to a Help file. Read/write. + Returns or sets a String expression containing the fully qualified path to a Help file. Read/write. + 1 + + + Returns a system error code produced by a call to a dynamic-link library (DLL). Read-only. + Returns a system error code produced by a call to a dynamic-link library (DLL). Read-only. + 1 + + + + + + Returns or sets a numeric value specifying an error. Read/write. + Returns or sets a numeric value specifying an error. Read/write. + + is greater than 65535. + 1 + + + Generates a run-time error; can be used instead of the Error statement. + Required. Long integer that identifies the nature of the error. Visual Basic errors are in the range 0–65535; the range 0–512 is reserved for system errors; the range 513–65535 is available for user-defined errors. When setting the Number property to your own error code in a class module, you add your error code number to the vbObjectError constant. For example, to generate the error number 513, assign vbObjectError + 513 to the Number property. + Optional. String expression naming the object or application that generated the error. When setting this property for an object, use the form project.class. If is not specified, the process ID of the current Visual Basic project is used. + Optional. String expression describing the error. If unspecified, the value in the Number property is examined. If it can be mapped to a Visual Basic run-time error code, the string that would be returned by the Error function is used as the Description property. If there is no Visual Basic error corresponding to the Number property, the "Application-defined or object-defined error" message is used. + Optional. The fully qualified path to the Help file in which help on this error can be found. If unspecified, Visual Basic uses the fully qualified drive, path, and file name of the Visual Basic Help file. + Optional. The context ID identifying a topic within that provides help for the error. If omitted, the Visual Basic Help-file context ID for the error corresponding to the Number property is used, if it exists. + 1 + + + + + + Returns or sets a String expression specifying the name of the object or application that originally generated the error. Read/write. + Returns or sets a String expression specifying the name of the object or application that originally generated the error. Read/write. + 1 + + + Indicates the file attributes to use when calling file-access functions. + 1 + + + Normal (default for Dir and SetAttr). No special characteristics apply to this file. This member is equivalent to the Visual Basic constant vbNormal. + + + Read only. This member is equivalent to the Visual Basic constant vbReadOnly. + + + Hidden. This member is equivalent to the Visual Basic constant vbHidden. + + + System file. This member is equivalent to the Visual Basic constant vbSystem. + + + Volume label. This attribute is not valid when used with SetAttr. This member is equivalent to the Visual Basic constant vbVolume. + + + Directory or folder. This member is equivalent to the Visual Basic constant vbDirectory. + + + File has changed since last backup. This member is equivalent to the Visual Basic constant vbArchive. + + + The FileSystem module contains the procedures that are used to perform file, directory or folder, and system operations. The My feature gives you better productivity and performance in file I/O operations than using the FileSystem module. For more information, see . + 1 + + + Changes the current directory or folder. The My feature gives you better productivity and performance in file I/O operations than the ChDir function. For more information, see . + Required. A String expression that identifies which directory or folder becomes the new default directory or folder. may include the drive. If no drive is specified, ChDir changes the default directory or folder on the current drive. + + is empty. + Invalid drive is specified, or drive is unavailable. + 1 + + + + + + + Changes the current drive. + Required. String expression that specifies an existing drive. If you supply a zero-length string (""), the current drive does not change. If the argument is a multiple-character string, ChDrive uses only the first letter. + Invalid drive is specified, or drive is unavailable. + 1 + + + + + + Changes the current drive. + Required. String expression that specifies an existing drive. If you supply a zero-length string (""), the current drive does not change. If the argument is a multiple-character string, ChDrive uses only the first letter. + Invalid drive is specified, or drive is unavailable. + 1 + + + + + + Returns a string representing the current path. The gives you better productivity and performance in file I/O operations than CurDir. For more information, see . + A string representing the current path. + 1 + + + + + + + Returns a string representing the current path. The gives you better productivity and performance in file I/O operations than CurDir. For more information, see . + A string representing the current path. + Optional. Char expression that specifies an existing drive. If no drive is specified, or if is a zero-length string (""), CurDir returns the path for the current drive. + 1 + + + + + + + Returns a string representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive. The gives you better productivity and performance in file I/O operations than the Dir function. See for more information. + A string representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive. + 1 + + + + + + Returns a string representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive. The gives you better productivity and performance in file I/O operations than the Dir function. See for more information. + A string representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive. + Optional. String expression that specifies a file name, directory or folder name, or drive volume label. A zero-length string ("") is returned if is not found. + Optional. Enumeration or numeric expression whose value specifies file attributes. If omitted, Dir returns files that match but have no attributes. + 1 + + + + + + + Returns a Boolean value True when the end of a file opened for Random or sequential Input has been reached. + Returns a Boolean value True when the end of a file opened for Random or sequential Input has been reached. + Required. An Integer that contains any valid file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Returns an enumeration representing the file mode for files opened using the FileOpen function. The gives you better productivity and performance in file I/O operations than the FileAttr function. See for more information. + The following enumeration values indicate the file access mode:ValueMode1OpenMode.Input2OpenMode.Output4OpenMode.Random8OpenMode.Append32OpenMode.Binary + Required. Integer. Any valid file number. + 1 + + + + + + Concludes input/output (I/O) to a file opened using the FileOpen function. My gives you better productivity and performance in file I/O operations. See for more information. + Optional. Parameter array of 0 or more channels to be closed. + + does not exist. + 1 + + + + + + + Copies a file. The gives you better productivity and performance in file I/O operations than FileCopy. See for more information. + Required. String expression that specifies the name of the file to be copied. may include the directory or folder, and drive, of the source file. + Required. String expression that specifies the destination file name. may include the directory or folder, and drive, of the destination file. + + or is invalid or not specified. + File is already open. + File does not exist. + 1 + + + + + + + Returns a Date value that indicates the date and time a file was written to. The My feature gives you better productivity and performance in file I/O operations than FileDateTime. For more information, see + Date value that indicates the date and time a file was created or last modified. + Required. String expression that specifies a file name. may include the directory or folder, and the drive. + + is invalid or contains wildcards. + Target file does not exist. + 1 + + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + Optional. Applies only when writing an array. Specifies whether the array is to be treated as dynamic and whether an array descriptor describing the size and bounds of the array is necessary. + Optional. Applies only when writing a string. Specifies whether to write a two-byte descriptor for the string that describes the length. The default is False. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + Optional. Applies only when writing a string. Specifies whether to write a two-byte descriptor for the string that describes the length. The default is False. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGet. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open disk file into a variable. The My feature gives you better productivity and performance in file I/O operations than FileGetObject. For more information, see . + Required. Any valid file number. + Required. Valid variable name into which data is read. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which reading starts. + 1 + + + + + + Returns a Long value that specifies the length of a file in bytes. The My feature gives you better productivity and performance in file I/O operations than FileLen. For more information, see . + Long value that specifies the length of a file in bytes. + Required. String expression that specifies a file. may include the directory or folder, and the drive. + File does not exist. + 1 + + + + + + + Opens a file for input or output. The My feature gives you better productivity and performance in file I/O operations than FileOpen. For more information, see . + Required. Any valid file number. Use the FreeFile function to obtain the next available file number. + Required. String expression that specifies a file name—may include directory or folder, and drive. + Required. Enumeration specifying the file mode: Append, Binary, Input, Output, or Random. For more information, see . + Optional. Enumeration specifying the operations permitted on the open file: Read, Write, or ReadWrite. Defaults to ReadWrite. For more information, see . + Optional. Enumeration specifying the operations not permitted on the open file by other processes: Shared, Lock Read, Lock Write, and Lock Read Write. Defaults to Lock Read Write. For more information, see . + Optional. Number less than or equal to 32,767 (bytes). For files opened for random access, this value is the record length. For sequential files, this value is the number of characters buffered. + Invalid Access, Share, or Mode. + WriteOnly file is opened for Input. + ReadOnly file is opened for Output. + ReadOnly file is opened for Append. + Record length is negative (and not equal to -1). + + is invalid (<-1 or >255), or is already in use. + + is already open, or is invalid. + 1 + + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + Optional. Applies only when writing an array. Specifies whether the array is to be treated as dynamic, and whether to write an array descriptor for the string that describes the length. + Optional. Applies only when writing a string. Specifies whether to write a two-byte string length descriptor for the string to the file. The default is False. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see .. + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + Optional. Applies only when writing a string. Specifies whether to write a two-byte string length descriptor for the string to the file. The default is False. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePut. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + + < 1 and not equal to -1. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data from a variable to a disk file. The My feature gives you better productivity and performance in file I/O operations than FilePutObject. For more information, see . + Required. Any valid file number. + Required. Valid variable name that contains data written to disk. + Optional. Record number (Random mode files) or byte number (Binary mode files) at which writing starts. + 1 + + + + + + Assigns an output line width to a file opened by using the FileOpen function. + Required. Any valid file number. + Required. Numeric expression in the range 0–255, inclusive, which indicates how many characters appear on a line before a new line is started. If equals 0, there is no limit to the length of a line. The default value for is 0. + + does not exist. + File mode is invalid. + 1 + + + + + + Returns an Integer value that represents the next file number available for use by the FileOpen function. + Returns an Integer value that represents the next file number available for use by the FileOpen function. + More than 255 files are in use. + 1 + + + + + + Returns a FileAttribute value that represents the attributes of a file, directory, or folder. The My feature gives you better productivity and performance in file I/O operations than FileAttribute. For more information, see . + The value returned by GetAttr is the sum of the following enumeration values:ValueConstantDescriptionNormalvbNormalNormal.ReadOnlyvbReadOnlyRead-only.HiddenvbHiddenHidden.SystemvbSystemSystem file.DirectoryvbDirectoryDirectory or folder.ArchivevbArchiveFile has changed since last backup.AliasvbAliasFile has a different name.NoteThese enumerations are specified by the Visual Basic language. The names can be used anywhere in your code in place of the actual values. + Required. String expression that specifies a file, directory, or folder name. can include the directory or folder, and the drive. + + is invalid or contains wildcards. + Target file does not exist. + 1 + + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Reads data from an open sequential file and assigns the data to variables. + Required. Any valid file number. + Required. Variable that is assigned the values read from the file—cannot be an array or object variable. + + does not exist. + File mode is invalid. + 1 + + + + + + Returns String value that contains characters from a file opened in Input or Binary mode. The My feature gives you better productivity and performance in file I/O operations than InputString. For more information, see . + Returns String value that contains characters from a file opened in Input or Binary mode. The My feature gives you better productivity and performance in file I/O operations than InputString. + Required. Any valid file number. + Required. Any valid numeric expression specifying the number of characters to read. + + does not exist. + + < 0 or > 214. + 1 + + + + + + Deletes files from a disk. The My feature gives you better productivity and performance in file I/O operations than Kill. For more information, see . + Required. String expression that specifies one or more file names to be deleted. can include the directory or folder, and the drive. + Target file(s) open. + Target file(s) not found. + Permission denied. + 1 + + + + + + + Reads a single line from an open sequential file and assigns it to a String variable. + Reads a single line from an open sequential file and assigns it to a String variable. + Required. Any valid file number. + End of file reached. + + does not exist. + 1 + + + + + + Returns a Long value that specifies the current read/write position in an open file. + Returns a Long value that specifies the current read/write position in an open file. + Required. Any valid Integer file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + Optional. Number of the only record or byte to lock or unlock + + does not exist. + File mode is invalid. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + Optional. Number of the first record or byte to lock or unlock. + Optional. Number of the last record or byte to lock or unlock. + + does not exist. + File mode is invalid. + 1 + + + + + + Returns a Long representing the size, in bytes, of a file opened by using the FileOpen function. The My feature gives you better productivity and performance in file I/O operations than LOF. For more information, see . + Returns a Long representing the size, in bytes, of a file opened by using the FileOpen function. The My feature gives you better productivity and performance in file I/O operations than LOF. + Required. An Integer that contains a valid file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Creates a new directory. The My feature gives you better productivity and performance in file I/O operations than MkDir. For more information, see . + Required. String expression that identifies the directory to be created. The may include the drive. If no drive is specified, MkDir creates the new directory on the current drive. + + is not specified or is empty. + Permission denied. + Directory already exists. + 1 + + + + + + + Writes display-formatted data to a sequential file. + Required. Any valid file number. + Optional. Zero or more comma-delimited expressions to write to a file.The argument settings are: + 1 + + + + + + Writes display-formatted data to a sequential file. + Required. Any valid file number. + Optional. Zero or more comma-delimited expressions to write to a file.The argument settings are: + 1 + + + + + + Renames a disk file or directory. The My feature gives you better productivity and performance in file I/O operations than Rename. For more information, see . + Required. String expression that specifies the existing file name and location. may include the directory, and drive, of the file. + Required. String expression that specifies the new file name and location. may include directory and drive of the destination location. The file name specified by cannot already exist. + Path is invalid. + + file does not exist. + + file already exists. + Access is invalid. + Cannot rename to different device. + 1 + + + + + + + Closes all disk files opened by using the FileOpen function. The My feature gives you better productivity and performance in file I/O operations than Reset. For more information, see . + 1 + + + + + + + Removes an existing directory. The My feature gives you better productivity and performance in file I/O operations than RmDir. For more information, see . + Required. String expression that identifies the directory or folder to be removed. can include the drive. If no drive is specified, RmDir removes the directory on the current drive. + + is not specified or is empty. + Target directory contains files. + Directory does not exist. + 1 + + + + + + + Returns a Long specifying the current read/write position in a file opened by using the FileOpen function, or sets the position for the next read/write operation in a file opened by using the FileOpen function. The My feature gives you better productivity and performance in file I/O operations than Seek. For more information, see . + Returns a Long specifying the current read/write position in a file opened by using the FileOpen function, or sets the position for the next read/write operation in a file opened by using the FileOpen function. + Required. An Integer that contains a valid file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Returns a Long specifying the current read/write position in a file opened by using the FileOpen function, or sets the position for the next read/write operation in a file opened by using the FileOpen function. The My feature gives you better productivity and performance in file I/O operations than Seek. For more information, see . + Required. An Integer that contains a valid file number. + Required. Number in the range 1–2,147,483,647, inclusive, that indicates where the next read/write operation should occur. + + does not exist. + File mode is invalid. + 1 + + + + + + Sets attribute information for a file. The My feature gives you better productivity and performance in file I/O operations than SetAttr. For more information, see . + Required. String expression that specifies a file name. can include directory or folder, and drive. + Required. Constant or numeric expression, whose sum specifies file attributes. + + invalid or does not exist. + + type is invalid. + 1 + + + + + + + Used with the Print or PrintLine function to position output. + Used with the Print or PrintLine function to position output. + Required. The number of spaces to insert before displaying or printing the next expression in a list. + 1 + + + + + + Used with the Print or PrintLine functions to position output. + Used with the Print or PrintLine functions to position output. + 1 + + + + + + Used with the Print or PrintLine functions to position output. + Used with the Print or PrintLine functions to position output. + Optional. The column number moved to before displaying or printing the next expression in a list. If omitted, TAB moves the insertion point to the start of the next print zone. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + + does not exist. + File mode is invalid. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + Optional. Number of the only record or byte to lock or unlock + + does not exist. + File mode is invalid. + 1 + + + + + + Controls access by other processes to all or part of a file opened by using the Open function. The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock. For more information, see . + Required. Any valid file number. + Optional. Number of the first record or byte to lock or unlock. + Optional. Number of the last record or byte to lock or unlock. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data to a sequential file. Data written with Write is usually read from a file by using Input. + Required. An Integer expression that contains any valid file number. + Optional. One or more comma-delimited expressions to write to a file. + + does not exist. + File mode is invalid. + 1 + + + + + + Writes data to a sequential file. Data written with Write is usually read from a file by using Input. + Required. An Integer expression that contains any valid file number. + Optional. One or more comma-delimited expressions to write to a file. + 1 + + + + + + The Financial module contains procedures used to perform financial operations. + 1 + + + Returns a Double specifying the depreciation of an asset for a specific time period using the double-declining balance method or some other method you specify. + Returns a Double specifying the depreciation of an asset for a specific time period using the double-declining balance method or some other method you specify. + Required. Double specifying initial cost of the asset. + Required. Double specifying value of the asset at the end of its useful life. + Required. Double specifying length of useful life of the asset. + Required. Double specifying period for which asset depreciation is calculated. + Optional. Double specifying rate at which the balance declines. If omitted, 2 (double-declining method) is assumed. + + <= 0, < 0, <= 0, or > + 1 + + + Returns a Double specifying the future value of an annuity based on periodic, fixed payments and a fixed interest rate. + Returns a Double specifying the future value of an annuity based on periodic, fixed payments and a fixed interest rate. + Required. Double specifying interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifying total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 x 12 (or 48) payment periods. + Required. Double specifying payment to be made each period. Payments usually contain principal and interest that doesn't change over the life of the annuity. + Optional. Double specifying present value (or lump sum) of a series of future payments. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + 1 + + + Returns a Double specifying the interest payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate. + Returns a Double specifying the interest payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate. + Required. Double specifying interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifying payment period in the range 1 through . + Required. Double specifying total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 x 12 (or 48) payment periods. + Required. Double specifying present value, or value today, of a series of future payments or receipts. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. + Optional. Double specifying future value or cash balance you want after you've made the final payment. For example, the future value of a loan is $0 because that's its value after the final payment. However, if you want to save $50,000 over 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + + <= 0 or > + 1 + + + Returns a Double specifying the internal rate of return for a series of periodic cash flows (payments and receipts). + Returns a Double specifying the internal rate of return for a series of periodic cash flows (payments and receipts). + Required. Array of Double specifying cash flow values. The array must contain at least one negative value (a payment) and one positive value (a receipt). + Optional. Object specifying value you estimate will be returned by IRR. If omitted, is 0.1 (10 percent). + Array argument values are invalid or <= -1. + 1 + + + Returns a Double specifying the modified internal rate of return for a series of periodic cash flows (payments and receipts). + Returns a Double specifying the modified internal rate of return for a series of periodic cash flows (payments and receipts). + Required. Array of Double specifying cash-flow values. The array must contain at least one negative value (a payment) and one positive value (a receipt). + Required. Double specifying interest rate paid as the cost of financing. + Required. Double specifying interest rate received on gains from cash reinvestment. + Rank of does not equal 1, = -1, or = -1 + Division by zero has occurred. + 1 + + + Returns a Double specifying the number of periods for an annuity based on periodic fixed payments and a fixed interest rate. + Returns a Double specifying the number of periods for an annuity based on periodic fixed payments and a fixed interest rate. + Required. Double specifying interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifying payment to be made each period. Payments usually contain principal and interest that does not change over the life of the annuity. + Required. Double specifying present value, or value today, of a series of future payments or receipts. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. + Optional. Double specifying future value or cash balance you want after you have made the final payment. For example, the future value of a loan is $0 because that is its value after the final payment. However, if you want to save $50,000 over 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + + <= -1. + + = 0 and = 0 + 1 + + + Returns a Double specifying the net present value of an investment based on a series of periodic cash flows (payments and receipts) and a discount rate. + Returns a Double specifying the net present value of an investment based on a series of periodic cash flows (payments and receipts) and a discount rate. + Required. Double specifying discount rate over the length of the period, expressed as a decimal. + Required. Array of Double specifying cash flow values. The array must contain at least one negative value (a payment) and one positive value (a receipt). + + is Nothing, rank of <> 1, or = -1 + 1 + + + Returns a Double specifying the payment for an annuity based on periodic, fixed payments and a fixed interest rate. + Returns a Double specifying the payment for an annuity based on periodic, fixed payments and a fixed interest rate. + Required. Double specifies the interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifies the total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 × 12 (or 48) payment periods. + Required. Double specifies the present value (or lump sum) that a series of payments to be paid in the future is worth now. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. + Optional. Double specifying future value or cash balance you want after you have made the final payment. For example, the future value of a loan is $0 because that is its value after the final payment. However, if you want to save $50,000 during 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + + = 0. + 1 + + + Returns a Double specifying the principal payment for a given period of an annuity based on periodic fixed payments and a fixed interest rate. + Returns a Double specifying the principal payment for a given period of an annuity based on periodic fixed payments and a fixed interest rate. + Required. Double specifies the interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifies the payment period in the range 1 through . + Required. Double specifies the total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 x 12 (or 48) payment periods. + Required. Double specifies the current value of a series of future payments or receipts. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. + Optional. Double specifying future value or cash balance you want after you have made the final payment. For example, the future value of a loan is $0 because that is its value after the final payment. However, if you want to save $50,000 over 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + + <=0 or > . + 1 + + + Returns a Double specifying the present value of an annuity based on periodic, fixed payments to be paid in the future and a fixed interest rate. + Returns a Double specifying the present value of an annuity based on periodic, fixed payments to be paid in the future and a fixed interest rate. + Required. Double specifies the interest rate per period. For example, if you get a car loan at an annual percentage rate (APR) of 10 percent and make monthly payments, the rate per period is 0.1/12, or 0.0083. + Required. Double specifies the total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has 4 x 12 (or 48) payment periods. + Required. Double specifies the payment to be made each period. Payments usually contain principal and interest that does not change during the life of the annuity. + Optional. Double specifies the future value or cash balance you want after you make the final payment. For example, the future value of a loan is $0 because that is its value after the final payment. However, if you want to save $50,000 over 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + 1 + + + Returns a Double specifying the interest rate per period for an annuity. + Returns a Double specifying the interest rate per period for an annuity. + Required. Double specifies the total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 * 12 (or 48) payment periods. + Required. Double specifies the payment to be made each period. Payments usually contain principal and interest that doesn't change over the life of the annuity. + Required. Double specifies the present value, or value today, of a series of future payments or receipts. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make. + Optional. Double specifies the future value or cash balance you want after you make the final payment. For example, the future value of a loan is $0 because that is its value after the final payment. However, if you want to save $50,000 over 18 years for your child's education, then $50,000 is the future value. If omitted, 0 is assumed. + Optional. Object of type that specifies when payments are due. This argument must be either DueDate.EndOfPeriod if payments are due at the end of the payment period, or DueDate.BegOfPeriod if payments are due at the beginning of the period. If omitted, DueDate.EndOfPeriod is assumed. + Optional. Double specifying value you estimate is returned by Rate. If omitted, is 0.1 (10 percent). + + <= 0. + 1 + + + Returns a Double specifying the straight-line depreciation of an asset for a single period. + Returns a Double specifying the straight-line depreciation of an asset for a single period. + Required. Double specifying initial cost of the asset. + Required. Double specifying value of the asset at the end of its useful life. + Required. Double specifying length of the useful life of the asset. + + = 0. + 1 + + + Returns a Double specifying the sum-of-years digits depreciation of an asset for a specified period. + Returns a Double specifying the sum-of-years digits depreciation of an asset for a specified period. + Required. Double specifying the initial cost of the asset. + Required. Double specifying the value of the asset at the end of its useful life. + Required. Double specifying the length of the useful life of the asset. + Required. Double specifying the period for which asset depreciation is calculated. + + < 0, > , or <=0. + 1 + + + Indicates the first day of the week to use when calling date-related functions. + 1 + + + The first day of the week as specified in your system settings This member is equivalent to the Visual Basic constant vbUseSystemDayOfWeek. + + + Sunday (default) This member is equivalent to the Visual Basic constant vbSunday. + + + Monday This member is equivalent to the Visual Basic constant vbMonday. + + + Tuesday This member is equivalent to the Visual Basic constant vbTuesday. + + + Wednesday This member is equivalent to the Visual Basic constant vbWednesday. + + + Thursday This member is equivalent to the Visual Basic constant vbThursday. + + + Friday This member is equivalent to the Visual Basic constant vbFriday. + + + Saturday This member is equivalent to the Visual Basic constant vbSaturday. + + + Indicates the first week of the year to use when calling date-related functions. + 1 + + + The weekspecified in your system settings as the first week of the year. This member is equivalent to the Visual Basic constant vbUseSystem. + + + The week in which January 1 occurs (default). This member is equivalent to the Visual Basic constant vbFirstJan1. + + + The first week that has at least four days in the new year. This member is equivalent to the Visual Basic constant vbFirstFourDays. + + + The first full week of the year. This member is equivalent to the Visual Basic constant vbFirstFullWeek. + + + The Globals module contains script engine functions. + 1 + + + Returns a String representing the runtime currently in use. + Returns a String representing the runtime currently in use. + 1 + + + Returns an Integer containing the build version number of the runtime currently in use. + Returns an Integer containing the build version number of the runtime currently in use. + 1 + + + Returns an Integer containing the major version number of the runtime currently in use. + Returns an Integer containing the major version number of the runtime currently in use. + 1 + + + Returns an Integer containing the minor version number of the runtime currently in use. + Returns an Integer containing the minor version number of the runtime currently in use. + 1 + + + The HideModuleNameAttribute attribute, when applied to a module, allows the module members to be accessed using only the qualification needed for the module. + 1 + + + Initializes a new instance of the attribute. + + + The Information module contains the procedures used to return, test for, or verify information. + 1 + + + Returns an integer indicating the line number of the last executed statement. Read-only. + Returns an integer indicating the line number of the last executed statement. Read-only. + 1 + + + Contains information about run-time errors. + Contains information about run-time errors. + 1 + + + Returns a Boolean value indicating whether a variable points to an array. + Returns a Boolean value indicating whether a variable points to an array. + Required. Object variable. + 1 + + + Returns a Boolean value indicating whether an expression represents a valid Date value. + Returns a Boolean value indicating whether an expression represents a valid Date value. + Required. Object expression. + 1 + + + Returns a Boolean value indicating whether an expression evaluates to the class. + Returns a Boolean value indicating whether an expression evaluates to the class. + Required. Object expression. + 1 + + + Returns a Boolean value indicating whether an expression is an exception type. + Returns a Boolean value indicating whether an expression is an exception type. + Required. Object expression. + 1 + + + Returns a Boolean value indicating whether an expression has no object assigned to it. + Returns a Boolean value indicating whether an expression has no object assigned to it. + Required. Object expression. + 1 + + + Returns a Boolean value indicating whether an expression can be evaluated as a number. + Returns a Boolean value indicating whether an expression can be evaluated as a number. + Required. Object expression. + 1 + + + Returns a Boolean value indicating whether an expression evaluates to a reference type. + Returns a Boolean value indicating whether an expression evaluates to a reference type. + Required. Object expression. + 1 + + + Returns the lowest available subscript for the indicated dimension of an array. + Integer. The lowest value the subscript for the specified dimension can contain. LBound always returns 0 as long as has been initialized, even if it has no elements, for example if it is a zero-length string. If is Nothing, LBound throws an . + Required. Array of any data type. The array in which you want to find the lowest possible subscript of a dimension. + Optional. Integer. The dimension for which the lowest possible subscript is to be returned. Use 1 for the first dimension, 2 for the second, and so on. If is omitted, 1 is assumed. + + is Nothing. + + < 1 or is greater than the rank of . + 1 + + + Returns an Integer value representing the RGB color code corresponding to the specified color number. + Returns an Integer value representing the RGB color code corresponding to the specified color number. + Required. A whole number in the range 0–15. + + is outside of range 0 to 15, inclusive. + 1 + + + Returns an Integer value representing an RGB color value from a set of red, green and blue color components. + Returns an Integer value representing an RGB color value from a set of red, green and blue color components. + Required. Integer in the range 0–255, inclusive, that represents the intensity of the red component of the color. + Required. Integer in the range 0–255, inclusive, that represents the intensity of the green component of the color. + Required. Integer in the range 0–255, inclusive, that represents the intensity of the blue component of the color. + + , , or outside of range 0 and 255, inclusive. + 1 + + + Returns a String value containing the system data type name of a variable. + Returns a String value containing the system data type name of a variable. + Required. A String variable containing a Visual Basic type name. + 1 + + + Returns a String value containing data-type information about a variable. + Returns a String value containing data-type information about a variable. + Required. Object variable. If Option Strict is Off, you can pass a variable of any data type except a structure. + 1 + + + + + + Returns the highest available subscript for the indicated dimension of an array. + Integer. The highest value the subscript for the specified dimension can contain. If has only one element, UBound returns 0. If has no elements, for example if it is a zero-length string, UBound returns -1. + Required. Array of any data type. The array in which you want to find the highest possible subscript of a dimension. + Optional. Integer. The dimension for which the highest possible subscript is to be returned. Use 1 for the first dimension, 2 for the second, and so on. If is omitted, 1 is assumed. + + is Nothing + + is less than 1 or is greater than the rank of . + 1 + + + Returns an Integer value containing the data type classification of a variable. + Returns an Integer value containing the data type classification of a variable. + Required. Object variable. If Option Strict is Off, you can pass a variable of any data type except a structure. + 1 + + + Returns a String value containing the Visual Basic data type name of a variable. + Returns a String value containing the Visual Basic data type name of a variable. + Required. String variable containing a type name used by the common language runtime. + 1 + + + The Interaction module contains procedures used to interact with objects, applications, and systems. + 1 + + + Activates an application that is already running. + Integer specifying the Win32 process ID number assigned to this process. You can use the ID returned by the , provided it is not zero. + 1 + + + + + + + Activates an application that is already running. + String expression specifying the title in the title bar of the application you want to activate. You can use the title assigned to the application when it was launched. + 1 + + + + + + + Sounds a tone through the computer's speaker. + 1 + + + + + + Executes a method on an object, or sets or returns a property on an object. + Executes a method on an object, or sets or returns a property on an object. + Required. Object. A pointer to the object exposing the property or method. + Required. String. A string expression containing the name of the property or method on the object. + Required. An enumeration member of type representing the type of procedure being called. The value of CallType can be Method, Get, or Set. + Optional. ParamArray. A parameter array containing the arguments to be passed to the property or method being called. + Invalid value; must be Method, Get, or Set. + 1 + + + + + + Selects and returns a value from a list of arguments. + Selects and returns a value from a list of arguments. + Required. Double. Numeric expression that results in a value between 1 and the number of elements passed in the argument. + Required. Object parameter array. You can supply either a single variable or an expression that evaluates to the Object data type, to a list of Object variables or expressions separated by commas, or to a single-dimensional array of Object elements. + 1 + + + Returns the argument portion of the command line used to start Visual Basic or an executable program developed with Visual Basic. The My feature provides greater productivity and performance than the Command function. For more information, see . + Returns the argument portion of the command line used to start Visual Basic or an executable program developed with Visual Basic.The My feature provides greater productivity and performance than the Command function. For more information, see . + 1 + + + + + + Creates and returns a reference to a COM object. CreateObject cannot be used to create instances of classes in Visual Basic unless those classes are explicitly exposed as COM components. + Creates and returns a reference to a COM object. CreateObject cannot be used to create instances of classes in Visual Basic unless those classes are explicitly exposed as COM components. + Required. String. The program ID of the object to create. + Optional. String. The name of the network server where the object will be created. If is an empty string (""), the local computer is used. + + not found or not supplied-or- fails the DnsValidateName function, most likely because it is longer than 63 characters or contains an invalid character. + Server is unavailable + No object of the specified type exists + 1 + + + + + + + Deletes a section or key setting from an application's entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than the DeleteSetting function. For more information, see . + Required. String expression containing the name of the application or project to which the section or key setting applies. + Required. String expression containing the name of the section from which the key setting is being deleted. If only and are provided, the specified section is deleted along with all related key settings. + Optional. String expression containing the name of the key setting being deleted. + + , , or setting does not exist. + User is not logged in. + 1 + + + + + + + + Returns the string associated with an operating-system environment variable. + Returns the string associated with an operating-system environment variable. + Required. Expression that evaluates either a string containing the name of an environment variable, or an integer corresponding to the numeric order of an environment string in the environment-string table. + + is missing. + 1 + + + + + + Returns the string associated with an operating-system environment variable. + Returns the string associated with an operating-system environment variable. + Required. Expression that evaluates either a string containing the name of an environment variable, or an integer corresponding to the numeric order of an environment string in the environment-string table. + + is missing. + 1 + + + + + + Returns a list of key settings and their respective values (originally created with SaveSetting) from an application's entry in the Windows registry. Using the My feature gives you greater productivity and performance in registry operations than GetAllSettings. For more information, see . + Returns a list of key settings and their respective values (originally created with SaveSetting) from an application's entry in the Windows registry.Using the My feature gives you greater productivity and performance in registry operations than GetAllSettings. For more information, see . + Required. String expression containing the name of the application or project whose key settings are requested. + Required. String expression containing the name of the section whose key settings are requested. GetAllSettings returns an object that contains a two-dimensional array of strings. The strings contain all the key settings in the specified section, plus their corresponding values. + User is not logged in. + + + + 1 + + + Returns a reference to an object provided by a COM component. + Returns a reference to an object provided by a COM component. + Optional. String. The full path and name of the file containing the object to retrieve. If is omitted, is required. + Required if is not supplied. String. A string representing the class of the object. The argument has the following syntax and parts:.ParameterDescriptionRequired. String. The name of the application providing the object.Required. String. The type or class of object to create. + No object of the specified class type exists. + No object with the specified path and file name exists. + 1 + + + + + + Returns a key setting value from an application's entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than GetAllSettings. For more information, see . + Returns a key setting value from an application's entry in the Windows registry.The My feature gives you greater productivity and performance in registry operations than GetAllSettings. + Required. String expression containing the name of the application or project whose key setting is requested. + Required. String expression containing the name of the section in which the key setting is found. + Required. String expression containing the name of the key setting to return. + Optional. Expression containing the value to return if no value is set in the setting. If omitted, is assumed to be a zero-length string (""). + One or more arguments are not String expressions, or user is not logged in. + 1 + + + + + + Returns one of two objects, depending on the evaluation of an expression. + Returns one of two objects, depending on the evaluation of an expression. + Required. Boolean. The expression you want to evaluate. + Required. Object. Returned if evaluates to True. + Required. Object. Returned if evaluates to False. + 1 + + + Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. + Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. + Required String expression displayed as the message in the dialog box. The maximum length of is approximately 1024 characters, depending on the width of the characters used. If consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a line feed character (Chr(10)), or a carriage return/line feed combination (Chr(13) & Chr(10)) between each line. + Optional. String expression displayed in the title bar of the dialog box. If you omit , the application name is placed in the title bar. + Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit , the displayed text box is empty. + Optional. Numeric expression that specifies, in twips, the distance of the left edge of the dialog box from the left edge of the screen. If you omit , the dialog box is centered horizontally. + Optional. Numeric expression that specifies, in twips, the distance of the upper edge of the dialog box from the top of the screen. If you omit , the dialog box is positioned vertically approximately one-third of the way down the screen. + 1 + + + + + + + + Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked. + ConstantValueOK1Cancel2Abort3Retry4Ignore5Yes6No7 + Required. String expression displayed as the message in the dialog box. The maximum length of is approximately 1024 characters, depending on the width of the characters used. If consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a line feed character (Chr(10)), or a carriage return/linefeed character combination (Chr(13) & Chr(10)) between each line. + Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If you omit , the default value is zero. + Optional. String expression displayed in the title bar of the dialog box. If you omit , the application name is placed in the title bar. + + is not a String expression, or is invalid. + Process is not running in User Interactive mode. + One or more parameters not a member of MsgBoxResult or MsgBoxStyle enumeration. + 1 + + + + + + + + Returns a string representing the calculated range that contains a number. + Returns a string representing the calculated range that contains a number. + Required. Long. Whole number that you want to locate within one of the calculated ranges. + Required. Long. Whole number that indicates the start of the set of calculated ranges. cannot be less than 0. + Required. Long. Whole number that indicates the end of the set of calculated ranges. cannot be less than or equal to . + Required. Long. Whole number that indicates the size of each range calculated between and . cannot be less than 1. + + < 0, <= , or < 1. + 1 + + + Saves or creates an application entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than SaveSetting. For more information, see . + Required. String expression containing the name of the application or project to which the setting applies. + Required. String expression containing the name of the section in which the key setting is being saved. + Required. String expression containing the name of the key setting being saved. + Required. Expression containing the value to which is being set. + Key registry could not be created, or user is not logged in. + 1 + + + + + + Runs an executable program and returns an integer containing the program's process ID if it is still running. + Runs an executable program and returns an integer containing the program's process ID if it is still running. + Required. String. Name of the program to execute, together with any required arguments and command-line switches. can also include the drive and the directory path or folder.If you do not know the path to the program, you can use the to locate it. For example, you can call My.Computer.FileSystem.GetFiles("C:\", True, "testFile.txt"), which returns the full path of every file named testFile.txt anywhere on drive C:\. + Optional. AppWinStyle. A value chosen from the specifying the style of the window in which the program is to run. If is omitted, Shell uses AppWinStyle.MinimizedFocus, which starts the program minimized and with focus. + Optional. Boolean. A value indicating whether the Shell function should wait for completion of the program. If is omitted, Shell uses False. + Optional. Integer. The number of milliseconds to wait for completion if is True. If is omitted, Shell uses -1, which means there is no timeout and Shell does not return until the program finishes. Therefore, if you omit or set it to -1, it is possible that Shell might never return control to your program. + + is not within range 0 through 9, inclusive. + Shell cannot find the file. + + is Nothing. + 1 + + + + + + + Evaluates a list of expressions and returns an Object value corresponding to the first expression in the list that is True. + Evaluates a list of expressions and returns an Object value corresponding to the first expression in the list that is True. + Required. Object parameter array. Must have an even number of elements. You can supply a list of Object variables or expressions separated by commas, or a single-dimensional array of Object elements. + Number of arguments is odd. + 1 + + + + + + Indicates which button was pressed on a message box, returned by the MsgBox function. + 1 + + + OK button was pressed. This member is equivalent to the Visual Basic constant vbOK. + + + Cancel button was pressed. This member is equivalent to the Visual Basic constant vbCancel. + + + Abort button was pressed. This member is equivalent to the Visual Basic constant vbAbort. + + + Retry button was pressed. This member is equivalent to the Visual Basic constant vbRetry. + + + Ignore button was pressed. This member is equivalent to the Visual Basic constant vbIgnore. + + + Yes button was pressed. This member is equivalent to the Visual Basic constant vbYes. + + + No button was pressed. This member is equivalent to the Visual Basic constant vbNo. + + + + + + Indicates which buttons to display when calling the MsgBox function. + 1 + + + OK button only (default). This member is equivalent to the Visual Basic constant vbOKOnly. + + + OK and Cancel buttons. This member is equivalent to the Visual Basic constant vbOKCancel. + + + Abort, Retry, and Ignore buttons. This member is equivalent to the Visual Basic constant vbAbortRetryIgnore. + + + Yes, No, and Cancel buttons. This member is equivalent to the Visual Basic constant vbYesNoCancel. + + + Yes and No buttons. This member is equivalent to the Visual Basic constant vbYesNo. + + + Retry and Cancel buttons. This member is equivalent to the Visual Basic constant vbRetryCancel. + + + Critical message. This member is equivalent to the Visual Basic constant vbCritical. + + + Warning query. This member is equivalent to the Visual Basic constant vbQuestion. + + + Warning message. This member is equivalent to the Visual Basic constant vbExclamation. + + + Information message. This member is equivalent to the Visual Basic constant vbInformation. + + + First button is default. This member is equivalent to the Visual Basic constant vbDefaultButton1. + + + Second button is default. This member is equivalent to the Visual Basic constant vbDefaultButton2. + + + Third button is default. This member is equivalent to the Visual Basic constant vbDefaultButton3. + + + Application modal message box. This member is equivalent to the Visual Basic constant vbApplicationModal. + + + System modal message box. This member is equivalent to the Visual Basic constant vbSystemModal. + + + Help text. This member is equivalent to the Visual Basic constant vbMsgBoxHelp. + + + Right-aligned text. This member is equivalent to the Visual Basic constant vbMsgBoxRight. + + + Right-to-left reading text (Hebrew and Arabic systems). This member is equivalent to the Visual Basic constant vbMsgBoxRtlReading. + + + Foreground message box window. This member is equivalent to the Visual Basic constant vbMsgBoxSetForeground. + + + + + + + + + This attribute supports My.Forms and My.WebServices in Visual Basic. + 1 + + + This attribute supports My.Forms and My.WebServices in Visual Basic. + String. Initializes the property. The compiler generates accessor properties for classes that derive from this type. + String. Initializes the property. Specifies the method in the class that creates the type's instances. + String. Initializes the property. Specifies the method in the class that disposes of the type's instances. + String. Initializes the property. Specifies the name of the property that returns the default instance of the class. + + + This property supports My in Visual Basic. + Specifies the method in the class that creates the type's instances. + 1 + + + This property supports My in Visual Basic. + Specifies the name of the property that returns the default instance of the class. + 1 + + + This property supports My in Visual Basic. + Specifies the method in the class that disposes of the type's instances. + 1 + + + This property supports My in Visual Basic. + Specifies the name of the type for which the compiler generates accessor properties. + 1 + + + Indicates how to open a file when calling file-access functions. + 1 + + + Read and write access permitted. This is the default. + + + Read access permitted. + + + Read and write access permitted. + + + Write access permitted. + + + Indicates how to open a file when calling file-access functions. + 1 + + + File opened for read access. + + + File opened for write access. + + + File opened for random access. + + + File opened to append to it. Default. + + + File opened for binary access. + + + Indicates how to open a file when calling file-access functions. + 1 + + + LockReadWrite. This is the default. + + + Any process can read or write to the file. + + + Other processes cannot read the file. + + + Other processes cannot read or write to the file. + + + Other processes cannot write to the file. + + + This class supports the Visual Basic Print and PrintLine functions. + 2 + + + This field supports the Visual Basic Print and PrintLine functions. + 1 + + + The Strings module contains procedures used to perform string operations. + 1 + + + Returns an Integer value representing the character code corresponding to a character. + Returns an Integer value representing the character code corresponding to a character. + Required. Any valid Char or String expression. If is a String expression, only the first character of the string is used for input. If is Nothing or contains no characters, an error occurs. + 1 + + + Returns an Integer value representing the character code corresponding to a character. + Returns an Integer value representing the character code corresponding to a character. + Required. Any valid Char or String expression. If is a String expression, only the first character of the string is used for input. If is Nothing or contains no characters, an error occurs. + 1 + + + Returns an Integer value representing the character code corresponding to a character. + Returns an Integer value representing the character code corresponding to a character. + Required. Any valid Char or String expression. If is a String expression, only the first character of the string is used for input. If is Nothing or contains no characters, an error occurs. + 1 + + + Returns an Integer value representing the character code corresponding to a character. + Returns an Integer value representing the character code corresponding to a character. + Required. Any valid Char or String expression. If is a String expression, only the first character of the string is used for input. If is Nothing or contains no characters, an error occurs. + 1 + + + Returns the character associated with the specified character code. + Returns the character associated with the specified character code. + Required. An Integer expression representing the code point, or character code, for the character. + + < 0 or > 255 for Chr. + 1 + + + Returns the character associated with the specified character code. + Returns the character associated with the specified character code. + Required. An Integer expression representing the code point, or character code, for the character. + + < -32768 or > 65535 for ChrW. + 1 + + + Returns a zero-based array containing a subset of a String array based on specified filter criteria. + Returns a zero-based array containing a subset of a String array based on specified filter criteria. + Required. One-dimensional array of strings to be searched. + Required. String to search for. + Optional. Boolean value indicating whether to return substrings that include or exclude . If is True, the Filter function returns the subset of the array that contains as a substring. If is False, the Filter function returns the subset of the array that does not contain as a substring. + Optional. Numeric value indicating the kind of string comparison to use. See "Settings" for values. + + is Nothing or is not a one-dimensional array. + 1 + + + + + + Returns a zero-based array containing a subset of a String array based on specified filter criteria. + Returns a zero-based array containing a subset of a String array based on specified filter criteria. + Required. One-dimensional array of strings to be searched. + Required. String to search for. + Optional. Boolean value indicating whether to return substrings that include or exclude . If is True, the Filter function returns the subset of the array that contains as a substring. If is False, the Filter function returns the subset of the array that does not contain as a substring. + Optional. Numeric value indicating the kind of string comparison to use. See "Settings" for values. + + is Nothing or is not a one-dimensional array. + 1 + + + + + + Returns a string formatted according to instructions contained in a format String expression. + Returns a string formatted according to instructions contained in a format String expression. + Required. Any valid expression. + Optional. A valid named or user-defined format String expression. + 1 + + + + + + Returns an expression formatted as a currency value using the currency symbol defined in the system control panel. + Returns an expression formatted as a currency value using the currency symbol defined in the system control panel. + Required. Expression to be formatted. + Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used. + Optional. enumeration that indicates whether or not a leading zero is displayed for fractional values. See "Remarks" for values. + Optional. enumeration that indicates whether or not to place negative values within parentheses. See "Remarks" for values. + Optional. enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See "Remarks" for values. + Number of digits after decimal point is greater than 99. + Type is not numeric. + 1 + + + + + + Returns a string expression representing a date/time value. + Returns a string expression representing a date/time value. + Required. Date expression to be formatted. + Optional. Numeric value that indicates the date/time format used. If omitted, DateFormat.GeneralDate is used. + + setting is not valid. + 1 + + + Returns an expression formatted as a number. + Returns an expression formatted as a number. + Required. Expression to be formatted. + Optional. Numeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used. + Optional. constant that indicates whether a leading 0 is displayed for fractional values. See "Settings" for values. + Optional. constant that indicates whether to place negative values within parentheses. See "Settings" for values. + Optional. constant that indicates whether or not numbers are grouped using the group delimiter specified in the locale settings. See "Settings" for values. + Type is not numeric. + 1 + + + + + + Returns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character. + Returns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character. + Required. Expression to be formatted. + Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value is –1, which indicates that the locale settings are used. + Optional. constant that indicates whether or not a leading zero displays for fractional values. See "Settings" for values. + Optional. constant that indicates whether or not to place negative values within parentheses. See "Settings" for values. + Optional. constant that indicates whether or not numbers are grouped using the group delimiter specified in the locale settings. See "Settings" for values. + Type is not numeric. + 1 + + + + + + Returns a Char value representing the character from the specified index in the supplied string. + Char value representing the character from the specified index in the supplied string. + Required. Any valid String expression. + Required. Integer expression. The (1-based) index of the character in to be returned. + + is Nothing, < 1, or is greater than index of last character of . + 1 + + + Returns an integer specifying the start position of the first occurrence of one string within another. + IfInStr returns is zero length or Nothing0 is zero length or Nothing is not found0 is found within Position where match begins > 0 + Optional. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start index is 1-based. + Required. String expression being searched. + Required. String expression sought. + Optional. Specifies the type of string comparison. If is omitted, the Option Compare setting determines the type of comparison. + + < 1. + 1 + + + Returns an integer specifying the start position of the first occurrence of one string within another. + IfInStr returns is zero length or Nothing0 is zero length or Nothing is not found0 is found within Position where match begins > 0 + Required. String expression being searched. + Required. String expression sought. + Optional. Specifies the type of string comparison. If is omitted, the Option Compare setting determines the type of comparison. + + < 1. + 1 + + + Returns the position of the first occurrence of one string within another, starting from the right side of the string. + IfInStrRev returns is zero-length0 is zero-length is not found0 is found within Position at which the first match is found, starting with the right side of the string. is greater than length of 0 + Required. String expression being searched. + Required. String expression being searched for. + Optional. Numeric expression setting the one-based starting position for each search, starting from the left side of the string. If is omitted then –1 is used, meaning the search begins at the last character position. Search then proceeds from right to left. + Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings for values. + + = 0 or < -1. + 1 + + + Returns a string created by joining a number of substrings contained in an array. + Returns a string created by joining a number of substrings contained in an array. + Required. One-dimensional array containing substrings to be joined. + Optional. Any string, used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If is a zero-length string ("") or Nothing, all items in the list are concatenated with no delimiters. + + is not one dimensional. + 1 + + + + + + Returns a string created by joining a number of substrings contained in an array. + Returns a string created by joining a number of substrings contained in an array. + Required. One-dimensional array containing substrings to be joined. + Optional. Any string, used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If is a zero-length string ("") or Nothing, all items in the list are concatenated with no delimiters. + + is not one dimensional. + 1 + + + + + + Returns a string or character converted to lowercase. + Returns a string or character converted to lowercase. + Required. Any valid String or Char expression. + 1 + + + Returns a string or character converted to lowercase. + Returns a string or character converted to lowercase. + Required. Any valid String or Char expression. + 1 + + + Returns a string containing a specified number of characters from the left side of a string. + Returns a string containing a specified number of characters from the left side of a string. + Required. String expression from which the leftmost characters are returned. + Required. Integer expression. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in , the entire string is returned. + + < 0. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. + Any valid String expression or variable name. If is of type Object, the Len function returns the size as it will be written to the file by the FilePut function. + 1 + + + Returns a left-aligned string containing the specified string adjusted to the specified length. + Returns a left-aligned string containing the specified string adjusted to the specified length. + Required. String expression. Name of string variable. + Required. Integer expression. Length of returned string. + 1 + + + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Required. Any valid String expression. + 1 + + + Returns a string containing a specified number of characters from a string. + Returns a string containing a specified number of characters from a string. + Required. String expression from which characters are returned. + Required. Integer expression. Starting position of the characters to return. If is greater than the number of characters in , the Mid function returns a zero-length string (""). is one based. + + <= 0 or < 0. + 1 + + + Returns a string containing a specified number of characters from a string. + Returns a string containing a specified number of characters from a string. + Required. String expression from which characters are returned. + Required. Integer expression. Starting position of the characters to return. If is greater than the number of characters in , the Mid function returns a zero-length string (""). is one based. + Optional. Integer expression. Number of characters to return. If omitted or if there are fewer than characters in the text (including the character at position ), all characters from the start position to the end of the string are returned. + + <= 0 or < 0. + 1 + + + Returns a string in which a specified substring has been replaced with another substring a specified number of times. + Replace returns the following values.IfReplace returns is zero-length or NothingCopy of is zero-lengthCopy of with no occurrences of is zero-length or Nothing, or is greater than length of Nothing is 0Copy of + Required. String expression containing substring to replace. + Required. Substring being searched for. + Required. Replacement substring. + Optional. Position within where substring search is to begin. If omitted, 1 is assumed. + Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means "make all possible substitutions." + Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings for values. + + < -1 or <= 0. + 1 + + + Returns a string containing a specified number of characters from the right side of a string. + Returns a string containing a specified number of characters from the right side of a string. + Required. String expression from which the rightmost characters are returned. + Required. Integer. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in , the entire string is returned. + + < 0. + 1 + + + Returns a right-aligned string containing the specified string adjusted to the specified length. + Returns a right-aligned string containing the specified string adjusted to the specified length. + Required. String expression. Name of string variable. + Required. Integer expression. Length of returned string. + 1 + + + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Required. Any valid String expression. + 1 + + + Returns a string consisting of the specified number of spaces. + Returns a string consisting of the specified number of spaces. + Required. Integer expression. The number of spaces you want in the string. + + < 0. + 1 + + + Returns a zero-based, one-dimensional array containing a specified number of substrings. + String array. If is a zero-length string (""), Split returns a single-element array containing a zero-length string. If is a zero-length string, or if it does not appear anywhere in , Split returns a single-element array containing the entire string. + Required. String expression containing substrings and delimiters. + Optional. Any single character used to identify substring limits. If is omitted, the space character (" ") is assumed to be the delimiter. + Optional. Maximum number of substrings into which the input string should be split. The default, –1, indicates that the input string should be split at every occurrence of the string. + Optional. Numeric value indicating the comparison to use when evaluating substrings. See "Settings" for values. + 1 + + + Returns -1, 0, or 1, based on the result of a string comparison. + The StrComp function has the following return values.IfStrComp returns sorts ahead of -1 is equal to 0 sorts after 1 + Required. Any valid String expression. + Required. Any valid String expression. + Optional. Specifies the type of string comparison. If is omitted, the Option Compare setting determines the type of comparison. + + value is not valid. + 1 + + + Returns a string converted as specified. + Returns a string converted as specified. + Required. String expression to be converted. + Required. member. The enumeration value specifying the type of conversion to perform. + Optional. The LocaleID value, if different from the system LocaleID value. (The system LocaleID value is the default.) + Unsupported , < 0 or > 2048, or unsupported conversion for specified locale. + 1 + + + Returns a string or object consisting of the specified character repeated the specified number of times. + Returns a string or object consisting of the specified character repeated the specified number of times. + Required. Integer expression. The length to the string to be returned. + Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value. + + is less than 0 or type is not valid. + + is Nothing. + 1 + + + + + + Returns a string or object consisting of the specified character repeated the specified number of times. + Returns a string or object consisting of the specified character repeated the specified number of times. + Required. Integer expression. The length to the string to be returned. + Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value. + + is less than 0 or type is not valid. + + is Nothing. + 1 + + + + + + Returns a string or object consisting of the specified character repeated the specified number of times. + Returns a string or object consisting of the specified character repeated the specified number of times. + Required. Integer expression. The length to the string to be returned. + Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value. + + is less than 0 or type is not valid. + + is Nothing. + 1 + + + + + + Returns a string in which the character order of a specified string is reversed. + Returns a string in which the character order of a specified string is reversed. + Required. String expression whose characters are to be reversed. If is a zero-length string (""), a zero-length string is returned. + 1 + + + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim). + Required. Any valid String expression. + 1 + + + Returns a string or character containing the specified string converted to uppercase. + Returns a string or character containing the specified string converted to uppercase. + Required. Any valid String or Char expression. + 1 + + + Returns a string or character containing the specified string converted to uppercase. + Returns a string or character containing the specified string converted to uppercase. + Required. Any valid String or Char expression. + 1 + + + This class supports the Visual Basic Print and PrintLine functions. + 2 + + + This field supports the Visual Basic Print and PrintLine functions. + 1 + + + Indicates a Boolean value or whether the default should be used when calling number-formatting functions. + 1 + + + False. The numeric value of this member is 0. + + + True. The numeric value of this member is -1. + + + Default setting. The numeric value of this member is -2. + + + Indicates the type of a variant object, returned by the VarType function. + 1 + + + Null reference. This member is equivalent to the Visual Basic constant vbEmpty. + + + Null object. This member is equivalent to the Visual Basic constant vbNull. + + + Short. (-32,768 through 32,767.) + + + Integer. (-2,147,483,648 through 2,147,483,647.) This member is equivalent to the Visual Basic constant vbInteger. + + + Single. (-3.402823E+38 through -1.401298E-45 for negative values; 1.401298E-45 through 3.402823E+38 for positive values.) This member is equivalent to the Visual Basic constant vbSingle. + + + Double. (-1.79769313486231E+308 through -4.94065645841247E-324 for negative values; 4.94065645841247E-324 through 1.79769313486231E+308 for positive values.) This member is equivalent to the Visual Basic constant vbDouble. + + + Currency. This member is equivalent to the Visual Basic constant vbCurrency. + + + Date. (0:00:00 on January 1, 0001 through 11:59:59 PM on December 31, 9999.) This member is equivalent to the Visual Basic constant vbDate. + + + String. (0 to approximately 2 billion Unicode characters.) This member is equivalent to the Visual Basic constant vbString. + + + Any type can be stored in a variable of type Object. This member is equivalent to the Visual Basic constant vbObject. + + + + + + + + Boolean. (True or False.) This member is equivalent to the Visual Basic constant vbBoolean. + + + Variant. This member is equivalent to the Visual Basic constant vbVariant. + + + DataObject. + + + Decimal. (0 through +/-79,228,162,514,264,337,593,543,950,335 with no decimal point; 0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest non-zero number is +/-0.0000000000000000000000000001.) This member is equivalent to the Visual Basic constant vbDecimal. + + + Byte. (0 through 255.) This member is equivalent to the Visual Basic constant vbByte. + + + Char. (0 through 65535.) This member is equivalent to the Visual Basic constant vbChar. + + + Long. (-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807.) This member is equivalent to the Visual Basic constant vbLong. + + + User-defined type. Each member of the structure has a range determined by its data type and independent of the ranges of the other members. This member is equivalent to the Visual Basic constant vbUserDefinedType. + + + Array. This member is equivalent to the Visual Basic constant vbArray. + + + Indicates that an array in a structure or non-local variable should be treated as a fixed-length array. + 1 + + + Initializes the value of the Bounds property. + Initializes the value of upper field, which represents the size of the first dimension of the array. + + + Initializes the value of the Bounds property. + Initializes the value of upper field, which represents the size of the first dimension of the array. + Initializes the value of upper field, which represents the size of the second dimension of the array. + + + Returns the bounds of the array. + Contains an integer array that represents the bounds of the array. + 1 + + + Returns the size of the array. + Contains an integer that represents the number of elements in the array. + 1 + + + Indicates that a string should be treated as if it were fixed length. + 1 + + + Initializes the value of the SizeConst field. + The length of the fixed string. + + + Gets the length of the string. + Returns the length of the string. + 1 + + + The VbMath module contains procedures used to perform mathematical operations. + 1 + + + Initializes the random-number generator. + 1 + + + Initializes the random-number generator. + Optional. An Object or any valid numeric expression. + 1 + + + Returns a random number of type Single. + The next random number in the sequence. + 1 + + + Returns a random number of type Single. + If number is less than zero, Rnd generates the same number every time, using as the seed. If number is greater than zero, Rnd generates the next random number in the sequence. If number is equal to zero, Rnd generates the most recently generated number. If number is not supplied, Rnd generates the next random number in the sequence. + Optional. A Single value or any valid Single expression. + 1 + + + Indicates which type of conversion to perform when calling the StrConv function. + 1 + + + Performs no conversion. + + + Converts the string to uppercase characters. This member is equivalent to the Visual Basic constant vbUpperCase. + + + Converts the string to lowercase characters. This member is equivalent to the Visual Basic constant vbLowerCase. + + + Converts the first letter of every word in the string to uppercase. This member is equivalent to the Visual Basic constant vbProperCase. + + + Converts narrow (single-byte) characters in the string to wide (double-byte) characters. Applies to Asian locales. This member is equivalent to the Visual Basic constant vbWide. + + + Converts wide (double-byte) characters in the string to narrow (single-byte) characters. Applies to Asian locales. This member is equivalent to the Visual Basic constant vbNarrow. + + + Converts Hiragana characters in the string to Katakana characters. Applies to Japanese locale only. This member is equivalent to the Visual Basic constant vbKatakana. + + + Converts Katakana characters in the string to Hiragana characters. Applies to Japanese locale only. This member is equivalent to the Visual Basic constant vbHiragana. + + + Converts the string to Simplified Chinese characters. This member is equivalent to the Visual Basic constant vbSimplifiedChinese. + + + Converts the string to Traditional Chinese characters. This member is equivalent to the Visual Basic constant vbTraditionalChinese. + + + Converts the string from file system rules for casing to linguistic rules. This member is equivalent to the Visual Basic constant vbLinguisticCasing. + + + + + + + + + Provides properties, methods, and events related to the current application. + 1 + + + Initializes a new instance of the class. + + + Changes the culture used by the current thread for string manipulation and for string formatting. + String. Name of the culture as a string. For a list of possible names, see . + + is Nothing. + + is not a valid culture name. + + + Changes the culture that the current thread uses for retrieving culture-specific resources. + String. Name of the culture as a string. For a list of possible names, see . + + is Nothing. + + is not a valid culture name. + + + Gets the culture that the current thread uses for string manipulation and string formatting. + A object that represents the culture the current thread uses for string manipulation and string formatting. + + + Returns the value of the specified environment variable. + A String containing the value of the environment variable with the name . + A String containing the name of the environment variable. + + is Nothing. + The environment variable specified by does not exist. + The calling code does not have with Read access. + 1 + + + + + + Gets an object that provides properties for getting information about the application's assembly, such as the version number, description, and so on. + The object for the current application. + + + Gets an object that provides properties and methods for writing event and exception information to the application's log listeners. + The object for the current application. + 1 + + + + + + + Gets the culture that the current thread uses for retrieving culture-specific resources. + A object that represents the culture that the current thread uses for retrieving culture-specific resources. + + + Provides properties for getting the information about the application, such as the version number, description, loaded assemblies, and so on. + 1 + + + Initializes a new instance of the class with the specified assembly information. + + . The assembly for which to obtain the information. + + + Gets the name, without the extension, of the assembly file for the application. + A String containing the file name. + + + Gets the company name associated with the application. + A String that contains the company name associated with the application. + The assembly does not have an attribute. + 1 + + + Gets the copyright notice associated with the application. + A String containing the copyright notice associated with the application. + The assembly does not have an attribute. + + + Gets the description associated with the application. + A String containing the description associated with the application. + The assembly does not have an attribute. + 1 + + + Gets the directory where the application is stored. + A String that contains the directory where the application is stored. + 1 + + + + + + Gets a collection of all assemblies loaded by the application. + A of containing all the assemblies loaded by the application. + The application domain is not loaded. + + + Gets the product name associated with the application. + A String containing the product name associated with the application. + The assembly does not have an attribute. + 1 + + + Gets the current stack-trace information. + A String containing the current stack-trace information. The return value can be . + The requested stack-trace information is out of range. + + + Gets the title associated with the application. + A String containing the associated with the application. + The assembly does not have an attribute. + 1 + + + Gets the trademark notice associated with the application. + A String containing the trademark notice associated with the application. + The assembly does not have an attribute. + + + Gets the version number of the application. + A object containing the version number of the application. + The application does not have sufficient permissions to access the assembly version. + 1 + + + + + + Gets the amount of physical memory mapped to the process context. + A Long containing the number of bytes of physical memory mapped to the process context. + A situation in which partial trust exists and the user lacks necessary permissions. + + + Indicates how a Visual Basic application authenticates the user for the My.User object. + 2 + + + The constructor initializes the principal for the application's main thread with the current user's Windows user information. + + + The constructor does not initialize the principal for the application's main thread. The application needs to initialize the principal for the application's main thread. + + + Indicates the type of role to check when calling the method. + 1 + + + Account operators manage the user accounts on a computer or domain. + + + Administrators have complete and unrestricted access to the computer or domain. + + + Backup operators can override security restrictions for the sole purpose of backing up or restoring files. + + + Guests are more restricted than users. + + + Power users possess most administrative permissions with some restrictions. Thus, power users can run legacy applications, in addition to certified applications. + + + Print operators can take control of a printer. + + + Replicators support file replication in a domain. + + + System operators manage a particular computer. + + + Users are prevented from making accidental or intentional system-wide changes. Thus, users can run certified applications, but not most legacy applications. + + + Provides a type converter to convert enumeration values to enumeration values. + 2 + + + Initializes a new instance of the class. + + + Gets a value indicating whether this converter can convert an object to the given destination type using the context. + A object that indicates whether this converter can perform the conversion. + An object that provides a format context. + A object that represents the type you wish to convert to. + 1 + + + Converts the given object to another type. + The converted object. + A formatter context. + The culture into which will be converted. + The object to convert. + The type to convert the object to. + + is Nothing. + The conversion cannot be performed. + 1 + + + This exception is thrown when a subsequent instance of a single-instance application is unable to connect to the first application instance. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with serialized data. + The object that holds the serialized object data about the exception being thrown. + The object that contains contextual information about the source or destination. + + + Initializes a new instance of the class with a specified error message. + A message that describes the error. + + + 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. + A object describing the error. + The object that is the cause of the current exception. If the parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a Catch block that handles the inner exception. + + + Provides properties, methods, and events related to the current application. + + + Initializes a new instance of the class. + + + Gets a collection containing the command-line arguments as strings for the current application. + A of String, containing the command-line arguments as strings for the current application. + + + Gets the current application's ClickOnce deployment object, which provides support for updating the current deployment programmatically and support for the on-demand download of files. + Returns the object for the application's ClickOnce deployment. + The application is not deployed as a ClickOnce application. + + + Sets the values to use as the current application's command-line arguments. + A of String, containing the strings to use as the command-line arguments for the current application. + + + Gets a Boolean that represents whether the application was deployed from a network using ClickOnce. + A Boolean that represents whether the application was deployed from a network. The value is True if the current application was deployed from a network; otherwise the value is False. + + + This exception is thrown by the Visual Basic Application Model when the property has not been set. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with serialized data. + The object that holds the serialized object data about the exception being thrown. + The object that contains contextual information about the source or destination. + + + Initializes a new instance of the class with a specified error message. + A message that describes the error. + + + 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. + A object describing the error. + The object that is the cause of the current exception. If the parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. + + + Represents the method that will handle the My.Application.Shutdown event. + The source of the event. + A object that contains the event data. + 2 + + + Indicates which condition should cause a Windows Forms application to shut down. + 2 + + + Shut down when the main form closes. + + + Shut down only after the last form closes. + + + Provides data for the My.Application.Startup event. + 2 + + + Initializes a new instance of the class. + A object that contains the command-line arguments of the application. + + + Gets the command-line arguments of the application. + A object that contains the command-line arguments of the application. + 1 + + + Represents the method that will handle the My.Application.Startup event. + The source of the event. + A object that contains the event data. + 2 + + + Provides data for the My.Application.StartupNextInstance event. + + + Initializes a new instance of the class. + A object that contains the command-line arguments of the subsequent application instance. + A that indicates whether the first application instance should be brought to the foreground upon exiting the exception handler. + + + Indicates whether the first application instance should be brought to the foreground upon exiting the exception handler. + A that indicates whether the first application instance should be brought to the foreground upon exiting the exception handler. + + + Gets the command-line arguments of the subsequent application instance. + A object that contains the command-line arguments of the subsequent application instance. + + + Represents the method that will handle the My.Application.StartupNextInstance event. + The source of the event. + A object that contains the event data. + + + Provides data for the My.Application.UnhandledException event. + 2 + + + Initializes a new instance of the class. + A that indicates whether the application should exit upon exiting the exception handler. + The that occurred. + + + Indicates whether the application should exit upon exiting the exception handler. + A that indicates whether the application should exit upon exiting the exception handler. + 1 + + + Represents the method that will handle the My.Application.UnhandledException event. + The source of the event. + A object that contains the event data. + 2 + + + Provides access to the information about the current user. + 1 + + + Initializes a new instance of the class. + + + Gets or sets the current principal (for role-based security). + A value representing the security context. + The caller does not have the permission required to set the principal. + 1 + + + + + + + Sets the thread's current principal to the Windows user that started the application. + + + Gets or sets the principal object representing the current user. + An object representing the current user. + + + Gets a value that indicates whether the user has been authenticated. + True if the user was authenticated; otherwise, False. + 1 + + + + + + + Determines whether the current user belongs to the specified role. + True if the current user is a member of the specified role; otherwise, False. + The built-in Windows role for which to check membership. + 1 + + + + + + + Determines whether the current user belongs to the specified role. + True if the current user is a member of the specified role; otherwise, False. + The name of the role for which to check membership. + 1 + + + + + + + Gets the name of the current user. + String. The name of the current user. + 1 + + + + + + + Provides access to the information about the current user. + 1 + + + Initializes a new instance of the class. + + + Gets or sets the principal object representing the current user. + An object representing the current user. + + + Provides properties, methods, and events related to the current application. + 1 + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified authentication mode. + + . Specifies the application's authentication mode. + + + Gets the object for the current thread of a Windows Forms application. + This property returns the object for the current thread. That object contains contextual information about the thread. + 1 + + + Processes all Windows messages currently in the message queue. + 2 + + + + + + + + Determines whether this application will use the Windows XP styles for windows, controls, and so on. + A value that indicates whether this application will use the XP Windows styles for windows, controls, and so on. + + + Hides the application's splash screen. + + + Determines whether this application is a single-instance application. + A value that indicates whether this application is a single-instance application. + + + Gets or sets the main form for this application. + Gets or sets the main form for this application. + + + Determines the minimum length of time, in milliseconds, for which the splash screen is displayed. + Integer. The minimum length of time, in milliseconds, for which the splash screen is displayed. + + + Occurs when the network availability changes. + 1 + + + When overridden in a derived class, allows a designer to emit code that configures the splash screen and main form. + + + When overridden in a derived class, allows a designer to emit code that initializes the splash screen. + + + Sets the visual styles, text display styles, and current principal for the main application thread (if the application uses Windows authentication), and initializes the splash screen, if defined. + A indicating if application startup should continue. + A of String, containing the command-line arguments as strings for the current application. + + + Provides the starting point for when the main application is ready to start running, after the initialization is done. + + + When overridden in a derived class, allows for code to run when the application shuts down. + + + When overridden in a derived class, allows for code to run when the application starts. + A that indicates if the application should continue starting up. + + . Contains the command-line arguments of the application and indicates whether the application startup should be canceled. + + + When overridden in a derived class, allows for code to run when a subsequent instance of a single-instance application starts. + + . Contains the command-line arguments of the subsequent application instance and indicates whether the first application instance should be brought to the foreground upon exiting the exception handler. + + + When overridden in a derived class, allows for code to run when an unhandled exception occurs in the application. + A that indicates whether the event was raised. + + . + + + Gets a collection of all the application's open forms. + A object that contains all of the application's open forms. + 1 + + + + + + Sets up and starts the Visual Basic Application model. + Array of type String. The command line from Sub Main. + 2 + + + + + + + + + + + + Determines whether the application saves the user settings on exit. + Boolean. True indicates that the application saves the user settings on exit. Otherwise, the settings are not implicitly saved. + + + Determines if the application has a splash screen defined, and if it does, displays it. + + + Occurs when the application shuts down. + 1 + + + Determines what happens when the application's main form closes. + A enumeration value, indicating what the application should do when the main form closes. + + + Gets or sets the splash screen for this application. + A object that the application uses as the splash screen. + The same value is assigned to this property and the property. + 1 + + + Occurs when the application starts. + 1 + + + Occurs when attempting to start a single-instance application and the application is already active. + 1 + + + Occurs when the application encounters an unhandled exception. + 1 + + + When overridden in a derived class, this property allows a designer to specify the default text rendering engine for the application's forms. + Boolean. A value of False indicates that the application should use the default text rendering engine for Visual Basic 2005. A value of True indicates that the application should use the text rendering engine for Visual Basic .NET 2002 and Visual Basic .NET 2003. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Boolean value that corresponds to the specified object. + The Boolean value that corresponds to . + Required. Object to convert to a Boolean value. + + + + + + Returns a Boolean value that corresponds to the specified string. + The Boolean value that corresponds to . + Required. String to convert to a Boolean value. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Byte value that corresponds to the specified object. + The Byte value that corresponds to . + Required. Object to convert to a Byte value. + + + + + + Returns a Byte value that corresponds to the specified string. + The Byte value that corresponds to . + Required. String to convert to a Byte value. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a CharArray value that corresponds to the specified object. + The CharArray value that corresponds to . + Required. Object to convert to a CharArray value. + + + + + + Returns a CharArray value that corresponds to the specified string. + The CharArray value that corresponds to . + Required. String to convert to a CharArray value. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Char value that corresponds to the specified object. + The Char value that corresponds to . + Required. Object to convert to a Char value. + + + + + + Returns a Char value that corresponds to the specified string. + The Char value that corresponds to . + Required. String to convert to a Char value. + + + Provides methods that perform various type conversions. + 1 + + + Converts an object to the specified type. + An object of the specified target type. + The object to convert. + The type to which to convert the object. + + + Executes a late-bound call to a user-defined conversion expression. This helper method is not meant to be called directly from your code. + The result returned from the user-defined conversion expression. + The user-defined conversion expression. + The type to convert to. + + + Converts a value to a string, given a byte count. + The string representation of the specified value. + The Char value to convert. + The byte count of the Char value. + + + Converts a array to a string. + The string representation of the specified array. + The Char array to convert. + + + Converts a subset of a array to a string. + The string representation of the specified array from the start position to the specified length. + The Char array to convert. + Zero-based index of the start position. + Length of the subset in bytes. + + + Converts an object to a value. + A Boolean value. Returns False if the object is null; otherwise, True. + The object to convert. + + + + + + Converts a string to a value. + A Boolean value. Returns False if the string is null; otherwise, True. + The string to convert. + + + + + + Converts an object to a value. + The Byte value of the object. + The object to convert. + + + + + + Converts a string to a value. + The Byte value of the string. + The string to convert. + + + + + + Converts an object to a value. + The Char value of the object. + The object to convert. + + + + + + Converts a string to a value. + The Char value of the string. + The string to convert. + + + + + + Converts an object to a one-dimensional array. + A one-dimensional Char array. + The object to convert. + + + + + + Converts a string to a one-dimensional array. + A one-dimensional Char array. + The string to convert. + + + + + + Converts an object to a value. + The DateTime value of the object. + The object to convert. + + + + + + Converts a string to a value. + The DateTime value of the string. + The string to convert. + + + + + + Converts a value to a value. + The Decimal value of the Boolean value. + A Boolean value to convert. + + + + + + Converts an object to a value. + The Decimal value of the object. + The object to convert. + + + + + + Converts a string to a value. + The Decimal value of the string. + The string to convert. + + + + + + Converts an object to a value. + The Double value of the object. + The object to convert. + + + + + + Converts a string to a value. + The Double value of the string. + The string to convert. + + + + + + Converts an object to a generic type . + A structure or object of generic type . + The object to convert. + The type to convert to. + + + Converts an object to an integer value. + The int value of the object. + The object to convert. + + + + + + Converts a string to an integer value. + The int value of the string. + The string to convert. + + + + + + Converts an object to a Long value. + The Long value of the object. + The object to convert. + + + + + + Converts a string to a Long value. + The Long value of the string. + The string to convert. + + + + + + Converts an object to an value. + The SByte value of the object. + The object to convert. + + + + + + Converts a string to an value. + The SByte value of the string. + The string to convert. + + + + + + Converts an object to a Short value. + The Short value of the object. + The object to convert. + + + + + + Converts a string to a Short value. + The Short value of the string. + The string to convert. + + + + + + Converts an object to a value. + The Single value of the object. + The object to convert. + + + + + + Converts a to a value. + The Single value of the string. + The string to convert. + + + + + + Converts a value to a . + The String representation of the Boolean value. + The Boolean value to convert. + + + + + + Converts a value to a . + The String representation of the Byte value. + The Byte value to convert. + + + + + + Converts a value to a . + The String representation of the Char value. + The Char value to convert. + + + + + + Converts a value to a value. + The String representation of the DateTime value. + The DateTime value to convert. + + + + + + Converts a value to a value. + The String representation of the Decimal value. + The Decimal value to convert. + + + + + + Converts a value to a value, using the specified number format. + The String representation of the Decimal value. + The decimal value to convert. + The number format to use, according to . + + + + + + Converts a value to a value. + The String representation of the Double value. + The Double value to convert. + + + + + + Converts a value to a value, using the specified number format. + The String representation of the Double value. + The Double value to convert. + The number format to use, according to . + + + + + + Converts a Short value to a value. + The String representation of the Short value. + The Short value to convert. + + + + + + Converts an integer value to a value. + The String representation of the int value. + The int value to convert. + + + + + + Converts a Long value to a value. + The String representation of the Long value. + The Long value to convert. + + + + + + Converts an object to a value. + The String representation of the object. + The object to convert. + + + + + + Converts a value (a single-precision floating point number) to a value. + The String representation of the Single value. + The Single value to convert. + + + + + + Converts a value to a value, using the specified number format. + The String representation of the Single value. + The Single value to convert. + The number format to use, according to . + + + + + + Converts a uint value to a value. + The String representation of the Uint value. + The Uint value to convert. + + + + + + Converts a Ulong value to a value. + The String representation of the Ulong value. + The Ulong value to convert. + + + + + + Converts an object to a Uint value. + The Uint value of the object. + The object to convert. + + + + + + Converts a string to a Uint value. + The Uint value of the string. + The string to convert. + + + + + + Converts an object to a Ulong value. + The Ulong value of the object. + The object to convert. + + + + + + Converts a string to a Ulong value. + The Ulong value of the string. + The string to convert. + + + + + + Converts an object to a Ushort value. + The Ushort value of the object. + The object to convert. + + + + + + Converts a string to a Ushort value. + The Ushort value of the string. + The string to convert. + + + + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Date value that corresponds to the specified object. + The Date value that corresponds to . + Required. Object to convert to a Date value. + + + + + + Returns a Date value that corresponds to the specified string. + The Date value that corresponds to . + Required. String to convert to a Date value. + + + Returns a Date value that corresponds to the specified string and culture information. + The Date value that corresponds to . + Required. String to convert to a Date value. + Required. A object that defines how date values are formatted and displayed, depending on the culture. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Decimal value that corresponds to the specified Boolean value. + The Decimal value that corresponds to . + Required. Boolean value to convert to a Decimal value. + + + Returns a Decimal value that corresponds to the specified object. + The Decimal value that corresponds to . + Required. Object to convert to a Decimal value. + + + + + + Returns a Decimal value that corresponds to the specified object and number format information. + The Decimal value that corresponds to . + Required. Object to convert to a Decimal value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + + + + Returns a Decimal value that corresponds to the specified string. + The Decimal value that corresponds to . + Required. String to convert to a Decimal value. + + + Returns a Decimal value that corresponds to the specified string and number format information. + The Decimal value that corresponds to . + Required. String to convert to a Decimal value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Returns a Decimal value that corresponds to the specified string and number format information. + The Decimal value that corresponds to . + Required. String to convert to a Decimal value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + When applied to a class, the compiler implicitly calls a component-initializing method from the default synthetic constructor. + + + Initializes a new instance of the attribute. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Double value that corresponds to the specified object. + The Double value corresponding to . + Required. Object to convert to a Double value. + + + + + + Returns a Double value that corresponds to the specified object. + The Double value corresponding to . + Required. Object to convert to a Double value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + + + + Returns a Double value that corresponds to the specified string. + The Double value corresponding to . + Required. String to convert to a Double value. + + + Returns a Double value that corresponds to the specified string and number format information. + The Double value corresponding to . + Required. String to convert to a Double value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Returns a Double value that corresponds to the specified string. + The Double value corresponding to . + Required. String to convert to a Double value. + + + Returns a Double value that corresponds to the specified string and number format information. + The Double value corresponding to . + Required. String to convert to a Double value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Provides exception handling support for the Visual Basic runtime. This class is not intended to be used from your code. + 1 + + + Provides services to the Visual Basic compiler for compiling For...Next and For Each loops. + 1 + + + Checks for a synchronization lock on the specified type. + The data type for which to check for synchronization lock. + + + Gets the enumerator for an array being iterated over in a For Each loop. + The enumerator for . + An array being iterated over in a For Each loop. + + + Gets the enumerator for an object being iterated over in a For Each loop. + The enumerator for . + An object being iterated over in a For Each loop. + + + Sets a reference to the next object in a For Each loop. + True if refers to the next object; False if there are no more objects and is Nothing. + The range variable of the For Each loop. + The of the object being iterated over in the For Each loop. + + + Initializes a For...Next loop. + False if the loop has terminated; otherwise, True. + The loop counter variable. + The initial value of the loop counter. + The value of the To option. + The value of the Step option. + An object that contains verified values for loop values. + The counter value for the next loop iteration. + + + + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to , or if is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Decimal value that represents the initial value passed for the loop counter variable. + Required. A Decimal value that represents the value passed by using the To keyword. + Required. A Decimal value that represents the value passed by using the Step keyword. + + + Increments a For...Next loop. + False if the loop has terminated; otherwise, True. + The loop counter variable. + An object that contains verified values for loop values. + The counter value for the next loop iteration. + + + + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to , or if is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Single value that represents the initial value passed for the loop counter variable. + Required. A Single value that represents the value passed by using the To keyword. + Required. A Single value that represents the value passed by using the Step keyword. + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to , or if is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Double value that represents the initial value passed for the loop counter variable. + Required. A Double value that represents the value passed by using the To keyword. + Required. A Double value that represents the value passed by using the Step keyword. + + + Returns a reference to and information about the current Visual Basic host window. + 1 + + + Initializes a new instance of the class. + + + Gets the current Visual Basic host object. + A object that returns a reference to and information about the current Visual Basic host window. + + + The Visual Basic compiler uses this class during static local initialization; it is not meant to be called directly from your code. An exception of this type is thrown if a static local variable fails to initialize. + 1 + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + A string representing the message to be sent. + + + Initializes a new instance of the class. + A string representing the message to be sent. + An object. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns an Integer value that corresponds to the specified object. + The Integer value that corresponds to . + Required. Object to convert to an Integer value. + + + + + + Returns an Integer value that corresponds to the specified string. + The Integer value that corresponds to . + Required. String to convert to an Integer value. + + + The exception thrown for internal Visual Basic compiler errors. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class, specifying an error message. + The message that describes the error. + + + Initializes a new instance of the class, specifying an error message and an inner exception. + The message that describes the error. + The exception that is the cause of the current internal exception. + + + Provides properties and methods that support Visual Basic XML literals. This class is not intended to be used directly from your code. + + + Gets or sets the value of an XML attribute. This property is not intended to be used from your code. + The value of the XML attribute identified by the parameter from the first element in the supplied collection of XML elements. If the collection is empty, returns Nothing. + A collection of XML elements to get an attribute value from or set an attribute value for. + The name of the XML attribute to get a value from or set a value for. + + + Gets or sets the value of an XML attribute. This property is not intended to be used from your code. + The value of the XML attribute identified by the parameter in the supplied XML element. + An XML element to get an attribute value from or set an attribute value for. + The name of the XML attribute to get a value from or set a value for. + + + Creates an XML attribute that has the supplied name and value. This method is not intended to be used from your code. + An object that has the supplied name and value. + The name of the XML attribute to create. + The value to assign to the created XML attribute. If is Nothing, this method returns Nothing. + + + Creates an XML attribute that has the supplied name and namespace value. This method is not intended to be used from your code. + An object that has the supplied name and namespace value. + The name of the XML attribute to create. + The namespace value to assign to the created XML attribute. + + + Removes XML namespace attributes from an XML element. This method is not intended to be used from your code. + The supplied XML element with the specified XML namespace attributes removed. + The list of XML namespace prefixes for XML elements in the current scope. + The list of XML namespaces for XML elements in the current scope. + The list of namespace attributes to remove from the XML element. + The XML element to remove XML namespace attributes from. + + + Removes XML namespace attributes from an XML element. This method is not intended to be used from your code. + The supplied XML element with the specified XML namespace attributes removed. + The list of XML namespace prefixes for XML elements in the current scope. + The list of XML namespaces for XML elements in the current scope. + The list of namespace attributes to remove from the XML element. + The XML element to remove XML namespace attributes from. + + + Removes XML namespace attributes from an XML element. This method is not intended to be used from your code. + The supplied XML element with the specified XML namespace attributes removed. + The list of XML namespace prefixes for XML elements in the current scope. + The list of XML namespaces for XML elements in the current scope. + The list of namespace attributes to remove from the XML element. + The XML element to remove XML namespace attributes from. + + + Gets or sets the value of an XML element. This property is not intended to be used from your code. + The value of the first XML element in the supplied collection. If the collection is empty, returns Nothing. + A collection of XML elements to get a value from or set a value for. + + + Represents a host window for Visual Basic. + 1 + + + Gets the host Window for the current Visual Basic environment. + The host window for the current Visual Basic environment. + + + Gets the title of the host window for the current Visual Basic environment. + The title of the host window for the current Visual Basic environment. + + + This class has been deprecated since Visual Basic 2005. + 1 + + + Performs a late-bound call to an object method. + The object to call a method on. + The type of the object. + The method name of to call. + An array of parameter values to pass to the method. + An array that contains the names of the parameters to which the values in the array are passed. + An array of Boolean values, where True indicates that the associated parameter is passed ByRef. + + + + + + Returns a late-bound value from an object. + If is an array, the value from at the location specified by . If is an object, the return value of invoked by using the named parameters in and their associated values in . + The object to return the value from. + The type of the object. + The member name of to retrieve a value from. + An array of one or more index values that specify the location in if is a one-dimensional or multi-dimensional array, or argument values to pass to the object . + An array that contains the names of the parameters to which the values in the array are passed. + An array of Boolean values, where True indicates that the associated parameter is passed ByRef. + + + + + + Returns a late-bound value from an object, using the specified index or parameters. + If is an array, the value from at the location specified by . If is an object, the return value of invoked by using the named parameters in and their associated values in . + The object to return the value from. + An array of one or more index values that specify the location in if is a one-dimensional or multi-dimensional array, or argument values to pass to the object . + An array that contains the names of the parameters to which the values in the array are passed. + + + + + + Sets a late-bound value of an object, using the specified parameters. + The object to set the value for. + An array of one or more index values that specify the location in if is a one-dimensional or multi-dimensional array, or argument values to pass to the object . + An array that contains the names of the parameters to which the values in the array are passed. + + + + + + Sets a late-bound value of an object, using the specified parameters. + The object to set the value for. + An array of one or more parameter values to pass to the object . + An array that contains the names of the parameters to which the values in the array are passed. + True to suppress the exception thrown when the set member is not found. + True to identify as the result of a late-bound expression. + + + + + + Sets a late-bound value of a member of an object, using the specified parameters. + The object to set the member value for. + The type of the object. + The member name to set. + An array of one or parameter values to pass to the member of . + An array that contains the names of the parameters to which the values in the array are passed. + + + + + + Sets a late-bound value of a member of an object, using the specified parameters. + The object to set the member value for. + The type of the object. + The member name to set. + An array of one or more parameter values to pass to the member of . + An array that contains the names of the parameters to which the values in the array are passed. + True to suppress the exception thrown when the set member is not found. + True to identify as the result of a late-bound expression. + + + + + + This class provides helpers that the Visual Basic compiler uses to do the work for the Like Operator (Visual Basic). It is not meant to be called directly from your code. + + + Performs binary or text string comparison given two objects. This helper method is not meant to be called directly from your code. + A Boolean value indicating whether the strings match. Returns True if the strings match; otherwise False. + The string to compare. + The string against which is being compared. + A enumeration specifying whether or not to use text comparison. If , this method uses text comparison; if , this method uses binary comparison. + + + Performs binary or text string comparison given two strings. This helper method is not meant to be called directly from your code. + A Boolean value indicating whether the strings match. Returns True if the strings match; otherwise False. + The string to compare. + The string against which is being compared. + A enumeration specifying whether or not to use text comparison. If , this method uses text comparison; if , this method uses binary comparison. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Long value that corresponds to the specified object. + The Long value that corresponds to . + Required. Object to convert to a Long value. + + + + + + Returns a Long value that corresponds to the specified string. + The Long value that corresponds to . + Required. String to convert to a Long value. + + + This class provides helpers that the Visual Basic compiler uses for late binding calls; it is not meant to be called directly from your code. + 1 + + + Executes a late-bound method or function call. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value indicating whether or not the return value can be ignored. + + + Executes a late-bound property get or field access call. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to determine whether the set operation will work. Set to True when you believe that an intermediate value has been set in the property or field; otherwise False. + A Boolean value that specifies when the base reference of the late reference is an RValue. Set to True when the base reference of the late reference is an RValue; this allows you to generate a run-time exception for late assignments to fields of RValues of value types. Otherwise, set to False. + + + Executes a late-bound get of the default property or field, or call to the default method or function. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. If is of type , then bind using the Dynamic Language Runtime; otherwise perform standard late-binding. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to specify whether to throw exceptions when an error is encountered. Set to True to throw exceptions. Set to False to return Nothing when an error is encountered. + + + Executes a late-bound get of the default property or field, or call to the default method or function. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to specify whether to throw exceptions when an error is encountered. Set to True to throw exceptions. Set to False to return Nothing when an error is encountered. + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + A Boolean value used to determine whether the set operation will work. Set to True when you believe that an intermediate value has been set in the property or field; otherwise False. + A Boolean value that specifies when the base reference of the late reference is an RValue. Set to True when the base reference of the late reference is an RValue; this allows you to generate a run-time exception for late assignments to fields of RValues of value types. Otherwise, set to False. + + + Executes a late-bound method or function call. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + An array of argument types; used only for generic calls to pass argument types. + An array of Boolean values that the late binder uses to communicate back to the call site which arguments match ByRef parameters. Each True value indicates that the arguments matched and should be copied out after the call to LateCall is complete. + A Boolean value indicating whether or not the return value can be ignored. + + + + + + Executes a late-bound call to the default method or function. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to specify whether to throw exceptions when an error is encountered. Set to True to throw exceptions. Set to False to return Nothing when an error is encountered. + + + Indicates whether a call requires late-bound evaluation. This helper method is not meant to be called directly from your code. + A Boolean value that indicates whether the expression requires late-bound evaluation. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + A Boolean value that specifies whether to allow function evaluation. + A Boolean value that specifies whether to allow property evaluation. + + + Executes a late-bound property get or field access call. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + An array of argument types; used only for generic calls to pass argument types. + An array of Boolean values that the late binder uses to communicate back to the call site which arguments match ByRef parameters. Each True value indicates that the arguments matched and should be copied out after the call to LateCall is complete. + + + + + + Executes a late-bound get of the default property or field. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to specify whether to throw exceptions when an error is encountered. Set to True to throw exceptions. Set to False to return Nothing when an error is encountered. + + + Executes a late-bound property get or field access call. This helper method is not meant to be called directly from your code. + An instance of the call object. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + + + + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + + + + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + A Boolean value used to determine whether the set operation will work. Set to True when you believe that an intermediate value has been set in the property or field; otherwise False. + A Boolean value that specifies when the base reference of the late reference is an RValue. Set to True when the base reference of the late reference is an RValue; this allows you to generate a run-time exception for late assignments to fields of RValues of value types. Otherwise, set to False. + + + + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + An array of argument types; used only for generic calls to pass argument types. + + + + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + An array of argument types; used only for generic calls to pass argument types. + A Boolean value used to determine whether the set operation will work. Set to True when you believe that an intermediate value has been set in the property or field; otherwise False. + A Boolean value that specifies when the base reference of the late reference is an RValue. Set to True when the base reference of the late reference is an RValue; this allows you to generate a run-time exception for late assignments to fields of RValues of value types. Otherwise, set to False. + An enumeration member of type representing the type of procedure being called. The value of CallType can be Method, Get, or Set. Only Set is used. + + + + + + Executes a late-bound property set or field write call. This helper method is not meant to be called directly from your code. + An instance of the call object exposing the property or method. + The type of the call object. + The name of the property or method on the call object. + An array containing the arguments to be passed to the property or method being called. + An array of argument names. + An array of argument types; used only for generic calls to pass argument types. + A Boolean value used to determine whether the set operation will work. Set to True when you believe that an intermediate value has been set in the property or field; otherwise False. + A Boolean value that specifies when the base reference of the late reference is an RValue. Set to True when the base reference of the late reference is an RValue; this allows you to generate a run-time exception for late assignments to fields of RValues of value types. Otherwise, set to False. + + + + + + The Visual Basic compiler uses this class for object flow control; it is not meant to be called directly from your code. + 1 + + + Checks for a synchronization lock on the specified type. + The data type for which to check for synchronization lock. + + + Provides services to the Visual Basic compiler for compiling For...Next loops. + + + Initializes a For...Next loop. + False if the loop has terminated; otherwise, True. + The loop counter variable. + The initial value of the loop counter. + The value of the To option. + The value of the Step option. + An object that contains verified values for loop values. + The counter value for the next loop iteration. + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to or is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Decimal value that represents the initial value passed for the loop counter variable. + Required. A Decimal value that represents the value passed by using the To keyword. + Required. A Decimal value that represents the value passed by using the Step keyword. + + + Increments a For...Next loop. + False if the loop has terminated; otherwise, True. + The loop counter variable. + An object that contains verified values for loop values. + The counter value for the next loop iteration. + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to , or if is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Single value that represents the initial value passed for the loop counter variable. + Required. A Single value that represents the value passed by using the To keyword. + Required. A Single value that represents the value passed by using the Step keyword. + + + Checks for valid values for the loop counter, Step, and To values. + True if is greater than zero and is less than or equal to , or if is less than or equal to zero and is greater than or equal to ; otherwise, False. + Required. A Double value that represents the initial value passed for the loop counter variable. + Required. A Double value that represents the value passed by using the To keyword. + Required. A Double value that represents the value passed by using the Step keyword. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Initializes a new instance of the class. + + + Performs an addition (+) operation. + The sum of and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs a bitwise And operation. + 1 if both and evaluate to 1; otherwise, 0. + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Performs a bitwise Or operation. + 0 if both and evaluate to 0; otherwise, 1. + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Performs an Xor operation. + A numeric value that represents the bitwise exclusion (exclusive bitwise disjunction) of two numeric bit patterns. For more information, see Xor Operator (Visual Basic). + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Performs a division (/) operation. + The full quotient of divided by , including any remainder. + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Returns a boxed primitive value. This method is used to prevent copying structures multiple times. + The primitive value of typed as object. + Required. Any expression. + + + Performs an integer division (\) operation. + The integer quotient of divided by , which discards any remainder and retains only the integer portion. + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs a Like comparison. + True if the string representation of the value in satisfies the pattern that is contained in ; otherwise, False. True if both and are Nothing. + Required. Any expression. + Required. Any string expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + Required. A value that specifies that the operation use either text or binary comparison. + + + + + + Performs a modulus (Mod) operation. + The remainder after is divided by . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs a multiplication (*) operation. + The product of and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs a unary minus (–) operation. + The negative value of . + Required. Any numeric expression. + + + + + + Performs a Not operation. + For Boolean operations, False if is True; otherwise, True. For bitwise operations, 1 if is 0; otherwise, 0. + Required. Any Boolean or numeric expression. + + + + + + Performs binary or text string comparison when given two objects. + Value Condition -1 is less than . 0 is equal to . 1 is greater than . + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Performs a unary plus (+) operation. + The value of . (The sign of the is unchanged.) + Required. Any numeric expression. + + + + + + Performs an exponent (^) operation. + The result of raised to the power of . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs an arithmetic left shift (<<) operation. + An integral numeric value. The result of shifting the bit pattern. The data type is the same as that of . + Required. Integral numeric expression. The bit pattern to be shifted. The data type must be an integral type (SByte, Byte, Short, UShort, Integer, UInteger, Long, or ULong). + Required. Numeric expression. The number of bits to shift the bit pattern. The data type must be Integer or widen to Integer. + + + + + + Performs an arithmetic right shift (>>) operation. + An integral numeric value. The result of shifting the bit pattern. The data type is the same as that of . + Required. Integral numeric expression. The bit pattern to be shifted. The data type must be an integral type (SByte, Byte, Short, UShort, Integer, UInteger, Long, or ULong). + Required. Numeric expression. The number of bits to shift the bit pattern. The data type must be Integer or widen to Integer. + + + + + + Performs a string concatenation (&) operation. + A string representing the concatenation of and . + Required. Any expression. + Required. Any expression. + + + + + + Performs a subtraction (–) operation. + The difference between and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Performs an Xor comparison. + A Boolean or numeric value. For a Boolean comparison, the return value is the logical exclusion (exclusive logical disjunction) of two Boolean values. For bitwise (numeric) operations, the return value is a numeric value that represents the bitwise exclusion (exclusive bitwise disjunction) of two numeric bit patterns. For more information, see Xor Operator (Visual Basic). + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Provides late-bound math operators, such as and , which the Visual Basic compiler uses internally. + 1 + + + Represents the Visual Basic addition (+) operator. + The sum of and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic And operator. + For Boolean operations, True if both and evaluate to True; otherwise, False. For bitwise operations, 1 if both and evaluate to 1; otherwise, 0. + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Represents Visual Basic comparison operators. + Value Condition -1 is less than .0 and are equal.1 is greater than . + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic equal (=) operator. + True if and are equal; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic greater-than (>) operator. + True if is greater than ; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic greater-than or equal-to (>=) operator. + True if is greater than or equal to ; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic less-than (<) operator. + True if is less than ; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic less-than or equal-to (<=) operator. + True if is less than or equal to ; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic not-equal (<>) operator. + True if is not equal to ; otherwise, False. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Performs binary or text string comparison when given two strings. + Value Condition -1 is less than . 0 is equal to . 1 is greater than . + Required. Any String expression. + Required. Any String expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + Represents the Visual Basic concatenation (&) operator. + A string representing the concatenation of and . + Required. Any expression. + Required. Any expression. + + + + + + Represents the overloaded Visual Basic equals (=) operator. + The result of the overloaded equals operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the overloaded Visual Basic greater-than (>) operator. + The result of the overloaded greater-than operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the overloaded Visual Basic greater-than or equal-to (>=) operator. + The result of the overloaded greater-than or equal-to operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the overloaded Visual Basic less-than (<) operator. + The result of the overloaded less-than operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the overloaded Visual Basic less-than or equal-to (<=) operator. + The result of the overloaded less-than or equal-to operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the overloaded Visual Basic not-equal (<>) operator. + The result of the overloaded not-equal operator. False if operator overloading is not supported. + Required. Any expression. + Required. Any expression. + Required. True to perform a case-insensitive string comparison; otherwise, False. + + + + + + Represents the Visual Basic division (/) operator. + The full quotient of divided by , including any remainder. + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic exponent (^) operator. + The result of raised to the power of . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Executes a late-bound evaluation of a user-defined operator. This helper method is not meant to be called directly from your code. + The result returned from the user-defined operator. + The user-defined operator. + Argument values to pass to the user-defined operator. + + + Represents the Visual Basic integer division (\) operator. + The integer quotient of divided by , which discards any remainder and retains only the integer portion. + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic arithmetic left shift (<<) operator. + An integral numeric value. The result of shifting the bit pattern. The data type is the same as that of . + Required. Integral numeric expression. The bit pattern to be shifted. The data type must be an integral type (SByte, Byte, Short, UShort, Integer, UInteger, Long, or ULong). + Required. Numeric expression. The number of bits to shift the bit pattern. The data type must be Integer or widen to Integer. + + + + + + Represents the Visual Basic Like operator. + True if the string representation of the value in satisfies the pattern that is contained in ; otherwise, False. True if both and are Nothing. + Required. Any expression. + Required. Any string expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + Required. A value that specifies that the operation use either text or binary comparison. + + + + + + Represents the Visual Basic Like operator. + True if the value in satisfies the pattern that is contained in ; otherwise, False. True if both and are empty. + Required. Any String expression. + Required. Any String expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + Required. A value that specifies that the operation use either text or binary comparison. + + + Represents the Visual Basic Mod operator. + The remainder after is divided by . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic multiply (*) operator. + The product of and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic unary minus (–) operator. + The negative value of . + Required. Any numeric expression. + + + + + + Represents the Visual Basic Not operator. + For Boolean operations, False if is True; otherwise, True. For bitwise operations, 1 if is 0; otherwise, 0. + Required. Any Boolean or numeric expression. + + + + + + Represents the Visual Basic Or operator. + For Boolean operations, False if both and evaluate to False; otherwise, True. For bitwise operations, 0 if both and evaluate to 0; otherwise, 1. + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Represents the Visual Basic unary plus (+) operator. + The value of . (The sign of the is unchanged.) + Required. Any numeric expression. + + + + + + Represents the Visual Basic arithmetic right shift (>>) operator. + An integral numeric value. The result of shifting the bit pattern. The data type is the same as that of . + Required. Integral numeric expression. The bit pattern to be shifted. The data type must be an integral type (SByte, Byte, Short, UShort, Integer, UInteger, Long, or ULong). + Required. Numeric expression. The number of bits to shift the bit pattern. The data type must be Integer or widen to Integer. + + + + + + Represents the Visual Basic subtraction (–) operator. + The difference between and . + Required. Any numeric expression. + Required. Any numeric expression. + + + + + + Represents the Visual Basic Xor operator. + A Boolean or numeric value. For a Boolean comparison, the return value is the logical exclusion (exclusive logical disjunction) of two Boolean values. For bitwise (numeric) operations, the return value is a numeric value that represents the bitwise exclusion (exclusive bitwise disjunction) of two numeric bit patterns. For more information, see Xor Operator (Visual Basic). + Required. Any Boolean or numeric expression. + Required. Any Boolean or numeric expression. + + + + + + Specifies that the current Option Compare setting should be passed as the default value for an argument. + 1 + + + Initializes a new instance of the class. + + + The Visual Basic compiler emits this helper class to indicate (for Visual Basic debugging) which comparison option, binary or text, is being used + 1 + + + Initializes a new instance of the class. This is a helper method. + + + Provides helpers for the Visual Basic Err object. + 1 + + + Performs the work for the Clear method of the Err object. A helper method. + + + Performs the work for the Raise method of the Err object. A helper method. + An object. + An integer value that identifies the nature of the error. Visual Basic errors are in the range 0–65535; the range 0–512 is reserved for system errors; the range 513–65535 is available for user-defined errors. + + + Closes all files for the calling assembly and stops the process. + + + + + + + The Visual Basic compiler uses this helper method to capture exceptions in the Err object. + The object to be caught. + + + The Visual Basic compiler uses this helper method to capture exceptions in the Err object. + The object to be caught. + The line number of the exception. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Short value that corresponds to the specified object. + The Short value that corresponds to . + Required. Object to convert to a Short value. + + + + + + Returns a Short value that corresponds to the specified string. + The Short value that corresponds to . + Required. String to convert to a Short value. + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a Single value that corresponds to the specified object. + The Single value corresponding to . + Required. Object to convert to a Single value. + + + + + + Returns a Single value that corresponds to the specified object. + The Single value corresponding to . + Required. Object to convert to a Single value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + + + + Returns a Single value that corresponds to the specified string. + The Single value that corresponds to . + Required. String to convert to a Single value. + + + Returns a Single value that corresponds to the specified string and number format information. + The Single value corresponding to . + Required. String to convert to a Single value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + This class provides attributes that are applied to the standard module construct when it is emitted to Intermediate Language (IL). It is not intended to be called directly from your code. + 1 + + + Initializes a new instance of the class. + + + The Visual Basic compiler uses this class internally when initializing static local members; it is not meant to be called directly from your code. + 1 + + + Initializes a new instance of the class. + + + Returns the state of the static local member's initialization flag (initialized or not). + + + This class has been deprecated as of Visual Basic 2005. + 1 + + + Returns a String value that corresponds to the specified Boolean. + The String value corresponding to . + Required. Boolean to convert to a String value. + + + Returns a String value that corresponds to the specified Byte. + The String value corresponding to . + Required. Byte to convert to a String value. + + + Returns a String value that corresponds to the specified Char. + The String value corresponding to . + Required. Char to convert to a String value. + + + Returns a String value that corresponds to the specified date. + The String value corresponding to . + Required. Date to convert to a String value. + + + Returns a String value that corresponds to the specified Decimal. + The String value corresponding to . + Required. Decimal to convert to a String value. + + + Returns a String value that corresponds to a specified Decimal and number format information. + The String value corresponding to . + Required. Decimal to convert to a String value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Returns a String value that corresponds to a specified Double. + The String value corresponding to . + Required. Double to convert to a String value. + + + Returns a String value that corresponds to a specified Double and number format information. + The String value corresponding to . + Required. Double to convert to a String value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Returns a String value that corresponds to a specified Integer. + The String value corresponding to . + Required. Integer to convert to a String value. + + + Returns a String value that corresponds to a specified Int64 (64-bit integer). + The String value corresponding to . + Required. Int64 to convert to a String value. + + + Returns a String value that corresponds to the specified object. + The String value corresponding to . + Required. Object to convert to a String value. + + + + + + Returns a String value that corresponds to a specified Int16 (16-bit integer). + The String value corresponding to . + Required. Int616 to convert to a String value. + + + Returns a String value that corresponds to a specified Single. + The String value corresponding to . + Required. Single to convert to a String value. + + + Returns a String value that corresponds to a specified Single and number format information. + The String value corresponding to . + Required. Sinble to convert to a String value. + A object that defines how numeric values are formatted and displayed, depending on the culture. + + + Overwrites the parameter with the contents of the parameter. + Required. String variable to modify. + Required. Location in the parameter to begin overwriting from. The index is 1-based. + Required. Maximum number of characters from the parameter to use, starting from the first character. + Required. String value to overwrite the parameter with. + + + Compares two strings. + Value Condition zero The two strings are equal. less than zero is less than . greater than zero is greater than . + Required. String to compare with . + Required. String to compare with . + Required. True to perform a case-insensitive comparison; otherwise False. + + + Compares the parameters and and returns the same results as the Like operator. + A Boolean value indicating whether or not the string satisfies the pattern. If the value in string satisfies the pattern contained in pattern, result is True. If the string does not satisfy the pattern, result is False. If both string and pattern are empty strings, the result is True. + Required. Any String expression. + Any String expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + Specifies how to compare strings to patterns, according to the . Can be vbBinaryCompare for binary comparison or vbTextCompare for comparison based on a case-insensitive text sort order determined by your system's LocaleID value. + + + Compares the parameters and and returns the same results as the Like operator, using binary comparison. + A Boolean value indicating whether or not the string satisfies the pattern. If the value in string satisfies the pattern contained in pattern, result is True. If the string does not satisfy the pattern, result is False. If both string and pattern are empty strings, the result is True. + Required. Any String expression. + Required. Any String expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + + + Compares the parameters and and returns the same results as the Like operator, using text comparison. + A Boolean value indicating whether or not the string satisfies the pattern. If the value in string satisfies the pattern contained in pattern, result is True. If the string does not satisfy the pattern, result is False. If both string and pattern are empty strings, the result is True. + Required. Any String expression. + Required. Any String expression conforming to the pattern-matching conventions described in Like Operator (Visual Basic). + + + Contains utilities that the Visual Basic compiler uses. + 1 + + + Used by the Visual Basic compiler as a helper for Redim. + The copied array. + The array to be copied. + The destination array. + + + Retrieves and formats a localized resource string or error message. + A formatted resource string or error message. + The identifier of the string or error message to retrieve. + An array of parameters to replace placeholders in the string or error message. + + + Returns a Visual Basic method signature. + The Visual Basic method signature for the supplied object. + A object to return a Visual Basic method signature for. + + + Sets the culture of the current thread. + The previous value of the property for the current thread. + A object to set as the culture of the current thread. + + + + + + Throws a localized Visual Basic exception. + The Visual Basic error identifier. + + + The module contains procedures used to interact with objects, applications, and systems. + 1 + + + Executes a method on an object, or sets or returns a property on an object. + Executes a method on an object, or sets or returns a property on an object. + Required. Object. A pointer to the object exposing the property or method. + Required. String. A string expression containing the name of the property or method on the object. + Required. An enumeration member of type representing the type of procedure being called. The value of CallType can be Method, Get, or Set. + Optional. ParamArray. A parameter array containing the arguments to be passed to the property or method being called. + + + + + + Returns a Boolean value indicating whether an expression can be evaluated as a number. + Returns a Boolean value indicating whether an expression can be evaluated as a number. + Required. Object expression. + + + Returns a string value containing the system data type name of a variable. + Returns a string value containing the system data type name of a variable. + Required. A string variable containing a Visual Basic type name. + + + Returns a string value containing data type information about a variable. + Returns a string value containing data type information about a variable. + Required. Object variable. If Option Strict is Off, you can pass a variable of any data type except a structure. + + + + + + Returns a string value containing the Visual Basic data type name of a variable. + Returns a string value containing the Visual Basic data type name of a variable. + Required. String variable containing a type name used by the common language runtime. + + + Provides methods for playing sounds. + 1 + + + Initializes a new instance of the class. + + + Plays a .wav sound file. + Byte array that represents the sound file. + + mode for playing the sound. By default, AudioPlayMode.Background. + + is Nothing. + + is not one of the enumeration values. + A partial-trust situation exists in which the user lacks necessary permissions. + 1 + + + + + + + + + Plays a .wav sound file. + + that represents the sound file. + + mode for playing the sound. By default, AudioPlayMode.Background. + + is Nothing. + + is not one of the enumeration values. + A partial-trust situation exists in which the user lacks necessary permissions. + 1 + + + + + + + + + Plays a .wav sound file. + A String containing the name of the sound file + + is an empty string. + The user does not have sufficient permissions to access the file named by . + The file path is malformed in . + The path name in is too long. + A partial-trust situation exists in which the user lacks necessary permissions. + 1 + + + + + + + + + Plays a .wav sound file. + A String containing the name of the sound file + + mode for playing the sound. By default, AudioPlayMode.Background. + + is an empty string. + The user does not have sufficient permissions to access the file named by . + The file path is malformed in . + The path name in is too long. + + is not one of the enumeration values. + A partial-trust situation exists in which the user lacks necessary permissions. + 1 + + + + + + + + + Plays a system sound. + + object representing the system sound to play. + + is Nothing. + + + Stops a sound playing in the background. + 1 + + + Provides properties for accessing the current local time and Universal Coordinated Time (equivalent to Greenwich Mean Time) from the system clock. + 1 + + + Initializes a new instance of the class. + + + Gets a Date object that contains the current local date and time on the computer, expressed as a UTC (GMT) time. + A Date object that contains the current date and time expressed as UTC (GMT) time. + 1 + + + Gets a Date object that contains the current local date and time on this computer. + A Date object that contains the current local date and time. + 1 + + + Gets the millisecond count from the computer's system timer. + An Integer containing the millisecond count from the computer's system timer. + 1 + + + Provides properties for manipulating computer components such as audio, the clock, the keyboard, the file system, and so on. + 1 + + + Initializes a new instance of the class. + + + Gets an object that provides properties for methods for playing sounds. + The My.Computer.Audio object for the computer. + 1 + + + Gets an object that provides methods for manipulating the Clipboard. + The My.Computer.Clipboard object for the computer. + 1 + + + Gets an object that provides properties for accessing the current state of the keyboard, such as what keys are currently pressed, and provides a method to send keystrokes to the active window. + The My.Computer.Keyboard object for the computer. + 1 + + + Gets an object that provides properties for getting information about the format and configuration of the mouse installed on the local computer. + The My.Computer.Mouse object for the computer. + 1 + + + Gets an object that provides a property and a method for accessing the computer's serial ports. + The My.Computer.Ports object. + 1 + + + Gets the object that represents the computer's primary display screen. + A object that represents the computer's primary screen. + 1 + + + Provides properties for getting information about the computer's memory, loaded assemblies, name, and operating system. + 1 + + + Initializes a new instance of the class. + + + Gets the total amount of free physical memory for the computer. + A ULong containing the number of bytes of free physical memory for the computer. + The application cannot obtain the memory status. + 1 + + + + + + Gets the total amount of the computer's free virtual address space. + A ULong containing the number of bytes of the computer's free virtual address space. + The application cannot obtain the memory status. + 1 + + + + + + Gets the current UI culture installed with the operating system. + A object represents the UI culture installed on the computer. + 1 + + + Gets the full operating system name. + A String containing the operating-system name. + The calling code does not have full trust. + 1 + + + + + + + + Gets the platform identifier for the operating system of the computer. + A String containing the platform identifier for the operating system of the computer, chosen from the member names of the enumeration. + The application cannot obtain the operating-system platform information. + 1 + + + Gets the version of the computer's operating system. + A String containing the current version number of the operating system. + The application cannot obtain the operating-system version information. + 1 + + + Gets the total amount of physical memory for the computer. + A ULong containing the number of bytes of physical memory for the computer. + The application cannot obtain the memory status. + 1 + + + + + + Gets the total amount of virtual address space available for the computer. + A ULong containing the number of bytes of virtual address space available for the computer. + The application cannot obtain the memory status. + 1 + + + + + + Provides properties for accessing the current state of the keyboard, such as what keys are currently pressed, and provides a method to send keystrokes to the active window. + 1 + + + Initializes a new instance of the class. + + + Gets a Boolean indicating if the ALT key is down. + A Boolean value: True if the ALT key is down; otherwise False. + 1 + + + Gets a Boolean indicating if CAPS LOCK is turned on. + A Boolean value: True if CAPS LOCK is turned on; otherwise False. + 1 + + + Gets a Boolean indicating if a CTRL key is down. + A Boolean value. True if a CTRL key is down; otherwise False. + 1 + + + Gets a Boolean indicating if the NUM LOCK key is on. + A Boolean value. True if NUM LOCK is on; otherwise False. + 1 + + + Gets a Boolean indicating whether the SCROLL LOCK key is on. + A Boolean value. True if SCROLL LOCK is on; otherwise False. + 1 + + + Sends one or more keystrokes to the active window, as if typed on the keyboard. + A String that defines the keys to send. + A partial-trust situation exists in which the user lacks necessary permissions. + + + Sends one or more keystrokes to the active window, as if typed on the keyboard. + A String that defines the keys to send. + Optional. A Boolean that specifies whether or not to wait for keystrokes to get processed before the application continues. True by default. + A partial-trust situation exists in which the user lacks necessary permissions. + 1 + + + + + + + + Gets a Boolean indicating if a SHIFT key is down. + A Boolean value. True if a SHIFT key is down; otherwise False. + 1 + + + Provides properties for getting information about the format and configuration of the mouse installed on the local computer. + 1 + + + Initializes a new instance of the class. + + + Gets a Boolean that indicates if the functionality of the left and right mouse buttons has been swapped. + A Boolean with a value True if the functionality of the left and right mouse buttons has been swapped; otherwise, False. + The computer has no mouse installed. + 1 + + + Gets a Boolean that indicates if the mouse has a scroll wheel. + A Boolean with value True if the mouse has a scroll wheel; otherwise False. + The computer has no mouse installed. + 1 + + + Gets a number that indicates how much to scroll when the mouse wheel is rotated one notch. + An Integer that indicates how much to scroll when the mouse wheel is rotated one notch. A positive value indicates scrolling by that number of lines, while a negative value indicates scrolling by one screen at a time. + The computer has no mouse installed. + The mouse has no scroll wheel. + 1 + + + Provides a property, event, and methods for interacting with the network to which the computer is connected. + 1 + + + Initializes a new instance of the class. + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + The drive name is not valid + + ends with a trailing slash. + The server does not respond within the default timeout (100 seconds). + The target web site requires user credentials. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + The drive name is not valid + + ends with a trailing slash. + The server does not respond within the default timeout (100 seconds). + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + True to display the progress of the operation; otherwise False. Default is False. + + . Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + True to display the progress of the operation; otherwise False. Default is False. + Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + Specifies behavior when the user clicks Cancel or No on the dialog box shown as a result of set to True. Default is . + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + The drive name is not valid + + ends with a trailing slash. + The server does not respond within the default timeout (100 seconds). + The target web site requires user credentials. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + String or . Path of the file to download, including file name and host address. + String. File name and path of the downloaded file. + + . Credentials to be supplied. + True to display the progress of the operation; otherwise False. Default is False. + Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + Credentials to be supplied. + True to display the progress of the operation; otherwise False. Default is False. + Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + Specifies behavior when the user clicks Cancel or No on the dialog box shown as a result of set to True. Default is . + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + The drive name is not valid + + ends with a trailing slash. + The server does not respond within the default timeout (100 seconds). + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + True to display the progress of the operation; otherwise False. Default is False. + Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Downloads the specified remote file and saves it in the specified location. + Path of the file to download, including file name and host address. + File name and path of the downloaded file. + User name to authenticate. Default is an empty string, "". + Password to authenticate. Default is an empty string, "". + True to display the progress of the operation; otherwise False. Default is False. + Timeout interval, in milliseconds. Default is 100 seconds. + True to overwrite existing files; otherwise False. Default is False. + Specifies behavior when the user clicks Cancel or No on the dialog box shown as a result of set to True. Default is . + The drive name is not valid + + ends with a trailing slash. + + is set to False and the destination file already exists. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Indicates whether a computer is connected to a network. + True if the computer is connected to a network; otherwise False. + 1 + + + + + + + + + + Occurs when the network availability changes. + 1 + + + Pings the specified server. + True if the operation was successful; otherwise False. + The URL, computer name, or IP number of the server to ping. + No network connection is available. + URL was not valid. + 1 + + + + + + + + + + + + Pings the specified server. + True if the operation was successful; otherwise False. + The URL, computer name, or IP number of the server to ping. + Time threshold in milliseconds for contacting the destination. Default is 500. + No network connection is available. + URL was not valid. + 1 + + + + + + + + + + + + Pings the specified server. + True if the operation was successful; otherwise False. + The URI of the server to ping. + No network connection is available. + URL was not valid. + 1 + + + + + + + + + + + + Pings the specified server. + True if the operation was successful; otherwise False. + The URI of the server to ping. + Time threshold in milliseconds for contacting the destination. Default is 500. + No network connection is available. + URL was not valid. + 1 + + + + + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + The source file path is not valid. + + does not include a file name. + The target server requires user credentials. + The server does not respond within the default timeout (100 seconds). + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the default timeout (100 seconds). + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + True to display progress of the operation; otherwise False. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + Whether to display progress of the operation. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + Action to be taken when the user clicks Cancel. Default is . + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + The source file path is not valid. + + does not include a file name. + The target server requires user credentials. + The server does not respond within the default timeout (100 seconds). + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + Credentials for authentication. + True to display progress of the operation; otherwise False. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + Credentials for authentication. + True to display progress of the operation; otherwise False. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + Action to be taken when the user clicks Cancel. Default is . + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the default timeout (100 seconds). + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + True to display progress of the operation; otherwise False. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Sends the specified file to the specified host address. + Path and name of file to upload. + URL, IP address, or URI of destination server. + User name to authenticate. Default is an empty string: "". + Password to authenticate. Default is an empty string: "". + Whether to display progress of the operation. Default is False. + Timeout interval in milliseconds. Default is 100 seconds. + Action to be taken when the user clicks Cancel. Default is . + The source file path is not valid. + + is less than or equal to zero. + + does not include a file name. + Authentication failed. + The server does not respond within the specified . + The user authentication fails. + User lacks necessary permissions to perform a network operation. + The request is denied by the target web server. + 1 + + + + + + + + Provides data for the My.Application.NetworkAvailabilityChanged and My.Computer.Network.NetworkAvailabilityChanged events. + 1 + + + Initializes a new instance of the class. + A that indicates whether a network is available to the application. + + + Gets a value indicating whether a network is available to the application. + A that indicates whether a network is available to the application. + 1 + + + Represents the method that will handle the My.Application.NetworkAvailabilityChanged or My.Computer.Network.NetworkAvailabilityChanged event. + The source of the event. + A object that contains the event data. + 1 + + + Provides a property and a method for accessing the computer's serial ports. + 1 + + + Initializes a new instance of the class. + + + Creates and opens a object. + An open object, configured with the supplied arguments. + String. Required. Name of the port to open. + + is Nothing or an empty string. + 1 + + + + + + Creates and opens a object. + An open object, configured with the supplied arguments. + String. Required. Name of the port to open. + Integer. Baud rate of the port. + + is Nothing or an empty string. + + is less than or equal to zero. + 1 + + + + + + Creates and opens a object. + An open object, configured with the supplied arguments. + String. Required. Name of the port to open. + Integer. Baud rate of the port. + + . Parity of the port. + + is Nothing or an empty string. + + is less than or equal to zero. + + is not one of the enumeration values. + 1 + + + + + + Creates and opens a object. + An open object, configured with the supplied arguments. + String. Required. Name of the port to open. + Integer. Baud rate of the port. + + . Parity of the port. + Integer. Data-bit setting of the port. + + is Nothing or an empty string. + + is less than or equal to zero. + + is less than or equal to zero. + + is not one of the enumeration values. + 1 + + + + + + Creates and opens a object. + An open object, configured with the supplied arguments. + String. Required. Name of the port to open. + Integer. Baud rate of the port. + + . Parity of the port. + Integer. Data-bit setting of the port. + + . Stop-bit setting of the port. + + is Nothing or an empty string. + + is less than or equal to zero. + + is less than or equal to zero. + + is not one of the enumeration values. + + is not one of the enumeration values. + 1 + + + + + + Gets a collection of the names of the serial ports on the computer. + A collection of the names of the serial ports on the computer. + 1 + + + Provides properties for manipulating computer components such as audio, the clock, the keyboard, the file system, and so on. + 1 + + + Initializes a new instance of the class. + + + Gets an object that provides properties for accessing the current local time and Universal Coordinated Time (the equivalent to Greenwich Mean Time) from the system clock. + The My.Computer.Clock object for the computer. + 1 + + + Gets an object that provides properties and methods for working with drives, files, and directories. + The My.Computer.FileSystem object for the computer. + 1 + + + Gets an object that provides properties for getting information about the computer's memory, loaded assemblies, name, and operating system. + The My.Computer.Info object for the computer. + 1 + + + Gets the computer name. + A String containing the name of the computer. + 1 + + + + + + + Gets an object that provides a property and methods for interacting with the network to which the computer is connected. + The My.Computer.Network object for the computer. + 1 + + + + + + + + + + Gets an object that provides properties and methods for manipulating the registry. + The My.Computer.Registry object for the computer. + 1 + + + Specifies what should be done when a directory that is to be deleted contains files or directories. + + + Throw an if the directory is not empty. The Data property of the exception lists the file(s) that could not be deleted. + + + Delete the contents of the directory along with the directory. Default. + + + Indicates whether text fields are delimited or fixed width. + 1 + + + Indicates that the fields are delimited. + + + Indicates that the fields are fixed width. + + + Provides properties and methods for working with drives, files, and directories. + 1 + + + Initializes a new instance of the class. + + + Combines two paths and returns a properly formatted path. + The combination of the specified paths. + String. First path to be combined. + String. Second path to be combined. + + or are malformed paths. + 1 + + + + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + 1 + + + + + + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + + is set to UIOption.AllDialogs and the user cancels the operation, or one or more files in the directory cannot be copied. + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies what should be done if the user clicks Cancel during the operation. Default is . + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + + is set to UIOption.AllDialogs and the user cancels the operation, or one or more files in the directory cannot be copied. + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + True to overwrite existing files; otherwise False. Default is False. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + 1 + + + + + + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies what should be done if the user clicks Cancel during the operation. Default is . + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + + is set to ThrowException, and the user has canceled the operation or an unspecified I/O error occurs. + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + True if existing files should be overwritten; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Creates a directory. + Name and location of the directory. + The directory name is malformed. For example, it contains illegal characters or is only white space. + + is Nothing or an empty string. + The directory name is too long. + The directory name is only a colon (:). + The parent directory of the directory to be created is read-only + The user does not have permission to create the directory. + 1 + + + + + + Gets or sets the current directory. + The current directory for file I/O operations. + The path is not valid. + The user lacks necessary permissions. + 1 + + + + + + + Deletes a directory. + Directory to be deleted. + Specifies what should be done when a directory that is to be deleted contains files or directories. Default is DeleteDirectoryOption.DeleteAllContents. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + + + Deletes a directory. + Directory to be deleted. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + + + Deletes a directory. + Directory to be deleted. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + Specifies whether to throw an exception if the user clicks Cancel. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + + + Deletes a file. + Name and path of the file to be deleted. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + 1 + + + + + + + + Deletes a file. + Name and path of the file to be deleted. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + + + Deletes a file. + Name and path of the file to be deleted. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + The user cancelled the operation and is set to . + + + Returns True if the specified directory exists. + True if the directory exists; otherwise False. + Path of the directory. + 1 + + + + + + Returns a read-only collection of all available drive names. + A read-only collection of all available drives as objects. + 1 + + + + + + + + + Returns True if the specified file exists. + Returns True if the file exists; otherwise this method returns False. + Name and path of the file. + The name of the file ends with a backslash (\). + 1 + + + + + + Returns a read-only collection of strings representing the names of files containing the specified text. + Read-only collection of the names of files containing the specified text.. + The directory to be searched. + The search text. + True if the search should be case-sensitive; otherwise False. Default is True. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + The specified directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + Returns a read-only collection of strings representing the names of files containing the specified text. + Read-only collection of the names of files containing the specified text.. + The directory to be searched. + The search text. + True if the search should be case-sensitive; otherwise False. Default is True. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to be matched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + The specified directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + Returns a collection of strings representing the path names of subdirectories within a directory. + Read-only collection of the path names of subdirectories within the specified directory.. + Name and path of directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + + + + Returns a collection of strings representing the path names of subdirectories within a directory. + Read-only collection of the path names of subdirectories within the specified directory. + Name and path of directory. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to match names. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + One or more of the specified wildcard characters is Nothing, an empty string, or contains only spaces. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + Returns a object for the specified path. + + object for the specified path. + String. Path of directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + The directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path + 1 + + + + + + Returns a object for the specified drive. + + object for the specified drive. + Drive to be examined. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + The user lacks necessary permissions to view the path + 1 + + + + + + Returns a object for the specified file. + + object for the specified file + Name and path of the file. + The path name is malformed. For example, it contains invalid characters or is only white space. The file name has a trailing slash mark. + + is Nothing or an empty string. + The path contains a colon in the middle of the string. + The path is too long. + The user lacks necessary permissions. + The user lacks ACL (access control list) access to the file. + 1 + + + + + + Returns a read-only collection of strings representing the names of files within a directory. + Read-only collection of file names from the specified directory. + Directory to be searched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing. + The directory to search does not exist. + + points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + + + + Returns a read-only collection of strings representing the names of files within a directory. + Read-only collection of file names from the specified directory. + Directory to be searched. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to be matched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing. + The directory to search does not exist. + + points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + Parses the file name out of the path provided. + The file name from the specified path. + Required. Path to be parsed. String. + + + Returns the parent path of the provided path. + The parent path of the provided path. + Path to be examined. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + Path does not have a parent path because it is a root path. + + is Nothing. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + 1 + + + + + + Creates a uniquely named zero-byte temporary file on disk and returns the full path of that file. + String containing the full path of the temporary file. + 1 + + + + + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + + is set to ThrowException and a subdirectory of the file cannot be copied. + + is set to ThrowException, and the user cancels the operation, or the operation cannot be completed. + + is set to ThrowException, and the user lacks necessary permissions. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + True if existing directories should be overwritten; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + + is set to ThrowException, and either the user has cancelled the operation or an unspecified I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + True to overwrite existing files; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + 1 + + + + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + Widths of the fields. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + Delimiters for the fields. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + + + Opens a object to read from a file. + + object to read from the file + File to be read. + The file name ends with a backslash (\). + The specified file cannot be found. + The user lacks necessary permissions to read from the file. + 1 + + + + + + Opens a object to read from a file. + + object to read from the file + File to be read. + The encoding to use for the file contents. Default is ASCII. + The file name ends with a backslash (\). + The specified file cannot be found. + The user lacks necessary permissions to read from the file. + 1 + + + + + + Opens a object to write to the specified file. + + object to write to the specified file. + File to be written to. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + The file name ends with a trailing slash. + 1 + + + + + + Opens a to write to the specified file. + + object to write to the specified file. + File to be written to. + True to append to the contents in the file; False to overwrite the contents of the file. Default is False. + Encoding to be used in writing to the file. Default is ASCII. + The file name ends with a trailing slash. + 1 + + + + + + Returns the contents of a file as a byte array. + Byte array containing the contents of the file. + File to be read. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Returns the contents of a text file as a String. + String containing the contents of the file. + Name and path of the file to read. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Returns the contents of a text file as a String. + String containing the contents of the file. + Name and path of the file to read. + Character encoding to use in reading the file. Default is UTF-8. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Renames a directory. + Path and name of directory to be renamed. + New name for directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + contains path information. + + is Nothing.-or- is Nothing or an empty string. + The directory does not exist. + There is an existing file or directory with the name specified in . + The path exceeds 248 characters. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + Renames a file. + File to be renamed. + New name of file. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + contains path information or ends with a backslash (\). + + is Nothing.-or- is Nothing or an empty string. + The directory does not exist. + There is an existing file or directory with the name specified in . + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + Writes data to a binary file. + Path and name of the file to be written to. + Data to be written to the file. + True to append to the file contents; False to overwrite the file contents. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Writes text to a file. + File to be written to. + Text to be written to file. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Writes text to a file. + File to be written to. + Text to be written to file. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + What encoding to use when writing to file. Default is UTF-8. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + The exception that is thrown when the method cannot parse a row using the specified format. + 1 + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with serialized data. + The object that holds the serialized object data about the exception being thrown. + The structure that contains contextual information about the source or destination. + + + Initializes a new instance of the class with a specified error message. + A message that describes the error. + + + 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. + A describing the error. + The object that is the cause of the current exception. If the parameter is not a null reference (Nothing in Visual Basic), 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 and a line number. + The message for the exception. + The line number of the malformed line. + + + Initializes a new instance of the class with a specified error message, a line number, and a reference to the inner exception that is the cause of this exception. + The message for the exception. + The line number of the malformed line. + The that is the cause of the current exception. If the parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. + + + Sets the object with information about the exception. + The object that holds the serialized object data about the exception being thrown. + The structure that contains contextual information about the source or destination. + 1 + + + + + + + Gets the line number of the malformed line. + The line number of the malformed line. + 1 + + + Creates and returns a string representation of the current exception. + A string representation of the current exception. + 1 + + + + + + Specifies whether a file should be deleted permanently or placed in the Recycle Bin. + + + Delete the file or directory permanently. Default. + + + Send the file or directory to the Recycle Bin. + + + Specifies whether to search all or only top-level directories. + + + Search only the specified directory and exclude subdirectories. + + + Search the specified directory and all subdirectories within it. Default. + + + Provides properties for accessing commonly referenced directories. + 1 + + + Returns an instance of the class. + + + Gets a path name pointing to the Application Data directory for the all users. + The path to the Application Data directory for the all users. + Controls access to system and user environment variables. Associated enumeration: . + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Application Data directory for the current user. + The path to the Application Data directory for the current user. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Desktop directory. + The path to the Desktop directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Documents directory. + The path to the My Documents directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Music directory. + The path to the My Music directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Pictures directory. + The path to the My Pictures directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path pointing to the Program Files directory. + The path to the Program Files directory. + The path is empty, usually because the operating system does not support the directory. + + + Gets a path name pointing to the Programs directory. + The path to the Programs directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Temp directory. + The path to the Temp directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + + Provides methods and properties for parsing structured text files. + 1 + + + Initializes a new instance of the TextFieldParser class. + + . The stream to be parsed. + + is Nothing. + + cannot be read from. + + + Initializes a new instance of the TextFieldParser class. + + . The stream to be parsed. + + . The character encoding to use if encoding is not determined from file. Default is . + + or is Nothing. + + cannot be read from. + + + Initializes a new instance of the TextFieldParser class. + + . The stream to be parsed. + + . The character encoding to use if encoding is not determined from file. Default is . + Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True. + + or is Nothing. + + cannot be read from. + + + Initializes a new instance of the TextFieldParser class. + + . The stream to be parsed. + + . The character encoding to use if encoding is not determined from file. Default is . + Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True. + Boolean. Indicates whether to leave open when the TextFieldParser object is closed. Default is False. + + or is Nothing. + + cannot be read from. + + + Initializes a new instance of the TextFieldParser class. + + . The stream to be parsed. + + is Nothing. + + + Initializes a new instance of the TextFieldParser class. + String. The complete path of the file to be parsed. + + is an empty string. + + + Initializes a new instance of the TextFieldParser class. + String. The complete path of the file to be parsed. + + . The character encoding to use if encoding is not determined from file. Default is . + + is an empty string or is Nothing. + + + Initializes a new instance of the TextFieldParser class. + String. The complete path of the file to be parsed. + + . The character encoding to use if encoding is not determined from file. Default is . + Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True. + + is an empty string or is Nothing. + + + Closes the current TextFieldParser object. + 1 + + + Defines comment tokens. A comment token is a string that, when placed at the beginning of a line, indicates that the line is a comment and should be ignored by the parser. + A string array that contains all of the comment tokens for the object. + A comment token includes white space. + 1 + + + Defines the delimiters for a text file. + A string array that contains all of the field delimiters for the object. + A delimiter value is set to a newline character, an empty string, or Nothing. + 1 + + + Releases resources used by the object. + + + Releases resources used by the object. + Boolean. True releases both managed and unmanaged resources; False releases only unmanaged resources. + + + Returns True if there are no non-blank, non-comment lines between the current cursor position and the end of the file. + True if there is no more data to read; otherwise, False. + 1 + + + + + + Returns the line that caused the most recent exception. + The line that caused the most recent exception. + 1 + + + Returns the number of the line that caused the most recent exception. + The number of the line that caused the most recent exception. + 1 + + + Denotes the width of each column in the text file being parsed. + An integer array that contains the width of each column in the text file that is being parsed. + A width value in any location other than the last entry of the array is less than or equal to zero. + 1 + + + Allows the object to attempt to free resources and perform other cleanup operations before it is reclaimed by garbage collection. + + + Denotes whether fields are enclosed in quotation marks when a delimited file is being parsed. + True if fields are enclosed in quotation marks; otherwise, False. + 1 + + + Returns the current line number, or returns -1 if no more characters are available in the stream. + The current line number. + 1 + + + Reads the specified number of characters without advancing the cursor. + A string that contains the specified number of characters read. + Int32. Number of characters to read. Required. + + is less than 0. + 1 + + + + + + Reads all fields on the current line, returns them as an array of strings, and advances the cursor to the next line containing data. + An array of strings that contains field values for the current line. + A field cannot be parsed by using the specified format. + 1 + + + + + + Returns the current line as a string and advances the cursor to the next line. + The current line from the file or stream. + 1 + + + Reads the remainder of the text file and returns it as a string. + The remaining text from the file or stream. + 1 + + + Sets the delimiters for the reader to the specified values, and sets the field type to Delimited. + Array of type String. + A delimiter is zero-length. + + + Sets the delimiters for the reader to the specified values. + Array of Integer. + + + Indicates whether the file to be parsed is delimited or fixed-width. + A value that indicates whether the file to be parsed is delimited or fixed-width. + 1 + + + Indicates whether leading and trailing white space should be trimmed from field values. + True if leading and trailing white space should be trimmed from field values; otherwise, False. + 1 + + + Specifies whether an exception is thrown if the user clicks Cancel during an operation. + 1 + + + Do nothing when the user clicks Cancel. + + + Throw an exception when the user clicks Cancel. + + + Specifies which dialog boxes to show when copying, deleting, or moving files or directories. + + + Only show error dialog boxes and hide progress dialog boxes. Default. + + + Show progress dialog box and any error dialog boxes. + + + Provides a property and methods for writing event and exception information to the application's log listeners. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + + . The name to give to the property object. + + + Creates a new and adds it to the collection. + + + Determines what to do when the object attempts to write to a log and there is less free disk space available than specified by the property. + 1 + + + Throw an exception. + + + Discard log messages. + + + Provides a simple listener that directs logging output to file. + 1 + + + Initializes a new instance of the class with the default name. + + + Initializes a new instance of the class with the supplied name. + String. The name of the instance object. + + + Determines whether to append the output to the current file or write it to a new file. + Boolean, with True indicating that the output is appended to the current file, and False indicating that output is written to a new file. The default setting for this property is True. + 1 + + + + + + + Indicates whether or not the writing to the log file stream flushes the buffer. + Boolean, with True indicating that the stream is flushed after every write; otherwise the log entries are buffered and written more efficiently. The default setting for this property is False. + 1 + + + + + + + Gets or sets the base name for the log files, which is used to create the full log-file name. + String. The base name for the log files. The default is the application's product name. + 1 + + + + + + Closes the underlying stream for the current log file and releases any resources associated with the current stream. + 1 + + + Gets or sets the log file directory when the property is set to . + String, which is the name of the log-file directory. The default setting for this property is the user's directory for application data. + 1 + + + + + + Gets or sets the delimiter used to delimit fields within a log message. + String, which is the delimiter used for fields within a log message. The default setting for this property is the TAB character. + 1 + + + Determines what to do when writing to the log file and there is less free disk space available than specified by the property. + + . Determines what to do when attempting to write to the log file and there is less free disk space available than specified by the property, or if the log file size is greater than what the property allows. The default value is . + 1 + + + + + + + Closes the underlying stream and optionally releases the managed resources. + True releases both managed and unmanaged resources; False releases only unmanaged resources. + + + Gets or sets the encoding to use when creating a new log file. + + , which is the encoding to use when creating a new log file. The default value of this property is . + 1 + + + Flushes the underlying stream that writes to the current log file. + 1 + + + Gets the current full log-file name. + String, which is the current full log-file name. + 1 + + + + + + + Gets the custom XML configuration attributes supported by the trace listener. + String array containing the XML configuration attributes recognized by this listener. + + + Indicates whether or not the host name of the logging machine should be included in the output. + Boolean. Use True if the host identifier should be included; otherwise use False. The default value is False. + 1 + + + + + + + Gets or sets location for the log files. + + , which is the location for the log file. The default value is . + 1 + + + Determines which date to include in the names of the log files. + + . This indicates which date to include in the log-file names. The default value is . + + + Gets or sets the maximum allowed size of the log file, in bytes. + Long. This is the maximum allowed log-file size, in bytes. The default value is 5000000. + When this property is set to a value less than 1000. + 1 + + + + + + + Gets or sets the amount of free disk space, in bytes, necessary before messages can be written to the log file. + Long. This is the amount of free disk space necessary. The default value is 10000000. + When this property is set to a value less than 0. + 1 + + + + + + + Writes trace information, a data object, and event information to the output file or stream. + A object that contains the current process ID, thread ID, and stack trace information. + A name of the trace source that invoked this method. + One of the enumeration values. + A numeric identifier for the event. + The trace data to emit. + + + Writes trace information, an array of data objects, and event information to the output file or stream. + A object that contains the current process ID, thread ID, and stack trace information. + The name of the trace source that invoked this method. + One of the enumeration values. + A numeric identifier for the event. + An array of objects to emit as data. + + + Writes trace information, a message and event information to the output file or stream. + A object that contains the current process ID, thread ID, and stack trace information. + A name of the trace source that invoked this method. + One of the enumeration values. + A numeric identifier for the event. + A message to write. + 1 + + + + + + + + Writes trace information, a formatted array of objects, and event information to the output file or stream. + A object that contains the current process ID, thread ID, and stack trace information. + A name of the trace source that invoked this method. + One of the enumeration values. + A numeric identifier for the event. + A format string that contains zero or more format items, which correspond to objects in the array. + An Object array containing zero or more objects to format. + 1 + + + + + + + + Writes a verbatim message to disk, without any additional context information. + String. The custom message to write. + 1 + + + + + + + + Writes a verbatim message to disk, followed by the current line terminator, without any additional context information. + String. The custom message to write. + 1 + + + + + + + + Provides a property and methods for writing event and exception information to the application's log listeners. + 1 + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + + . The name to give to the property object. + + + Gets the file the object that underlies the Log object. + Returns the object that underlies the Log object. + 2 + + + Creates a new object and adds it to the collection. + + + Gets to the object that underlies the Log object. + Returns the object that underlies the Log object. + 2 + + + Writes a message to the application's log listeners. + Required. The message to log. If is Nothing, an empty string is used. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + 1 + + + + + + + + Writes a message to the application's log listeners. + Required. The message to log. If is Nothing, an empty string is used. + The type of message. By default, TraceEventType.Information. + The message type is not one of the enumeration values. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + 1 + + + + + + + + Writes a message to the application's log listeners. + Required. The message to log. If is Nothing, an empty string is used. + The type of message. By default, TraceEventType.Information. + Message identifier, typically used for correlation. By default, related to as described in the table. + The message type is not one of the enumeration values. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + 1 + + + + + + + + Writes exception information to the application's log listeners. + Required. Exception to log. + + is Nothing. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + + + Writes exception information to the application's log listeners. + Required. Exception to log. + The type of message. By default, . + String to append to the message. By default, this is an empty string. + + is Nothing. + The message type is not one of the enumeration values. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + + + Writes exception information to the application's log listeners. + Required. Exception to log. + The type of message. By default, . + String to append to the message. By default, this is an empty string. + Message identifier, typically used for correlation. By default, related to as described in the table in the Remarks section. + + is Nothing. + The message type is not one of the enumeration values. + Code with partial trust calls the method, but writes to an event log listener that requires full trust. + + + Determines which date to include in the names of the class log files. + + + Do not include the date in the log file name. + + + Include the current date in the log file name. + + + Include the first day of the current week in the log file name. + + + Determines which predefined path the class uses to write its log files. + 1 + + + Use the path of the current system's temporary folder. + + + Use the path for a user's application data. + + + Use the path for the application data that is shared among all users. + + + Use the path for the executable file that started the application. + + + If the string specified by is not empty, then use it as the path. Otherwise, use the path for a user's application data. + + + Provides methods for manipulating the Clipboard. + 2 + + + Clears the Clipboard. + 1 + + + Indicates whether the Clipboard contains audio data. + True if audio data is stored on the Clipboard; otherwise False. + 1 + + + + + + + + Indicates whether the Clipboard contains data in the specified custom format. + True if data in the specified custom format is stored on the Clipboard; otherwise False. + String. Name of the custom format to be checked. Required. + 1 + + + + + + + + Returns a Boolean indicating whether the Clipboard contains a file drop list. + True if a file drop list is stored on the Clipboard; otherwise False. + 1 + + + + + + + + Returns a Boolean indicating whether an image is stored on the Clipboard. + True if an image is stored on the Clipboard; otherwise False. + 1 + + + + + + + + Determines if there is text on the Clipboard. + True if the Clipboard contains text; otherwise False. + 1 + + + + + + + + Determines if there is text on the Clipboard. + True if the Clipboard contains text; otherwise False. + + . If specified, identifies what text format to be checked for. Required. + 1 + + + + + + + + Retrieves an audio stream from the Clipboard. + A object containing audio data or Nothing if the Clipboard does not contain any audio data. + 1 + + + + + + + + Retrieves data in a custom format from the Clipboard. + An Object representing the Clipboard data or Nothing if the Clipboard does not contain any data that is in the specified format or can be converted to that format. + String. Name of the data format. Required. + 1 + + + + + + + + Retrieves data from the Clipboard as an . + An object that represents the data currently on the Clipboard, or Nothing if there is no data on the Clipboard. + 1 + + + + + + + + Retrieves a collection of strings representing file names from the Clipboard. + A containing file names or Nothing if the Clipboard does not contain any data that is in the format or can be converted to that format. + 1 + + + + + + + + Retrieves an image from the Clipboard. + An representing the Clipboard image data or Nothing if the Clipboard does not contain any data that is in the format or can be converted to that format. + 1 + + + + + + + + Retrieves text from the Clipboard. + The Clipboard text data or an empty string if the Clipboard does not contain data in the or format, depending on the operating system. + 1 + + + + + + + + Retrieves text from the Clipboard. + The Clipboard text data or an empty string if the Clipboard does not contain data in the specified format. + + . If specified, identifies what text format should be retrieved. Default is . Required. + 1 + + + + + + + + Writes audio data to the Clipboard. + Byte array. Audio data to be written to the Clipboard. Required. + 1 + + + Writes audio data to the Clipboard. + + Audio data to be written to the clipboard. Required. + 1 + + + Writes data in a custom format to the Clipboard. + String. Format of data. Required. + Object. Data object to be written to the Clipboard. Required. + 1 + + + Writes a to the Clipboard. + + . Data object to be written to the Clipboard. Required. + 1 + + + Writes a collection of strings representing file paths to the Clipboard. + + . List of file names. Required. + 1 + + + Writes an image to the Clipboard. + + . Image to be written. Required. + 1 + + + Writes text to the Clipboard. + String. Text to be written. Required. + + is an empty string. + + is Nothing. + 1 + + + Writes text to the Clipboard. + String. Text to be written. Required. + + . Format to be used when writing text. Default is . Required. + + is an empty string. + + is Nothing. + 1 + + + Provides properties and methods for working with drives, files, and directories. + 2 + + + Combines two paths and returns a properly formatted path. + The combination of the specified paths. + String. First path to be combined. + String. Second path to be combined. + + or are malformed paths. + 1 + + + + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + 1 + + + + + + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + + is set to UIOption.AllDialogs and the user cancels the operation, or one or more files in the directory cannot be copied. + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies what should be done if the user clicks Cancel during the operation. Default is . + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + + is set to UIOption.AllDialogs and the user cancels the operation, or one or more files in the directory cannot be copied. + + + Copies a directory to another directory. + The directory to be copied. + The location to which the directory should be copied. + True to overwrite existing files; otherwise False. Default is False. + The new name specified for the directory contains a colon (:) or slash (\ or /). + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + The source directory does not exist. + The source directory is a root directory + The combined path points to an existing file. + The source path and target path are the same. + The operation is cyclic. + The path exceeds the system-defined maximum length. + A folder name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + A destination file exists but cannot be accessed. + 1 + + + + + + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies what should be done if the user clicks Cancel during the operation. Default is . + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + + is set to ThrowException, and the user has canceled the operation or an unspecified I/O error occurs. + + + Copies a file to a new location. + The file to be copied. + The location to which the file should be copied. + True if existing files should be overwritten; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + The system could not retrieve the absolute path. + + contains path information. + + or is Nothing or an empty string. + The source file is not valid or does not exist. + The combined path points to an existing directory. + The user does not have sufficient permissions to access the file. + A file in the target directory with the same name is in use. + The destination file exists and is set to False. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The path exceeds the system-defined maximum length. + The user does not have required permission. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Creates a directory. + Name and location of the directory. + The directory name is malformed. For example, it contains illegal characters or is only white space. + + is Nothing or an empty string. + The directory name is too long. + The directory name is only a colon (:). + The parent directory of the directory to be created is read-only + The user does not have permission to create the directory. + 1 + + + + + + Gets or sets the current directory. + The current directory for file I/O operations. + The path is not valid. + The user lacks necessary permissions. + 1 + + + + + + + Deletes a directory. + Directory to be deleted. + Specifies what should be done when a directory that is to be deleted contains files or directories. Default is DeleteDirectoryOption.DeleteAllContents. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + 1 + + + + + + + + Deletes a directory. + Directory to be deleted. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + 1 + + + + + + + + Deletes a directory. + Directory to be deleted. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + Specifies whether to throw an exception if the user clicks Cancel. + The path is a zero-length string, is malformed, contains only white space, or contains invalid characters (including wildcard characters). The path is a device path (starts with \\.\). + + is Nothing or an empty string. + The directory does not exist or is a file. + The directory is not empty, and is set to ThrowIfDirectoryNonEmpty. + The user does not have permission to delete the directory or subdirectory. + A file in the directory or subdirectory is in use. + The directory name contains a colon (:). + The path exceeds the system-defined maximum length. + The user does not have required permissions. + The user cancels the operation or the directory cannot be deleted. + 1 + + + + + + + + Deletes a file. + Name and path of the file to be deleted. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + 1 + + + + + + + + Deletes a file. + Name and path of the file to be deleted. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + + + Deletes a file. + Name and path of the file to be deleted. + Whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; it has a trailing slash where a file must be specified; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The file is in use. + The user lacks necessary permissions to view the path. + The file does not exist. + The user does not have permission to delete the file or the file is read-only. + The user cancelled the operation and is set to . + + + Returns True if the specified directory exists. + True if the directory exists; otherwise False. + Path of the directory. + 1 + + + + + + Returns a read-only collection of all available drive names. + A read-only collection of all available drives as objects. + 1 + + + + + + Returns True if the specified file exists. + Returns True if the file exists; otherwise this method returns False. + Name and path of the file. + The name of the file ends with a backslash (\). + 1 + + + + + + Returns a read-only collection of strings representing the names of files containing the specified text. + Read-only collection of the names of files containing the specified text.. + The directory to be searched. + The search text. + True if the search should be case-sensitive; otherwise False. Default is True. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + The specified directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + + 1 + + + Returns a read-only collection of strings representing the names of files containing the specified text. + Read-only collection of the names of files containing the specified text.. + The directory to be searched. + The search text. + True if the search should be case-sensitive; otherwise False. Default is True. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to be matched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + The specified directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + + + + 1 + + + Returns a collection of strings representing the path names of subdirectories within a directory. + Read-only collection of the path names of subdirectories within the specified directory.. + Name and path of directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + Returns a collection of strings representing the path names of subdirectories within a directory. + Read-only collection of the path names of subdirectories within the specified directory. + Name and path of directory. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to match names. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + One or more of the specified wildcard characters is Nothing, an empty string, or contains only spaces. + The specified directory does not exist. + The specified directory points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + Returns a object for the specified path. + + object for the specified path. + String. Path of directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + The directory path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path + 1 + + + + + + Returns a object for the specified drive. + + object for the specified drive. + Drive to be examined. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing or an empty string. + The path exceeds the system-defined maximum length. + The user lacks necessary permissions to view the path + 1 + + + + + + Returns a object for the specified file. + + object for the specified file + Name and path of the file. + The path name is malformed. For example, it contains invalid characters or is only white space. The file name has a trailing slash mark. + + is Nothing or an empty string. + The path contains a colon in the middle of the string. + The path is too long. + The user lacks necessary permissions. + The user lacks ACL (access control list) access to the file. + 1 + + + + + + Returns a read-only collection of strings representing the names of files within a directory. + Read-only collection of file names from the specified directory. + Directory to be searched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing. + The directory to search does not exist. + + points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + Returns a read-only collection of strings representing the names of files within a directory. + Read-only collection of file names from the specified directory. + Directory to be searched. + Whether to include subfolders. Default is SearchOption.SearchTopLevelOnly. + Pattern to be matched. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + is Nothing. + The directory to search does not exist. + + points to an existing file. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user lacks necessary permissions. + 1 + + + + + + Parses the file name out of the path provided. + The file name from the specified path. + Required. Path to be parsed. String. + + + Returns the parent path of the provided path. + The parent path of the provided path. + Path to be examined. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + Path does not have a parent path because it is a root path. + + is Nothing. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + 1 + + + + + + Creates a uniquely named zero-byte temporary file on disk and returns the full path of that file. + String containing the full path of the temporary file. + 1 + + + + + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + + is set to ThrowException and a subdirectory of the file cannot be copied. + + is set to ThrowException, and the user cancels the operation, or the operation cannot be completed. + + is set to ThrowException, and the user lacks necessary permissions. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + + + Moves a directory from one location to another. + Path of the directory to be moved. + Path of the directory to which the source directory is being moved. + True if existing directories should be overwritten; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + or is Nothing or an empty string. + + or is Nothing or an empty string. + The directory does not exist. + The source is a root directory or The source path and the target path are the same. + The target directory already exists and o is set to False. + The path exceeds the system-defined maximum length. + The operation is cyclic. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. + Specifies whether or not an exception is thrown when the user cancels the operation. Default is UICancelOption.ThrowException. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + + is set to ThrowException, and either the user has cancelled the operation or an unspecified I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + + + Moves a file to a new location. + Path of the file to be moved. + Path of the directory into which the file should be moved. + True to overwrite existing files; otherwise False. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing or an empty string. + The source file is not valid or does not exist. + The destination file exists and is set to False. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + 1 + + + + + + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + 1 + + + + + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + Widths of the fields. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + + + The OpenTextFieldParser method allows you to create a object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. + + to read the specified file. + The file to be opened with the TextFieldParser. + Delimiters for the fields. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + A row cannot be parsed using the specified format. The exception message specifies the line causing the exception, while the property is assigned the text contained in the line. + The user lacks necessary permissions to view the path. + + + Opens a object to read from a file. + + object to read from the file + File to be read. + The file name ends with a backslash (\). + The specified file cannot be found. + The user lacks necessary permissions to read from the file. + 1 + + + + + + Opens a object to read from a file. + + object to read from the file + File to be read. + The encoding to use for the file contents. Default is ASCII. + The file name ends with a backslash (\). + The specified file cannot be found. + The user lacks necessary permissions to read from the file. + 1 + + + + + + Opens a object to write to the specified file. + + object to write to the specified file. + File to be written to. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + The file name ends with a trailing slash. + 1 + + + + + + Opens a to write to the specified file. + + object to write to the specified file. + File to be written to. + True to append to the contents in the file; False to overwrite the contents of the file. Default is False. + Encoding to be used in writing to the file. Default is ASCII. + The file name ends with a trailing slash. + 1 + + + + + + Returns the contents of a file as a byte array. + Byte array containing the contents of the file. + File to be read. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Returns the contents of a text file as a String. + String containing the contents of the file. + Name and path of the file to read. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Returns the contents of a text file as a String. + String containing the contents of the file. + Name and path of the file to read. + Character encoding to use in reading the file. Default is UTF-8. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Renames a directory. + Path and name of directory to be renamed. + New name for directory. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + contains path information. + + is Nothing.-or- is Nothing or an empty string. + The directory does not exist. + There is an existing file or directory with the name specified in . + The path exceeds 248 characters. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + Renames a file. + File to be renamed. + New name of file. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\). + + contains path information or ends with a backslash (\). + + is Nothing.-or- is Nothing or an empty string. + The file does not exist. + There is an existing file or directory with the name specified in . + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + The user lacks necessary permissions to view the path. + The user does not have required permission. + 1 + + + + + + Gets an object that provides properties for accessing commonly referenced directories. + This property returns the object for the computer. + 1 + + + Writes data to a binary file. + Path and name of the file to be written to. + Data to be written to the file. + True to append to the file contents; False to overwrite the file contents. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Writes text to a file. + File to be written to. + Text to be written to file. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Writes text to a file. + File to be written to. + Text to be written to file. + True to append to the contents of the file; False to overwrite the contents of the file. Default is False. + What encoding to use when writing to file. Default is UTF-8. + The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\); it ends with a trailing slash. + + is Nothing. + The file does not exist. + The file is in use by another process, or an I/O error occurs. + The path exceeds the system-defined maximum length. + A file or directory name in the path contains a colon (:) or is in an invalid format. + There is not enough memory to write the string to buffer. + The user lacks necessary permissions to view the path. + 1 + + + + + + Provides properties and methods for manipulating the registry. + 1 + + + Returns a type which provides access to HKEY_CLASSES_ROOT. + + + + 1 + + + Returns a type which provides access to HKEY_CURRENT_CONFIG. + + + + 1 + + + Returns a type which provides access to HKEY_CURRENT_USER. + + + + 1 + + + Returns a type, which provides access to HKEY_DYNDATA. + + + + 1 + + + Gets a value from a registry key. + Gets a value from a registry key. + String. Key from which the value is to be retrieved. Required. + String. Value to be retrieved. Required. + Object. Default value to be supplied if the value does not exist. Required. + The user does not have the permissions required to read from the registry key. + The that contains the specified value has been marked for deletion. + + does not begin with a valid registry root. + 1 + + + + + + + + + Returns a type, which provides access to HKEY_LOCAL_MACHINE. + + + + 1 + + + Returns a type, which provides access to HKEY_PERFORMANCE_DATA. + + + + 1 + + + Writes a value to a registry key. + String. Name of the key to be written to. Required. + String. Name of the value to be written. Required. + Object. Value to be written. Required. + + is Nothing. + + does not begin with a valid registry root.-or- is longer than the maximum length allowed (255 characters). + The is read-only and thus cannot be written to; for example, it is a root-level node, or it has not been opened with write access.. + The user does not have the permissions required to create or modify registry keys. + 1 + + + + + + + + Writes a value to a registry key. + String. Name of the key to be written to. Required. + String. Name of the value to be written. Required. + Object. Value to be written. Required. + + . Required. + + is Nothing. + + does not begin with a valid registry root.-or- is longer than the maximum length allowed (255 characters).-or- The type of does not match the registry data type specified by , therefore the data cannot be converted properly. + The is read-only, and thus cannot be written to; for example, it is a root-level node, or it has not been opened with write access. + The user does not have the permissions required to create or modify registry keys. + 1 + + + + + + + + Returns a type, which provides access to HKEY_USERS. + + + + 1 + + + Provides properties for accessing commonly referenced directories. + 2 + + + Gets a path name pointing to the Application Data directory for the all users. + The path to the Application Data directory for the all users. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Application Data directory for the current user. + The path to the Application Data directory for the current user. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Desktop directory. + The path to the Desktop directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Documents directory. + The path to the My Documents directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Music directory. + The path to the My Music directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the My Pictures directory. + The path to the My Pictures directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path pointing to the Program Files directory. + The path to the Program Files directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Programs directory. + The path to the Programs directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + Gets a path name pointing to the Temp directory. + The path to the Temp directory. + The path is empty, usually because the operating system does not support the directory. + 1 + + + + + + + This class supports My in Visual Basic. + The type of the object to store. + + + This class supports My in Visual Basic. + + + This property supports My in Visual Basic. + The value associated with this class. + + + \ No newline at end of file diff --git a/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nupkg b/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nupkg new file mode 100644 index 000000000..feb8498f0 Binary files /dev/null and b/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nupkg differ diff --git a/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nuspec b/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nuspec new file mode 100644 index 000000000..3f97b20b5 --- /dev/null +++ b/packages/MySql.Data.6.6.5/MySql.Data.6.6.5.nuspec @@ -0,0 +1,19 @@ + + + + MySql.Data + 6.6.5 + MySql.Data + Oracle Corporation + Oracle Corporation + http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + http://www.mysql.com/downloads/connector/net/ + http://www.mysql.com/common/logos/logo-mysql-110x57.png + false + Connector/Net is a fully-managed ADO.NET driver for MySQL. + + + + MySQL + + \ No newline at end of file diff --git a/packages/MySql.Data.6.6.5/lib/net20/MySql.Data.dll b/packages/MySql.Data.6.6.5/lib/net20/MySql.Data.dll new file mode 100644 index 000000000..4506c842f Binary files /dev/null and b/packages/MySql.Data.6.6.5/lib/net20/MySql.Data.dll differ diff --git a/packages/MySql.Data.6.6.5/lib/net40/MySql.Data.dll b/packages/MySql.Data.6.6.5/lib/net40/MySql.Data.dll new file mode 100644 index 000000000..fd3c20ab7 Binary files /dev/null and b/packages/MySql.Data.6.6.5/lib/net40/MySql.Data.dll differ diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/FireBird.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/FireBird.cfg.xml new file mode 100644 index 000000000..17747f9aa --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/FireBird.cfg.xml @@ -0,0 +1,30 @@ + + + + + + NHibernate.Driver.FirebirdClientDriver + + Server=localhost; + Database=C:\nhibernate.fdb; + User=SYSDBA;Password=masterkey + + false + NHibernate.Dialect.FirebirdDialect + 60 + true 1, false 0, yes 1, no 0 + + diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MSSQL.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MSSQL.cfg.xml new file mode 100644 index 000000000..70397662e --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MSSQL.cfg.xml @@ -0,0 +1,16 @@ + + + + + + NHibernate.Driver.SqlClientDriver + + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + + NHibernate.Dialect.MsSql2008Dialect + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MySql.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MySql.cfg.xml new file mode 100644 index 000000000..3b1062697 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/MySql.cfg.xml @@ -0,0 +1,16 @@ + + + + + + NHibernate.Driver.MySqlDataDriver + + Database=test;Data Source=someip;User Id=blah;Password=blah + + NHibernate.Dialect.MySQLDialect + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/Oracle.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/Oracle.cfg.xml new file mode 100644 index 000000000..523090cbc --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/Oracle.cfg.xml @@ -0,0 +1,18 @@ + + + + + + NHibernate.Driver.OracleClientDriver + + User ID=nhibernate;Password=nhibernate;Data Source=localhost + + false + NHibernate.Dialect.OracleDialect + true 1, false 0, yes 'Y', no 'N' + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/PostgreSQL.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/PostgreSQL.cfg.xml new file mode 100644 index 000000000..d01718ed9 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/PostgreSQL.cfg.xml @@ -0,0 +1,15 @@ + + + + + NHibernate.Driver.NpgsqlDriver + + Server=localhost;Database=nhibernate;User ID=nhibernate;Password=nhibernate; + + NHibernate.Dialect.PostgreSQL82Dialect + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SQLite.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SQLite.cfg.xml new file mode 100644 index 000000000..d07b7eeb9 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SQLite.cfg.xml @@ -0,0 +1,15 @@ + + + + + NHibernate.Driver.SQLite20Driver + + Data Source=nhibernate.db + + NHibernate.Dialect.SQLiteDialect + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseASE.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseASE.cfg.xml new file mode 100644 index 000000000..4f722b1f0 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseASE.cfg.xml @@ -0,0 +1,16 @@ + + + + + NHibernate.Driver.SybaseAseClientDriver + + Data Source=10.0.0.1;Port=5000;Database=nhibernate;User ID=nhibernate;Password=password + + NHibernate.Dialect.SybaseASE15Dialect + true=1;false=0 + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseSQLAnywhere.cfg.xml b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseSQLAnywhere.cfg.xml new file mode 100644 index 000000000..04a929b7b --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/ConfigurationTemplates/SybaseSQLAnywhere.cfg.xml @@ -0,0 +1,16 @@ + + + + + NHibernate.Driver.SybaseSQLAnywhereDriver + + UID=DBA;PWD=sql;Server=localhost;DBN=nhibernate;DBF=c:\nhibernate.db;ASTOP=No + + NHibernate.Dialect.SybaseSQLAnywhere12Dialect + true=1;false=0 + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nupkg b/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nupkg new file mode 100644 index 000000000..03d72e175 Binary files /dev/null and b/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nupkg differ diff --git a/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nuspec b/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nuspec new file mode 100644 index 000000000..193434d4b --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/NHibernate.3.3.3.4001.nuspec @@ -0,0 +1,20 @@ + + + + NHibernate + 3.3.3.4001 + NHibernate community, Hibernate community + NHibernate community, Hibernate community + https://raw.github.com/nhibernate/nhibernate-core/3.3.x/lgpl.txt + http://www.nhforge.org/ + https://raw.github.com/nhibernate/nhibernate-core/3.3.x/logo/NHibernate-NuGet.png + false + NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects. + NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects. + en-US + ORM DataBase DAL ObjectRelationalMapping + + + + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/NHibernate.license.txt b/packages/NHibernate.3.3.3.4001/NHibernate.license.txt new file mode 100644 index 000000000..866688dba --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/NHibernate.license.txt @@ -0,0 +1,460 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/packages/NHibernate.3.3.3.4001/NHibernate.readme.html b/packages/NHibernate.3.3.3.4001/NHibernate.readme.html new file mode 100644 index 000000000..e62ac003d --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/NHibernate.readme.html @@ -0,0 +1,54 @@ +

Welcome to NHibernate

+ +

NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, +fully featured and used in thousands of successful projects.

+ +

The NHibernate community website - http://www.nhforge.org - has a range of resources to help you get started, +including wikis, blogs and reference documentation.

+ +

Latest Version

+ +

The quickest way to get the latest release of NHibernate is to add it to your project using +NuGet (http://nuget.org/List/Packages/NHibernate).

+ +

Alternatively binaries are available from SourceForge at http://sourceforge.net/projects/nhibernate.

+ +

You are encouraged to review the release notes (releasenotes.txt), particularly when upgrading to a +later version. The release notes will generally document any breaking changes.

+ +

Community Forums

+ +

There are two official NHibernate community forums:

+ + + +

Bug Reports

+ +

If you find any bugs, please report them using the JIRA bug tracker. A +test-case that demonstrates the issue is usually required. Instructions on providing a test-case +can be found here.

+ +

Licenses

+ +

This software is distributed under the terms of the Free Software Foundation Lesser GNU Public License (LGPL), version 2.1 (see lgpl.txt).

+ +

Credits

+ +

Many thanks to the following individuals, organisations and projects whose work is so important to the success +of NHibernate (in no particular order):

+ + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/NHibernate.releasenotes.txt b/packages/NHibernate.3.3.3.4001/NHibernate.releasenotes.txt new file mode 100644 index 000000000..992c1d306 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/NHibernate.releasenotes.txt @@ -0,0 +1,2637 @@ +Build 3.3.3.SP1 +============================= + +Fixes for regressions introduced in the 3.3.3 cycle. + +** Bug + * [NH-3429] - Exception when debug logging is enabled when using a linq expression that requires a proxy class. + * [NH-3436] - Linq-Query with IList.Contains fails with NotSupportedException(The constant for 'System.Collections.Generic.List`1[System.Guid]' is not supported) at HqlTreeBuilder.Constant + +Build 3.3.3.GA +============================= + +BEWARE: In versions prior to 3.3.3.CR1, the handling of the LINQ Take() method + was flawed - no matter where in the query Take() was placed it was + always applied as if it had been placed at the end. 3.3.3 fixes this, + so that Take() now correctly follows the .Net semantics. That is, in + 3.3.3, the following queries might now give different results: + + session.Query.OrderBy(...).Take(5).Where(...); + session.Query.Where(...).OrderBy(...).Take(5); + + Starting with 3.3.3, the first query will generate a subquery to correctly + apply the row limit before the where-clause. + +** Bug + * [NH-2408] - SQL Server pessimistic locking syntax incorrect for union-subclass + * [NH-3109] - Rounding float values in aggregate functions with group by statements (MySQL). + * [NH-3324] - HQL: ArgumentNullException when using LEFT OUTER JOIN and SetMaxResults + * [NH-3408] - System.IndexOutOfRangeException when using Contains on a List + * [NH-3413] - Clearing a list used by Contains causes subsequent queries to fail + +Build 3.3.3.CR1 +============================= + +** Fix + * [NH-3148] - ComponentAsId properties do not maintain the Column specified using property mapper when component is from base class + +** Sub-task + * [NH-3052] - Projection of one-to-many generates invalid SQL + * [NH-3385] - Add ability to expand many subcollections with WCF Data Services + +** Bug + * [NH-2042] - Table per subclass, using a discriminator mappings with formula in child class error + * [NH-2539] - Contains/StartsWith fails when invoked via WCF Data Service. + * [NH-2566] - NotSupportedException when using Skip/Take/First/Single/Any on GroupBy + * [NH-2588] - NotSupportedException when using Skip/Take with Where clause + * [NH-2860] - Lazy property throwing casting exception + * [NH-2979] - MsSqlCe dialect doesn't give the correct SQL type for Decimal with Scale defined + * [NH-3039] - IndexOutOfRangeException thrown when web server is processing multiple sessionfactory creation requests + * [NH-3057] - Collection subquery constraint on joined-subclass inherited properties causes invalid sql (base classes are not joined in). + * [NH-3105] - ComponentAsId does not find property that belongs to a parent class + * [NH-3108] - OrderBy with Select throws exception + * [NH-3129] - Linq Provider doesn't recognize CompareTo method + * [NH-3241] - Linq: Mixing Fetch/FetchMany with Any() throws: ArgumentException: Expression of type 'System.Collections.IList' cannot be used for parameter of type 'System.Collections.Generic.IEnumerable`1[System.Object]' + * [NH-3261] - Linq Query throws when there is a conditional operator + * [NH-3305] - SybaseSQLAnywhere10Dialect defaults a numeric datatype to (19,255) precision, which is not compatible with the DB + * [NH-3318] - Composite-id does not allow superclass properties + * [NH-3320] - Exception in LINQ projection with OrderBy/Take - block using WCF Data Services projection's + * [NH-3326] - Exception in LINQ with pagination - block using WCF Data Services + * [NH-3330] - Exception in LINQ for nullable strings in Oracle - blocks using WCF Data Services + * [NH-3332] - The NH linq driver generates sql code that doesn't match the semantics of the original linq query + * [NH-3337] - Exception in LINQ for complex nullable conditionals - blocks using WCF Data Services + * [NH-3357] - System.NotSupportedException : Don't currently support idents of type DateTimeOffset + * [NH-3366] - LINQ query with various Compare() and CompareTo() fails (WCF Data Services) + * [NH-3369] - ToFuture/ToFutureValue should fall-back on dialects without MultiQuery support + * [NH-3378] - MySQLDialect incorrect handle DbType.Currency as MONEY + * [NH-3379] - Oracle8iDialect and FirebirdDialect incorrect handle DbType.Currency type + +** Improvement + * [NH-2297] - Configuration.BuildSessionFactory throws a NullReferenceException when loading an invalid ICompositeUserType + * [NH-3301] - Support SqlMethods.Like() in LINQ queries. + * [NH-3360] - Allow setting timeout on a LINQ query + * [NH-3367] - Support string.Equals() + * [NH-3368] - Add support for Equals method of sbyte, DateTimeOffset and unsigned numerics + * [NH-3371] - NHibernate should log LINQ expression trees to ease debugging + +** New Feature + * [NH-2986] - Add ability to include collections into projections + * [NH-3092] - Nhibernate Linq provider does not support Math functions like Math.Cos, Math.Sin, etc + * [NH-3180] - Could not select first element of the group + * [NH-3184] - Add ability to use ToFutureValue with aggregating queries + * [NH-3283] - New driver: Devart.Data.MySql + * [NH-3333] - Add ability to expand subcollections with WCF Data Services + +** Patch + * [NH-3255] - The IDbCommand that performs the cleanup of data in AbstractStatementExecutor.DropTemporaryTableIfNecessary does not have a connection. + +Build 3.3.2.GA +============================= + +** Bug + * [NH-2463] - Exception in LINQ projection with redundant type cast - block using WCF Data Services projection's + * [NH-2688] - SelectMany with cast throws QuerySyntaxException + * [NH-2898] - Retrieving object from 2nd cache with lazy property fails + * [NH-3050] - Contributed patch as solution to Unable to cast object of type 'NHibernate.Impl.ExpandedQueryExpression' to type 'NHibernate.Linq.NhLinqExpression' at NHibernate.Linq.NhQueryProvider.PrepareQuery + * [NH-3123] - Nuget package should contain the NHibernate logo + * [NH-3217] - OrderBy with a parameter then Skip and Take produces sql error + * [NH-3239] - Linq to NHibernate and Dynamic LINQ - query caching not working + * [NH-3271] - Threading problem in TypeFactory + +** Improvement + * [NH-3296] - Tweak build system to allow keeping a constant assembly version between compatible releases + * [NH-3297] - NHibernate 3.x NuGet package should forbid Iesi.Collections 4.0 or higher + +** Patch + * [NH-3293] - SimpleExpression.ToString() returns hashes for strings and dates + +Build 3.3.1.GA +============================= + +** Sub-task + * [NH-3167] - Support for Microsoft Sql Server 2012 sequences + * [NH-3170] - Add native "iif" function to MsSql2012Dialect + +** Bug + * [NH-2789] - LINQ query on byte? simple property fails on MSSQL 2005 (tinyint) + * [NH-2812] - Performing a Linq query on a non-null byte property throws an InvalidCastException + * [NH-3121] - Silent truncation of binary data + * [NH-3124] - invalid cast to int in generated sql with a char property + * [NH-3125] - Invalid SQL when querying via LINQ with grouping (regression from 3.2) + * [NH-3126] - InvalidCastException when cascading saves to transient dictionary values + * [NH-3138] - Distinct Bug on MSSQL with OrderBy/Limit and functions in Projection/Order + * [NH-3142] - Batch-loading of lazy children failing when key is composite + * [NH-3145] - HQL query using base class entity with lazy properties throws "No Persister For" error + * [NH-3147] - Calling Contains on a subquery that contains a join throws an Exception + * [NH-3153] - Duplicated id generator tables if schema is specified using different methods for different classes. + * [NH-3162] - Byte.Equals in LINQ Where clauses throws NotSupportedException + * [NH-3172] - "Duplicate dynamic module name within an assembly" + +** Improvement + * [NH-3104] - Typo in Warning Messages + * [NH-3149] - MsSql2005Dialect should use nowait in LockMode.UPGRADE_NOWAIT + * [NH-3156] - ShowBuildMenu.bat does not work with spaces in repository folder name + * [NH-3168] - Add support for bit_length function for MsSql2000Dialect and above + * [NH-3169] - Add supprot for extract function for MsSql2000Dialect and above + +Build 3.3.0.GA +============================= + +** Known BREAKING CHANGES from NH3.2.0.GA to NH3.3.0.GA + + ##### Possible Breaking Changes ##### + * [NH-2214] - SQL Server 2005/2008: Exception is now thrown when paging a statement that requires distinct results, and is ordered by a column that is not included in the result set of the query + - Dialog.ExtractColumnOrAliasNames method signature and visibility changed - may affect custom dialects that use this method + * [NH-2950] - IAccessCallback.NextValue property renamed and changed to a method called IAccessCallback.GetNextValue() + * [NH-2953] - SequenceStyleGenerator now forces use of a table if a pooled optimizer is chosen and the dialect doesn't support pooled sequences. + * [NH-2960] - Queries for an entity name will now not include instances of the same class mapped using a different entity name. + * [NH-2664] - IHqlExpressionVisitor has new property ISessionFactory SessionFactory { get; } + * [NH-3067] - The use of Substring() in Linq queries have been corrected so the zero-based index parameter in C# is converted to one-based index in SQL. + * [NH-2528] - Throw exception instead of silently truncate string and blob data + * [NH-3086] - The base dialect now defaults to ANSI syntax for substring. A custom dialect may need to adjust for this. + +** Bug + * [NH-2956] - SybaseSQLAnywhere10Dialect doesn't override OffsetStartsAtOne + * [NH-3111] - Wrong SQL generated when subquery uses objects from parent query + +** Improvement + * [NH-3086] - All dialects should support substring() with two arguments + +Build 3.3.0.CR1 +============================= + +** Bug + * [NH-1477] - Saving a collection (thats been Cleared) with all-delete-orphan using Oracle with ODP drivers + * [NH-2214] - Distinct and Row_number problem + * [NH-2347] - Casts inside aggregate functions are incorrectly applied outside of them + * [NH-2419] - Linq Provider Problem with group by with an order by clause + * [NH-2429] - SQL Server Linq Average function on Interger field only returns truncated interger value + * [NH-2439] - LINQ 'in' query not fully interpreted + * [NH-2451] - LINQ Issue - joining twice with same table when used in both select and where. Second join is a full select and filtered in where instead of a join .. on + * [NH-2452] - NH 3.0 Linq provider does not correctly translate standard .Key property when grouping + * [NH-2492] - Problem with ROW_NUMBER and DISTINCT operator using LINQ + * [NH-2511] - System.ArgumentException: Object of type 'System.Linq.Expressions.ConstantExpression' cannot be converted to type 'System.Linq.Expressions.LambdaExpression' when passing an expression through a method + * [NH-2527] - AbstractBatcher reuses disposed IDbCommands which causes an ArgumentOutOfRangeException with OracleDataClientDriver + * [NH-2560] - NoViableAltException with ordering by projection in GroupBy + * [NH-2664] - Linq, cannot query dynamic-component + * [NH-2706] - subselect in LINQ query with Contains clause produces wrong SQL + * [NH-2722] - Linq Count() does not respect previous calls to Select() or Distinct() + * [NH-2744] - NewArrayInit Is not Implemented + * [NH-2763] - queryover fails where referencing enum in VB.NET + * [NH-2781] - linq's OrderBy by a calculated column doesn't work + * [NH-2809] - Incorrect specification of VARBINARY(MAX) in MsSql2005Dialect + * [NH-2828] - Persist uploads not initialized collections on flush + * [NH-2833] - "where" clause not working after "group by", generates wrong SQL + * [NH-2846] - Fetch on Count Throws Error + * [NH-2850] - Unable to use enums in NH 3.2 QueryOver checked comparison + * [NH-2853] - SetFirstResult and SetMaxResults do not work correctly on Oracle (ODP.NET) + * [NH-2856] - Retrieval of cached query with Fetch throws exception + * [NH-2857] - Medium Trust Bug in 3.2 + * [NH-2858] - ToString() on Guid column with SQL Server Dialects + * [NH-2863] - Criteria API restriction over aggregate function wrapped in NotExpression is wrongly placed in WHERE clause instead of HAVING clause which generates invalid SQL + * [NH-2869] - Custom extension methods in the select clause are not projected using HQL + * [NH-2880] - Proxies loose their session reference on session deserialization + * [NH-2881] - Fix not found key handling on extra lazy one to many maps + * [NH-2886] - Informix support broken + * [NH-2889] - QueryOver component with multiple properties results in Sql Error + * [NH-2891] - Too many parameters removed (Pervasive SQL) - SELECT doesn't work + * [NH-2893] - NHibernate SQL Parameter on IBM.Data.DB2.iSeries provider + * [NH-2904] - Wrong query generation with LINQ subquery + * [NH-2906] - Using the same parameter name for two differently typed where clauses throws an exception + * [NH-2913] - LINQ query that contains .Any() produces invalid SQL + * [NH-2917] - Paging error with Skip().Take(). + * [NH-2925] - Improper SQL is generated for Take (pagination) for dialects which have UseMaxForLimit = true (like Oracle) + * [NH-2927] - Oracle Dialect does not handle the correct resolution for timestamp version columns + * [NH-2937] - Invalid index 0 for this DB2ParameterCollection with Count=0. + * [NH-2940] - OracleDialect creates wrong sql using SetFirstResult with criteria queries + * [NH-2946] - Superfluous join when querying by foreign key given Id with LINQ + * [NH-2954] - PostgreSQL should SupportsPooledSequences + * [NH-2959] - Polymorphic queries in MultiQuery, MultiCriteria and Futures cause ArgumentOutOfRangeException + * [NH-2960] - Query using entity name also returns entities of same type but different entity name + * [NH-2967] - MySQL Schema Update tool fails with exception + * [NH-2976] - AbstractPersistentCollection.Remove does not remove item from an uninitialized dictionary + * [NH-2989] - ComponentAsId does not set Id Property + * [NH-2998] - Allow to use AsQueryable on child collection + * [NH-3000] - QuerySyntaxException: Exception of type 'Antlr.Runtime.NoViableAltException' was thrown. when projection contains complex code [regression] + * [NH-3001] - NHibernate.HibernateException: Query Source could not be identified + * [NH-3002] - HQL: parser is trying to reuse parent implied join for subquery + * [NH-3003] - Linq: extra joins + * [NH-3004] - DriverBase.RemoveUnusedCommandParameters removes all parameters when UseNamedPrefixInSql = true and UseNamedPrefixInParameter = false + * [NH-3008] - Excess DB parameters created when passing SqlFunctionProjection to LHS of InExpression + * [NH-3009] - Linq trying to add parameters twice if same predicate is used in query more then once + * [NH-3016] - Mapping by code does not properly support nested types + * [NH-3019] - LINQ: Select Key from group by generates wrong SQL + * [NH-3020] - Firebird and DB2 dialect claims to support sequences, but throws in GetSelectSequenceNextValString(string) (since not overriden) + * [NH-3026] - Linq order by grouped count before select clause gives wrong sql + * [NH-3031] - Cannot Sum Property of Type Single + * [NH-3032] - Group By and Condition Throws Exception + * [NH-3036] - Wrong SqlType size set for LIKE statement + * [NH-3044] - Self-joined query with subquery and where - where applied to subquery rather than the external query + * [NH-3059] - Contains broken when used on a path (Works in previous version) + * [NH-3063] - Turkish-I problem in ValidateColumn + * [NH-3064] - Schema validation fails for ODBC + * [NH-3073] - Equal in Linq-provider is only implemented for string + +** Improvement + * [NH-1007] - Add a generator attribute to id + * [NH-2528] - Throw exception instead of silently truncate string and blob data + * [NH-2825] - Add property-ref and not-found attributes in mapping by code + * [NH-2835] - SQL Anywhere dialect/driver improvements + * [NH-2870] - Simplify Development on NHibernate for Contributors + * [NH-2875] - Add Foreign Key to one-to-one mapping by code + * [NH-2883] - DisableLogFormatedSql is not useful + * [NH-2899] - Support for "in ()" in Linq + * [NH-2950] - Update optimizers for enhanced id generators (ported from Hibernate) + * [NH-2953] - Update the SequenceStyleGenerator + * [NH-2962] - Fix PostgreSQL and Firebird timestamp selection and precision + * [NH-2974] - Add unsaved-value attribute in mapping by code. + * [NH-2980] - Port enhanced TableGenerator from Hibernate + * [NH-3024] - Mapping-by-Code does not allow Unique in Component mapping + * [NH-3040] - SymbolSource support along with NuGet + +** Patch + * [NH-2004] - SequenceStyleGenerator + TableStructure opens multiple transactions. + * [NH-2545] - Comparing strings in VB throws NotSupportedException + * [NH-2840] - Improper SQL is generated for Take (pagination) for dialects which have UseMaxForLimit = true (like Oracle) + * [NH-2864] - Fix for nuget package creation. + * [NH-2905] - Support for multistep joins in Linq + * [NH-2914] - Functions for DateTime properties in OracleDialect + * [NH-2924] - CLONE - Improper SQL is generated for Take (pagination) for dialects which have UseMaxForLimit = true (like Oracle) + * [NH-2936] - Better Sequence Support for Firebird + * [NH-2964] - WhereRestrictionOn().IsInG() is a icollection not ienumerable like it should be + * [NH-2982] - SimpleExpression.ToString() can result in unwanted loading of lazy objects + * [NH-3010] - Fix for batching/command behaviour in OneToManyPersister + * [NH-3067] - Linq - substring function does not work + +** Task + * [NH-2672] - Upgrade Npgsql lib file to next release after 2.0.11.91. + * [NH-2752] - Re-enable CriteriaQueryTest.AllowToSetLimitOnSubquries for SQLite + +Build 3.2.0.GA (rev6000) +============================= + +** Known BREAKING CHANGES from NH3.1.0.GA to NH3.2.0.GA + + ##### Design time ##### + * removed obsolete "use_outer_join" property from nhibernate-configuration.xsd (simply remove it from your xml configuration) + + ##### Possible Breaking Changes ##### + * All Dialect.GetLimitString() methods replaced with a single GetLimitString method with a new signature. + For dialects the developers don't perform routine tests on, efforts were made to ensure the new limit string + method conforms to the database documentation. Please report any limit-related bugs discovered at runtime. + * [NH-2550] - Allow public access to FieldInterceptor Session (IFieldInterceptor changed) + * [NH-2593] - For Microsoft SQL Server the default batch-size (adonet.batch_size) is set to 20 where not explicit defined in the session-factory configuration + * - ICollectionPersister added property to fix [NH-2489] + * [NH-2605] Refactorize MultiQuery/MultiCriteria implementation to delegate responsibility to IDrive (IDrive changed). + * For users who don't look at Log-ERROR, to prevent wrong behavior when lazy-properties are used the DynamicProxyValidator validates the accessability of properties setters. + * For those implementing IDrive without inherit from DriveBase: IDrive.AdjustCommand + * Dialect base: removed some no more needed properties + +** Bug + * [NH-2792] - Using a named parameter multiple times in a native SQL query results in invalid parameter binding (exception in some drivers) + * [NH-2813] - Cache DefaultExpiration type is "byte" + +** Improvement + * [NH-2571] - Full PostgreSQL Support + * [NH-2743] - Generic version of ISession.Merge() + * [NH-2800] - Change internal primitive type constructor to protected + +** Patch + * [NH-2811] - Wrong logger type into AdoNetTransactionFactory & AdoNetWithDistributedTransactionFactory classes + * [NH-2814] - Documentation Error: Section 3.5 - Table 3.2 - transaction.factory_class (with patch) + +Build 3.2.0.CR1 (rev5976) +============================= +** Bug + * [NH-2118] - GroupBy without Select doesnt work + * [NH-2387] - Postgres - Unable to run LINQ query using boolean predicate - ERROR: 42883: operator does not exist: boolean = integer + * [NH-2435] - No order by clause generated with self referencing orderby clause. + * [NH-2583] - Query with || operator and navigations (many-to-one) creates wrong joins + * [NH-2773] - ProxyObjectReference creates a new ProxyFactory for each deserialization which disables proxy caching + +** Improvement + * [NH-2748] - Support % operator + +** Patch + * [NH-2774] - Perf - reusing same regex object in joinwalker objects + +Build 3.2.0.Beta2 (rev5964) +============================= +** Bug + * [NH-2206] - Cast is not supported by the new Linq provider + * [NH-2213] - CLONE -Wrong parameters order in IQuery with SetParameterList and Filter. SQL Server 2005 + * [NH-2296] - Subselect fetching strategy with a "SetMaxResults" query generates *extremely* inefficient sql + * [NH-2317] - Select after Take does not work properly + * [NH-2318] - Template functions fail with certain combinations of arguments. + * [NH-2328] - Linq query on fails + * [NH-2415] - HQL parameters not converted correctly to SQL + * [NH-2657] - OrderBy After Cast Not Working + * [NH-2662] - Casting a joined alias in QueryOver loses alias context and looks for property on QueryOver root + * [NH-2700] - SqlFunctionProjection does not honor parameter order + * [NH-2701] - Cannot use Linq Skip() in conjunction with FetchMany and ToFuture + * [NH-2703] - Using a "with" restriction in outer joins result in wrong SQL + * [NH-2708] - Cast<>() with a where clause fails with a NotSupportedException + * [NH-2712] - Linq query doesn't support enums in VB.NET + * [NH-2717] - Count() after Cast<>() causes InvalidOperationException + * [NH-2729] - Parameter values are not set using OffsetStartsAtOne + * [NH-2733] - Using an expression in QueryOver gives: Lambda Parameter not in scope + * [NH-2736] - Inverted parameters in HQL statement using take + * [NH-2739] - Can't get ByCode mapping to produce not nullable varbinary(max) + * [NH-2741] - CLONE -HQL .class query on mapping does not work + * [NH-2746] - Invalid SQL generated for MSSQL when using Filter and paging subquery together [regression from 2.1] + +** Improvement + * [NH-941] - One-Many Requiring Nullable Foreign Keys + * [NH-1050] - Unidirectional One To Many Without Nullable Foreign Key + * [NH-2070] - Better error message for "object references an unsaved transient instance" + * [NH-2427] - Support querying HasValue on Nullable types + * [NH-2683] - Add common dialect functions as extension methods for QueryOver + * [NH-2702] - Support HQL pagination with parameters + * [NH-2728] - ManyToAny missing from ICollectionElementRelation + * [NH-2732] - Dialect.GetLimitString simplifications and improvements + * [NH-2738] - Exception thrown when mapping contains empty enum + * [NH-2749] - Externalize Remotion.Linq namespace + * [NH-2753] - one-shot-insert for and for unidirectional one-to-many + * [NH-2760] - Unable to order by sub-collection's count + * [NH-2770] - Property spelling of IDbIntegrationConfigurationProperties.LogFormatedSql + +** New Feature + * [NH-2616] - Support Trim() function in Linq + +** Patch + * [NH-2125] - Solution for NH2123 - Subselect in combination with a disjuction query causes an enormous memory cons + * [NH-2363] - Patch for ComponentCollectionCriteriaInfoProvider, fixed persister.ElementType cast in constructor. + +Build 3.2.0.Beta1 (rev5839) +============================= +** Bug + * [NH-2404] - Future queries crash (MultiQuery) when using projection queries using hql + result transformer or the linq provider (which compiles into hql) + * [NH-2421] - NotSupportedException text in ToFuture and ToFutureValue does not make sense (or help) + * [NH-2422] - ToFuture throws NotSupportedException on IQueryable if Fetch is used. + * [NH-2559] - NH 3.0 Linq Provider : Issue using multiple filters on the same entity + * [NH-2615] - Linq Fetch cannot traverse through components + * [NH-2690] - Linq Select() broken with .ToFuture() + * [NH-2691] - Linq LongCount() behavior different from Count() + * [NH-2697] - Named parameter not found in HQL with mapping using "entity-name" + * [NH-2698] - Proxying fails for methods with generic type constraints + +** Improvement + * [NH-2568] - Create Custom Persister for Collection Type inherited from OneToManyPersister + * [NH-2695] - update default driver of firebird dialect to FirebirdClientDriver (FirebirdDriver is obsolete) + +** New Feature + * [NH-2699] - Sql Azure dialect + +Build 3.2.0.Aplha3 (rev5803) +============================= +** Sub-task + * [NH-1344] - QueryTranslator: Invalid Cast to object array when using IResultTransformer + * [NH-1642] - one-to-many collection doesn't work if the child is mapped using table per class + +** Bug + * [NH-1090] - Query cache does not work when using Criteria API to create a projection query with a result transformer + * [NH-1747] - Lazy load failure on items using if FK for bag is in the secondary table + * [NH-2510] - Lazy-loading doesn't work with cache + * [NH-2569] - IDGeneratorBinding seems broken when mixing schemas + * [NH-2587] - .Cacheable().Fetch() throws 'Exception occurred getter of xxx' + * [NH-2661] - NHibernate cannot handle SQL Server TIME columns when built with the .NET 4 framework + * [NH-2673] - Nhibernate 2nd level cache and Result transformer + * [NH-2685] - Unnecessary proxy initialisation in CriteriaQueryTranslator + * [NH-2686] - Embedded ResultsTransformers should implements Equals/GetHashCode + +** Improvement + * [NH-2505] - Querries with WHERE containing SQL Server 'bit' datatype produce CASE construction + * [NH-2551] - Bad code practice. Function SessionFactoryImpl.GetImplementors: if type not found - value from ReflectHelper.ClassForFullName returns through TypeLoadException. + * [NH-2670] - Stateless Session load no-lazy collection + * [NH-2684] - More simple way to add NamedQueries by-code + +** New Feature + * [NH-2674] - QueryOver doesn't have support for entity-name + +** Patch + * [NH-2669] - Patch to prevent "NHibernate.AssertionFailure: possible non-threadsafe access to the session" error caused by stateless sessions + +Build 3.2.0.Aplha2 (rev5715) +============================= +** Bug + * [NH-2540] - Linq generates invalid boolean case statements (was: Linq ignoring configured query-substitutions) + * [NH-2640] - HQL Having clause is ignored without preceeding group by + * [NH-2641] - HQL does not throw exception on unexpected trailing tokens + * [NH-2642] - BatcherDataReaderWrapper.GetValue has a typo + * [NH-2643] - MSSQL configuration template is still using "use_outer_join" + * [NH-2652] - SchemaMetadataUpdater does not take Dialect default properties + +** Improvement + * [NH-2644] - schemaaction is not supported in joinedsubclass + +** New Feature + * [NH-2533] - Support paging in HQL + +** Task + * [NH-2653] - Remove just added ExpressionTreeVisitor class + +Build 3.2.0.Aplha1 (rev5664) +============================= +** Bug + * [NH-1925] - Wrong SQL aliases generated for HQL subselect + * [NH-2480] - AssertByIds test function with unordered Ids + * [NH-2488] - Subclass join does not exclude lazy properties + * [NH-2489] - AbstractPersistentCollection.ReadElementByIndex gives wrong result for missing element with lazy="extra" + * [NH-2490] - Mapping.Join.IsLazy always returns true + * [NH-2491] - ObjectNotFoundException in HQL query when referencing joined subclass + * [NH-2498] - Lazy="no-proxy" does eager load + * [NH-2554] - NHibernate Formula doesnt recognize varbinary as a keyword on Sql Server 2008 or 2008 R2 + * [NH-2565] - session.Persist does not work with entities with lazy properties (no-proxy) + * [NH-2584] - An entity with a lazy property cannot be saved in new session + * [NH-2603] - lazy="extra" return different count than initialized collection. + * [NH-2604] - Problem with MSTest and Relinq (possibly due to ILMerge) + * [NH-2607] - Proxifier should not try to proxy sealed and non public methods + * [NH-2610] - ISQLExceptionConverter doesn't work with MultiCriteria and MultiQuery + * [NH-2622] - Proxying fails for methods with out and ref arguments + * [NH-2626] - LinqExtensionMethods.Query implements wrong NhQueryable + * [NH-2627] - Cloning subcriteria loses WithClause + * [NH-2628] - Fails to create proxy for class with method that has argument "ref of Dictionary" + * [NH-2632] - Lazy Properties Causing An Exception If Containing Class Is Set To Not Lazy + * [NH-2633] - MapperByCode don't Register Component + +** Improvement + * [NH-1513] - MultiCriteria, MultiQuery improvements + * [NH-2382] - HQL, Criteria, QueryOver need Set methods for all NHibernate types + * [NH-2418] - Dialect.IsQuoted fails on empty name + * [NH-2495] - Support ISqlQuery in MultiQuery + * [NH-2518] - disable/truncate SQL parameter logging of BLOBs + * [NH-2526] - Sybase ASE 15 support + * [NH-2530] - Include WHERE clause in error message if we aren't able to locate a 'High' value + * [NH-2531] - NHibernate.Impl.CriteriaImpl.cs: Fix for possible ArgumentNullException in sub-criteria alias handling + * [NH-2550] - Allow public access to FieldInterceptor Session + * [NH-2563] - Support calls to ToString() in Linq queries + * [NH-2570] - Full SQLite Support + * [NH-2573] - Ability to retrieve longest registered type for a specified DbType + * [NH-2580] - "Unable to locate persister" exception message should be more helpful + * [NH-2586] - Default ProxyFactory + * [NH-2592] - Add ICriteria functionality missing in QueryOver + * [NH-2593] - Default common values per dialect + * [NH-2601] - Remove Dialect.HasAlterTable + * [NH-2605] - Refactorize MultiQuery/MultiCriteria implementation to delegate responsibility to IDrive + * [NH-2612] - Move the lambda con to the same namespace than Configuration + * [NH-2630] - Truncate SQL parameter logging of very long strings + +** New Feature + * [NH-2015] - Implement Hibernate's Order.IgnoreCase() + * [NH-2426] - postgresql schema metadata + * [NH-2591] - Insert ordering + * [NH-2602] - Mapping node in collection, subclass, join and so on + * [NH-2635] - Mapping by code + +** Patch + * [NH-2548] - HQL Select Clause Parameters + * [NH-2590] - Missed registration of Concat function for SQLCE4 + * [NH-2600] - Increase visibility of components in AbstractPersistentCollection + +** Task + * [NH-2561] - Consider current_timestamp semantics + * [NH-2575] - Update documentation for immutable classes + * [NH-2608] - Integrate Remotion 1.13.100 to fix duplicate mscorlib problem + * [NH-2636] - Expose ExpressionTreeVisitor Members + +Build 3.1.0.GA (rev5425) +============================= + +** Known BREAKING CHANGES from NH3.0.0.GA to NH3.1.0.GA + + ##### Design time ##### + * [NH-2481] - Deprecated: ISession.SaveOrUpdateCopy methods - use ISession.Merge methods instead + + ##### Run time ##### + * [NH-2481] - An exception will now be thrown when an entity references a transient entity and cascade="merge|all" is not configured on the association + + ##### Possible Breaking Changes ##### + * [NH-2461] - Signature change for IQuery.SetParameterList + * [NH-2556] - NH is too tolerante to incorrect naming when access="field.XXX" is used + +** Sub-task + * [NH-2525] - Wrong parameter used for limit claues in MySQL + +** Bug + * [NH-1985] - NHibernate is allowing deletion of immutable objects + * [NH-2037] - Reattaching an entity with many-to-one inside a natural-id + * [NH-2130] - Reporting query containing sum crashes when there are no rows + * [NH-2179] - String constants are not useable in Linq query projection + * [NH-2203] - problem with orderby in linq query + * [NH-2280] - LINQ Query on Composite key creates invalid SQL + * [NH-2311] - .Any() extension method does not work in most cases + * [NH-2362] - GroupBy with multiple fields fails with exception + * [NH-2375] - OfType with a where clause fails with a NotSupportedException + * [NH-2381] - Fetch clause fails with a NotSupportedException + * [NH-2386] - Unecessary update / invalid SQL generated when collection updated with a versioned (generated) parent entity + * [NH-2400] - Linq query fail when using contains from an empty Collection + * [NH-2407] - Linq provider doesn't support enums in VB.NET + * [NH-2412] - OrderBy generates an inner join instead a left join + * [NH-2433] - When using extensions methods with generic parameters the provider uses the first use even if the generic parameter is different. + * [NH-2441] - Logical bool values are not mapped properly (query execution returns incorrect result with SQLite) + * [NH-2443] - Error compiling NH with ShowBuildMenu.bat -> Cannot run Tests + * [NH-2450] - Multi Query in MySQL no longer working in 3.0 (was in 2.1) + * [NH-2459] - LINQ provider query plan cache issue with use of type check expression .Where(o=>o is SomeType) + * [NH-2460] - version generator is not working with DateTime2 data type. + * [NH-2464] - NHibernate DLLs not built with optimization in 'release' mode. + * [NH-2467] - Futures in 3.0.0.GA go bananas when using PostgreSQL + * [NH-2470] - PersistentIdentifierBag not creating snapshot correctly for new collections. + * [NH-2482] - SerializationException when writing object to viewstate + * [NH-2484] - Regression - Binary Blob SerializationException - MSSQL 2k8 / varbinary(max) + * [NH-2499] - Case statement does not handle multiple when clauses + * [NH-2501] - Case statement does not allow a parameter in the first then clause + * [NH-2503] - HQL subselect with addition fails + * [NH-2507] - LINQ queries tha compare enumeration values with /checked+ compiler option throw NotSupportedException + * [NH-2512] - QueryOver with Where clause and Take crashes + * [NH-2524] - Linq converts enums to integers prematurely + * [NH-2529] - Linq on Informix using take gives an exception + * [NH-2536] - Second call to OfType don't change the query + * [NH-2543] - IQueryOver support is not implemented for IStatelessSession + * [NH-2549] - Disposing an Stateless Session that has already been closed causes a SessionException + * [NH-2555] - Linq with Contains doesn't work with read only collections + * [NH-2556] - NH is too tolerante to incorrect naming when access="field.XXX" is used + +** Improvement + * [NH-1342] - Very slow inserts for large BLOB + * [NH-2023] - Batch operations - introduce SetBatchSize for IStatelessSession + * [NH-2098] - Support for transaction isolation levels in stateless sessions. + * [NH-2211] - Stateless Session Linq Support + * [NH-2228] - Cascading StaleStateException doesn't show which Entity caused the problem + * [NH-2425] - Cache the XmlSerializer for HbmMapping class + * [NH-2449] - Add IStatelessSession.BeginTransaction(IsolationLevel) Method + * [NH-2454] - Add auto-quote settings to main documentation + * [NH-2455] - Centralization of proxy check to IProxyFactoryFactory (better support for static proxy) + * [NH-2457] - Ability to use DetachedCriteria from stateless session + * [NH-2461] - Allow parameter list as ienumerable and simplify IQuery + * [NH-2471] - ShowBuildMenu.bat and Windows XP + * [NH-2481] - Merge can fail when there is a transient entity reachable by multiple paths and at least one path does not cascade on merge + * [NH-2502] - Fetch/Cacheable Should be Allowed to be Called Anywhere + * [NH-2508] - Deprecate the ISession.SaveAndUpdateCopy API + * [NH-2522] - ILMerge Antlr and ReLinq + * [NH-2537] - Implement camelcase-m-underscore naming strategy + * [NH-2557] - Improves log message, of CustomType not serializable, by adding additional data + +** New Feature + * [NH-908] - Implement read-only entities + * [NH-2410] - Port from Hibernate + +** Patch + * [NH-2153] - Unused parameter in SetCommandTimeout method in DriverBase + * [NH-2172] - Unrecognised method call in expression when using QueryOver queries in VB.Net + * [NH-2445] - Add IStatelessSession.IsOpen and IStatelessSession.IsConnected + * [NH-2473] - EntityName + inheritance doesn't work + * [NH-2474] - Xsd for on subclass missing + * [NH-2478] - Docs for + * [NH-2513] - SetMaxResults issue with DB2400Dialect + +** Task + * [NH-2506] - Fix first example of ternary association in documentation + * [NH-2541] - Upgrade ReLinq to 1.13.93 + +Build 3.0.0.GA (rev5290) +============================= +** Known BREAKING CHANGES from NH2.1.1.GA to NH3.0.0.GA + + ##### Design time ##### + * [NH-2392] - ICompositeUserType.NullSafeSet method signature changed + + ##### Run time ##### + * [NH-2199] - null values in maps/dictionaries are no longer silenty ignored/deleted + * [NH-1894] - SybaseAnywhereDialect has been removed, and replaced with SybaseASA9Dialect. + - Sybase Adaptive Server Enterprise (ASE) dialects removed. + + ##### Possible Breaking Changes ##### + * [NH-2251] - Signature change for GetLimitString in Dialect + * [NH-2284] - Obsolete members removed + * Related to [NH-2358]: DateTimeOffset type now works as a DateTimeOffset instead a "surrogate" of DateTime + +** Bug + * [NH-2222] - Wrong type for constant/parameter value used + * [NH-2234] - Query on Property mapped with IUserType + * [NH-2244] - Linq provider does not has full supporting of components in queries. + * [NH-2370] - NHibernate.Linq simple where clause results in a table scan. + * [NH-2394] - Comparing an enum (stored as a string with a user type) to an enum literal fails + * [NH-2398] - Null equality uses non-boolean expression + * [NH-2402] - LINQ equality should map to SQL equality + * [NH-2403] - Linq boolean constants are of wrong type (integer) + * [NH-2409] - Using WithClause in Criteria API causes NH to mix up query parameters + * [NH-2416] - NHibernate.Linq does not support queries against elements + * [NH-2417] - NHibernate fails to correctly load a child collection if the parent contains a many-to-one + * [NH-2420] - Cannot use distributed transactions while providing connection to the session + * [NH-2438] - LINQ 'in' query not fully interpreted + +** Improvement + * [NH-2423] - NHibernate.Linq queries against Dictionaries with ContainsKey + + +** Patch + * [NH-2413] - Micro optimization in DefaultFlushEntityEventListener + * [NH-2437] - Typo + +Build 3.0.0.CR1 (rev5265) +============================= + +** Bug + * [NH-1897] - boolean discriminator formulas broken on PostgreSQL + * [NH-2154] - Booleans may not be used in expression HQL in PostgreSQLDialect + +** Patch + * [NH-2392] - ICompositeUserType support for cases where not all parameters should be set (such as dynamic-update) + +Build 3.0.0.Beta2 (rev5254) +============================= + +** Bug + * [NH-1155] - SubselectFetch doesn't take into account paging + * [NH-2371] - Exception is thrown when using SetMaxResults on query using MySQL + * [NH-2374] - ForeignGenerator does not support EntityMode.Map + +** Improvement + * [NH-1799] - Change SQL Server dialect to support variable limits + * [NH-2376] - Allow IDisposable for event-listeners + +** Patch + * [NH-2342] - Added XDocument type + * [NH-2378] - Don't currently support idents of type Int16 + * [NH-2391] - Updated Chapter 4 + +Build 3.0.0.Beta1 (rev5241) +============================= + +** Bug + * [NH-2001] - Filter by Null in Linq (hql ast version) doesn't work + * [NH-2077] - SQL Server Dialect: Nhibernate fails to execute native queries with parameters, separated with ';' + * [NH-2084] - Future + hql queries + same parameter name leads to "NHibernate.QueryException: The named parameter personId was used in more than one query. Either give unique names to your parameters, or use the multi query SetParameter() methods" + * [NH-2331] - ICriteria: Correlated query throws "Could not find a matching criteria info provider to", works in 2.1.0 broken in 2.1.2 + * [NH-2352] - Null reference exception in GetDefaultConfigurationFilePath when AppDomain.CurrentDomain.RelativeSearchPath is null + * [NH-2358] - DateTimeOffsetType doesnt properly convert to-from database; milliseconds are lost. + * [NH-2364] - Dynamic entities with "full name" result in incorrect queries + +** Improvement + * [NH-1108] - Reference Data - Ability to load all rows from a table using an HBM file. + * [NH-2313] - Better logging when SessionFactory is being built + * [NH-2355] - Allow composite-id without class on dynamic entity + +** New Feature + * [NH-2309] - Add support for Future() with the new Linq provider + * [NH-2367] - Native support for System.Uri as string + +** Patch + * [NH-2073] - Missing QuerySequencesString override in FirebirdDialect + * [NH-2082] - AdoTransaction sometimes writes to log wrong information about IsolationLevel + * [NH-2357] - Support for custom boolean functions in the linq provider (as FREETEXT). + + +Build 3.0.0.Alpha3 (rev5226) +============================= + +** Bug + * [NH-1927] - Criteria generates wrong sql when eager fetching one-to-many with filter + * [NH-1928] - SQL line comments swallow next line + * [NH-2024] - Max results parameter could not provided to subquery + * [NH-2061] - Merge operation causes null exception for null components that contain many-to-many relations + * [NH-2096] - IndexOutOfRangeException reading zero-length binary value from MySQL + * [NH-2112] - Update executed on the DB during a Session.Merge of an unmodified entity + * [NH-2138] - Entity name support in custom SQL is broken: sql-query/return/@entity-name attribute is ignored + * [NH-2147] - default_batch_fetch_size has no effect + * [NH-2188] - Exception occurs when configuration searches default config file and multiple search path were defined for current AppDomain. + * [NH-2202] - Unable to use ICriteria with projection property that references a composite key relationship + * [NH-2258] - Paging params in subquery breaks query execution. + * [NH-2265] - Any linq query using oracle fails when restricting the number of results returned + * [NH-2270] - NHibernatethrows MappingException on Linux/Mono 2.7 + * [NH-2279] - PersistentIdentifierBag fails to maintain ID map in many cases + * [NH-2288] - The drop scripts from SchemaExport in SQL2005 dialect will not work for constraints when using DefaultSchema setting other than dbo + * [NH-2289] - Linq query fail when using contains from ICollection or IList + * [NH-2302] - MsSql Dialect, mapping an nvarchar(max) using string(10000) causes string truncation + * [NH-2303] - Regression bug: hibernate-mapping/subclass element can no longer extend hibernate-mapping/class//subclass element + * [NH-2322] - Performing updates in OnPostUpdate event causes enumeration error + * [NH-2339] - After rev 5139 (apply NH-2335) NHibernate does not work under Medium Trust + * [NH-2343] - NHibernate.Type.GenericBagType.Wrap() incorrectly assumes collection implements IList + * [NH-2344] - Coalesce expression does not work on linq provider + +** Improvement + * [NH-626] - Adding XmlDoc to NH types + * [NH-1618] - Lazy loading for one-to-one association + * [NH-1894] - New SQL Anywhere NHibernate dialect + * [NH-2135] - Compatible with Mono + * [NH-2292] - Set Initialize in AbstractLazyInitializer as virtual + * [NH-2301] - Castle Bytecode with last released 2.5 + * [NH-2321] - Recommended method for xml intellisense + * [NH-2340] - Workaround, for some DataProviders, in AbstractCharType for char? + +** New Feature + * [NH-866] - SQL Server 2005 XML Support + * [NH-2348] - Support polymorphism with Get and Load + +** Patch + * [NH-2006] - Additional test to use-many-to-one + * [NH-2111] - PersistentIdentifierBag has null reference exception when accessing SyncRoot on lazy loaded collection + * [NH-2278] - PersistentGenericIdentifierBag instantiates wrong list type + * [NH-2284] - Obsolete members can be removed + * [NH-2293] - When query has only a "from" throw QuerySyntaxException instead of InvalidCastException + * [NH-2307] - Fix ByteCode Framework Targets + * [NH-2332] - Update SybaseAnywhereMetaData.cs to support fetching the reserved words + * [NH-2335] - ReflectiveHttpContext support for different .NET versions + * [NH-2336] - Leading and trailing ansi trim emulation functions are reversed + * [NH-2346] - Dialect.TableTypeString is not used when creating schema. + +** Task + * [NH-2161] - Breaking change in naming strategy from 2.0 to 2.1 + * [NH-2315] - Spring version does not match antlr version + * [NH-2338] - Upgrade to Castle.Core 2.5.1 + +Build 3.0.0.Alpha2 (rev5159) +============================= + +** Bug + * [NH-1653] - SubqueryExpression don't support Dialect with VariableLimit + * [NH-1836] - AliasToBean transformer doesn't work correctly with MultiQuery + * [NH-2133] - Incorrect number of command parameters + * [NH-2148] - Not possible to call methods on Proxy for lazy-property + * [NH-2149] - CAST() statements fail in MySql due to invalid type parameters + * [NH-2158] - NVL Sql Function is broken + * [NH-2160] - MSSql DateTime2 type is not supported when preparing + * [NH-2162] - Formulas containing a DateTime data type incorrectly have that data type aliased with the outer entity alias + * [NH-2224] - SQLite 'In'-Restriction with year function + * [NH-2245] - AbstractEntityPersister ignores optimistic-lock when generating delete SQL on versioned objects + * [NH-2251] - System.FormatException mixing Future and Skip/Take + * [NH-2253] - SchemaExport/SchemaUpdate should take in account hbm2ddl.keywords + * [NH-2257] - Parameter ordering not working when driver does not support Named Parameters + * [NH-2261] - Linq Count function fails with MySQL Dialect + * [NH-2273] - SqlClientBatchingBatcher doesn't set timeout on batches after the first + * [NH-2277] - NHibernate.Linq - Eager Fetching Superclass Collection Throws NullReferenceException. + +** Improvement + * [NH-1378] - New Drivers using ADO.NET's DbProviderFactories + * [NH-1421] - Better exception message for Invalid handling of empty parameter lists + * [NH-2103] - Expose hbm mappings + * [NH-2117] - many-to-one mapping with composite-id formula fails + * [NH-2191] - Make a method FilterFragment of class AbstractEntityPersister a virtual + * [NH-2217] - LinFu version 1.0.3 used is not thread-safe. (new LinFu1.0.4 available) + * [NH-2220] - Support temporary tables within SQLite Dialect + * [NH-2226] - Set custom bytecode provider type in app.config + * [NH-2263] - Client Profile Support + * [NH-2266] - better exception if no concrete subclasses exist + * [NH-2267] - Prepared statements should be enabled for PostgreSQL + * [NH-2268] - Substring and Replace functions for PostgreSQLDialect + * [NH-2287] - Wrong HQL should throws QuerySyntaxException + +** New Feature + * [NH-1135] - Local & Utc DateTime Type + * [NH-1554] - Logging Abstraction + * [NH-1946] - Criteria API support for HQL 'with' clause + * [NH-2256] - Add support for user-provided extensions to the Linq provider + * [NH-2259] - Add a way to reset the Any cached type + +** Patch + * [NH-2026] - Fix: SchemaExport fails with foreign key constraints on Informix + * [NH-2120] - CsharpSqlite managed/embedded SQL database driver + * [NH-2142] - Register function Concat fo MySql to avoid null problem + * [NH-2190] - Criteria Join Restrictions Support (HHH-2308 Port) + * [NH-2252] - Added paging support for SQL CE 4 + * [NH-2255] - MsSql2005Dialect resets parameters' positions(for paging parameters) when lock in use. + +Build 3.0.0.Alpha1 (rev5056) +============================= + +** Sub-task + * [NH-2045] - NH 2044 Fixed + +** Bug + * [NH-892] - associated by property-ref generates wrong SQL + * [NH-1849] - Using custom sql function "contains" causes an Antlr exception + * [NH-1891] - Formula - Escape characters break formula + * [NH-1899] - SaveOrUpdateCopy throws InvalidCastException + * [NH-1902] - QBE don't set the '%' wildcards when using an other matchmode than Matchmode.Exact + * [NH-1975] - QueryOver() on char Property yields exception + * [NH-1981] - Multiple SQL parameters generated for same HQL parameter + * [NH-1989] - Future query does not use second level cache + * [NH-2009] - Many-to-one fails when using property-ref against a joined property + * [NH-2020] - ISQLExceptionConverter does not get called if batch size enabled + * [NH-2027] - NH sql-query does not support calling Stored Procedures in Packages + * [NH-2030] - NHibernate.SqlTypes.SqlTypeFactory is not threadsafe + * [NH-2035] - Wrong error "ORDER BY items must appear in the select list if SELECT DISTINCT is specified." + * [NH-2044] - NHibernate.Criterion.Expression.Eq with chartype has a bug + * [NH-2047] - OracleDataClientBatchingBatcher writes misleading log messages in a different format than SqlClientBatchingBatcher + * [NH-2052] - CLONE -Getting identifier on a proxied class initializes it when identifier is defined in parent class + * [NH-2064] - Filter definitions should not be mandatory to be used + * [NH-2069] - When touching the identifier of a proxy object a call to the database is executed. + * [NH-2074] - SQL Server Dialect: unicode literals in formula results in incorrect SQL + * [NH-2086] - MsSqlCeDialect fails when mapping contains schemas + * [NH-2090] - ShemaValidator + Firebird + * [NH-2092] - Constrained lazy loaded one to one relations using Castle DynamicProxy throws ArgumentNullException + * [NH-2093] - When using Castle:s FieldInterceptionProxy, NHibernateProxyHelper.GuessClass() cannot guess the correct entity type. + * [NH-2094] - When using Castle:s FieldInterceptorProxy, accessing an initialized property (even nonlazy) throws LazyInitializationException + * [NH-2102] - Entity with constrained, lazy one-to-one relation should not generate field intercepting proxy + * [NH-2113] - NH force eager loading of key-many-to-one entity with overriden GetHashCode + * [NH-2122] - Nhibernate documentation refers to CriteriaUtil whitch is removed from 2.1 + * [NH-2129] - FutureValue Parameters Missing Quotes + * [NH-2137] - list-index with one-to-many does not work + * [NH-2155] - NHibernate project files contain reference to missing AssemblyInfo.cs file + * [NH-2166] - Custom ISQLExceptionConverter is not called in the case when using query.UniqueResult() + * [NH-2168] - Statistics.QueryExecutionMaxTimeQueryString is empty + * [NH-2173] - SetMaxResults fails when Dialect has BindLimitParametersFirst == true + * [NH-2175] - Cannot Cache NHibernate Future Criteria Results + * [NH-2189] - Fetch Join Not Consistently Working With Future + * [NH-2192] - Thread safety issue with QueryParameters.PrepareParameterTypes + * [NH-2199] - Map with element doesn't support nullable types + * [NH-2205] - NHibernate.Loader.Loader.DoQuery can hide exceptions + * [NH-2210] - Problem with merging detached entities with components + * [NH-2219] - HQL Update of multiple columns only updates the first column + * [NH-2221] - The tuplizer value specified for a component within a HBM file is ignored + * [NH-2225] - New Embedded LINQ Provider & Bitwise Queries + * [NH-2235] - IQueryOver.SelectList uses sub-type type instead of root type + * [NH-2242] - Formula - Escape characters break formula + +** Improvement + * [NH-1248] - Check if result of Subquery is null with Criteria API + * [NH-1838] - Guid support in MySql dialect + * [NH-1850] - NHibernate should log query duration + * [NH-1862] - Strongly typed configuration of SessionFactory properties + * [NH-1877] - Support for Projections.GroupBy(IProjection projection) + * [NH-1892] - Programatic configuration of Cache + * [NH-1935] - Add new WcfSessionContext to the already available ICurrentSessionContext implementations + * [NH-2021] - Exceptions serialization + * [NH-2055] - hbm2ddl SchemaExport support batching (GO in ddl) + * [NH-2065] - provide better exception details + * [NH-2083] - Undocumented attributes on hibernate-mapping element + * [NH-2150] - CreateCriteria / QueryOver inconsistency + * [NH-2186] - Allow MultiCriteria to directly add IQueryOver + * [NH-2215] - MsSql2005Dialect does not use parameters for paging parameters + * [NH-2216] - EnumType as IType + * [NH-2230] - tag does not allow any accessor + * [NH-2249] - DateType as IParameterizedType to customize the BaseDateValue for null + +** New Feature + * [NH-429] - Lazy load columns + * [NH-1922] - Allow DetachedCriteria To Work with IStatelessSession + * [NH-1978] - Add ability to delimit aliases in generated SQL + * [NH-2152] - QueryOver equality to null should generate (x is null or x == value) + +** Patch + * [NH-2031] - Mod function in SqlDialect is broken + * [NH-2041] - SchemaExport does not export Components in Joined tables properly + * [NH-2046] - Release builds do not include PDB files + * [NH-2101] - Missing IsNotIn for WhereRestrictionOn + * [NH-2106] - DetachedCriteria.SetLockMode() is missing + * [NH-2131] - SessionIdLoggingContext perf patch + * [NH-2169] - ToUpper and ToLower functions are inverted in the new Linq provider + * [NH-2194] - NHibernate.Util.PropertiesHelper class throwing FormatException when property values are in-compatible with the expected type + * [NH-2201] - NDataReader doesn't reset the currentrow index when a move to NextResult is executed + * [NH-2227] - Missing [Serializable] attribute on ReadOnlyAccessor + * [NH-2236] - GetSequenceNextValString for Informix is wrong + * [NH-2243] - 'foreign-key' ignored in join/key + +** Task + * [NH-2013] - HQL breaking change + * [NH-2247] - Update FlushMode Documentation + +Build 2.1.2.GA (rev4854) +============================= +** Bug + * [NH-2011] - Many-to-many inside a component will not be saved when using SaveOrUpdateCopy or Merge + * [NH-2283] - CLONE -one-to-many collection with table per subclass, using discriminator: wrong proxies in collection + +** Improvement + * [NH-2022] - Allow overriding in Query By Example + +** Patch + * [NH-2007] - SesssionIdLoggingContext patch for big resultsets + * [NH-2019] - Clarification about the use of for polymorphic queries + +Build 2.1.1.GA (rev4814) +============================= + +** Sub-task + * [NH-1368] - Check same behavior for other persistent collection. + +** Bug + * [NH-1255] - key-many-to-one && not-found + * [NH-1476] - filtering by key-many-to-one causes invalid sql + * [NH-1760] - Missing table join when use a criteria on key-many-to-one part of a Composite Id + * [NH-1785] - Invalid SQL generated for join on composite id using Criteria API + * [NH-1858] - Problem with MsSql2000 and 2005 Dialects GetLimitString when using use_sql_comments=true + * [NH-1895] - delete-orphan mapping, NullReferenceException in DefaultDeleteEventListener.DeleteTransientEntity + * [NH-1898] - HQL query parser can't determine parameter type when using native sql function in hql query. + * [NH-1899] - SaveOrUpdateCopy throws InvalidCastException + * [NH-1902] - QBE don't set the '%' wildcards when using an other matchmode than Matchmode.Exact + * [NH-1904] - Protected properties and public properties cannot have the same name with different case + * [NH-1905] - Join used together with subquery generates wrong SQL + * [NH-1907] - IQuery.SetParameter should use DetermineType + * [NH-1908] - Mishandling of filter parameters causes System.InvalidCastException + * [NH-1911] - Aggregate parameters in projection are not substituted + * [NH-1913] - AdoNet batcher not using CommandTimeout + * [NH-1914] - Collections with out native ID generation is not working + * [NH-1915] - CLONE -HQL AST-Parser: Null-Pointer Exception on Non-Exsistant Entity on Joins + * [NH-1917] - Not retrieving AUTO_INCREMENT identifier on MySQL because of connection closing + * [NH-1920] - Session Filters + collection + parametrized query = bug + * [NH-1926] - Oracle: Schema update crashes + * [NH-1931] - NativeSQLQuerySpecification.Equals compares collections by reference + * [NH-1938] - No 'lower' call in sql-query in LikeExpression with 'ignorecae' = true + * [NH-1939] - Missing element in NHibernate mapping schema. + * [NH-1941] - Custom Enum-String mapping is not written to SQL statement + * [NH-1948] - Hibernate mapping file does not allow a value of 0 for the "scale" attribute of the "property" element + * [NH-1959] - Adding/Removing items to idbag in one transaction causes KeyNotFoundException + * [NH-1963] - System.InvalidCastException on cacheable query with byte array query parameter + * [NH-1964] - Byte array truncation to a length of 8000 + * [NH-1969] - Criteria API does not handle property of type "System.Type" correctly + * [NH-1973] - DateTime sent to dataase is not accurate to millisecond + * [NH-1979] - cast and parameter combination in HQL fails to parse + * [NH-1983] - Blobs and Clobs with Sql Server CE + * [NH-1985] - NHibernate is allowing deletion of immutable objects + * [NH-1987] - MultiQuery does not update statistics + * [NH-1990] - Subquery filter parameters are not set as variables in SQL + * [NH-1992] - BasicFormatter throws exceptions for certain types of data + * [NH-1997] - Original exception information lost when error occurs NHibernate.Engine.TransactionHelper.Work.DoWork + * [NH-2000] - Problem when calling ISession.GetEnableFIilter with a not enabled filter name + * [NH-2003] - IsNullable property is not set properly in ClassIdBinder.cs + +** Improvement + * [NH-847] - Oracle stored procedure with Ref Cursor out + * [NH-1525] - IResultTransformer should override Equals and GetHashCode + * [NH-1912] - Add decimal types to MySQL dialect. + * [NH-1943] - Fix introduction in docs so it won't mention VS 2003 + * [NH-1980] - Ignore exception when trying to set the same type of CollectionTypeFactory + +** New Feature + * [NH-1922] - Allow DetachedCriteria To Work with IStatelessSession + * [NH-1936] - Introduce new Interface IPostEvent in NHibernate.Event + * [NH-1998] - Possibility to turn off many-to-one filters + +** Patch + * [NH-1903] - GetEnumerator().Current inconsistent for generic + * [NH-1970] - SQLite dialect - Fix to substring function + * [NH-1993] - Patch for a bug in MySQLMetaData.cs + +Build 2.1.0 +======================== +** Known BREAKING CHANGES from NH2.0.xGA to NH2.1.0 + ##### Run time ##### + * If you want work using lazy loading with LinFu.DynamicProxy now you must deploy NHibernate.ByteCode.LinFu.dll + * If you want work using lazy loading with Castle.DynamicProxy2 now you must deploy NHibernate.ByteCode.Castle.dll + * If you want work using lazy loading with Spring.Aop now you must deploy NHibernate.ByteCode.Spring.dll + * compatible only with .NET2.0 SP1 or above (System.DateTimeOffset) + * In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true) + * Antlr3.Runtime.dll is required + * the syntax foo.bar.baz.elements or foo.bar.baz.indices is not longer supported. Use the alternative syntax of elements(foo.bar.baz) or indices(foo.bar.baz) instead + Note: in some case, where a sub-select is needed, the collection is enough example: FROM m IN CLASS Master WHERE NOT EXISTS( FROM m.Details d WHERE NOT d.I=5 ) + * INamingStrategy.PropertyToColumnName does not include the component property path + + ##### Possible Breaking Changes ##### + * ISession interface has additional methods + * ICriteria.SetProjection now takes a params array of projections, instead of a single projection + Only a breaking change if you are implementing ICriteria, there is full source code compatability + * IStatelessSession interface has additional methods + * DefaultProxyFactoryFactory removed + * IProxyFactoryFactory now provide the IProxyValidator implementation + * Now filters are working even with many-to-one association for Criteria and HQL (NH-1293, NH-1179) + + ##### Initialization time ##### + * The ProxyValidator check for "internal virtual" (to be intercepted by proxy need "protected internal virtual") + * The session-factory configuration property "proxyfactory.factory_class" is mandatory; You must choose one of the availables NHibernate.ByteCode + + ##### Breaking Changes ##### + * see NH-1633 if you are using SQL native queries + * CriteriaUtil is gone. NHibernate.Transform.Transformers now returns predefined IResultTransformer. + * ISessionFactory.Settings is gone (moved to ISessionFactoryImplementor.Settings) + * Obsolete ORACLE dialects was removed (new implementations are available) + * ISQLExceptionConverter was changed in order to have more flexibility about information available for the conversion and followed management. + * ADOException now use string instead SqlString + * IParameterizedType is using IDictionary + +Build 2.1.0.Beta2 (rev4501) +============================= +** Sub-task + * [NH-1827] - SchemaUpdate exception + * [NH-1843] - Precision and scale for MySQL is not working, too + +** Bug + * [NH-1734] - NHibernate aggregate function sum() to return Int64 instead of floating point value + * [NH-1810] - Use of custom sorted set leads to "collection not processed by flush" exception + * [NH-1812] - Aggregates + IsNull bug (AST parser) + * [NH-1821] - Wrong SQL executed when the SQL contains new lines + * [NH-1822] - CLONE -NHibernate.Util.TypeNameParser doesn't parse correctly generic types + * [NH-1830] - Missing MatchMode Parameter + * [NH-1831] - AST Parser & Bitwise queries + * [NH-1834] - Formula node in Many-To-One is ignored + * [NH-1835] - prepare_sql = true (creating prepared queries) makes NHibernate set up wrong size for byte arrays larger than 8000 + * [NH-1837] - UniqueResult() executes sql query twice. + +** Improvement + * [NH-473] - order-by in is ignored if FetchMode is Join + * [NH-1069] - Add context information to LazyInitializationException. + * [NH-1097] - Should not parse column names, and consider them as failing HQL queries + * [NH-1192] - Support bitwise operations + * [NH-1266] - ISQLExceptionConverter for various Dialects + * [NH-1672] - Unnecessary calls to planCache.Put + * [NH-1820] - PostgreSQL: support for Temporary Tables + * [NH-1824] - MySQL: support for Temporary Tables + * [NH-1826] - PostgreSQL: support iff() function + * [NH-1833] - OverflowException instead of expected FormatException when trying to parse a "long" literal + * [NH-1846] - DbTimestampType (from H3.3.1) + +** New Feature + * [NH-1623] - Configuration of UserCollection for any collection type + * [NH-1817] - Allow for Id generator class + +** Patch + * [NH-1829] - AbstractEntityPersister.Delete is not virtual + * [NH-1842] - Type.CharBooleanType.ctor(SqlType) is internal for no reason. Making it protected supports better extensibility. + + +Build 2.1.0.Beta1 (rev4424) +============================= +** Bug + * [NH-959] - HQL queries with math operators and aggregates fail + * [NH-1092] - An Aggregate Count(*) on on an Abstract Base Class (Polymorphic) with UniqueResults returns 1 result per subclass when using the table per subclass approach + * [NH-1171] - Named parameters in SQL query are not substituted when query contains comments with apostrophes + * [NH-1182] - Calling session.delete() causes unnecessary update to timestamp before sql:delete + * [NH-1400] - HQL string literals with dots in are tried loaded as types (classes) and fails + * [NH-1427] - XML Comments inside tag cause exception + * [NH-1444] - broken implicit join + * [NH-1487] - schema generation of unique-key with column involved in multiple unique constraints + * [NH-1507] - NHibernate misplaces JOIN conditions when WHERE references their columns and others altoghether + * [NH-1517] - SaveOrUpdateCopy does not call "public LifecycleVeto OnUpdate(ISession s)" + * [NH-1601] - Problems when accessing lists through property + * [NH-1617] - Formulas containing a data type incorrectly have that data type aliased with the outer entity alias + * [NH-1735] - TicksType used as entity version causes exceptions on cache put operation. + * [NH-1789] - A proxy sometimes doesn't call the overriden Equals() method (mapping interface instead class) + * [NH-1801] - Cross join with a where clause where lhs and rhs are different types of associations breaks with the new AST Query Translator + * [NH-1802] - Query Cache does not include filters in QueryKey.ToString + * [NH-1805] - Does ignore on + * [NH-1813] - Not understandable exception message + +** Improvement + * [NH-1019] - Improve error message for HQL in when entity not recognised + * [NH-1814] - Autoregister ReservedWords from MetaData + +** New Feature + * [NH-188] - Should Table/Column names be quoted automatically? + +** Patch + * [NH-1044] - IdBag for component not in XSD + * [NH-1804] - Expiration property of session factory not handled when configured via XML + +Build 2.1.0.Alpha3 (rev4378) +============================= + +** Bug + * [NH-1098] - Problem in filters with parameters and associated logging information + * [NH-1179] - Filter not applied in explicit join + * [NH-1264] - Eager fetching with Criteria/DetachedCriteria does not seem to be working properly + * [NH-1307] - Parameter Postion incorrect in the sql query . + * [NH-1343] - In HQL, when having only one Class for query it fails to work if we forget the Alias. + * [NH-1388] - Map does not delete keys if value of the key is null + * [NH-1574] - Stateless Session isn't ignoring untouched proxy properties on update + * [NH-1725] - When using SELECT NEW (iif(a=0, 2, 1)) From .... Returns error '(' expected after HQL function in SELECT + * [NH-1727] - Hql parameter problems (Sql2005dialect) + * [NH-1736] - NHibernate.Util.TypeNameParser doesn't parse correctly generic types + * [NH-1741] - DetachedNamedQuery is ignoring mapped properties + * [NH-1742] - Wrong parameters order in IQuery with SetParameterList and Filter. SQL Server 2005 and SQL Server 2000 + * [NH-1744] - Open/Close a session inside a TransactionScope fails. + * [NH-1751] - DistinctRootEntityResultTransformer assumes source ILists are always ArrayLists + * [NH-1754] - cast HQLFunction don't cast the result + * [NH-1756] - Updating newly saved entity with generated version causes StaleObjectStateException (explicit flush before commit) + * [NH-1764] - TableHiLoGenerator fail in a TransactionScope with MySQL database + * [NH-1767] - Multiple TransactionScopes inside one Session do not work properly + * [NH-1770] - Not posible to have system properties in web.config and session-factory properties in external hibernate.cfg.xml + * [NH-1773] - HQL Queries with projection and join fetching fail with AST query translator + * [NH-1775] - AST Parser & Bitwise queries + * [NH-1776] - Query executed twice on session with enabled Filter will cause NullReferenceException + * [NH-1780] - Section 18.4 - Incorrect method name IsUnsaved() + * [NH-1788] - Dynamic Update & generated timestamp cause NH to try to update the readonly timestamp column + * [NH-1792] - Invalid Sql for Paging when Subquery contains Order By clause using MsSql2005Dialect + +** Improvement + * [NH-514] - Allow expansion of the "on" clause in joins. + * [NH-1051] - Port AST-based HQL parser / QueryTranslator from H3 + * [NH-1093] - Invalid caching probably shouldn't throw exceptions, but should log warnings. + * [NH-1516] - HQL doesn't support "update" statements + * [NH-1553] - SQL Server 2005: Support for wrapping snapshot isolation update conflict SQLException into a NHibernate StaleObjectStateException. + * [NH-1670] - MutiCriteria and MultiQuery results may be loaded directly into a generic List instead of an ArrayList + * [NH-1745] - SQL formatters for DDL and all others SQLs + * [NH-1750] - Mark NHibernate.Util.WeakHashtable [Serializable] + * [NH-1765] - Add ISessionImplementor property to PreDeleteEvent + * [NH-1791] - Allow passing params of projections to ICriteria.SetProjectios + * [NH-1794] - Allow query only properties and associations + * [NH-1797] - MsSql2005Dialect uses paging query when no offset specified + +** New Feature + * [NH-322] - case when...then...else...end in select clause + * [NH-917] - Allow NHibernate to enlist in arbitrary IDbTransaction + * [NH-1701] - format_sql property of hibernate + * [NH-1786] - IObjectFactory (implementation responsibility by ByteCode provider) to concentrate all Activator.CreateInstance. + +** Patch + * [NH-1726] - ISessionFactory.Settings gone - breaking change + * [NH-1769] - Transaction completion on rollback with TransactionScope can cause ObjectDisposedException + * [NH-1777] - Removed some duplicated casts + * [NH-1783] - DateType should store only the date part of a System.DateTime to a column + +Build 2.1.0.Alpha2 (rev4167) +======================== + +** Sub-task + * [NH-1688] - System.Boolean type incorrectly mapped to YesNoType when the criterion is created by using a projection instead of a property name + +** Bug + * [NH-1635] - should not require a column + * [NH-1671] - SoftLimitMRUCache has a softReferenceCache which is NOT soft + * [NH-1693] - Wrong parameters order in query with subselect and filter + * [NH-1694] - SQL2005Dialect - Sorting fails on a Formula property containing a comma while using paging (MaxResults) + * [NH-1700] - union-subclass with same name as abstract superclass causes NHibernate.DuplicateMappingException. + * [NH-1706] - property-ref does not work for different data type than PK type + * [NH-1710] - Decimal fields are not create correctly in SQL Server 2005/2008 using SchemaExport + * [NH-1711] - Failure of DTC transaction with multiple durable enlistment will crash the process + * [NH-1715] - Timespan type doesn't work with SqlServer 2005 + +** Improvement + * [NH-1707] - MsSQL : prepare_sql should be true by-default + * [NH-1716] - By default map TimeSpan as int64 + +** New Feature + * [NH-1222] - elements: collections support + * [NH-1718] - CurrencyType + * [NH-1719] - Current TimeSpan moved to TimeAsTimeSpan and TimeSpanInt64 moved back to TimeSpan + +** Patch + * [NH-1708] - MS SQL CE Metadata implementation + * [NH-1712] - Release notes missing info about removal of CriteriaUtil + * [NH-1713] - NH-1707 results in buggy PrepareStatement behavior + +Build 2.1.0.Alpha1 +======================== + +** Sub-task + * [NH-1379] - Allow for version custom type + * [NH-1649] - DateTime2 and DateTimeOffset data types support + * [NH-1650] - FileStream data type support + * [NH-1656] - Date and Time data types support + +** Bug + * [NH-1083] - When using a proxy with an interface access strategy on the Id does not get applied + * [NH-1177] - Save/Delete/Evict/Save does not work if collections are mapped + * [NH-1197] - Some tests related to paged subselect are failing under PostgreSQL + * [NH-1251] - TypeFactory.GetSerializableType race condition + * [NH-1253] - Named paramaters with numeric suffix may cause problems + * [NH-1297] - with native ID generator throws InvalidCastException + * [NH-1329] - Expression.Sql with parameters (inside of functions) is broken + * [NH-1345] - PersistentGenericList.GetEnumerator missing Read + * [NH-1357] - ICriteria.ClearOrders is mispelled and belongs on DetachedCriteria too + * [NH-1358] - SchemaUpdate fails for Firebird in released binaries only - NHibernate source and local builds from this source work fine + * [NH-1385] - System.Collections.Generic.KeyNotFoundException exception in PersistentGenericMap.GetDeletes() + * [NH-1395] - Unsaved value null for ValueType + * [NH-1422] - incorrect parameter replacement when one variable is the prefix of another + * [NH-1443] - default_catalog is not used in create table + * [NH-1445] - CriteriaImpl.Clone does not propertly maintain the persistentClass + * [NH-1446] - cast case sensitivity + * [NH-1447] - boolean ConstantProjection fails with MSSQL2005 + * [NH-1480] - SchemaUpdate & Oracle + * [NH-1495] - using access=field.camelcase with interface to create proxy + * [NH-1499] - NullReferenceException construting Criteria query + * [NH-1502] - Order by with projections uses invalid parameter characters + * [NH-1505] - LikeExpression when using projections is invalid + * [NH-1520] - SQLite Dialect does not properly escape names surrounded by backticks + * [NH-1521] - The drop scripts from SchemaExport in SQL2005 dialect will not work when using DefaultSchema setting other than dbo + * [NH-1522] - AdoTransaction.CloseIfRequerid + * [NH-1526] - Cannot use projection for Count in OrderBy + * [NH-1527] - Using projection on order by in conjuction with set max results with parameters passed to the projection will fail + * [NH-1528] - Using order by with a parameter and set max results on 2005 mix up the parameters + * [NH-1549] - Accessing Id of proxy with base class intializes proxy + * [NH-1552] - Paging in NHibernate builds buggy SQL query string, when paging is used against a MS SQL 2005 Database + * [NH-1556] - Cannot order by aggregates in HQL + * [NH-1572] - Small typo in AbstractType.Compare() + * [NH-1573] - "collable" typo in nhibernate-mapping.xsd + * [NH-1578] - The "not" criteria does surround the following or inner criteria with parens only when using MySQLDialect. + * [NH-1584] - one-to-one compositions to a joined subclass don't load + * [NH-1587] - PocoEntityTuplizer don't use ReflectionOptimizer for instantiator + * [NH-1590] - NHibernate.Util.ReflectHelper.TryGetMethod not returning inherited id-getter/setter + * [NH-1593] - SchemaUpdate not create property index. + * [NH-1594] - When setting property in hbm type="Decimal(precision, scale)" - "DECIMAL(19,5)" is always generated + * [NH-1608] - LRUMap Memory Leak + * [NH-1609] - MSSQL2005 dialect: paged query in multicriteria uses wrong parameter values when preceeded by other queries + * [NH-1611] - One-To-One Mappings Fail with Composite ID + * [NH-1612] - Native SQL queries for value collections fail with NullReferenceException + * [NH-1619] - NHibernateUtil returns a wrong IType for Boolean on Postgres + * [NH-1627] - lazy=extra causes the where=".." to be ignored when using collection.Count() + * [NH-1633] - Native SQL queries with addJoin or return object arrays instead of single Entities + * [NH-1637] - Oracle9Dialect Paging based on rownum is not valid. + * [NH-1640] - FETCH JOIN query doesn't work in a StatelessSession + * [NH-1654] - Reserved words in formula + * [NH-1668] - Ingres .NET Data Provider name changed + * [NH-1675] - Problem using distinct query with SetMaxResult + * [NH-1677] - Bug in Criteria API with EntityMode == Map + * [NH-1679] - System.Boolean type incorrectly mapped to YesNoType when the criterion is created by using a projection instead of a property name + * [NH-1685] - Generated Version Not Reloaded After Update + * [NH-1687] - Version tag are ignoring child column tag + +** Improvement + * [NH-298] - After, deleting an item which belongs to a the list indices are not modified + * [NH-545] - Distributed transactions support + * [NH-645] - Support for scalar functions which don't return a value in where clause + * [NH-727] - Allow using sql-insert with generator class="identity" + * [NH-1047] - Add overloads to IQuery.SetParameter to accept System.Type + * [NH-1053] - Allow short class name for collection-type + * [NH-1202] - Improve the error messages when compiling queries + * [NH-1274] - Give the option to exclude a mapped class from the SchemaExport.Create loop. + * [NH-1291] - Example.Create with anonymous objects + * [NH-1336] - Native id generator as default and make generator optional in config + * [NH-1354] - Add support for keyed retrieval of MultiCriteria results + * [NH-1381] - Add support for keyed retrieval of MultiQuery results + * [NH-1396] - Allow override of EmptyInterceptor.GetEntityName + * [NH-1398] - Allow access to EntityMode from ISession + * [NH-1402] - Support Cache for Dynamic entities (entity-name without entity-class) + * [NH-1468] - InFragment ToFragmentString() needs more information in error + * [NH-1496] - Configuration.AddAssembly(Assembly) should do some logging if no mapping files where found + * [NH-1500] - Spelling error of NHibernate.Cfg.ConfigurationSchema.ParseColectionsCache + * [NH-1515] - Proxy validator doesn't check "internal" methods + * [NH-1560] - AbstractDataBaseSchema: Make GetIndexInfo and GetIndexColumns virtual + * [NH-1564] - Generic EnumString Mapping + * [NH-1588] - "Relax" PocoEntityTuplizer + * [NH-1589] - ReflectionOptimizer override CreateCreateInstanceMethod + * [NH-1605] - Typedef support in sql-query/return-scaler/@type attribute + * [NH-1613] - Allow custom action for schema script create/update + * [NH-1643] - Allow to use ICollection and HashSet for + * [NH-1644] - Oracle Lite Driver With Working Query Parameters + * [NH-1657] - TimeSpan as DbType.Time + * [NH-1658] - current_timestamp_offset: current_timestamp for DateTimeOffset + * [NH-1659] - current_timestamp in MsSql2008Dialect using SYSDATETIME() + * [NH-1661] - DriverConnectionProvider.GetConnection doesn't dispose IDbConnection in case of an exception + * [NH-1665] - Supports Hibernate-Quoting sequence name + * [NH-1669] - Add guid.native support to MySQL5Dialect + * [NH-1678] - Add a CreateCriteria method to session + * [NH-1684] - MS SQL Server Dialect - UNION ALL + * [NH-1686] - IStatelessSession.CreateCriteria(System.Type entityType) + * [NH-1703] - Configuration full serializable + * [NH-1704] - AliasToBeanResultTransformer should hold ConstructorInfo + +** New Feature + * [NH-791] - Add always-wrap As a Configuration Option On Collections + * [NH-855] - Port lazy="extra" from Hibernate 3 + * [NH-871] - Implement SelectGenerator + * [NH-1033] - Add support for polymorphic criteria + * [NH-1106] - SQL Anywhere 10 Driver and Dialect + * [NH-1173] - Generic Ordered Set + * [NH-1176] - Trigger generated identities + * [NH-1188] - Provide a method to delete by Id + * [NH-1232] - Enums as discriminators + * [NH-1233] - EnumCharType + * [NH-1305] - Add BuildMappings method to Configuration to eagerly configure mappings + * [NH-1359] - Ability to create an IProjection from a DetachedCriteria + * [NH-1370] - Allow short name for + * [NH-1371] - short name for UserType () + * [NH-1373] - shorter name for UserCollectionType () + * [NH-1393] - Ability to use Aggregate Projections on Projections + * [NH-1394] - Ability to use "order by projection" + * [NH-1397] - from H3.2 + * [NH-1401] - Support for EntityMode.Map and for DefaultEntityMode in Settings + * [NH-1416] - Support DEFAULTs, for properties values, in mappings + * [NH-1451] - Port of from H3.2.6 + * [NH-1458] - Collections events (from H3.2.6) + * [NH-1479] - Add Guid native generation + * [NH-1493] - BackingField accessors + * [NH-1518] - Log info per Operation Threshold in statistics (from H3.2.6) + * [NH-1537] - Comments in Query + * [NH-1538] - Configuration property use_sql_comments (from H3.2) + * [NH-1561] - Dialect, Driver + MetaData for SQL Anywhere 9, and 10 + * [NH-1562] - SQLite MetaData + * [NH-1563] - LinFu ProxyFactoryFactory (LinFu.DynamicProxy) + * [NH-1571] - MSSQL 2008 Dialect + * [NH-1596] - Support Connection to Oracle Lite + * [NH-1621] - Read only property accessor + * [NH-1632] - System.Transactions support issue + * [NH-1646] - Support for IQuery.Future() + * [NH-1662] - sequence-identity generator from H3 + * [NH-1664] - Identity style generic generator support + +** Patch + * [NH-1094] - DecodeCaseFragment ignoring 'returnColumnName' + * [NH-1127] - Use default assembly name and namespace from the element (more than at present). + * [NH-1209] - TableHiLoGenerator Jumps 1 number each lo > maxLo + * [NH-1280] - Adds HAVING support to CreateCriteria queries, Fixes parameter order bugs + * [NH-1295] - ISynchronization support + * [NH-1314] - Change signature of AbstractPersistentCollection.IdentityRemoveAll() from ICollection to IEnumerable for generics + * [NH-1322] - DeleteEvent constructor does not check its parameter properly + * [NH-1356] - Fixes Generic List of Composite Elements + * [NH-1409] - Includes Patch : nant build scripts ignore -D:sign=false + * [NH-1429] - Oracle GUID to Raw(16) + * [NH-1467] - some comment clean ups + * [NH-1485] - MultiQueryImpl.GetResultList does not use Result Transformers correctly. + * [NH-1491] - NoArgSQLFunction is not cls compliant + * [NH-1503] - Support for Sybase ASE ADO.NET 2 Provider + * [NH-1532] - Class called SystemConfiguration does not persist properly + * [NH-1539] - Oracle dialect - incorrect CONCAT behaviour + * [NH-1540] - Oracle dialect - allowing pagging in subqueries + * [NH-1541] - Oracle Dialect - Extra lazy collection count not working under Oracle + * [NH-1542] - Oracle dialect - Fix to some HQL functions + * [NH-1543] - SQLite paging broken + * [NH-1547] - SqLite Paqing does not page properly after the 2nd page + * [NH-1550] - Oracle dialect - pagging correction (+left/right functions) + * [NH-1551] - Update some tests to support Oracle + * [NH-1555] - Add some helper methods for the transformers class + * [NH-1570] - Revision 3859 broke paging support in SQL 2005 dialect for ordered queries + * [NH-1575] - Revision 3860 introduced bug where paged Hql Queries can break unpaged Hql Queries in Sql 2005 + * [NH-1582] - DbType.Date support for SQLite + * [NH-1586] - Informix driver + * [NH-1591] - SetCacheable isn't exposed by DetachedCriteria + * [NH-1592] - Informix dialect update + * [NH-1595] - SQLite dialect does not support the "extract" function + * [NH-1603] - MSSql2005Dialect - Better Data Paging Strategy + * [NH-1606] - Timestamp in Oracle8 + * [NH-1607] - Dictionary should use ContainsKey to check for values + * [NH-1614] - Add support to primitive type (es: unsigned type) to MySql Dialect + * [NH-1660] - Faster retrieval of tuplizer + * [NH-1691] - Nested component broken by fix for NH-1612 + * [NH-1695] - MySQL MetaData implementation + * [NH-1698] - MS SQL Server 2005 creates a clustered primary key by default. Requesting nonclustered as a default to simplify the creation of optimized clustered indexes. + * [NH-1702] - Make AliasToBeanResultTransformer able to return types with a non-public constructor + +** Task + * [NH-1511] - Correctly spell IPropertyAccessor.CanAccessTroughReflectionOptimizer + + +Build 2.0.1.GA +======================== +** Bug + * [NH-1293] - Changed behavior of Filters for many-to-one associations brings up possible bug when used with outer joins. + * [NH-1464] - C++ and Dispose method + * [NH-1466] - current_session_context_class = thread_static doesn't work + * [NH-1473] - IsEqual and Compare broken in EntityType + * [NH-1481] - Named Hql queries w/ Named Parameters broken after upgrade to 2.0 from 1.2.1 + * [NH-1483] - Subclass Not Loaded From Cache as Baseclass + * [NH-1488] - Table per class hierarchy and OUTER JOIN + * [NH-1490] - Wrong order of parameters in query when session uses IFilter + * [NH-1492] - Parameter mismatch enabling filters + * [NH-1499] - NullReferenceException construting Criteria query + +** Improvement + * [NH-1484] - first chance exception 'NHibernate.MappingException' when starting a webapplication + * [NH-1496] - Configuration.AddAssembly(Assembly) should do some logging if no mapping files where found + * [NH-1500] - Spelling error of NHibernate.Cfg.ConfigurationSchema.ParseColectionsCache + + +** Patch + * [NH-1034] - HQL functions - parameters support + * [NH-1434] - Some unit test supplies non-character value to LIKE: not portable across every RDBMS + * [NH-1435] - Explicitly order query in NH-1179 to ensure reliable results + * [NH-1436] - Mapping of NH-1250 not portable across every RDBMS + * [NH-1437] - Mapping of NH-1408 not portable across every RDBMS + * [NH-1438] - Some queries from FooBarTest fixture are not portable across every RDBMS + * [NH-1439] - Handle Dialect.GetIdentityColumnString(DbType type) + * [NH-1459] - Sybase dialect + * [NH-1462] - StringHelper.GetFullClassname fails to parse generic types + +Build 2.0.0.GA +======================== +** BREAKING CHANGES from NH1.2.1GA to NH2.0.0 + ##### Infrastructure ##### + * .NET 1.1 is no longer supported + * Nullables.NHibernate is no longer supported (use nullable types of .NET 2.0) + * Contrib projects moved to http://sourceforge.net/projects/nhcontrib + + ##### Compile time ##### + * NHibernate.Expression namespace was renamed to NHibernate.Criterion + * IInterceptor have additional methods. (IsUnsaved was renamed IsTransient) + * INamingStrategy + * IType + * IEntityPersister + * IVersionType + * IBatcher + * IUserCollectionType + * IEnhancedUserType + * IPropertyAccessor + * ValueTypeType renamed to PrimitiveType + + ##### Possible Breaking Changes for external frameworks ##### + * Various classes were moved between namespaces + * Various classes have been renamed (to match Hibernate 3.2 names) + * ISession interface have additional methods + * ICacheProvider + * ICriterion + * CriteriaQueryTranslator + + ##### Initialization time ##### + * section, in App.config, is no longer supported and will be ignored. Configuration schema for configuration file and App.config is now identical, and the App.config section name is: + * have a different schema and all properties names are cheked + * configuration properties are no longer prefixed by "hibernate.", if before you would specify "hibernate.dialect", now you specify just "dialect" + * All named queries will be validated at initialization time, an exception will be thrown if any is not valid (can be disabled if needed) + * Stricter checks for proxying classes (all public methods must be virtual) + + ##### Run time ##### + * SaveOrUpdateCopy() returns a new instance of the entity without changing the original + * AutoFlush will not occur outside a transaction - Database transactions are never optional, all communication with the database must occur inside a transaction, whatever you read or write data. + * NHibernate will return long for count(*) queries on SQL Server + * must contain parenthesis when needed + * The HQL functions names may cause conflic in your HQL (reserved names are: substring,locate,trim,length,bit_length,coalesce,nullif,abs,mod,sqrt,upper,lower,cast,extract,concat,current_timestamp,sysdate,second,minute,hour,day,month,year,str) + * when meta-type="class" the persistent type is a string containing the Class.FullName (In order to set a parameter in a query you must use SetParameter("paraName", typeof(YourClass).FullName, NHibernateUtil.ClassMetaType) ) + + ##### Mapping ##### + * : default meta-type is "string" (was "class") + +Build 2.0.0.CR2 +======================== +** Sub-task + * [NH-1407] - Actualize documentation of + +Build 2.0.0.CR1 +======================== +** Bug + * [NH-1361] - ProxyTypeValidator: Non-virtual public methods are accepted + * [NH-1389] - Sybase SQLAnywhere 8/9 support broken in Beta1 onword + * [NH-1399] - Database constraint names and hash collisions + * [NH-1403] - Support with meta-type="class" + * [NH-1405] - composite-id property is nulled when related composite many-to-one mapping returns null. + * [NH-1406] - IQuery.SetTimeout work incorrect for ExecuteUpdate + * [NH-1408] - CriteriaTransformer don't clone a DetachedCriteria with sub DetachedCriteria + * [NH-1413] - Paging with multiple orders fail in MSSQL2005 + +** Improvement + * [NH-1304] - Reflection optimizer on != property access + * [NH-1415] - Adding multi query support to MySqlDataDriver + +** New Feature + * [NH-1412] - Allow custom accessors to define if the ReflectionOptimizer can be used. + +** Patch + * [NH-1254] - Sybase ASA10 - Dialect + Driver + * [NH-1390] - Union subclass support for PostgreSQL + +** Task + * [NH-1410] - Spelling mistake in error message: sublcass must be subclass + + +Build 2.0.0.Beta2 +======================== +** Bug + * [NH-1030] - DB2400Dialect : mod(x,y) function triggers a parse exception + * [NH-1077] - Pessimistic locking for SQL Server fails on cached objects + * [NH-1258] - Oracle Sequences mappings without Schema information throwns InvalidKeyException + * [NH-1279] - AggressiveRelease tests fail for MySQL + * [NH-1300] - Detached Entities that have many-to-one associations improperly throw LazyInitializationExceptions when accessing the association outside the loading session + * [NH-1355] - Custom Version type (IUserVersionType) not allowed + * [NH-1362] - Nested cascades on ISession.Refresh() + * [NH-1375] - Disable Multi Query support for Npgsql + * [NH-1383] - Components with (non-C#) Nullables do not follow documentation sect. 7.1 "if all component columns are null, then the entire component is null" + * [NH-1384] - Support for latest Npgsql2 (PostgreSQL) Data Provider + +** Improvement + * [NH-693] - Better error message when user forgets to supply table name + * [NH-803] - Support DML type batch sql statements + * [NH-824] - GetClassname cannot parse generic classnames + * [NH-938] - Escape characters in Like expressions + * [NH-978] - show_sql: Transaction Begin, Commit, Rollback + * [NH-1101] - component directy detection should consider null component value to be equiv to all component member's being null + * [NH-1151] - Improve Configuration to Support ASP.NET Configuration File Hierarchy and Inheritance + * [NH-1216] - SchemaExport creates varchar(255) on MySQL when Property Type is StringClob + * [NH-1236] - XML Entity support in mapping files broken + * [NH-1257] - lazy=true and fetch=join doesn't work together it will be nice to receive a WARN + * [NH-1364] - LinkedHashMap.RemoveImpl can be improved (using try/catch for common scenario) + * [NH-1382] - Oracle Dialect support for Unsigned Int (UInt32, UInt64) + +** New Feature + * [NH-1115] - Add support for "Refresh" cascade style + * [NH-1367] - Add Interceptor or Event to Batcher + + +** Task + * [NH-1144] - Apply patch for NH-1022 (Oracle command batching) to trunk + * [NH-1210] - "table" attribute documented as required when in fact optional + + +Build 2.0.0.Beta1 +======================== +** Bug + * [NH-1238] - NH_1155_ShouldNotLoadAllChildrenInPagedSubSelect fails for MsSql2000Dialect + * [NH-1318] - Enum fields cannot be mapped to database on DB2 + * [NH-1329] - Expression.Sql with parameters (inside of functions) is broken + * [NH-1346] - SchemaUpdate.Execute fails on MS SQL Server 2005 With Locale TURKISH_CI_AS + * [NH-1347] - SetMaxResult does not work with SQLite (SQLiteDialect) + * [NH-1348] - Cannot use multiple listeners for the same event type + +** Improvement + * [NH-1172] - ASA 10 Driver for NHibernate + * [NH-1315] - ForeignGenerator.cs property Key is not found if the generator tag is empty causes exception + * [NH-1335] - Performance improvment of PersistentEnumType class + + +** Patch + * [NH-1254] - Sybase ASA10 - Dialect + Driver + * [NH-1326] - ISession.Disconnect() creates zombied transactions + * [NH-1327] - PostCommitXXXEventListeners invoked even when transaction fails + + +Build 2.0.0.Alpha2 +======================== + +** Bug + * [NH-1100] - Introduce exception if two columns are being selected, but only one being returned by NH + * [NH-1145] - MultiCrieria Does Not Respect MaxResults on Criteria + * [NH-1161] - Java mentioned in NHibernate Documentation + * [NH-1203] - Problem to resolv property name + * [NH-1205] - Various subselect bugs in MultiCriteria + * [NH-1246] - Reading BinaryBlob triggers update when transaction is committed. + * [NH-1250] - Failure with MsSql2005Dialect when paging in polymorphic queries with discriminator formula + * [NH-1252] - Inconsistent behavior of ISession.Get() under certain conditions + * [NH-1263] - CreateSchema works ok for mappings in different schemas but DropSchema not + * [NH-1281] - Regression: Criteria Query does not deliver right result when compared to similar HQL query + * [NH-1285] - Drop schema script generated by SchemaExport has bug + * [NH-1290] - AuxiliaryDatabaseObject with no params causes crash + * [NH-1296] - SQLite dialect does not support empty inserts + * [NH-1301] - Cascade doesn't work for Refresh + * [NH-1309] - Cannot recreate db when using schema and fK + * [NH-1313] - SqlFunctionProjection does not look at custom sql functions + * [NH-1332] - PostCommitDelete only fires when PostCommit is also used (in 2.0.0.alpha1) + * [NH-1334] - SesssionFactoryImpl.BuildCurrentSessionContext does recognize "web" property + * [NH-1340] - Ordering by Formula Property when paging will cause invalid SQL on SQL Server 2005 + +** Improvement + * [NH-763] - NHibernate Does Not Recognize Dependent Resources + * [NH-1158] - Upgrade to DynamicProxy 2 + * [NH-1283] - SetGuid is missing in IMultiQuery interface + * [NH-1303] - UUIDStringGenerator#Generate Improvement + +** New Feature + * [NH-1134] - Allow property-ref for collection keys + +** Patch + * [NH-1058] - automatically create indexes for foreign keys in postgresql dialect + * [NH-1140] - Getting NullReferenceException when using SimpleSubqueryExpression within another subexpression + * [NH-1146] - Expose DetachedCriteria in SubqueryExpression + * [NH-1162] - Add list-index element and property-ref attribute to key element in mapping schema + * [NH-1163] - Add more complete identity column support to SQLiteDialect + * [NH-1166] - Sql server lock patch, pessimistic locking for SQL Server 2000/2005 + * [NH-1201] - Patch: MultiQueryImpl.GetResultList does not use Result Transformers correctly. + * [NH-1292] - No-Dialect Patch + * [NH-1302] - Patches for Visual Studio 2008 / .Net 3.5 + * [NH-1308] - Patch to get a MappingException when association references unmapped class + * [NH-1310] - IStatelessSession invalid return type from Get() + * [NH-1320] - CriteriaTransformer does not properly transforms to rowcount when using subcriteria + * [NH-1325] - Source code does not compile + +** Task + * [NH-802] - Investigate possible use of MSBuild to build the project + * [NH-1321] - Add NCache Express provider to documentation + +Build 2.0.0.Alpha1 +======================== + +** Bug + * [NH-987] - Schema creation on SQL Server 2000 uses SQL 2005 system views + * [NH-1028] - Duplicate column names in queries + * [NH-1042] - MultiQuery force to use parameter in all queries + * [NH-1045] - CastleLazyInitializer throws null pointer exception during proxy creation + * [NH-1055] - Multi Criteria ignored Result Transformer + * [NH-1059] - Join mapping for a subclass is incorrectly applied to the base class + * [NH-1084] - Subclass with Join fail when trying to query + * [NH-1088] - Wrong exception text referring to config property hibernate.dialect + * [NH-1104] - RowCountProjection type should be Int64 + * [NH-1147] - Minor bug with AbstractFlushingEventListener + * [NH-1149] - Second Level Caching with Quey Caching is not working + * [NH-1154] - Delete object broken + * [NH-1168] - HQL functions 'length()' and 'bit_length()' doesn't support a non-string argument type under PostgreSQL 8.3 + * [NH-1170] - Multiple queries issues for UniqueResult + * [NH-1178] - Example.Create(exampleInstance).ExcludeZeroes().ExcludeNulls() seems has a bug.(version 1.2.0.400) + * [NH-1179] - Filter not applied in explicit join + * [NH-1181] - NHibernate.JetDriver - replace 'upper(' with 'ucase(' + * [NH-1187] - concat function fails when a parameter contains a comma, and using MaxResults (MSSQL 2005) + * [NH-1223] - To Change hibernate mapping.xml schma value change for at the runtime + * [NH-1229] - Formula fails when using the pagging on MSSQL 2005 dialect + * [NH-1234] - PersistentEnumType incorrectly assumes enum types have zero-value defined + * [NH-1235] - SetMaxResults() returns one less row when SetFirstResult() is not used + * [NH-1237] - Cannot set PostLoadEventListener event listeners. + * [NH-1246] - Reading BinaryBlob triggers update when transaction is committed. + * [NH-1249] - Bug in GetLimitString for MSSql 05 when ordering by aggregates + * [NH-1255] - key-many-to-one && not-found + * [NH-1259] - Recursive call in SetListener(type,null) causes stack overflow + * [NH-1260] - SessionImpl.EnableFilter returns wrong filter if already enabled + * [NH-1261] - HQL Functions with no arguments add the return type twice + * [NH-1265] - Generated Id does not work for MySQL + * [NH-1268] - one-to-one can never be lazy? + * [NH-1275] - FOR UPDATE statements not generated for pessimistic locking + * [NH-1286] - Binary types are not compared properly and always sent to update + +** Improvement + * [NH-364] - IdBag doesn't work with Identity columns + * [NH-421] - Dialect Improvements + * [NH-568] - year(), month(),date() and some other functions: not supported in HQL + * [NH-628] - HQL functions mapping + * [NH-865] - Change SQL Server dialect to use COUNT_BIG for count + * [NH-913] - make Flush() - return int value for records affected + * [NH-924] - ICriteria - Inspection/traversal, modification and cloning + * [NH-969] - IIf for MS SQL + * [NH-970] - OnPreLoad & OnPostLoad Lifecycle Events + * [NH-975] - Add a way for the user to specify their own ProxyFactory + * [NH-993] - Document MultiCriteria + * [NH-1063] - NHibernate.Mapping.Attributes - Support ImportAttribute when serializing an assembly + * [NH-1085] - When using multi query, allow missing parameters in queries + +** New Feature + * [NH-280] - Using constants in select clause of HQL + * [NH-424] - Add [ Table per subclass, using a discriminator ] Support to Nhibernate + * [NH-543] - Adding GetEntityName to IInterceptor (H3.0 feature) + * [NH-786] - Port statistics from H3 + * [NH-831] - Add MutliCriteria + * [NH-979] - Allow cloning of DetachedCriteria + * [NH-1036] - IQuery.executeUpdate() + * [NH-1111] - PostgreSQL 8.3 dialect with Guid type support + +** Patch + * [NH-387] - Rolling back identifiers + * [NH-466] - Add join mapping element to map one class to several tables + * [NH-982] - Patch for Castle DynamicProxy2 Support + * [NH-1073] - Remove #if NET_2_0 directives + * [NH-1078] - .NET 2.0 Configuration section to store nhibernate configuration + * [NH-1109] - HQL functions 'current_timestamp', 'str' and 'locate' for PostgreSQL dialect + * [NH-1110] - Enable Multi Query support for Npgsql (PostgreSQL) driver + * [NH-1113] - Test DetachedQueryFixture.ExecutableNamedQuery fails on case-sensitive databases + * [NH-1114] - Tests NHSpecificTest NH898 and NH958 failed on databases without DbType.Guid support + * [NH-1231] - Add support for SetResultTransformer to ISQLQuery queries (auto-discovery of return types) + * [NH-1240] - VetoInterceptor - Cancel Calls to Delete, Update, Insert via the IInterceptor Interface + * [NH-1242] - Change path delimiter to '/' to be buildable on non-Windows platforms + * [NH-1243] - NHibernate.Search is not CLS compliant. + * [NH-1244] - NHibernate uses ConfigurationManager which is in System.Configuration.dll which is not referenced. + * [NH-1245] - Update mono targets. + * [NH-1273] - Generic version of AbstractQueryImp.UniqueResult() called twice + +** Task + * [NH-1087] - Discard section and substitute it whit + * [NH-1221] - Implement FullTextQueryImpl.ExecuteUpdate() + * [NH-1239] - Update build script to include configuration templates. + +Build 1.2.1 +======================== + +Bug Fixed: + + * [NH-111] - Oracle "Invalid identifier" exception + * [NH-989] - Assemblies are not registered in the correct order + * [NH-995] - Problem with CompositeId+"key-many-to-one"+Caching + * [NH-999] - One Shot Delete doesn't work - and cause reference violations + * [NH-1006] - Invalid SQL order generated by JetDriver + * [NH-1011] - update=false attribute ignored + * [NH-1012] - DetachedCriteria CreateAlias with joinType (new in1.2) is broken + * [NH-1018] - 'DistinctRootEntity' result transformer throws InvalidCastException + * [NH-1023] - using projections and transformer causes invalid column name when property and alias are the same + * [NH-1039] - NullReferenceException for dynamic-component containing a set + * [NH-1061] - Schema name missing when quering for highest key value + * [NH-1064] - wrong association owner when fetching eagerly + * [NH-1068] - Typo in example-mappings.html + * [NH-1086] - SerializationException when using MemCacheProvider as cache because some classes miss the SerializableAttribute. + * [NH-1124] - Problem in NHibernate.Type.ComponentType.NullSafeSet + * [NH-1155] - SubselectFetch doesn't take into account paging + * [NH-1156] - MS2005Dialect doesn't handle same column & alias names correctly + * [NH-1167] - SubCriteria.CreateCriteria(string associationPath, string alias, JoinType joinType) always uses JoinType.InnerJoin + +Improvements: + + * [NH-901] - ComponentType mappings for with value types (structs) cause incorrect dirty checking + * [NH-1049] - classes which inherit Order can't override ToSqlString + +New Features: + + * [NH-1022] - Add command batching support for OracleClient driver + +Patches Applied: + + * [NH-585] - Unknown version when using replicate and joined-subclass + * [NH-903] - IQuery.SetFirstResult and SetMaxResults break in MsSql2005Dialect for ISQLQuery using WITH keyword + * [NH-990] - Abstract CurrentSessionContext management and add more implementations + * [NH-1014] - NHibernate Cross Join Syntax Causes Issues With SQL Server 2000/2005 + * [NH-1054] - Add hibernate.transaction.factory_class setting + * [NH-1056] - Command batching support for OracleDataClientDriver + * [NH-1076] - Sybase11 Dialect + * [NH-1080] - HQL parser incorrectly registers a many-to-one association as a one-to-one. + * [NH-1119] - valuetypes in uniqueresult give an error when query result is null + * [NH-1160] - Parameter compatibility problem in cached Sql command. + * [NH-1193] - Limit string in MsSql2005 dialect can sort incorrectly on machines with multiple processors + +Task Completed: + + * [NH-1002] - Document undocumented configuration properties + + +Build 1.2.0.GA +======================== + +Patches Applied: + + * [NH-992] - AuxiliaryDatabaseObject enhancement + +Bugs Fixed: + + * [NH-980] - Table name not quoted with increment generator + +Improvements: + + * [NH-974] - Build and distribute a binary zip file along with the installer + * [NH-976] - Better error description when subclass table name is wrong + * [NH-985] - Map DbType.Guid to CHAR(38) for Oracle + * [NH-988] - Proxy validator should complain on non-virtual internal members + +Build 1.2.0.CR2 +======================== + +Patches Applied: + + * [NH-859] - Improve SubselectFetch performance + * [NH-931] - Error Message Improvement for SingleTableEntityPersister.cs + * [NH-934] - Fix Spelling in comments and parameter lists + * [NH-937] - Improve comments and parameter lists + * [NH-954] - Fix build for mono-1.0 on Linux + * [NH-955] - JetDriver breaks on non-standard cultures, on the DateTime fix + * [NH-962] - Parent-Child relationships not properly persisted in certain cases + +Bugs Fixed: + + * [NH-898] - ArgumentException from EntityKey constructor when running a HQL query + * [NH-926] - Identity insert fails with SQL Ce dialect and aggresive connection release mode. + * [NH-929] - session.Save(object) sets bogus ID fields using MySQL with default hibernate.connection.release_mode + * [NH-930] - Schema Export generates duplicate constraints + * [NH-932] - hbm2net: Troubles using "classname, AssemblyName" in Extends attribute of joined-subclass + * [NH-933] - Expression.In does not support Generic lists + * [NH-940] - domain model exception badly handled by proxy NHibernate + * [NH-952] - AddAssembly doesn't seem to order joined-subclass correctly + * [NH-958] - ISession.SaveOrUpdateCopy throws exception when class has mapping + * [NH-965] - Error with computed property (property ... formula="... ) inside block + * [NH-966] - Unsafe type cast code in DetachedCriteria.GetExecutableCriteria + +New Features: + + * [NH-305] - Generated properties + * [NH-428] - Support Multiple Collections join fetch + * [NH-915] - Add pessimistic locking for SQL Server 2000/2005 + * [NH-936] - Sys Cache with SqlCacheDependencies + +Improvements: + + * [NH-944] - Provide API for specifying JoinType in subqueries + * [NH-947] - Add IInterceptor.SetSession + * [NH-948] - Documentation needs update: "Copy the xsd files to ... directory for enabling IntelliSense" + +Build 1.2.0.CR1 +======================== + +Patches Applied: + + * [NH-859] - Improve SubselectFetch performance + * [NH-874] - Named Parameters do not work in Having Clause + * [NH-875] - Query cache does not work when filters are enabled + * [NH-923] - The NHibernate.Expression.Order class doesn't implement ToString() + +Bugs Fixed: + + * [NH-857] - Filter parameter is mandatory and should be optional + * [NH-864] - Dynamic update of NULL column using Nullables.NullableInt32 with "dirty" optimistic locking fails + * [NH-870] - Expression.Disjunction has wrong semantics when empty + * [NH-872] - SetCacheable(true) with an enabled filter fails + * [NH-873] - Setting hibernate.cache.use_second_level_cache to false throws NRE in SessionFactoryImpl constructor + * [NH-876] - NullReferenceException on query exection with SetCacheable(true) and null parameters + * [NH-882] - using binary type in filter does not work + * [NH-883] - Update to Bag cannot be flushed more than once. + * [NH-890] - hbm2net cannot handle wildcards without a path + * [NH-891] - Parameters do not work in HQL array access expression + * [NH-897] - An index attribute in the property tag does not create an index + * [NH-906] - SubselectFetch does not properly handle forumla properties containing "from" + * [NH-907] - Test WhereAttributesOnBags fail on PostgreSQL + * [NH-909] - Test CastFunc() fails on PostgreSQL + * [NH-911] - Allow subqueries with joins using Criteria API and Subqueries with DetachedCriteria + * [NH-912] - NullReferenceException in TypedValue.ToString + * [NH-914] - Test NH826 fails on PostgreSQL + * [NH-916] - Test SelectSqlProjectionTest() fails on PostgreSQL + * [NH-918] - wrong parameters passed to AddIdentitySelectToInsert() + * [NH-920] - DB2400Dialect does not support "mod(x,y)" function + +New Features: + + * [NH-888] - RFE: IQuery.SetGuid + +Tasks Completed: + + * [NH-862] - Document that aggressive connection release does not work well with System.Transactions + * [NH-867] - Write a migration guide from 1.0.x to 1.2.0 + +Improvements: + + * [NH-868] - Add optimistic-lock attribute to all elements that have it in H3 + * [NH-869] - Implement IInterceptor.BeforeTransactionCompletion and others + * [NH-879] - Deprecate ILifecycle and IValidatable; move them to NHibernate.Classic. + * [NH-880] - Move IUserType and ICompositeUserType to NHibernate.UserTypes + * [NH-881] - Add Configuration.AddSqlFunction + * [NH-887] - Support superclass property reference in property-ref + * [NH-902] - Remove usage of string.Intern + * [NH-910] - PostgreSQL 8.2 dialect with "IF EXISTS" + * [NH-922] - PostgreSQL support for identity column using "SERIAL" type + +Build 1.2.0.Beta3 +======================== + +Breaking Changes + * ConnectionReleaseMode support ported from Hibernate. By default, connections are released after every transaction, + or after every operation if no NHibernate transaction is in progress. + +Patches Applied: + + * [NH-807] - Criteria Tests + * [NH-813] - CacheKey key is invalid - memcached fails to store objects. + +Bugs Fixed: + + * [NH-793] - NHybridDataReader.ReadIntoMemory fails when the result is 0 records. "Invalid attempt to read when no data is present". + * [NH-812] - PostgreSQL - for update no wait + * [NH-815] - SQLQueryImpl fails to bind parameter lists + * [NH-816] - Criteria using class with discriminator + * [NH-818] - NHibernate.JetDriver Not Working at all in 1.2.0.Beta2 (encounters System.NullReferenceException) + * [NH-819] - Memcached.Client library is using log4net 1.2.9, instead of 1.2.10 + * [NH-825] - QueryKey doesn't take into account the entity ID when generating ToString() + * [NH-826] - Using Criteria to query for an item throws on Flush in some situations + * [NH-829] - pagination select doesn't support 'distinct' for NHibernate.Dialect.FirebirdDialect + * [NH-830] - ICriteria does not automatically flush the session for many-to-many association change + * [NH-837] - Error using Limits with DB2400Dialect + * [NH-839] - PersistentGenericMap GetSnapshotElement InvalidCastException + * [NH-841] - generator class="native" not works with NHibernate.JetDriver + * [NH-845] - Queries and imports in separate hmb.xml are not parsed (re-opening) + * [NH-850] - Non-portable file path for generated source files by hbm2net + +New Features: + + * [NH-370] - Add Configuration.SetDefaultAssembly and SetDefaultNamespace methods + * [NH-752] - Informix Dialect + * [NH-828] - Port connection release mode from H3 + +Tasks Completed: + + * [NH-796] - Document ISessionFactory.GetCurrentSession functionality + * [NH-801] - Upgrade NAnt libraries to 0.85 + * [NH-833] - Document SQL Server command batching functionality + * [NH-834] - Document hibernate.connection.connection_string_name + +Improvements: + + * [NH-383] - SessionFactory should implement System.IDisposable + * [NH-442] - Medium Trust level support + * [NH-648] - NHibernate.Mapping.Attributes - Allow [(Jcs)Cache], [Discriminator] and [Key] at class-level + * [NH-666] - IQuery.SetParameterList should support generics + * [NH-729] - Add ICurrentSessionContext implementation for ASP.NET apps. + * [NH-730] - make the bag Attribute protected instead of private in PersistentBag.cs + * [NH-743] - change BatcherImpl to public + * [NH-780] - Obsolete code in the tips 'n tricks + * [NH-808] - Type of count(*) should be Int64 + * [NH-810] - Prevent use of many-to-one association in Expression.Eq + * [NH-817] - DetachedCriteria Serializable + * [NH-835] - Document MultiQuery + * [NH-840] - Include Inner Exception on 'Duplicate identifier in table for:' exception msg + * [NH-851] - More descriptive error message for 'Cannot find constructor' on projections + * [NH-852] - Report proxy validator errors in bulk + * [NH-856] - NHibernate.Mapping.Attributes - Allow mapping attributes on interfaces + + +Build 1.2.0.Beta2 +======================== + +Breaking Changes: + * XML schema versions have been changed from 2.0 to 2.2. + * This version includes an updated Castle.DynamicProxy library. However, + its maintainers have not changed the version number with the update. Remember + to update Castle.DynamicProxy when updating NHibernate from an earlier version. + +Patches Applied: + + * [NH-247] - Expression.InsensitiveLike support for Firebird + * [NH-335] - discriminator formula + * [NH-723] - SqlTest for Firebird + * [NH-725] - null reference exception which attempting to flush a versioned object + * [NH-747] - Invalid number of SQL parameters when calling ISession.Delete on an optimistic-locked object with 1 or more NULL properties + * [NH-749] - NHb tests using Firebird + * [NH-751] - hasDataTypeInIdentityColumn to support Informix and similar + * [NH-757] - Patch for JetDriver + * [NH-762] - Patch to fix errors in Expression.AbstractEmptiness + * [NH-765] - Use "(" and ")" to enclose the ToString of LogicalExpression.cs + +Bugs Fixed: + + * [NH-528] - Fix GROUP BY example in documentation (GROUP BY object instance does not work) + * [NH-555] - Problems with complex aggregate queries + * [NH-585] - Unknown version when using replicate and joined-subclass + * [NH-593] - Throw a meaningful exception when using Expression.In with collection types + * [NH-600] - TimestampType precision problems + * [NH-622] - Collection of subtypes with discriminators not working + * [NH-623] - Where attribute of collection not rendered when eager fetched + * [NH-637] - Between Criterion Parameters Applied Incorrectly for Component + * [NH-642] - ArgumentNullException if no setter exists and no access strategy was specified + * [NH-681] - Generic List Error + * [NH-697] - System.MissingMethodException: Method not found: Int32 System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(System.Object). + * [NH-704] - Lock(obj, LockMode.None) not working when there is collection + * [NH-716] - Dirty Checking exception (many-to-one, select-before-update) + * [NH-732] - Can't use UserType for keys + * [NH-734] - ArgumentOutOfRangeException when setting LIMIT parameters using MySQL + * [NH-735] - Oracle Driver/Dialect + * [NH-739] - Saving transient item in the PersistantBag results duplicate items + * [NH-740] - Logging for tests is sometimes not configured properly + * [NH-741] - Invalid parameter handling when using functions + * [NH-742] - Error with computed property (property ... formula="... ) inside block + * [NH-746] - NHibernate.SqlCommand.Template quoted Token when not required + * [NH-750] - with many-to-many + * [NH-753] - Composite ID with Positional Parameters in sql-query + * [NH-768] - Delete fails when using optimistic-lock and bags + * [NH-775] - IQuery.SetResultTransformer() doesn't work + * [NH-776] - one-to-one to proxied types not handling missing associated classes correctly (as null) + * [NH-777] - ArgumentNullException: Value cannot be null. Reflection exception. + * [NH-782] - Update to latest DynamicProxy to fix race condition + * [NH-798] - Custom insert/update/delete SQL ignored for collections + +New Features: + + * [NH-432] - Port sessionFactory.getCurrentSession() from H3.1 + * [NH-499] - NHibernate filters + * [NH-515] - Port subselect fetching from Hibernate 3.1 + * [NH-755] - Port DetachedCriteria from Hibernate 3 + * [NH-758] - Allow Schema Export to work directly against an IDbConnection or TextWriter + * [NH-783] - Port Subquery support for the Criteria API + * [NH-795] - Implement lazy="proxy|false" for *-to-one associations + +Tasks Completed: + + * [NH-412] - Improve build files + * [NH-663] - Update readme.html + +Improvements: + + * [NH-372] - Allow insert="false", update="false" for components + * [NH-575] - Enhance user types support + * [NH-606] - Throw an meaningfull exception when collectionType.GetGenericArguments() returns 0 arguments. + * [NH-608] - Add ICriteria.CreateCriteria and CreateAlias overloads taking a JoinType parameter. + * [NH-614] - Optimize generic IQuery.List implementation + * [NH-615] - Change XML schema names to -2.2 + * [NH-632] - Change the error message for a database driver assembly that wasn't found. + * [NH-696] - upgrade to log4net 1.2.10.0 + * [NH-712] - Improve returned error message when default constructor is not present on a class mapped as a component + * [NH-726] - Document that custom insert sql ignored when id generator not "assigned" + * [NH-744] - Add DDL logging to SchemaExport + * [NH-760] - Allow replacing a registered function in Dialect.RegisterFunction + * [NH-761] - Change ISession.Get() to initialize a proxy if it returns one, like in H3.2 + * [NH-778] - Adding pascalcase-m (without the underscore) + * [NH-792] - Do not wrap exceptions in DriverConnectionProvider.GetConnection + +Build 1.2.0.Beta1 +======================== + +Patches Applied: + + * [NH-604] - Excessive memory consumption bug with heavy HQL usage + * [NH-636] - Add parametrized type + * [NH-638] - Add tests for UserCollectionType + * [NH-650] - DB2400Driver and DB2400Dialect + * [NH-668] - Support Sqlite ADO.Net 2.0 DataProvider + * [NH-673] - SQL Server 2005 Everywhere Edition Driver (SqlServerCeDriver) + * [NH-680] - Updates to NHibernate.Tool.hbm2net-2.0 to map nullable types correctly (and more) + * [NH-689] - NHibernate.SQL - Log the SQL parameters on the same log line as the statement + * [NH-698] - Firebird Dialect Limit Support + * [NH-701] - Log SchemaExport errors using log4net + * [NH-713] - Port property level optimistic-lock functionality from Hibernate 3.0 + * [NH-715] - SQL00029 error on INSERT INTO DB2/400 (with identity column) + +Bugs Fixed: + + * [NH-559] - Memory leak associated with HQL queries + * [NH-621] - IdentifierGeneratorFactory.Get() should use Id's IType conversion methods + * [NH-643] - Parent child problem when using SysCacheProvider + * [NH-649] - Firebird dialect (repeated RegisterFunction) + * [NH-669] - Generic map is not working + * [NH-687] - ISession.Get() strange behavior (probably a bug) + * [NH-690] - SupportsIdentitySelectInInsert property in Dialect class never used + * [NH-705] - With SysCache impossible to strore object after the gc clears the cache + * [NH-709] - CommandTimeout property should not be global + * [NH-719] - Caching of "any" reference to lazy classes + * [NH-720] - Cache regions are not being used + +New Features: + + * [NH-258] - Stored Procedures + * [NH-268] - "not-found" attribute on relation mappings + * [NH-617] - Add support for projections in criteria queries + * [NH-629] - Ingres Driver and Dialect + * [NH-640] - IList parameter for Criteria.List + +Improvements: + + * [NH-530] - Config loader error messages + * [NH-535] - Allow all ID generators to return all integer types, not just Int16/32/64 + * [NH-541] - Error Message Improvement + * [NH-581] - Make MsSql2005Dialect use nvarchar(max), varbinary(max), and varchar(max) instead of ntext, image, and text + * [NH-613] - Guid for Firebird + * [NH-625] - Add Configuration.AddUrl + +NHibernate.Mapping.Attributes: + + * [NH-494] - RawXmlAttribute: Insert XML as-is in the mapping + * [NH-684] - AttributeIdentifierAttribute: Change a string value in an Attribute (column name, ...) + * [NH-589] - Registration of properties' types patterns: Transform FQNs of properties types + * [NH-644] - Pass UnsavedValue as object: Use UnsavedValueObject (in Id, Version, ...) + * [NH-651] - Add methods to HbmSerializer returning a stream + * [NH-652] - Order (joined-)subclasses when they extend each others + * [NH-587] - HbmWriter.WriteUserDefinedContent(): Improve extensibility + * [NH-588] - MappingException: Exception thrown by this library + +Build 1.2.0.Alpha1 +======================== + +Important Breaking Changes: + * Entities and collections are lazy by default. Change by setting default-lazy="false" + in . + * Types used as proxies are now validated (a check is done that all public members are + virtual). Validation can be disabled by setting hibernate.use_proxy_validator to false. + * ISession.Get/Load now obey where="..." attribute of . + * Assemblies are signed using a new, publicly available, key. + * Assembly.LoadWithPartialName is no longer used to load assemblies. If you want NH to load + an assembly from the GAC, use element in the configuration file to + specify its fully qualified name. This change will primarily affect loading of ADO.NET + data provider assemblies. + +Patches Applied: + + * [NH-595] - Possible bug in SessionImpl.EndLoadingCollections method + +Bugs Fixed: + + * [NH-242] - Hbm2Net looks for template file in the current directory but should in the program directory + * [NH-467] - Many-to-one ignores "WHERE" class mapping element on associated Class + * [NH-511] - IVersionType.Seed should be set to 1 instead of 0 for integer types + * [NH-532] - PropertyNotFoundException ctor throws NullReferenceException + * [NH-538] - config.AddDirectory doesn't work + * [NH-540] - Register of AnsiChar type + * [NH-544] - Small Issue about Iesi.Collection.Set + * [NH-548] - Component Parent set to null on 2nd-level cache hit + * [NH-550] - Incorrect SQL Generated when using SetMaxResults() with DB2 + * [NH-551] - Unable to use DB2 in .NET 1.1 when 1.1 & 2.0 installed side by side + * [NH-552] - Collection of "nullifiables" not updated when object saved back + * [NH-560] - Bad alias generated for Generic class + * [NH-563] - Exception in NDataReader.cs when loading BinaryBlob + * [NH-571] - class keyword in WHERE broken for table-per-subclass mappings + * [NH-574] - sort="natural" doen't work when namespace and assemply were set + * [NH-579] - Cannot load class="System.DayOfWeek" + * [NH-580] - Possible bug in hbm2net + * [NH-582] - All IType implementations should be serializable + * [NH-607] - session.GetEntityIdentifierIfNotUnsaved can return null + * [NH-609] - SysCache re-caches items without expiration policy + +New Features: + + * [NH-449] - SQL Server 2005 dialect + * [NH-553] - Driver for Adaptive Server Anywhere 9.0 + +Tasks: + + * [NH-155] - Look at TableHiLoGenerator Impl + +Improvements: + + * [NH-179] - Add Proxy Validator + * [NH-243] - Hbm2Net is unable to extent with own renderer + * [NH-259] - Type-Safe Collections + * [NH-338] - Support .NET 2.0 CLR/BCL features, esp Generics and Nullable Types + * [NH-353] - Assembly.LoadWithPartialName is obsolete in .NET2 + * [NH-416] - Change default laziness of classes and collections to "true" to match Hibernate 3.1 + * [NH-441] - Make proxy validator optional + * [NH-457] - SysCache slidingExpiration property doesn't work properly + * [NH-547] - Add IL-based reflection optimizer + * [NH-602] - Support for new Firebird provider + +Build 1.0.2.0 +======================== + +Bugs Fixed: + + * [NH-409] - Sybase - Polymorphics Queries - wrong SQL generation about aliases/quotes + * [NH-418] - Custom persister cannot be instanciated. + * [NH-464] - DateTime does not work in composite-element mapping + * [NH-470] - Disconnect and Close should not close user-supplied connections + * [NH-471] - Misspelled property in ICriteria throws NullReferenceException + * [NH-476] - GetSetHelperFactory doesn't work with external dependencies + * [NH-477] - IncrementGenerator reads Int64 even if Int32 or Int16 is used. + * [NH-479] - One-To-One SaveAndUpdateCopy - Reference Identifier Bug + * [NH-480] - Should use invariant culture with ToLower and other string calls + * [NH-496] - Reflection optimizer should throw a more informative exception when a property is mapped using a wrong type + * [NH-505] - Reflection optimizer does not work with structures + * [NH-508] - changes to idbag collection not persisted correctly + * [NH-509] - ILMerge is not packaged in the distribution + * [NH-512] - Custom properties accessors do not work + * [NH-523] - SaveOrUpdateCopy throws PersistentObjectException + +New Features: + + * [NH-513] - FOR UPDATE NOWAIT in Postgresql 8.1 + +Improvements: + + * [NH-483] - Improve type resolution to handle dynamic assemblies + * [NH-488] - Change log level for GetSetHelper messages to DEBUG so that users are not confused + * [NH-489] - Remove logging from ADOException constructor + * [NH-491] - SQLite dialect should use DATETIME type for date/time columns + * [NH-493] - Correction in the NHibernate.Type.CharType.cs + * [NH-497] - Add more Hibernate-compatible type names + * [NH-506] - Make Environment.UseReflectionOptimizer property writable + * [NH-516] - Log SQL parameter values + * [NH-521] - Locking an unitialized entity causes its initialization + * [NH-525] - Upgrade to latest DynamicProxy + +Build 1.0.1.0 +======================== + +Bugs Fixed: + + * [NH-406] - NHibernate.Cfg.Configuration.Configure("MyAssembly.dll.config") results in System.NullReferenceException + * [NH-407] - session.Refresh(myObject) does not refresh/load the object from the datbase if it does not exist in the cache. + * [NH-414] - Need to process and in configuration files + * [NH-417] - Column Alias bug + * [NH-422] - child tag missing from + * [NH-440] - one-to-one unique foreign key mapping fails during query + * [NH-415] - AddXmlString should rethrow exceptions it catches + * [NH-463] - IncrementGenerator returns Int64 but uses an Int32 internally + +New Features: + + * [NH-113] - drop table SQL will now check if the table exists on MS SQL + to avoid unnecessary warnings. + * [NH-450] - Added hbm2ddl NAnt task by James Geurts + +Improvements: + * [NH-403] - BinaryType.Get should now perform faster + * [NH-398] - Bulk property get/set optimization in AbstractEntityPersister + contributed by Roberto Paterlini. The optimization is enabled by default, + set hibernate.use_reflection_optimizer property to false in your + App.config file to disable it. Note that the property is global, thus + it is only possible to set it in the app.config file in + session (see above). + * [NH-443] - Added more details to "broken column mapping" message + * [NH-448] - NHibernate configuration process is now closer to Hibernate: + - hibernate.properties file corresponds to section + in app.config (mapped to NameValueSectionHandler) + - configuration through hibernate.cfg.xml is supported + - instead of hibernate.cfg.xml, section + in app.config (mapped to NHibernate.Cfg.ConfigurationSectionHandler) + can also be used. + - creating a new configuration instance in version 1.0 would cause it + to read section immediately. In 1.0.1 this + was changed so that the section is only read when Configure() is called + * HashCodeProvider is now merged into NHibernate assembly during build, + thus it does not have to be distributed along with NHibernate.dll. + +Build 1.0.0.0 +======================== + +Improvements: + * ITransaction.Commit and Rollback will not wrap exceptions that derive + from HibernateException into TransactionExceptions, those exceptions + will instead be propagated untouched. + * FieldAccessor now includes correct type in PropertyNotFoundException. + * Oracle9Dialect will now generate a column of type TIMESTAMP(4) + for date fields mapped as "datetime". + +Build 0.99.3.0 (1.0-rc3) +======================== + +Bug Fixes: + * [NH-376] - Expression.In w/ an empty collection causes a SQL exception + * [NH-382, NH-392] - problems with ADO transactions that plagued previous + 1.0-rcX versions should all be resolved now. + * [NH-391] - Bug in ReadWriteCache when session is opened with existing + connection + * [NH-394] - NullReferenceException in debug print of session objects. + * [NH-396] - User-provided class names should be trimmed before use + * [NH-397] - ConfigurationSectionHandler doesn't reads empty properties + +Improvements: + * [NH-388] - Support for the "Any", "Meta-Value" tags + * Added fetch attribute from Hibernate 3 with values "select"/"join". + fetch="select" is equivalent to outer-join="false", and fetch="join" + matches outer-join="true". + +Build 0.99.2.0 (1.0-rc2) +======================== + +Bug Fixes: + * [NH-377] - Allow whitespace around dialect name in cfg.xml + * [NH-380] - Error with query after comitted transaction + * [NH-385] - ADOException thrown instead of StaleObjectStateException when + updating stale record + * [NH-386] - Aliases generated for properties with initial underscores should + NOT begin with an underscore + * Using Expression.Eq on a many-to-one property now works again (it was broken + by mistake in 1.0-rc1) + +Improvements: + * [NH-329] - If unsaved-value for or is not specified, + NHibernate will now try to guess it by instantiating an empty object and + retrieving default property values from it (as Hibernate 3 does it). + * The documentation has an "installer" to integrate it in VS .NET Help. + +Build 0.99.1.0 (1.0-rc1) +======================== + +Breaking changes to external API: +- Updated to a newer version of Castle.DynamicProxy. + WARNING: this new version has the same number (1.1.5.0) as the version used + by the previous release of NHibernate, but the binaries are in fact + different and the old 1.1.5.0 will not work with 1.0-rc1. +- NHibernate no longer configures log4net internally. It is now up to the user + to configure logging. +- Accessing a disposed or closed ISession or ITransaction now causes + an ObjectDisposedException. HibernateException or TransactionException could + be thrown in this case before, such cases were also changed to + throw ObjectDisposedException. +- Renamed SQLExpression to SQLCriterion per Hibernate 2.1. Now, {alias} should + be used instead of $alias in SQL criteria. +- Unused constructors for some exceptions were removed. + +Breaking changes to NHibernate extension interfaces: +- Renamed IClassPersister.IsDefaultVersion to IsUnsavedVersion. It now takes + as argument an array of property values instead of an object. +- Renamed IClassPersister.CurrentVersion to GetCurrentVersion to follow naming + conventions closer. +- Fixed MatchMode.Start and MatchMode.End for Like expressions, their meanings + were reversed. +- Dialect.AddIdentitySelectToInsert should now return null if the functionality + is not supported, instead of throwing an exception. + +Bug fixes and enhancements: +- Ported almost all remaining Hibernate 2.1 features to NHibernate: + * subcriteria + * meta attributes + * optimistic-lock setting + * query cache + * select-before-update + * batch lazy loading + * dynamic components + Missing features are Databinder, ScrollableResults and SchemaUpdate. +- Allow serializing an unflushed session (NH-292, Yves Dierick). +- Check that composite id classes override GetHashCode and Equals. +- Throw QueryException when attempting to fetch multiple collections in + a query. +- Added a SectionHandler to allow using .cfg.xml syntax to configure NHibernate + from App.config files. (This was already part of 0.9.1 release but was not + announced in the release notes.) +- Fixed bug when using joined-subclass with key-many-to-one (NH-369). +- Added IType implementations and constants in NHibernateUtil for unsigned + integer types. +- Added index attribute for . +- SchemaExport now generates SQL to create an index when index attribute is + used on or . +- SchemaExport will add an "if exists" clause to "drop table" statement, + if supported by the dialect. +- Heavy refactoring of the documentation; it now contains the documentation for + NHibernate Contributions. +- Fixed a bug when generating a TOP clause for MS SQL Server - the whole SQL + string was being converted to lower case. + +Build 0.9.1.0 +======================== +- Fixed bug in limit clause generation on MySQL. +- Fixed bug in Configuration.AddDocument. +- Fixed not working with ints or shorts. +- NHibernate now checks whether object identifier passed to its methods is of the right type. +- Fixed bug with YesNo type generating CHAR(255) column, it now generates CHAR(1). +- Implemented hibernate.show_sql feature, logging all SQL executed using NHibernate.SQL logger. + +Build 0.9.0.0 +======================== +- Added ISession.Clear(). +- Added configurable command timeout property (hibernate.command_timeout). +- Added named SQL query support. +- Allow to specify an isolation level when starting a transaction. +- Upgraded Castle.DynamicProxy library to the latest version (1.1.5). +- Upgraded log4net library to the latest version (1.2.9). +- Fixed bug with Get/Load loading wrong subclasses because of class discriminant not being included in the generated query (Alexander Popov). +- Fixed VersionNegative unsaved-value strategy not to treat 0 as the unsaved value. +- Fixed bug in SchemaExport for a many-to-many relationship, it now generates a table with non-null columns and a primary key. +- Added IncrementGenerator (Mark Holden). +- Fixed bug with insert attribute not being declared in the schema and having a wrong default value. +- Fixed bug in proxy Equals method always either returning true or failing with a NPE. +- Changed LazyInitializer to match Hibernate 2.1, proxies now don't have their own special implementation of Equals and GetHashCode, either System.Object's or the real class methods are used instead. +- Added more naming strategies (lower case, pascal-case underscored). +- Fixed bug with custom access strategy not working for components. +- Allow using structs (value types) as components. +- Added ISession.Replicate(). +- Added support for using MS SQL TOP clause for paging (Yves Derrick). +- Added persister attribute for collection mappings. +- Fixed a NPE in Junction.ToString(). +- Disabled nullability checks when deleting an object. +- Fixed SchemaExport not to generate duplicate foreign key constraints (this caused problems with Oracle). +- Implemented Copy methods for various ITypes, so that SaveOrUpdateCopy actually works. +- Changed visibility of CollectionEntry class to public to aid XML serializability of collections. It should not be expected to work in all cases since XML serialization has many limitations in .NET. +- Several Oracle-related improvements. +- More informative error message for a bad identifier generation strategy. +- Fixed bug with SchemaExport ignoring foreign-key attribute sometimes. +- Fixed bug with Get/Load not updating the internal nonExists collection of the session (Jerry Shea). +- More informative error message for foreign key problems. +- Throw a more informative exception when attempting to set the value of a non-existent query parameter. +- Do not allow reconnecting a closed session. +- More informative error message when executing ISession.Find("from NonexistentClass"). +- Added more information to the exception thrown when expected and actual row counts from a command do not match. +- Remove underscores from the beginning of generated aliases for fields (Oracle cannot handle them). +- Search the current AppDomain's bin directory for hibernate.cfg.xml, in addition to the application directory. +- Added element as a synonym for . + +Build 0.8.4.0 +======================== +- Added limited support for storing an enum type using its string representation. See the documentation of EnumStringType and TypesTest\EnumStringTypeFixture.cs for an example. +- Fixed bug with BatcherImpl cached commands being disposed. The caching functionality was removed. +- Fixed bug when property paths were used in criteria queries and caused an exception. +- Modified DB2Dialect, Oracle9Dialect and PostgreSQLDialect to use Int32 for limit and offset parameters. +- Various code clean-ups and commenting. + +Build 0.8.3.0 +======================== +- Added name of Property to the PropertyNotFoundException message. +- Fixed bug with that has a . +- Fixed bug with extra "AND" being added to sql. +- Fixed NullReferenceException that could occur in InstantiationException. +- Improved efficiency of GuidCombGenerator (Marc C. Brooks). +- Modified BinaryType to work with MySql's buggy version of GetBytes(). + +Build 0.8.2.0 +======================== +- Fixed default value of "unsaved-value" for in xsd. +- Fixed default value of "unsaved-value" for in xsd. +- Modified "proxy" to use "namespace" and "assembly" from + +Build 0.8.1.0 +======================== +- Fixed bug with defaulting to "null" instead of "undefined". + +Build 0.8.0.0 +======================== +- Added "namespace" and "assembly" attributes to . +- Added lazy="true" as short hand for proxy="full type name" +- Added insert attribute to . +- Added ability to set INamingStrategy on Configuration class. +- Added property-ref attribute on and . +- Added "foreign-key" attribute to , , , key allowing a different column to be the foreign key target +- Added check attribute to column element. +- Added element. +- Added "unsaved-value" to / as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime +- Added SaveOrUpdateCopy() which allows synchronisation for detached objects +- Added Expression.Example for Query By Example. +- Added IDriver and Dialect for Sybase (Steve Corbin). +- Added UniqueResult() to ICriteria and IQuery. +- Added default value of hibernate.connection.driver_class to Dialect so most of the time this configuration is not needed. +- Added SByteType to built in ITypes. +- Fixed so that two queries are no longer issued when one side is null. +- Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) +- Fixed bug with being initialized from Cache. +- Fixed bug with hql "select new ClassName(...) from ..." where one parameter was an Enum. (Luca Altea) +- Fixed bug in mapping that required type="full.name.of.enum" to be required instead of NH correctly inferring type. (Luca Altea) +- Fixed bug with a decimal and unsaved-value. +- Fixed problem with loading ADO.NET Data Providers from GAC. +- Fixed issue with TableGenerator not disposing of IDbCommand. +- Improved memory consumption of Configuration, smaller footprint and releases objects faster. +- Improved nhibernate-mapping schema to more schema constructs instead of direct dtd port. +- Improved message from NullableType when DataProvider can't cast the database value to .net class. +- Modified to use "null" or "not null" as the value. +- Modified Dialect to use Hibernate 2.1 methods. +- Modified Expression to return ICriterion instead of Expression class. This will break existing code. +- Modified nhibernate-configuration-2.0.xsd to not require . +- Modified TestFixtures in NHibernate.Test to only execute create/drop ddl in the TestFixtureSetUp/TestFixtureTearDown. +- Split QueryFunctionStandard into ISQLFunction interface and StandardSQLFunction. +- Upgraded to nant-0.85-rc3 and nunit-2.2.0. + +Build 0.7.0.0 +======================== +- Renamed class NHibernate.NHibernate to NHibernate.NHibernateUtil. This will break alot of code if you were using ISession.Find with parameters - migrate to IQuery instead. +- Fixed bug with DateTime type where any value less than 1/1/1753 was written to the database as null. If you were relying on this then the Nullables library in NHibernateContrib is the way to code null values for DateTime properties. +- Added ISession.Get() as an alternative to ISession.Load() (Sergey Koshcheyev). +- Added IDisposable to EnumerableImpl, ISession, ITransaction, IBatcher, and IConnectionProvider. +- Added default value of hibernate.connection.driver_class to Dialects. +- Added default value of hibernate.prepare_sql="false" to MsSql2000Dialect. +- Added [ComVisible(false)] to NHibernate AssemblyInfo. +- Added OracleDataClientDriver for Oracle.DataAccess assembly (James Mills). +- Added IDriver and Dialect for SQLite (Ioan Bizau). +- Fixed messages in exceptions from GetGetter and GetSetter in BasicPropertyAccessor and NoSetterAccessor. +- Fixed problem of LazyInitializationException losing InnerException. +- Fixed problem of Collections not always getting cached. +- Fixed Id.TableGenerator so it works with Oracle. +- Fixed problem with SequenceHiLoGenerator and converting to Int64 (Yves Dierick). +- Fixed problem of some NHibernate Exceptions not being serializable. +- Improved documentation in IQuery to explain how SetMaxResult is working. +- Improved messages in Exceptions thrown by ISetter. +- Improved messages in Exceptions for Persisters with problems parsing discriminator values. +- Improved Configuration.AddAssembly() to process hbm.xml files with subclass/joined-subclass files using "extends" in correct order (Mark Traudt). Also added overload of AddAssembly(Assembly,bool) that can be used to skip ordering. +- Many internal cleanups from FxCop reccommendations. +- Modified ISession.Lock() to allow reassociating transient instances like hibernate 2.1 (Sergey Koshcheyev). +- Modified Exception thrown by Preparer when the IDbCommand.Prepare() method fails to ADOException. +- Modified SqlCommand.Parameter to be immutable. +- Modified how constraints are generated to work with MySql 4.1 (Bill Hawes). +- Modified Dialect to throw an ArgumentException when an unsupported DbType is used. +- Modified constructors on NHibernate Collections to be internal instead of public. +- Renamed Transaction to AdoTransaction. + +Build 0.6.0.0 +======================== +- Added support for proxy="" on classes. proxy="" must either specify an Interface or the properties that need to be proxied have to be virtual. +- Added a configuration parameter "hibernate.prepare_sql" to turn on or off calls to IDbCommand.Prepare(). +- Added NHibernate Type for System.SByte. (Sergey Koshcheyev) +- Added support for mapping subclasses and joined-subclasses in different files through addition of extends attribute. (Andrew Mayorov) +- Added support for LIMIT to MySQLDialect. (Sergey Koshcheyev) +- Improved error messages when IDbCommand and IDbConnection can't be found by the IDriver. +- Improved error message when mapped class is missing a constructor with no args. +- Fixed problem with spaces in sql generated from hql and MySql. +- Fixed bug with Configuration when there is a class without a namespace. +- Fixed bug with Sql generated for an IN clause that contains a class/subclass with a discriminator-value="null". +- Fixed potential threading problem with QueryTranslator. +- Modified logging in Transaction to not generate as many messages. +- Modified how exceptions are rethrown so call stack of original exception is not lost. +- Moved NHibernate.Tasks and NHibernate.Tool.hbm2net to the NHibernateContrib package. +- Removed DbType {get;} from IUserType. + +Build 0.5.0.0 +======================== +- Added Iesi.Collections Library that contains an ISet. Code was taken from http://www.codeproject.com/csharp/sets.asp. +- Fixed hbm2net problem with spaces in arguments. (Kevin Williams) +- Added a NHibernateContrib project that contains Nullable Types for .net 1.1 designed for WinForm Databinding. (Donald Mull) +- Added DB2Driver and DB2Dialect to core of NHibernate. (Martijn Boland) +- Fixed IQuery.SetParameter() when the value is an Enum +- Updated to latest MySql Data Provider and changed classes to MySqlDataDriver. Removed binaries from CVS since they are GPL now. +- Isolated test and classes that use DbType.Time into their own fixtures. Data Drivers don't implement this consistently. +- Fixed problem where HQL was not parsing Enums correctly. (Peter Smulovics) +- Fixed Int16 not working as a Property. +- Added CLSCompliantAttribute(true) attribute to NHibernate and Iesi.Collections. +- Fixed how Exceptions are rethrown to not lose the stack trace. +- Added more comments around ISession.Find and ISession.Enumerate to explain Cache usage. +- Fixed bug with dynamic-update generating SQL for all properties. (Sergey Koshcheyev) +- Add Clover.NET into NHibernate build process thanks to license donated by Cenqua (www.cenqua.com). +- Modified TableGenerator to default first id to "1" instead of "0" to work better with unsaved-value. (Karl Andersson) + +Alpha Build 0.4.0.0 +======================== +- Started work on documentation. +- Improved Cache to use pluggable CacheProviders like Hibernate 2.1. (Kevin Williams) +- Removed properties UseScrollableResults, BatchSize, and FetchSize - not applicable to ADO.NET. +- Fixed problem with object not getting removed from Cache when Evicted from Session. +- Added to MySqlDialect a mapping from DbType.Guid to varchar(40) for schema-export. (Thomas Kock) +- Added lowercase-underscore naming strategy. (Corey Behrends) +- Fixed bug with access="field" and no type="" attribute causing Exception in ReflectHelper. +- Removed IVersionType implementation from TimeType and DateType. +- Moved Eg namespace from NHibernate core to NHibernate.Eg project. +- Added guid.comb id generator. (Donald Mull) +- Added ability to configure with a cfg.xml embedded as a resource in an assembly (Thomas Kock) +- Fixed PostgreSQLDialect binding of Limit Parameters. (Martijn Boland) +- Began restructure of lib folder to support net-1.0, net-1.1, net-2.0, and mono-1.0 in build. Still only 'officially' supports net-1.1. + +Alpha Build 0.3.0.0 +======================== +- Removed property AdoTransaction from Transaction. +- Added MsSql7Dialect. +- Added PostgreSQL Driver and Dialect (Oliver Weichhold & Martijn Boland). +- Fixed bug with Expression.Ge() not returning correct Expression. +- PersistentCollection now implements ICollection (Donald Mull). +- BatcherImpl and PreparerImpl were combined and code cleaned up thanks to problems found when using Ngpsql (Martijn Boland). +- ITransaction is now responsible for joining IDbCommand to IDbTransaction instead of IBatcher - if applicable. +- Modified code to help improve performance of Drivers that don't support multiple Open DataReaders on a single IDbConnection. +- Fixed bug with hbm2net and VelocityRenderer throwing Exception (Carlos Guzmn lvarez & Peter Smulovics). +- Clean up of hbm2net (Peter Smulovics). +- Modified internals of AbstractEntityPersister to help with buiding on Mono (Oliver Weichhold). +- Renamed nhibernate.build to NHibernate.build to help with building on Mono (Oliver Weichhold). +- Removed Dialect.GetLimitString(string) should use Dialect.GetLimitString(SqlString) instead. +- SqlStringBuilders were modified to set an initial capacity for the ArrayList. +- Added properties to SqlString to help with SqlStringBuilders and Hql. +- Marked Exceptions as [Serializable]. +- Fixed bug with Hql not being able to use a constant in an imported or mapped Class. +- DateTimeType.DeepCopyNotNull() cleaned up (Mark Traudt). +- Added VersionProperty to IClassMetadata. +- Renamed PrimitiveType to ValueTypeType to be more .net style consistent and fixed them up so they inherit from the appropriate class. +- Fixed bug with caching an ObjectType. +- Much code cleaned up for FxCop (Peter Smulovics). +- Fixed bug with , doing an Add, and then a Flush() resulting in the entity in there twice. + +Alpha Build 0.2.0.0 +======================== +- Removed support for mapping since it doesn't exist in .net. +- Fixed bug in nhibernate.build file when not signing NHibernate.dll. +- Fixed bug with Hql and SetParameter() where there were 2 parameters with same name. +- Fixed bug with Hql and "IN (:namedParam)". +- Fixed bug with Hql and multi column IType. +- Fixed bug with Hql and scalar queries +- Fixed bug with NullReferenceException and TypeType class. +- ISession.Filter() is now working. +- Compiled Queries and Filters are now cached. +- Refactored Hql to use a SqlString instead of string containing sql. +- Dialect has had public API changed because of Sql to SqlCommand refactoring. +- IPreparer has had methods removed from public API. +- type="System.Object" no longer matches to SerializableType - instead it matches to ObjectType. Use type="Serializable" instead. +- Added "access" attribute for NHibernate to get to fields and properties with no setters. See NHibernate.Property.PropertyAccessorFactory for all valid value types and how to plug in your own implementation of IPropertyAccessor. +- Added Types to read BLOB/CLOB columns to a byte[]/string Property. +- Modified Expression.Sql() to require use of SqlString if parameters are used. +- TypeFactory was modified to allow the attribute "type" to be the Assembly Qualified Name, Full Name, NHibernate IType.Name, or Hibernate name to help with porting hibernate hbm.xml files and Net2Hbm that John is writing. +- hibernate.connection.isolation configuration now affects the IDbTransaction's IsolationLevel, it is parsed as the name value of the IsolationLevel enum - "Chaos", "ReadCommitted", "ReadUncommitted", "RepeatableRead", "Serializable", and "Unspecified". +- ICriteria.SetMaxResults() is now working. +- IQuery.SetMaxResults().Enumerable() is now working. +- Modifed Test Fixtures to help isolate problems caused by DataProviders. + +PreAlpha Build 0.1.0.0 +======================== +- NHibernate and HashCodeProvider are now strong named assemblies. The key used to sign the assemblies is not in CVS. +- Many more Tests implemented. +- Added Examples into CVS and zip. +- ConnectionProvider uses settings passed to it by ConnectionProviderFactory instead of default settings. +- Hbm2Net moved from NHibernate folder to its own folder and NAnt Tasks for it contributed by Kevin Williams. +- Adding properties to Cfg instead of using app.config/web.config or cfg.xml now supported. +- In cfg.xml, an assembly where the resource can be found is now needed - ie: . +- nhibernate-configuration-2.0.xsd schema was updated to .net friendly names and all cfg.xml files are now validated. +- Fixed bug with classes having dynamic-insert and dynamic-update causing IndexOutOfRangeExceptions. +- Modified length of string for CultureInfoType. +- Added Firebird fixes contributed by Carlos Guzmn lvarez. +- Changed TimestampType.Set to behaive like hibernate. Will not write a null value anymore - instead replaces it with DateTime.Now. +- Removed IVersionType interface from DecimalType. +- Add PropertyExpressions contributed by Carlos Guzmn lvarez. +- Fixed bug with referencing joined classes properties in hql. +- Fixed IndexOutOfRangeException with NormalizedEntityPersister for versioned entities. +- Added ObjectType to TypeFactory and NHibernate. +- Fixed problem with hql subselects referencing a class in main query. +- Limited support for Serializing a Session. Sometimes a Refresh() is needed after Deserialization. +- Fixed bug with sending a one-to-many collection to be updated that involves inserting a new row. + +PreAlpha Build 6 +======================== +- Fixed Configuration so app.config/web.config behaives like hibernate.properties and a hibernate.cfg.xml. Settings in app.confg/web.config are no longer required if a cfg.xml file is used. +- Dialects now set default values for outer joins. +- Fixed bug in ArrayHolder with null elements. +- Added IDisposable to ISession +- Fixed bug with lazy loaded SortedSet during Flush(). +- Fixed problem with Loading using LockModes because of missing columns with Forumlas. +- Added SetAnsiString to IQuery +- Fixed bug with IDbCommands used in a Session that is Disconnected and Reconnected not being associated with the correct IDbTransaction. +- Driver can disable calls to IDbCommand.Prepare() for Data Providers that don't support it. +- Removed requirement to set length with type attribute - ie, can use type="String" instead of type="String(50)". +- schema-export now functions just like it does with hibernate 2.0.3 +- Converting a SqlString to an IDbCommand is now a Driver specific function because different Driver's have different requirements for IDbCommands. +- Added HashCodeProvider.dll to remove problems with RuntimeHelpers.GetHashCode causing MissingMethodException with App Domain reloading with ASP.NET and NUnit. + +PreAlpha Build 5 +======================== +- Added check in Configuration for 1.1 version of runtime. +- Removed reference in NHibernate.csproj to nunit.framework.dll. +- Fixed update="true" when values different than insert attribute. +- Enumerable with HQL now works with multiple results. +- Fixed NullReferenceException in EvictCollections. +- Fixed bug with lazy loaded sorted collections not loading correctly. +- Fixed problem with cascading deletes causing OutOfMemoryException. +- Implemented more TestFixtures. + +PreAlpha Build 4 +======================== +- Implemented most DomainModel classes and hbms for testing +- Implemented more TestFixtures (both migrated and new) +- Added Oracle Dialects and Drivers (thanks to feilng for contributing those!) +- Modified classes in Type namespace to support reading values from Oracle Driver +- Added DotNetMock.dll to NHibernate.Test assembly to help with testing Type namesapce +- Fixed parameter parsing so both Named Params (:name) and ? can be used in HQL +- Fixed problem with joins in HQL +- Fixed problem with , , and where lazy="true" +- Fixed problem with being bound to a Bag instead of IdentifierBag +- Fixed problem with CollectionPersister.WriteRowSelect and IdentifierBags +- Fixed problem with when a null value was in the array +- Fixed problem with sending an unneeded Update before a Delete +- Fixed problem with null aliases and Parameter.Equals() +- Cleaned up HQL parsing so it internally throws fewer exceptions +- ConnectionProvider's now provide internal IDbConnection cache like h2.0.3 - not on by default +- Fixed problem with StringHelper.Replace being passed a null template +- is now supported +- is now supported +- read only and a read-write can now refer to the same column without problems. +- changed value of Dialect.SupportForUpdateOf to false, like h2.0.3 has it +- Id generation strategies that use TableGenerator now work for all Drivers +- Modified IdentityMap to use SequencedHashMap instead of ListDictionary (thanks to feling for finding the performance problems that ListDictionary was causing) +- Fixed problem with Expresion.Juction.GetTypedValues() not returning correct TypedValue[] + + +PreAlpha Build 3 +======================== +- Synched Cache Namespace with cache package in H2.0.3 +- Synched CollectionPersister with H2.0.3 +- Synched Config Namespace with config package in H2.0.3. +- Synched Cascade strategies with H2.0.3 +- Synched Dialect Namespace with dialect package in H2.0.3 +- Started HQL Namespace synch with hql package in H2.0.3. There are still some issues in there. +- Synched Id Namespace with id package in H2.0.3 +- Synched Mapping namespace with mapping package in H2.0.3. +- Added ForUpdateFragment +- hbm2net created. +- Added AnsiStringType. +- Added GuidType. +- Fixed problem with IdentityMap that caused to not work. +- Added support for and mappings. +- Implemented sorted collections. +- Build files rewritten. +- MsSql Dialect now issues one statement to Insert and retrieve identity value. +- Fixed a bug with +- Implemented SqlExpression for Criteria queries. +- Initial fix of Multiple IDataReaders being opened with Entities that contain mappings. +- Fixed problems with Alias and Ms Sql Server. + +PreAlpha Build 2 +======================== +- Continued to synchronize NHibernate with Hibernate 2.0.3's features. +- Modifed BooleanType to use GetBoolean instead of GetByte +- Modified MsSqlServer2000Dialect to maps a BooleanSqlType to a bit column type. +- Fixed bug with IdentityMap that caused problems with Session.Flush() loading lazy collections +- Added TicksType to TypeFactory +- Fixed bug with SchemaExport committing a non existing IDbTransaction \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.dll b/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.dll new file mode 100644 index 000000000..edb5f886f Binary files /dev/null and b/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.dll differ diff --git a/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.xml b/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.xml new file mode 100644 index 000000000..0d4351cae --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/lib/Net35/NHibernate.xml @@ -0,0 +1,44178 @@ + + + + NHibernate + + + + + Implementation of BulkOperationCleanupAction. + + + + + An operation which may be scheduled for later execution. + Usually, the operation is a database insert/update/delete, + together with required second-level cache management. + + + + Called before executing any actions + + + Execute this action + + + + What spaces (tables) are affected by this action? + + + + + Get the before-transaction-completion process, if any, for this action. + + + + + Get the after-transaction-completion process, if any, for this action. + + + + + Create an action that will evict collection and entity regions based on queryspaces (table names). + + + + + Any action relating to insert/update/delete of a collection + + + + + Initializes a new instance of . + + The that is responsible for the persisting the Collection. + The Persistent collection. + The identifier of the Collection. + The that the Action is occurring in. + + + Called before executing any actions + + + Execute this action + + + + Compares the current object with another object of the same type. + + + A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other. + + An object to compare with this object. + + + + What spaces (tables) are affected by this action? + + + + Execute this action + + This method is called when a new non-null collection is persisted + or when an existing (non-null) collection is moved to a new owner + + + + + Removes a persistent collection from its loaded owner. + + The collection to to remove; must be non-null + The collection's persister + The collection key + Indicates if the snapshot is empty + The session + Use this constructor when the collection is non-null. + + + + Removes a persistent collection from a specified owner. + + The collection's owner; must be non-null + The collection's persister + The collection key + Indicates if the snapshot is empty + The session + Use this constructor when the collection to be removed has not been loaded. + + + + Acts as a stand-in for an entity identifier which is supposed to be + generated on insert (like an IDENTITY column) where the insert needed to + be delayed because we were outside a transaction when the persist + occurred (save currently still performs the insert). + + The stand-in is only used within the see cref="NHibernate.Engine.PersistenceContext" + in order to distinguish one instance from another; it is never injected into + the entity instance or returned to the client... + + + + + Base class for actions relating to insert/update/delete of an entity + instance. + + + + + Instantiate an action. + + The session from which this action is coming. + The id of the entity + The entity instance + The entity persister + + + + Entity name accessor + + + + + Entity Id accessor + + + + + Entity Instance + + + + + Session from which this action originated + + + + + The entity persister. + + + + + Delegate representing some process that needs to occur before transaction completion. + + + NH specific: C# does not support dynamic interface proxies so a delegate is used in + place of the Hibernate interface (see Action/BeforeTransactionCompletionProcess). The + delegate omits the parameter as it is not used. + + + + + Delegate representing some process that needs to occur after transaction completion. + + Did the transaction complete successfully? True means it did. + + NH specific: C# does not support dynamic interface proxies so a delegate is used in + place of the Hibernate interface (see Action/AfterTransactionCompletionProcess). The + delegate omits the parameter as it is not used. + + + + Format an SQL statement using simple rules: + a) Insert newline after each comma; + b) Indent three spaces after each inserted newline; + If the statement contains single/double quotes return unchanged, + it is too complex and could be broken by simple formatting. + + + + Represents the the understood types or styles of formatting. + + + Centralize logging handling for SQL statements. + + + Constructs a new SqlStatementLogger instance. + + + Constructs a new SqlStatementLogger instance. + Should we log to STDOUT in addition to our internal logger. + Should we format SQL ('prettify') prior to logging. + + + Log a IDbCommand. + Title + The SQL statement. + The requested formatting style. + + + Log a IDbCommand. + The SQL statement. + The requested formatting style. + + + + Manages prepared statements and batching. Class exists to enforce separation of concerns + + + + + Manages s and s + for an . + + +

+ Abstracts ADO.NET batching to maintain the illusion that a single logical batch + exists for the whole session, even when batching is disabled. + Provides transparent IDbCommand caching. +

+

+ This will be useful once ADO.NET gets support for batching. Until that point + no code exists that will do batching, but this will provide a good point to do + error checking and making sure the correct number of rows were affected. +

+
+
+ + + Get an for using in loading / querying. + + The to convert to an . + The of the command. + The SqlTypes of parameters + in . + + An that is ready to be executed. + + + + If not explicitly released by , it will be + released when the session is closed or disconnected. + + + This does NOT add anything to the batch - it only creates the IDbCommand and + does NOT cause the batch to execute... + + + + + + Get a non-batchable an to use for inserting / deleting / updating. + Must be explicitly released by CloseCommand() + + The to convert to an . + The of the command. + The SqlTypes of parameters + in . + + An that is ready to have the parameter values set + and then executed. + + + + + Close a opened using PrepareCommand() + + The to ensure is closed. + The to ensure is closed. + + + + Close a opened using + + The to ensure is closed. + + + + Get a batchable to use for inserting / deleting / updating + (might be called many times before a single call to ExecuteBatch() + + + After setting parameters, call AddToBatch() - do not execute the statement + explicitly. + + The to convert to an . + The of the command. + The SqlTypes of parameters + in . + + + + + Add an insert / delete / update to the current batch (might be called multiple times + for a single PrepareBatchStatement()) + + Determines whether the number of rows affected by query is correct. + + + + Execute the batch + + + + + Close any query statements that were left lying around + + + Use this method instead of Dispose if the + can be used again. + + + + + Gets an by calling ExecuteReader on the . + + The to execute to get the . + The from the . + + The Batcher is responsible for ensuring that all of the Drivers rules for how many open + s it can have are followed. + + + + + Executes the . + + The to execute. + The number of rows affected. + + The Batcher is responsible for ensuring that all of the Drivers rules for how many open + s it can have are followed. + + + + + Must be called when an exception occurs. + + + + + + Cancel the current query statement + + + + + Gets the value indicating whether there are any open resources + managed by this batcher (IDbCommands or IDataReaders). + + + + + Gets or sets the size of the batch, this can change dynamically by + calling the session's SetBatchSize. + + The size of the batch. + + + + Initializes a new instance of the class. + + The owning this batcher. + + + + + Prepares the for execution in the database. + + + This takes care of hooking the up to an + and if one exists. It will call Prepare if the Driver + supports preparing commands. + + + + + Ensures that the Driver's rules for Multiple Open DataReaders are being followed. + + + + + Adds the expected row count into the batch. + + The number of rows expected to be affected by the query. + + If Batching is not supported, then this is when the Command should be executed. If Batching + is supported then it should hold of on executing the batch until explicitly told to. + + + + + A flag to indicate if Dispose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this BatcherImpl is being Disposed of or Finalized. + + If this BatcherImpl is being Finalized (isDisposing==false) then make sure not + to call any methods that could potentially bring this BatcherImpl back to life. + + + + + Gets the current that is contained for this Batch + + The current . + + + + Gets or sets the size of the batch, this can change dynamically by + calling the session's SetBatchSize. + + The size of the batch. + + + + Gets the the Batcher was + created in. + + + The the Batcher was + created in. + + + + + Gets the for this batcher. + + + + Implementation of ColumnNameCache. + + + + Manages the database connection and transaction for an . + + + This class corresponds to ConnectionManager and JDBCContext in Hibernate, + combined. + + + + The batcher managed by this ConnectionManager. + + + + Expected row count. Valid only for batchable expectations. + + + + Factory for instances. + + + + Provide the class of according to the configuration + and the capabilities of the driver. + + + By default, .Net doesn't have any batching capabilities, drivers that does have + batching support. + The BatcherFactory trough session-factory configuration section. + This interface was added in NHibernate for backdraw compatibility to have the ability + to specify a default for a specific . + + + + + An implementation of the + interface that does no batching. + + + + + Initializes a new instance of the class. + + The for this batcher. + + + + + Executes the current and compares the row Count + to the expectedRowCount. + + + The expected number of rows affected by the query. A value of less than 0 + indicates that the number of rows to expect is unknown or should not be a factor. + + + Thrown when there is an expected number of rows to be affected and the + actual number of rows is different. + + + + + This Batcher implementation does not support batching so this is a no-op call. The + actual execution of the is run in the AddToBatch + method. + + + + + + A BatcherFactory implementation which constructs Batcher instances + that do not perform batch operations. + + + + + Summary description for OracleDataClientBatchingBatcher. + By Tomer Avissar + + + + + A ResultSet delegate, responsible for locally caching the columnName-to-columnIndex + resolution that has been found to be inefficient in a few vendor's drivers (i.e., Oracle + and Postgres). + + + + + + Expose the batch functionality in ADO.Net 2.0 + Microsoft in its wisdom decided to make my life hard and mark it internal. + Through the use of Reflection and some delegates magic, I opened up the functionality. + + Observable performance benefits are 50%+ when used, so it is really worth it. + + + + + Append a command to the batch + + + + + + This is required because SqlClient.SqlCommandSet will throw if + the command has no parameters. + + + + + + Executes the batch + + + This seems to be returning the total number of affected rows in all queries + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Return the batch command to be executed + + + + + The number of commands batched in this instance + + + + + Any exception that occurs in the O-R persistence layer. + + + Exceptions that occur in the database layer are left as native exceptions. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + CodeDOM-based bytecode provider. + + + + + Retrieve the delegate for this provider + capable of generating reflection optimization components. + + The class to be reflected upon. + All property getters to be accessed via reflection. + All property setters to be accessed via reflection. + The reflection optimization delegate. + + + + The specific factory for this provider capable of + generating run-time proxies for lazy-loading purposes. + + + + + NHibernate's object instaciator. + + + For entities and its implementations. + + + + + Instanciator of NHibernate's collections default types. + + + + + ctor + + The target class + Array of setters + Array of getters + + + + Set up the compiler options + + + + + Add an assembly to the list of ReferencedAssemblies + required to build the class + + + + + + Build the generated code + + Generated code + An instance of the generated class + + + + Check if the property is public + + + If IsPublic==true I can directly set the property + If IsPublic==false I need to use the setter/getter + + + + + + + Generate the required code + + C# code + + + + Represents optimized entity property access. + + + + + Factory that generate object based on IReflectionOptimizer needed to replace the use + of reflection. + + + Used in and + + + + + + Generate the IReflectionOptimizer object + + The target class + Array of setters + Array of getters + if the generation fails + + + + Represents reflection optimization for a particular class. + + + + + Represents optimized entity instantiation. + + + + + Perform instantiation of an instance of the underlying class. + + The new instance. + + + + Class constructor. + + + + + Generates a dynamic method which creates a new instance of + when invoked. + + + + + Generates a dynamic method on the given type. + + + + + Generates a dynamic method on the given type. + + + + + + Interface for instanciate all NHibernate objects. + + + + + Creates an instance of the specified type. + + The type of object to create. + A reference to the created object. + + + + Creates an instance of the specified type. + + The type of object to create. + true if a public or nonpublic default constructor can match; false if only a public default constructor can match. + A reference to the created object. + + + + Creates an instance of the specified type using the constructor + that best matches the specified parameters. + + The type of object to create. + An array of constructor arguments. + A reference to the created object. + + + + An interface for factories of proxy factory instances. + + + Used to abstract from the tupizer. + + + + + Build a proxy factory specifically for handling runtime + lazy loading. + + The lazy-load proxy factory. + + + + Emits an ldc.i4 opcode using the fastest available opcode choice. + + + + + Emits IL to unbox a value type and if null, create a new instance of the value type. + + + This does not work if the value type doesn't have a default constructor - we delegate + that to the ISetter. + + + + + Defines a new delegate type. + + + + + Type factory for collections types. + + + + + Creates a new for an . + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The to use to create the array. + Is embedded in XML (not supported yet) + + An for the specified role. + + + + + Creates a new for an + with bag semantics. + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + with bag semantics. + + The type of elements in the list. + The role the collection is in. + + The name of the property in the owner object containing the collection ID, + or if it is the primary key. + + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an . + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + with list + semantics. + + The type of elements in the list. + The role the collection is in. + + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + with id-bag semantics. + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + with identifier + bag semantics. + + The type of elements in the list. + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an . + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + that is sorted by an . + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The that does the sorting. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an . + + The type of elements in the collection. + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + A for the specified role. + + + + Creates a new for a sorted . + + The type of elements in the collection. + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + The to use for the set. + A for the specified role. + + + + Creates a new for an ordered . + + The type of elements in the collection. + The role the collection is in. + + The name of the property in the owner object containing the collection ID, + or if it is the primary key. + + Is embedded in XML (not supported yet) + A for the specified role. + + + + Creates a new for an . + + The role the collection is in. + + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + that maintains insertion order of elements. + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + that is sorted by an . + + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The that does the sorting. + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + Creates a new for an + . + + The type of keys in the dictionary. + The type of values in the dictionary. + The role the collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + Is embedded in XML (not supported yet) + + A for the specified role. + + + + + A implementation that returns + , disabling reflection optimization. + + + + + Marker interface, denoting a client-visible "soft lock" on a cached item. + + + + + A cached instance of a persistent class + + + + + An item of cached data, timestamped with the time it was cached, when it was locked, + when it was unlocked + + + + + Caches data that is sometimes updated while maintaining the semantics of + "read committed" isolation level. If the database is set to "repeatable + read", this concurrency strategy almost maintains the semantics. + Repeatable read isolation is compromised in the case of concurrent writes. + This is an "asynchronous" concurrency strategy. + + + If this strategy is used in a cluster, the underlying cache implementation + must support distributed hard locks (which are held only momentarily). This + strategy also assumes that the underlying cache implementation does not do + asynchronous replication and that state has been fully replicated as soon + as the lock is released. + for a faster algorithm + + + + + + Implementors manage transactional access to cached data. + + + + Transactions pass in a timestamp indicating transaction start time. + + + When used to cache entities and collections the key is the identifier of the + entity/collection and the value should be set to the + for an entity and the results of + for a collection. + + + + + + Attempt to retrieve an object from the Cache + + The key (id) of the object to get out of the Cache. + A timestamp prior to the transaction start time + The cached object or + + + + + Attempt to cache an object, after loading from the database + + The key (id) of the object to put in the Cache. + The value + A timestamp prior to the transaction start time + the version number of the object we are putting + a Comparer to be used to compare version numbers + indicates that the cache should avoid a put if the item is already cached + if the object was successfully cached + + + + + We are going to attempt to update/delete the keyed object + + The key + + + This method is used by "asynchronous" concurrency strategies. + + + + Called after an item has become stale (before the transaction completes). + + + + This method is used by "synchronous" concurrency strategies. + + + + Called after an item has been updated (before the transaction completes), + instead of calling Evict(). + + + + + + This method is used by "synchronous" concurrency strategies. + + + + Called after an item has been inserted (before the transaction completes), instead of calling Evict(). + + + + + This method is used by "synchronous" concurrency strategies. + + + + Called when we have finished the attempted update/delete (which may or + may not have been successful), after transaction completion. + + The key + The soft lock + + This method is used by "asynchronous" concurrency strategies. + + + + Called after an item has been updated (after the transaction completes), + instead of calling Release(). + + + + + + This method is used by "asynchronous" concurrency strategies. + + + + Called after an item has been inserted (after the transaction completes), instead of calling release(). + + + + + This method is used by "asynchronous" concurrency strategies. + + + + Evict an item from the cache immediately (without regard for transaction isolation). + + + + + + + Evict all items from the cache immediately. + + + + + + Clean up all resources. + + + + + + Gets the cache region name. + + + + + Gets or sets the for this strategy to use. + + The for this strategy to use. + + + + Generate an id for a new lock. Uniqueness per cache instance is very + desirable but not absolutely critical. Must be called from one of the + synchronized methods of this class. + + + + + + Do not return an item whose timestamp is later than the current + transaction timestamp. (Otherwise we might compromise repeatable + read unnecessarily.) Do not return an item which is soft-locked. + Always go straight to the database instead. + + + Note that since reading an item from that cache does not actually + go to the database, it is possible to see a kind of phantom read + due to the underlying row being updated after we have read it + from the cache. This would not be possible in a lock-based + implementation of repeatable read isolation. It is also possible + to overwrite changes made and committed by another transaction + after the current transaction read the item from the cache. This + problem would be caught by the update-time version-checking, if + the data is versioned or timestamped. + + + + + Stop any other transactions reading or writing this item to/from + the cache. Send them straight to the database instead. (The lock + does time out eventually.) This implementation tracks concurrent + locks by transactions which simultaneously attempt to write to an + item. + + + + + Do not add an item to the cache unless the current transaction + timestamp is later than the timestamp at which the item was + invalidated. (Otherwise, a stale item might be re-added if the + database is operating in repeatable read isolation mode.) + + Whether the item was actually put into the cache + + + + decrement a lock and put it back in the cache + + + + + Re-cache the updated state, if and only if there there are + no other concurrent soft locks. Release our lock. + + + + + Is the client's lock commensurate with the item in the cache? + If it is not, we know that the cache expired the original + lock. + + + + + Gets the cache region name. + + + + + Lock the item + + + + + Is this item visible to the timestamped transaction? + + + + + + + Don't overwrite already cached items + + + + + + + + + The timestamp on the cached data + + + + + The actual cached data + + + + + Not a lock! + + + + + Represents any exception from an . + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Factory class for creating an . + + + + + No providers implement transactional caching currently, + it was ported from Hibernate just for the sake of completeness. + + + + + Creates an from the parameters. + + The name of the strategy that should use for the class. + The name of the class the strategy is being created for. + if the object being stored in the cache is mutable. + Used to retrieve the global cache region prefix. + Properties the cache provider can use to configure the cache. + An to use for this object in the . + + + + Allows multiple entity classes / collection roles to be + stored in the same cache region. Also allows for composite + keys which do not properly implement equals()/hashCode(). + + + + + Construct a new key for a collection or entity instance. + Note that an entity name should always be the root entity + name, not a subclass entity name. + + The identifier associated with the cached data + The Hibernate type mapping + The entity or collection-role name. + The entiyt mode of the originating session + The session factory for which we are caching + + + + A soft lock which supports concurrent locking, + timestamped with the time it was released + + + This class was named Lock in H2.1 + + + + + Increment the lock, setting the + new lock timeout + + + + + Decrement the lock, setting the unlock + timestamp if now unlocked + + + + + + Can the timestamped transaction re-cache this + locked item now? + + + + + locks are not returned to the client! + + + + + Was this lock held concurrently by multiple + transactions? + + + + + Yes, this is a lock + + + + + Used by + + + + + Implementors define a caching algorithm. + + + + + All implementations must be threadsafe. + + + The key is the identifier of the object that is being cached and the + value is a . + + + + + + Get the object from the Cache + + + + + + + + + + + + + + Remove an item from the Cache. + + The Key of the Item in the Cache to remove. + + + + + Clear the Cache + + + + + + Clean up. + + + + + + If this is a clustered cache, lock the item + + The Key of the Item in the Cache to lock. + + + + + If this is a clustered cache, unlock the item + + The Key of the Item in the Cache to unlock. + + + + + Generate a timestamp + + + + + + Get a reasonable "lock timeout" + + + + + Gets the name of the cache region + + + + + A simple -based cache + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cache Provider plugin for NHibernate that is configured by using + cache.provider_class="NHibernate.Cache.HashtableCacheProvider" + + + + + Support for pluggable caches + + + + + Configure the cache + + the name of the cache region + configuration settings + + + + + generate a timestamp + + + + + + Callback to perform any necessary initialization of the underlying cache implementation + during ISessionFactory construction. + + current configuration settings + + + + Callback to perform any necessary cleanup of the underlying cache implementation + during . + + + + + Contract for sources of optimistically lockable data sent to the second level cache. + + + Note currently EntityPersisters are + the only viable source. + + + + + Does this source represent versioned (i.e., and thus optimistically lockable) data? + + True if this source represents versioned data; false otherwise. + + + Get the comparator used to compare two different version values together. + An appropriate comparator. + + + + Defines the contract for caches capable of storing query results. These + caches should only concern themselves with storing the matching result ids. + The transactional semantics are necessarily less strict than the semantics + of an item cache. + + + + + Defines a factory for query cache instances. These factories are responsible for + creating individual QueryCache instances. + + + + + A cache provider placeholder used when caching is disabled. + + + + + Configure the cache + + the name of the cache region + configuration settings + + + + + Generate a timestamp + + + + + Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory + construction. + + current configuration settings. + + + + Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close(). + + + + + Caches data that is sometimes updated without ever locking the cache. + If concurrent access to an item is possible, this concurrency strategy + makes no guarantee that the item returned from the cache is the latest + version available in the database. Configure your cache timeout accordingly! + This is an "asynchronous" concurrency strategy. + for a much stricter algorithm + + + + + Get the most recent version, if available. + + + + + Add an item to the cache + + + + + Do nothing + + + + + Invalidate the item + + + + + Invalidate the item + + + + + Do nothing + + + + + Invalidate the item (again, for safety). + + + + + Invalidate the item (again, for safety). + + + + + Do nothing + + + + + Gets the cache region name. + + + + + Initializes a new instance of the class. + + the session factory for this query key, required to get the identifiers of entities that are used as values. + The query string. + The query parameters. + The filters. + + + + Caches data that is never updated + + + + + Unsupported! + + + + + Unsupported! + + + + + Unsupported! + + + + + Do nothing. + + + + + Do nothing. + + + + + Do nothing. + + + + + Unsupported! + + + + + Gets the cache region name. + + + + + The standard implementation of the Hibernate + interface. This implementation is very good at recognizing stale query + results and re-running queries when it detects this condition, recaching + the new results. + + + + + Standard Hibernate implementation of the IQueryCacheFactory interface. Returns + instances of . + + + + + Generates increasing identifiers (in a single application domain only). + + + Not valid across multiple application domains. Identifiers are not necessarily + strictly increasing, but usually are. + + + + + + + + + + + + + + Tracks the timestamps of the most recent updates to particular tables. It is + important that the cache timeout of the underlying cache implementation be set + to a higher value than the timeouts of any of the query caches. In fact, we + recommend that the the underlying cache not be configured for expiry at all. + Note, in particular, that an LRU cache expiry policy is never appropriate. + + + + + + + + Helper to parse hibernate-configuration XmlNode. + + + + + The XML node name for hibernate configuration section in the App.config/Web.config and + for the hibernate.cfg.xml . + + + + The XML Namespace for the nhibernate-configuration + + + XPath expression for bytecode-provider property. + + + XPath expression for reflection-optimizer property. + + + XPath expression for session-factory whole node. + + + XPath expression for session-factory.property nodes + + + XPath expression for session-factory.mapping nodes + + + XPath expression for session-factory.class-cache nodes + + + XPath expression for session-factory.collection-cache nodes + + + XPath expression for session-factory.event nodes + + + XPath expression for session-factory.listener nodes + + + + Convert a string to . + + The string that represent . + + The converted to . + + If the values is invalid. + + See for allowed values. + + + + + Convert a string to . + + The string that represent . + + The converted to . + + If the values is invalid. + + See for allowed values. + + + + + Values for class-cache include. + + Not implemented in Cache. + + + Xml value: all + + + Xml value: non-lazy + + + + Configuration parsed values for a class-cache XML node. + + + + + Initializes a new instance of the class. + + The class full name. + Cache strategy. + When is null or empty. + + + + Initializes a new instance of the class. + + The class full name. + Cache strategy. + Values for class-cache include. + When is null or empty. + + + + Initializes a new instance of the class. + + The class full name. + Cache strategy. + The cache region. + When is null or empty. + + + + Initializes a new instance of the class. + + The class full name. + Cache strategy. + Values for class-cache include. + The cache region. + When is null or empty. + + + + The class full name. + + + + + The cache region. + + If null or empty the is used during configuration. + + + + Cache strategy. + + + + + class-cache include. + + + Not implemented in Cache. + Default value . + + + + + Configuration parsed values for a collection-cache XML node. + + + + + Initializes a new instance of the class. + + The cache role. + Cache strategy. + When is null or empty. + + + + Initializes a new instance of the class. + + The cache role. + Cache strategy. + The cache region. + When is null or empty. + + + + The role. + + + + + The cache region. + + If null or empty the is used during configuration. + + + + Cache strategy. + + + + + Configuration parsed values for a event XML node. + + + + + Initializes a new instance of the class. + + The listener. + The type. + + + + The default type of listeners. + + + + + Listeners for this event. + + + + + Values for bytecode-provider system property. + + + + Xml value: codedom + + + Xml value: lcg + + + Xml value: null + + + + Configuration parsed values for hibernate-configuration section. + + + + + Initializes a new instance of the class. + + The XML reader to parse. + + The nhibernate-configuration.xsd is applied to the XML. + + When nhibernate-configuration.xsd can't be applied. + + + + Value for bytecode-provider system property. + + Default value . + + + + Value for reflection-optimizer system property. + + Default value true. + + + + The if the session-factory exists in hibernate-configuration; + Otherwise null. + + + + + Configuration parsed values for a listener XML node + + + + + Initializes a new instance of the class. + + The class full name. + When is null or empty. + + + + Initializes a new instance of the class. + + The class full name. + The listener type. + When is null or empty. + + + + The class full name. + + + + + The listener type. + + Default value mean that the value is ignored. + + + + Configuration parsed values for a mapping XML node + + + There are 3 possible combinations of mapping attributes + 1 - resource and assembly: NHibernate will read the mapping resource from the specified assembly + 2 - file only: NHibernate will read the mapping from the file. + 3 - assembly only: NHibernate will find all the resources ending in hbm.xml from the assembly. + + + + + Initializes a new instance of the class. + + Mapped file. + When is null or empty. + + + + Initializes a new instance of the class. + + The assembly name. + The mapped embedded resource. + When is null or empty. + + + + Configuration parsed values for a session-factory XML node. + + + + + The session factory name. + + + + + Session factory propeties bag. + + + + + Session factory mapping configuration. + + + + + Session factory class-cache configurations. + + + + + Session factory collection-cache configurations. + + + + + Session factory event configurations. + + + + + Session factory listener configurations. + + + + + The session factory name. + + + + + Session factory propeties bag. + + + + + Session factory mapping configuration. + + + + + Session factory class-cache configurations. + + + + + Session factory collection-cache configurations. + + + + + Session factory event configurations. + + + + + Session factory listener configurations. + + + + + Initializes a new instance of the class. + + The session factory name. Null or empty string are allowed. + + + + Define and configure the dialect to use. + + The dialect implementation inherited from . + The fluent configuration itself. + + + + Maximum depth of outer join fetching + + + 0 (zero) disable the usage of OuterJoinFetching + + + + + Set the SessionFactory mnemonic name. + + The mnemonic name. + The fluent configuration itself. + + The SessionFactory mnemonic name can be used as a surrogate key in a multi-DB application. + + + + + DataBase integration configuration. + + + + + Cache configuration. + + + + + Properties of TypeDef configuration. + + + + + + The key to use the type-definition inside not strongly typed mappings (XML mapping). + + + + + An which public properties are used as + type-definition pareneters or null where type-definition does not need parameters or you want use default values. + + + + As an anonimous object can be used: + + configure.TypeDefinition<TableHiLoGenerator>(c=> + { + c.Alias = "HighLow"; + c.Properties = new {max_lo = 99}; + }); + + + + + + + Responsible for checking that a resource name matches the default pattern of "*.hbm.xml". This is the + default filter for . + + + + + Responsible for determining whether an embedded resource should be parsed for HBM XML data while + iterating through an . + + + + + + + + Implemented by any mapping elemes supports simple and/or multicolumn mapping. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A base class for HBM schema classes that provides helper methods. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The relation of the element of the collection. + + + Can be one of: HbmCompositeElement, HbmElement, HbmManyToAny, HbmManyToMany, HbmOneToMany... + according to the type of the collection. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Columns and Formulas, in declared order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Responsible for converting a of HBM XML into an instance of + . + + + + + Responsible for building a list of objects from a range of acceptable + sources. + + + + + Calls the greedy constructor, passing it new instances of and + . + + + + Adds any embedded resource streams which pass the . + An assembly containing embedded mapping documents. + A custom filter. + + + Adds any embedded resource streams which pass the default filter. + An assembly containing embedded mapping documents. + + + + Responsible for converting a of HBM XML into an instance of + . + + Uses an to deserialize HBM. + + + + Converts a partial class name into a fully qualified one + + + + + + + + Converts a partial class name into a fully one + + + + The class FullName (without the assembly) + + The FullName is equivalent to the default entity-name + + + + + Attempts to find a type by its full name. Throws a + using the provided in case of failure. + + name of the class to find + Error message to use for + the in case of failure. Should contain + the {0} formatting placeholder. + A instance. + + Thrown when there is an error loading the class. + + + + + Similar to , but handles short class names + by calling . + + + + + + + + + Called for all collections. parameter + was added in NH to allow for reflection related to generic types. + + + + + Called for arrays and primitive arrays + + + + + Called for Maps + + + + + Called for all collections + + + + + Bind columns and formulas in the order in which they were mapped. + + + + + + + + Extracts the names of classes mapped in a given file, + and the names of the classes they extend. + + + + + Returns a collection of containing + information about all classes in this stream. + + A validated representing + a mapping file. + + + + Holds information about mapped classes found in the hbm.xml files. + + + + + Allows the application to specify properties and mapping documents to be used when creating + a . + + + + Usually an application will create a single , build a single instance + of , and then instantiate objects in threads + servicing client requests. + + + The is meant only as an initialization-time object. + is immutable and does not retain any association back to the + + + + + Default name for hibernate configuration file. + + + + Clear the internal state of the object. + + + + + Create a new Configuration object. + + + + + Get the mapping for a particular class + + + + Get the mapping for a particular entity + An entity name. + the entity mapping information + + + + Get the mapping for a particular collection role + + a collection role + + + + + Read mappings from a particular XML file. This method is equivalent + to . + + + + + + + Read mappings from a particular XML file. + + a path to a file + This configuration object. + + + + Read mappings from a . This method is equivalent to + . + + an XML string + The name to use in error reporting. May be . + This configuration object. + + + + Read mappings from a . + + an XML string + This configuration object. + + + + Read mappings from a URL. + + a URL + This configuration object. + + + + Read mappings from a URL. + + a to read the mappings from. + This configuration object. + + + + Read mappings from an . + + A loaded that contains the mappings. + The name of the document, for error reporting purposes. + This configuration object. + + + + Takes the validated XmlDocument and has the Binder do its work of + creating Mapping objects from the Mapping Xml. + + The NamedXmlDocument that contains the validated mapping XML file. + + + + Add mapping data using deserialized class. + + Mapping metadata. + XML file's name where available; otherwise null. + + + + Create a new to add classes and collection + mappings to. + + + + + Read mappings from a . + + The stream containing XML + This Configuration object. + + The passed in through the parameter + is not guaranteed to be cleaned up by this method. It is the caller's responsiblity to + ensure that is properly handled when this method + completes. + + + + + Read mappings from a . + + The stream containing XML + The name of the stream to use in error reporting. May be . + This Configuration object. + + The passed in through the parameter + is not guaranteed to be cleaned up by this method. It is the caller's responsiblity to + ensure that is properly handled when this method + completes. + + + + + Adds the mappings in the resource of the assembly. + + The path to the resource file in the assembly. + The assembly that contains the resource file. + This configuration object. + + + + Adds the mappings from embedded resources of the assembly. + + Paths to the resource files in the assembly. + The assembly that contains the resource files. + This configuration object. + + + + Read a mapping from an embedded resource, using a convention. + + The type to map. + This configuration object. + + The convention is for class Foo.Bar.Foo to be mapped by + the resource named Foo.Bar.Foo.hbm.xml, embedded in + the class' assembly. If the mappings and classes are defined + in different assemblies or don't follow the naming convention, + this method cannot be used. + + + + + Adds all of the assembly's embedded resources whose names end with .hbm.xml. + + The name of the assembly to load. + This configuration object. + + The assembly must be loadable using . If this + condition is not satisfied, load the assembly manually and call + instead. + + + + + Adds all of the assembly's embedded resources whose names end with .hbm.xml. + + The assembly. + This configuration object. + + + + Read all mapping documents from a directory tree. Assume that any + file named *.hbm.xml is a mapping document. + + a directory + + + + Generate DDL for dropping tables + + + + + + Generate DDL for creating tables + + + + + + Call this to ensure the mappings are fully compiled/built. Usefull to ensure getting + access to all information in the metamodel when calling e.g. getClassMappings(). + + + + + This method may be called many times!! + + + + + Instantiate a new , using the properties and mappings in this + configuration. The will be immutable, so changes made to the + configuration after building the will not affect it. + + An instance. + + + + Returns the set of properties computed from the default properties in the dialect combined with the other properties in the configuration. + + + + + + Set the default assembly to use for the mappings added to the configuration + afterwards. + + The default assembly name. + This configuration instance. + + This setting can be overridden for a mapping file by setting default-assembly + attribute of <hibernate-mapping> element. + + + + + Set the default namespace to use for the mappings added to the configuration + afterwards. + + The default namespace. + This configuration instance. + + This setting can be overridden for a mapping file by setting default-namespace + attribute of <hibernate-mapping> element. + + + + + Sets the default interceptor for use by all sessions. + + The default interceptor. + This configuration instance. + + + + Specify a completely new set of properties + + + + + Adds an of configuration properties. The + Key is the name of the Property and the Value is the + value of the Property. + + An of configuration properties. + + This object. + + + + + Sets the value of the configuration property. + + The name of the property. + The value of the property. + + This configuration object. + + + + + Gets the value of the configuration property. + + The name of the property. + The configured value of the property, or if the property was not specified. + + + + Configure NHibernate using the <hibernate-configuration> section + from the application config file, if found, or the file hibernate.cfg.xml if the + <hibernate-configuration> section not include the session-factory configuration. + + A configuration object initialized with the file. + + To configure NHibernate explicitly using hibernate.cfg.xml, appling merge/override + of the application configuration file, use this code: + + configuration.Configure("path/to/hibernate.cfg.xml"); + + + + + + Configure NHibernate using the file specified. + + The location of the XML file to use to configure NHibernate. + A Configuration object initialized with the file. + + Calling Configure(string) will override/merge the values set in app.config or web.config + + + + + Configure NHibernate using a resource contained in an Assembly. + + The that contains the resource. + The name of the manifest resource being requested. + A Configuration object initialized from the manifest resource. + + Calling Configure(Assembly, string) will overwrite the values set in app.config or web.config + + + + + Configure NHibernate using the specified XmlReader. + + The that contains the Xml to configure NHibernate. + A Configuration object initialized with the file. + + Calling Configure(XmlReader) will overwrite the values set in app.config or web.config + + + + + Set up a cache for an entity class + + + + + Set up a cache for a collection role + + + + + Create an object-oriented view of the configuration properties + + A object initialized from the settings properties. + + + + Set a custom naming strategy + + the NamingStrategy to set + + + + + Load and validate the mappings in the against + the nhibernate-mapping-2.2 schema, without adding them to the configuration. + + + This method is made public to be usable from the unit tests. It is not intended + to be called by end users. + + The XmlReader that contains the mapping. + The name of the document, for error reporting purposes. + NamedXmlDocument containing the validated XmlDocument built from the XmlReader. + + + + Adds the Mappings in the after validating it + against the nhibernate-mapping-2.2 schema. + + The XmlReader that contains the mapping. + This Configuration object. + + + + Adds the Mappings in the after validating it + against the nhibernate-mapping-2.2 schema. + + The XmlReader that contains the mapping. + The name of the document to use for error reporting. May be . + This Configuration object. + + + + Set or clear listener for a given . + + The . + The array of AssemblyQualifiedName of each listener for . + + must implements the interface related with . + All listeners of the given will be cleared if the + is null or empty. + + + when an element of have an invalid value or cant be instantiated. + + + + + Set or clear listener for a given . + + The . + The listener for or null to clear. + must implements the interface related with . + + + + + Set or clear listeners for a given . + + The . + The listener for or null to clear. + Listeners of must implements one of the interface of event listenesr. + + + + + Append the listeners to the end of the currently configured + listeners + + + + + Generate DDL for altering tables + + + + + + The class mappings + + + + + The collection mappings + + + + + The table mappings + + + + + The named queries + + + + + Retrieve the user-supplied delegate to handle non-existent entity scenarios. + + + Specify a user-supplied delegate to be used to handle scenarios where an entity could not be + located by specified id. This is mainly intended for EJB3 implementations to be able to + control how proxy initialization errors should be handled... + + + + + Gets or sets the to use. + + The to use. + + + + Gets or sets the that contains the configuration + properties and their values. + + + The that contains the configuration + properties and their values. + + + + + Get the query language imports (entityName/className -> AssemblyQualifiedName) + + + + + The named SQL queries + + + + + Naming strategy for tables and columns + + + + + Defines operations common to "compiled" mappings (ie. SessionFactory) and + "uncompiled" mappings (ie Configuration that are used by implementors of IType + + + + + Add a type-definition for mappings. + + The peristent type. + The where add the type-definition. + The custom configuration action. + The . + + + + + Depending on where you will use the type-definition in the mapping the + can be : + + + + + + + + + + + + + + + + + + + + + Summary description for ConfigurationSectionHandler. + + + + + The default + + See for a better alternative + + + + A set of rules for determining the physical column and table names given the information in the mapping + document. May be used to implement project-scoped naming standards for database objects. + + + + + Return a table name for an entity class + + the fully-qualified class name + a table name + + + + Return a column name for a property path expression + + a property path + a column name + + + + Alter the table name given in the mapping document + + a table name + a table name + + + + Alter the column name given in the mapping document + + a column name + a column name + + + + Return a table name for a collection + + the fully-qualified name of the owning entity class + a property path + a table name + + + + Return the logical column name used to refer to a column in the metadata + (like index, unique constraints etc) + A full bijection is required between logicalNames and physical ones + logicalName have to be case insersitively unique for a given table + + given column name if any + property name of this column + + + + The singleton instance + + + + + Return the unqualified class name + + + + + + + Return the unqualified property name + + + + + + + Return the argument + + + + + + + Return the argument + + + + + + + Return the unqualified property name + + + + + + + + Values for class-cache and collection-cache strategy. + + + + Xml value: read-only + + + Xml value: read-write + + + Xml value: nonstrict-read-write + + + Xml value: transactional + + + + Helper to parse to and from XML string value. + + + + + Convert a in its xml expected value. + + The to convert. + The . + + + + Convert a string to . + + The string that represent . + + The converted to . + + If the values is invalid. + + See for allowed values. + + + + + Provides access to configuration information. + + + NHibernate has two property scopes: + + + Factory-level properties may be passed to the when it is + instantiated. Each instance might have different property values. If no properties are + specified, the factory gets them from Environment + + + System-level properties are shared by all factory instances and are always determined + by the properties + + + In NHibernate, <hibernate-configuration> section in the application configuration file + corresponds to Java system-level properties; <session-factory> + section is the session-factory-level configuration. + + It is possible to use the application configuration file (App.config) together with the NHibernate + configuration file (hibernate.cfg.xml) at the same time. + Properties in hibernate.cfg.xml override/merge properties in application configuration file where same + property is found. For others configuration a merge is applied. + + + + + Used to find the .Net 2.0 named connection string + + + + A default database schema (owner) name to use for unqualified tablenames + + + A default database catalog name to use for unqualified tablenames + + + The EntityMode in which set the Session opened from the SessionFactory. + + + + When using an enhanced id generator and pooled optimizers (), + prefer interpreting the database value as the lower (lo) boundary. The default is to interpret it as the high boundary. + + + + Enable formatting of SQL logged to the console + + + Should named queries be checked during startup (the default is enabled). + Mainly intended for test environments. + + + Enable statistics collection + + + Enable ordering of insert statements for the purpose of more effecient batching. + + + + Issue warnings to user when any obsolete property names are used. + + + + + + + NHibernate version (informational). + + + + + Gets a copy of the configuration found in <hibernate-configuration> section + of app.config/web.config. + + + This is the replacement for hibernate.properties + + + + + The bytecode provider to use. + + + This property is read from the <nhibernate> section + of the application configuration file by default. Since it is not + always convenient to configure NHibernate through the application + configuration file, it is also possible to set the property value + manually. This should only be done before a configuration object + is created, otherwise the change may not take effect. + + + + + Whether to enable the use of reflection optimizer + + + This property is read from the <nhibernate> section + of the application configuration file by default. Since it is not + always convenient to configure NHibernate through the application + configuration file, it is also possible to set the property value + manually. This should only be done before a configuration object + is created, otherwise the change may not take effect. + + + + + Represents a mapping queued for delayed processing to await + processing of an extends entity upon which it depends. + + + + + An exception that occurs at configuration time, rather than runtime, as a result of + something screwy in the hibernate.cfg.xml. + + + + + An exception that usually occurs at configuration time, rather than runtime, as a result of + something screwy in the O-R mappings + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Initializes a new instance of the class. + + Default message is used. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Summary description for ImprovedNamingStrategy. + + + + + The singleton instance + + + + + Return the unqualified class name, mixed case converted to underscores + + + + + + + Return the full property path with underscore separators, mixed case converted to underscores + + + + + + + Convert mixed case to underscores + + + + + + + Convert mixed case to underscores + + + + + + + Return the full property path prefixed by the unqualified class name, with underscore separators, mixed case converted to underscores + + + + + + + + A collection of mappings from classes and collections to relational database tables. + + Represents a single <hibernate-mapping> element. + + + + Binding table between the logical column name and the name out of the naming strategy + for each table. + According that when the column name is not set, the property name is considered as such + This means that while theoretically possible through the naming strategy contract, it is + forbidden to have 2 real columns having the same logical name + + + + + Binding between logical table name and physical one (ie after the naming strategy has been applied) + + + + + + + + + + + + + + + + + Adds an import to allow for the full class name Namespace.Entity (AssemblyQualifiedName) + to be referenced as Entity or some other name in HQL. + + The name of the type that is being renamed. + The new name to use in HQL for the type. + Thrown when the rename already identifies another type. + + + + + + + + + The default namespace for persistent classes + + + + + The default assembly for persistent classes + + + + + + + + + + + Gets or sets a boolean indicating if the Fully Qualified Type name should + automatically have an import added as the class name. + + if the class name should be used as an import. + + Auto-import is used to shorten the string used to refer to types to just their + unqualified name. So if the type MyAssembly.MyNamespace.MyClass, MyAssembly has + auto-import="false" then all use of it in HQL would need to be the fully qualified + version MyAssembly.MyNamespace.MyClass. If auto-import="true", the type could + be referred to in HQL as just MyClass. + + + + + Queues mapping files according to their dependency order. + + + + + Adds the specified document to the queue. + + + + + Gets a that can now be processed (i.e. + that doesn't depend on classes not yet processed). + + + + + + Checks that no unprocessed documents remain in the queue. + + + + + Holds information about mapped classes found in an embedded resource + + + + + Gets the names of all entities outside this resource + needed by the classes in this resource. + + + + + Gets the names of all entities in this resource + + + + + Settings that affect the behavior of NHibernate at runtime. + + + + + Get the registry to provide Hql-Generators for known properties/methods. + + + + + Reads configuration properties and configures a instance. + + + + + Provides callbacks from the to the persistent object. Persistent classes may + implement this interface but they are not required to. + + + + , , and are intended to be used + to cascade saves and deletions of dependent objects. This is an alternative to declaring cascaded + operations in the mapping file. + + + may be used to initialize transient properties of the object from its persistent + state. It may not be used to load dependent objects since the interface + may not be invoked from inside this method. + + + A further intended usage of , , and + is to store a reference to the for later use. + + + If , , or return + , the operation is silently vetoed. If a + is thrown, the operation is vetoed and the exception is passed back to the application. + + + Note that is called after an identifier is assigned to the object, except when + identity key generation is used. + + + + + + Called when an entity is saved + + The session + If we should veto the save + + + + Called when an entity is passed to . + + The session + A value indicating whether the operation + should be vetoed or allowed to proceed. + + This method is not called every time the object's state is + persisted during a flush. + + + + + Called when an entity is deleted + + The session + A value indicating whether the operation + should be vetoed or allowed to proceed. + + + + Called after an entity is loaded. + + + It is illegal to access the from inside this method.. + However, the object may keep a reference to the session for later use + + The session + The identifier + + + + Veto the action + + + + + Accept the action + + + + + Implemented by persistent classes with invariants that must be checked before inserting + into or updating the database + + + + + Validate the state of the object before persisting it. If a violation occurs, + throw a . This method must not change the state of the object + by side-effect. + + + + + Thrown from when an invariant was violated. Some applications + might subclass this exception in order to provide more information about the violation + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + An unordered, unkeyed collection that can contain the same element + multiple times. The .NET collections API, has no Bag. + Most developers seem to use to represent bag semantics, + so NHibernate follows this practice. + + The type of the element the bag should hold. + The underlying collection used is an + + + + An unordered, unkeyed collection that can contain the same element + multiple times. The .NET collections API has no Bag class. + Most developers seem to use s to represent bag semantics, + so NHibernate follows this practice. + + + + + Base class for implementing . + + + + + + Persistent collections are treated as value objects by NHibernate. + ie. they have no independent existence beyond the object holding + a reference to them. Unlike instances of entity classes, they are + automatically deleted when unreferenced and automatically become + persistent when held by a persistent object. Collections can be + passed between different objects (change "roles") and this might + cause their elements to move from one database table to another. + + + NHibernate "wraps" a collection in an instance of + . This mechanism is designed + to support tracking of changes to the collection's persistent + state and lazy instantiation of collection elements. The downside + is that only certain abstract collection types are supported and + any extra semantics are lost. + + + Applications should never use classes in this namespace + directly, unless extending the "framework" here. + + + Changes to structure of the collection are recorded by the + collection calling back to the session. Changes to mutable + elements (ie. composite elements) are discovered by cloning their + state when the collection is initialized and comparing at flush + time. + + + + + + Return the user-visible collection (or array) instance + + + By default, the NHibernate wrapper is an acceptable collection for + the end user code to work with because it is interface compatible. + An NHibernate PersistentList is an IList, an NHibernate PersistentMap is an IDictionary + and those are the types user code is expecting. + + + + After flushing, re-init snapshot state. + + + + Clears out any Queued Additions. + + + After a Flush() the database is in synch with the in-memory + contents of the Collection. Since everything is in synch remove + any Queued Additions. + + + + + Called just before reading any rows from the + + + + + Called after reading all rows from the + + + This should be overridden by sub collections that use temporary collections + to store values read from the db. + + + true if NOT has Queued operations + + + + + Called after initializing from cache + + + true if NOT has Queued operations + + + + + Disassociate this collection from the given session. + + + true if this was currently associated with the given session + + + + Associate the collection with the given session. + + + false if the collection was already associated with the session + + + + Read the state of the collection from a disassembled cached value. + + + + + + + + Iterate all collection entries, during update of the database + + + An that gives access to all entries + in the collection. + + + + + Reads the row from the . + + + This method should be prepared to handle duplicate elements caused by fetching multiple collections, + or should be updated + to return for the collection type. + + The IDataReader that contains the value of the Identifier + The persister for this Collection. + The descriptor providing result set column names + The owner of this Collection. + The object that was contained in the row. + + + + Get the identifier of the given collection entry + + + + + Get the index of the given collection entry + + + + + Get the value of the given collection entry + + + + + Get the snapshot value of the given collection entry + + + + + Called before any elements are read into the collection, + allowing appropriate initializations to occur. + + The for this persistent collection. + The anticipated size of the collection after initilization is complete. + + + + Does the current state exactly match the snapshot? + + The to compare the elements of the Collection. + + if the wrapped collection is different than the snapshot + of the collection or if one of the elements in the collection is + dirty. + + + + Is the snapshot empty? + + + + Disassemble the collection, ready for the cache + + The for this Collection. + The contents of the persistent collection in a cacheable form. + + + + Gets a indicating if the rows for this collection + need to be recreated in the table. + + The for this Collection. + + by default since most collections can determine which rows need to be + individually updated/inserted/deleted. Currently only 's for many-to-many + need to be recreated. + + + + + Return a new snapshot of the current state of the collection + + + + + To be called internally by the session, forcing + immediate initalization. + + + This method is similar to , except that different exceptions are thrown. + + + + + Does an element exist at this entry in the collection? + + + + + Do we need to insert this element? + + + + + Do we need to update this element? + + + + + Get all the elements that need deleting + + + + + Is this the wrapper for the given underlying collection instance? + + The collection to see if this IPersistentCollection is wrapping. + + if the IPersistentCollection is wrappping the collection instance, + otherwise. + + + + Get the "queued" orphans + + + + Clear the dirty flag, after flushing changes + to the database. + + + + + Mark the collection as dirty + + + + + Called before inserting rows, to ensure that any surrogate keys are fully generated + + + + + + Called after inserting a row, to fetch the natively generated id + + + + + Get all "orphaned" elements + + The snapshot of the collection. + The persistent class whose objects + the collection is expected to contain. + + An that contains all of the elements + that have been orphaned. + + + + + The owning entity. + + + Note that the owner is only set during the flush + cycle, and when a new collection wrapper is created + while loading an entity. + + + + Get the current collection key value + + + Get the current role name + + + Is the collection unreferenced? + + + + Is the collection dirty? Note that this is only + reliable during the flush cycle, after the + collection elements are dirty checked against + the snapshot. + + + + Get the snapshot cached by the collection instance + + + + Is the initialized collection empty? + + + + + Gets a indicating if the underlying collection is directly + accessible through code. + + + if we are not guaranteed that the NHibernate collection wrapper + is being used. + + + This is typically whenever a transient object that contains a collection is being + associated with an through or . + NHibernate can't guarantee that it will know about all operations that would cause NHibernate's collections + to call or . + + + + + + + + + + + + + + Not called by Hibernate, but used by non-NET serialization, eg. SOAP libraries. + + + + + Return the user-visible collection (or array) instance + + + By default, the NHibernate wrapper is an acceptable collection for + the end user code to work with because it is interface compatible. + An NHibernate PersistentList is an IList, an NHibernate PersistentMap is an IDictionary + and those are the types user code is expecting. + + + + + Called by any read-only method of the collection interface + + + + Called by the Count property + + + + Called by any writer method of the collection interface + + + + + Queue an addition, delete etc. if the persistent collection supports it + + + + + After reading all existing elements from the database, + add the queued elements to the underlying collection. + + + + + Clears out any Queued operation. + + + After flushing, clear any "queued" additions, since the + database state is now synchronized with the memory state. + + + + + Called just before reading any rows from the + + + + + Called after reading all rows from the + + + This should be overridden by sub collections that use temporary collections + to store values read from the db. + + + + + Initialize the collection, if possible, wrapping any exceptions + in a runtime exception + + currently obsolete + if we cannot initialize + + + + Mark the collection as initialized. + + + + + Disassociate this collection from the given session. + + + true if this was currently associated with the given session + + + + Associate the collection with the given session. + + + false if the collection was already associated with the session + + + + Gets a indicating if the rows for this collection + need to be recreated in the table. + + The for this Collection. + + by default since most collections can determine which rows need to be + individually updated/inserted/deleted. Currently only 's for many-to-many + need to be recreated. + + + + + To be called internally by the session, forcing + immediate initalization. + + + This method is similar to , except that different exceptions are thrown. + + + + + Gets the Snapshot from the current session the collection is in. + + + + + Called before inserting rows, to ensure that any surrogate keys are fully generated + + + + + + Called after inserting a row, to fetch the natively generated id + + + + + Get all "orphaned" elements + + + + + Given a collection of entity instances that used to + belong to the collection, and a collection of instances + that currently belong, return a collection of orphans + + + + + Disassemble the collection, ready for the cache + + + + + + + Is this the wrapper for the given underlying collection instance? + + + + + + + Does an element exist at this entry in the collection? + + + + + + + + Get all the elements that need deleting + + + + + Read the state of the collection from a disassembled cached value. + + + + + + + + Do we need to update this element? + + + + + + + + + Reads the row from the . + + The IDataReader that contains the value of the Identifier + The persister for this Collection. + The descriptor providing result set column names + The owner of this Collection. + The object that was contained in the row. + + + + Do we need to insert this element? + + + + + + + + + Get the index of the given collection entry + + + + + Called before any elements are read into the collection, + allowing appropriate initializations to occur. + + The underlying collection persister. + The anticipated size of the collection after initilization is complete. + + + + Is the collection currently connected to an open session? + + + + + Is this collection in a state that would allow us to "queue" additions? + + + + Is this collection in a state that would allow us to + "queue" puts? This is a special case, because of orphan + delete. + + + + Is this collection in a state that would allow us to + "queue" clear? This is a special case, because of orphan + delete. + + + + Is this the "inverse" end of a bidirectional association? + + + + Is this the "inverse" end of a bidirectional association with + no orphan delete enabled? + + + + + Is this the "inverse" end of a bidirectional one-to-many, or + of a collection with no orphan delete? + + + + + + + + Is the initialized collection empty? + + + + + Gets a indicating if the underlying collection is directly + accessible through code. + + + if we are not guaranteed that the NHibernate collection wrapper + is being used. + + + This is typically whenever a transient object that contains a collection is being + associated with an through or . + NHibernate can't guarantee that it will know about all operations that would cause NHibernate's collections + to call or . + + + + Is this instance initialized? + + + Does this instance have any "queued" additions? + + + + + + + Counts the number of times that the occurs + in the . + + The element to find in the list. + The to search. + The that can determine equality. + The entity mode. + + The number of occurrences of the element in the list. + + + + + Initializes this PersistentBag from the cached values. + + The CollectionPersister to use to reassemble the PersistentBag. + The disassembled PersistentBag. + The owner object. + + + + Gets a indicating if this PersistentBag needs to be recreated + in the database. + + + + if this is a one-to-many Bag, if this is not + a one-to-many Bag. Since a Bag is an unordered, unindexed collection + that permits duplicates it is not possible to determine what has changed in a + many-to-many so it is just recreated. + + + + + Implements "bag" semantics more efficiently than by adding + a synthetic identifier column to the table. + + + + The identifier is unique for all rows in the table, allowing very efficient + updates and deletes. The value of the identifier is never exposed to the + application. + + + Identifier bags may not be used for a many-to-one association. Furthermore, + there is no reason to use inverse="true". + + + + + + Implements "bag" semantics more efficiently than a regular + by adding a synthetic identifier column to the table. + + + + The identifier is unique for all rows in the table, allowing very efficient + updates and deletes. The value of the identifier is never exposed to the + application. + + + PersistentIdentifierBags may not be used for a many-to-one association. + Furthermore, there is no reason to use inverse="true". + + + + + + Initializes this Bag from the cached values. + + The CollectionPersister to use to reassemble the PersistentIdentifierBag. + The disassembled PersistentIdentifierBag. + The owner object. + + + + A persistent wrapper for an + + The type of the element the list should hold. + The underlying collection used is a + + + + A persistent wrapper for an + + + The underlying collection used in an . + + + + + Initializes an instance of the + in the . + + The the list is in. + + + + Initializes an instance of the + that wraps an existing in the . + + The the list is in. + The to wrap. + + + + Initializes this PersistentList from the cached values. + + The CollectionPersister to use to reassemble the PersistentList. + The disassembled PersistentList. + The owner object. + + + + A persistent wrapper for a . Underlying + collection is a + + The type of the keys in the IDictionary. + The type of the elements in the IDictionary. + + + + A persistent wrapper for a . Underlying collection + is a . + + + + + Construct an uninitialized PersistentMap. + + The ISession the PersistentMap should be a part of. + + + + Construct an initialized PersistentMap based off the values from the existing IDictionary. + + The ISession the PersistentMap should be a part of. + The IDictionary that contains the initial values. + + + + Initializes this PersistentMap from the cached values. + + The CollectionPersister to use to reassemble the PersistentMap. + The disassembled PersistentMap. + The owner object. + + + + .NET has no design equivalent for Java's Set so we are going to use the + Iesi.Collections library. This class is internal to NHibernate and shouldn't + be used by user code. + + + The code for the Iesi.Collections library was taken from the article + Add Support for "Set" Collections + to .NET that was written by JasonSmith. + + + + + .NET has no design equivalent for Java's Set so we are going to use the + Iesi.Collections library. This class is internal to NHibernate and shouldn't + be used by user code. + + + The code for the Iesi.Collections library was taken from the article + Add Support for "Set" Collections + to .NET that was written by JasonSmith. + + + + + The that NHibernate is wrapping. + + + + + A temporary list that holds the objects while the PersistentSet is being + populated from the database. + + + This is necessary to ensure that the object being added to the PersistentSet doesn't + have its' GetHashCode() and Equals() methods called during the load + process. + + + + + Constructor matching super. + Instantiates a lazy set (the underlying set is un-initialized). + + The session to which this set will belong. + + + + Instantiates a non-lazy set (the underlying set is constructed + from the incoming set reference). + + The session to which this set will belong. + The underlying set data. + + + + Initializes this PersistentSet from the cached values. + + The CollectionPersister to use to reassemble the PersistentSet. + The disassembled PersistentSet. + The owner object. + + + + Set up the temporary List that will be used in the EndRead() + to fully create the set. + + + + + Takes the contents stored in the temporary list created during BeginRead() + that was populated during ReadFrom() and write it to the underlying + PersistentSet. + + + + + A persistent wrapper for an array. lazy initialization is NOT supported + + Use of Hibernate arrays is not really recommended. + + + + A temporary list that holds the objects while the PersistentArrayHolder is being + populated from the database. + + + + + Returns the user-visible portion of the NHibernate PersistentArrayHolder. + + + The array that contains the data, not the NHibernate wrapper. + + + + + Before is called the PersistentArrayHolder needs to setup + a temporary list to hold the objects. + + + + + Takes the contents stored in the temporary list created during + that was populated during and write it to the underlying + array. + + + + + Initializes this array holder from the cached values. + + The CollectionPersister to use to reassemble the Array. + The disassembled Array. + The owner object. + + + + Gets or sets the array. + + The array. + + + + The base class for the ConnectionProvider. + + + + + A strategy for obtaining ADO.NET . + + + The IConnectionProvider interface is not intended to be exposed to the application. + Instead it is used internally by NHibernate to obtain . + Implementors should provide a public default constructor. + + + + + Initialize the connection provider from the given properties. + + The connection provider settings + + + + Dispose of a used + + The to clean up. + + + + Get an open . + + An open . + + + + Gets the this ConnectionProvider should use to + communicate with the .NET Data Provider + + + The to communicate with the .NET Data Provider. + + + + + Closes the . + + The to clean up. + + + + Configures the ConnectionProvider with the Driver and the ConnectionString. + + An that contains the settings for this ConnectionProvider. + + Thrown when a could not be found + in the settings parameter or the Driver Class could not be loaded. + + + + + Get the .NET 2.0 named connection string + + + Thrown when a was found + in the settings parameter but could not be found in the app.config + + + + + Configures the driver for the ConnectionProvider. + + An that contains the settings for the Driver. + + Thrown when the could not be + found in the settings parameter or there is a problem with creating + the . + + + + + Get an open . + + An open . + + + + A flag to indicate if Disose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this ConnectionProvider is being Disposed of or Finalized. + +

+ If this ConnectionProvider is being Finalized (isDisposing==false) then make + sure not to call any methods that could potentially bring this + ConnectionProvider back to life. +

+

+ If any subclasses manage resources that also need to be disposed of this method + should be overridden, but don't forget to call it in the override. +

+
+
+ + + Gets the for the + to connect to the database. + + + The for the + to connect to the database. + + + + + Gets the that can create the object. + + + The that can create the . + + + + + Instanciates a connection provider given configuration properties. + + + + + A ConnectionProvider that uses an IDriver to create connections. + + + + + Closes and Disposes of the . + + The to clean up. + + + + Gets a new open through + the . + + + An Open . + + + If there is any problem creating or opening the . + + + + + An implementation of the IConnectionProvider that simply throws an exception when + a connection is requested. + + + This implementation indicates that the user is expected to supply an ADO.NET connection + + + + + Throws an if this method is called + because the user is responsible for closing s. + + The to clean up. + + Thrown when this method is called. User is responsible for closing + s. + + + + + Throws an if this method is called + because the user is responsible for creating s. + + + No value is returned because an is thrown. + + + Thrown when this method is called. User is responsible for creating + s. + + + + + Configures the ConnectionProvider with only the Driver class. + + + + All other settings of the Connection are the responsibility of the User since they configured + NHibernate to use a Connection supplied by the User. + + + + + Provides a current session + for each . + Not recommended for .NET 2.0 web applications. + + + + + Extends the contract defined by + by providing methods to bind and unbind sessions to the current context. + + + The notion of a contextual session is managed by some external entity + (generally some form of interceptor like the HttpModule). + This external manager is responsible for scoping these contextual sessions + appropriately binding/unbinding them here for exposure to the application + through calls. + + + + + Defines the contract for implementations which know how to + scope the notion of a current session. + + + + Implementations should adhere to the following: + + contain a constructor accepting a single argument of type + + should be thread safe + should be fully serializable + + + + Implementors should be aware that they are also fully responsible for + cleanup of any generated current-sessions. + + + Note that there will be exactly one instance of the configured + ICurrentSessionContext implementation per . + + + It is recommended to inherit from the class + whenever possible as it simplifies the implementation and provides + single entry point with session binding support. + + + + + + Retrieve the current session according to the scoping defined + by this implementation. + + The current session. + Typically indicates an issue + locating or creating the current session. + + + + Retrieve the current session according to the scoping defined + by this implementation. + + The current session. + Indicates an issue + locating the current session. + + + + Binds the specified session to the current context. + + + + + Returns whether there is a session bound to the current context. + + + + + Unbinds and returns the current session. + + + + Gets or sets the currently bound session. + + + + Get the dicitonary mapping session factory to its current session. + + + + + Set the map mapping session factory to its current session. + + + + + Gets or sets the currently bound session. + + + + + The key is the session factory and the value is the bound session. + + + + + The key is the session factory and the value is the bound session. + + + + + Provides a current session + for each System.Web.HttpContext. + Works only with Web Applications. + + + + + This class allows access to the HttpContext without referring to HttpContext at compile time. + The accessors are cached as delegates for performance. + + + + + A impl which scopes the notion of current + session by the current thread of execution. Threads do not give us a + nice hook to perform any type of cleanup making + it questionable for this impl to actually generate Session instances. In + the interest of usability, it was decided to have this default impl + actually generate a session upon first request and then clean it up + after the associated with that session + is committed/rolled-back. In order for ensuring that happens, the sessions + generated here are unusable until after {@link Session#beginTransaction()} + has been called. If Close() is called on a session managed by + this class, it will be automatically unbound. +

+ Additionally, the static and methods are + provided to allow application code to explicitly control opening and + closing of these sessions. This, with some from of interception, + is the preferred approach. It also allows easy framework integration + and one possible approach for implementing long-sessions. +

+

+
+ + + Unassociate a previously bound session from the current thread of execution. + + + + + + + Provides a current session + for each thread using the []. + To avoid if there are two session factories in the same thread. + + + + Gets or sets the currently bound session. + + + + Provides a current session + for the current OperationContext in WCF. Works only during the lifetime of a WCF operation. + + + + + Provides a current session + for each System.Web.HttpContext. Works only with web applications. + + + + + Constructed with property name + + + + + Apply a "between" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + + + + Apply a "like" constraint to the named property + + + + + Apply a "like" constraint to the named property + + + + + Apply a "like" constraint to the named property + + + + + Apply an "is empty" constraint to the named property + + + + + Apply a "not is empty" constraint to the named property + + + + + Apply an "is null" constraint to the named property + + + + + Apply an "not is null" constraint to the named property + + + + + Constructed with property name + + + + + Add a property equal subquery criterion + + detached subquery + + + + Add a property equal all subquery criterion + + detached subquery + + + + Create a property greater than or equal subquery criterion + + detached subquery + + + + Create a property greater than or equal all subquery criterion + + detached subquery + + + + Create a property greater than or equal some subquery criterion + + detached subquery + + + + Create a property greater than subquery criterion + + detached subquery + + + + Create a property greater than all subquery criterion + + detached subquery + + + + Create a property greater than some subquery criterion + + detached subquery + + + + Create a property in subquery criterion + + detached subquery + + + + Create a property less than or equal subquery criterion + + detached subquery + + + + Create a property less than or equal all subquery criterion + + detached subquery + + + + Create a property less than or equal some subquery criterion + + detached subquery + + + + Create a property less than subquery criterion + + detached subquery + + + + Create a property less than all subquery criterion + + detached subquery + + + + Create a property less than some subquery criterion + + detached subquery + + + + Create a property not equal subquery criterion + + detached subquery + + + + Create a property not in subquery criterion + + detached subquery + + + + Create an alias for the previous projection + + + + + Select an arbitrary projection + + + + + A property average value + + + + + A property average value + + + + + A property value count + + + + + A property value count + + + + + A distinct property value count + + + + + A distinct property value count + + + + + A grouping property value + + + + + A grouping property value + + + + + A property maximum value + + + + + A property maximum value + + + + + A property minimum value + + + + + A property minimum value + + + + + A projected property value + + + + + A projected property value + + + + + A property value sum + + + + + A property value sum + + + + + Constructed with property name + + + + + Apply a "between" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + Apply an "in" constraint to the named property + + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + + + + Apply a "like" constraint to the named property + + + + + Apply a "like" constraint to the named property + + + + + Apply a "like" constraint to the named property + + + + + Apply an "is empty" constraint to the named property + + + + + Apply a "not is empty" constraint to the named property + + + + + Apply an "is null" constraint to the named property + + + + + Apply an "not is null" constraint to the named property + + + + + Add an Exists subquery criterion + + + + + Add a NotExists subquery criterion + + + + + Subquery expression in the format + .Where(t => t.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Subquery expression in the format + .Where(() => alias.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Subquery expression in the format + .WhereAll(t => t.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Subquery expression in the format + .WhereAll(() => alias.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Subquery expression in the format + .WhereSome(t => t.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Subquery expression in the format + .WhereSome(() => alias.Property [==, !=, >, etc.] detachedQueryOver.As<propertyType>()) + + + + + Add a property equal subquery criterion + + detached subquery + + + + Add a property equal all subquery criterion + + detached subquery + + + + Create a property greater than or equal subquery criterion + + detached subquery + + + + Create a property greater than or equal all subquery criterion + + detached subquery + + + + Create a property greater than or equal some subquery criterion + + detached subquery + + + + Create a property greater than subquery criterion + + detached subquery + + + + Create a property greater than all subquery criterion + + detached subquery + + + + Create a property greater than some subquery criterion + + detached subquery + + + + Create a property in subquery criterion + + detached subquery + + + + Create a property less than or equal subquery criterion + + detached subquery + + + + Create a property less than or equal all subquery criterion + + detached subquery + + + + Create a property less than or equal some subquery criterion + + detached subquery + + + + Create a property less than subquery criterion + + detached subquery + + + + Create a property less than all subquery criterion + + detached subquery + + + + Create a property less than some subquery criterion + + detached subquery + + + + Create a property not equal subquery criterion + + detached subquery + + + + Create a property not in subquery criterion + + detached subquery + + + + Base class for implementations. + + + + + An object-oriented representation of a query criterion that may be used as a constraint + in a query. + + + Built-in criterion types are provided by the Expression factory class. + This interface might be implemented by application classes but, more commonly, application + criterion types would extend AbstractCriterion. + + + + + Render a SqlString fragment for the expression. + + A SqlString that contains a valid Sql fragment. + + + + Return typed values for all parameters in the rendered SQL fragment + + An array of TypedValues for the Expression. + + + + Return all projections used in this criterion + + An array of IProjection used by the Expression. + + + + Gets a string representation of the . + + + A String that shows the contents of the . + + + This is not a well formed Sql fragment. It is useful for logging what the + looks like. + + + + + Render a SqlString for the expression. + + A SqlString that contains a valid Sql fragment. + + + + Return typed values for all parameters in the rendered SQL fragment + + An array of TypedValues for the Expression. + + + + Return all projections used in this criterion + + An array of IProjection used by the Expression. + + + + See here for details: + http://steve.emxsoftware.com/NET/Overloading+the++and++operators + + + + + See here for details: + http://steve.emxsoftware.com/NET/Overloading+the++and++operators + + + + + An Aggregation + + + + + A single-column projection that may be aliased + + + + + An "enhanced" Projection for a query. + + + + + Render the SQL Fragment. + + The criteria. + The position. + The criteria query. + The enabled filters. + + + + + Render the SQL Fragment to be used in the Group By Clause. + + The criteria. + The criteria query. + The enabled filters. + + + + + Return types for a particular user-visible alias + + + + + + + + + + + + + + + + + Get the SQL select clause column aliases for a particular user-visible alias + + + + + + + Get the SQL select clause column aliases for a particular user-visible alias + + + + + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + Get the user-visible aliases for this projection (ie. the ones that will be passed to the ResultTransformer) + + + + + Does this projection specify grouping attributes? + + + + + Does this projection specify aggregate attributes? + + + + + Get the SQL column aliases used by this projection for the columns it writes for inclusion into the + SELECT clause . NHibernate always uses column aliases + to extract data from the , so it is important that these be implemented + correctly in order for NHibernate to be able to extract these values correctly. + + Just as in , represents the number of columns rendered prior to this projection. + The local criteria to which this project is attached (for resolution). + The overall criteria query instance. + The columns aliases. + + + + Get the SQL column aliases used by this projection for the columns it writes for inclusion into the + SELECT clause () for a particular criteria-level alias. + + The criteria-level alias. + Just as in , represents the number of columns rendered prior to this projection. + The local criteria to which this project is attached (for resolution). + The overall criteria query instance. + The columns aliases. + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + An that combines two s + with an and between them. + + + + + An that combines two s + with a operator (either "and" or "or") between them. + + + + + Initialize a new instance of the class that + combines two other s. + + The to use in the Left Hand Side. + The to use in the Right Hand Side. + + + + Combines the for the Left Hand Side and the + Right Hand Side of the Expression into one array. + + An array of s. + + + + Converts the LogicalExpression to a . + + A well formed SqlString for the Where clause. + The SqlString will be enclosed by ( and ). + + + + Gets a string representation of the LogicalExpression. + + + The String contains the LeftHandSide.ToString() and the RightHandSide.ToString() + joined by the Op. + + + This is not a well formed Sql fragment. It is useful for logging what Expressions + are being combined. + + + + + Gets the that will be on the Left Hand Side of the Op. + + + + + Gets the that will be on the Right Hand Side of the Op. + + + + + Get the Sql operator to put between the two s. + + + + + Initializes a new instance of the class + that combines two . + + The to use as the left hand side. + The to use as the right hand side. + + + + Get the Sql operator to put between the two s. + + The string "and" + + + + An that represents a "between" constraint. + + + + + Initializes a new instance of the class. + + The _projection. + The _lo. + The _hi. + + + + Initialize a new instance of the class for + the named Property. + + The name of the Property of the Class. + The low value for the BetweenExpression. + The high value for the BetweenExpression. + + + + Casting a value from one type to another, at the database + level + + + + + An that Junctions together multiple + s with an and + + + + + A sequence of logical s combined by some associative + logical operator. + + + + + Adds an to the list of s + to junction together. + + The to add. + + This instance. + + + + + Adds an to the list of s + to junction together. + + + + + Adds an to the list of s + to junction together. + + + + + Get the Sql operator to put between multiple s. + + + + + The corresponding to an instance with no added + subcriteria. + + + + + Get the Sql operator to put between multiple s. + + The string " and " + + + + This is useful if we want to send a value to the database + + + + + A Count + + + + The alias that refers to the "root" entity of the criteria query. + + + Each row of results is a from alias to entity instance + + + Each row of results is an instance of the root entity + + + Each row of results is a distinct instance of the root entity + + + This result transformer is selected implicitly by calling + + + Specifies joining to an entity based on an inner join. + + + Specifies joining to an entity based on a full join. + + + Specifies joining to an entity based on a left outer join. + + + + Some applications need to create criteria queries in "detached + mode", where the Hibernate session is not available. This class + may be instantiated anywhere, and then a ICriteria + may be obtained by passing a session to + GetExecutableCriteria(). All methods have the + same semantics and behavior as the corresponding methods of the + ICriteria interface. + + + + + Get an executable instance of Criteria, + to actually run the query. + + + + Get an executable instance of Criteria, + to actually run the query. + + + + Gets the root entity type if available, throws otherwise + + + This is an NHibernate specific method, used by several dependent + frameworks for advance integration with NHibernate. + + + + + Clear all orders from criteria. + + + + + An that Junctions together multiple + s with an or + + + + + Get the Sql operator to put between multiple s. + + The string " or " + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + An that represents an "equal" constraint + between two properties. + + + + + Superclass for an that represents a + constraint between two properties (with SQL binary operators). + + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + Name of the LHS property. + Name of the RHS property. + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + + + + Get the Sql operator to use for the property expression. + + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class + that compares two mapped properties using an "equal" constraint. + + The name of the Property to use as the left hand side. + The name of the Property to use as the right hand side. + + + + Get the Sql operator to use for the . + + The string " = " + + + + Support for Query By Example. + + + + List results = session.CreateCriteria(typeof(Parent)) + .Add( Example.Create(parent).IgnoreCase() ) + .CreateCriteria("child") + .Add( Example.Create( parent.Child ) ) + .List(); + + + + "Examples" may be mixed and matched with "Expressions" in the same + + + + + Set escape character for "like" clause + + + + Set the for this . + + The to determine which properties to include. + This instance. + + This should be used when a custom has + been implemented. Otherwise use the methods + or to set the + to the s built into NHibernate. + + + + + Set the for this + to exclude zero-valued properties. + + + + + Set the for this + to exclude no properties. + + + + + Use the "like" operator for all string-valued properties with + the specified . + + + The to convert the string to the pattern + for the like comparison. + + + + + Use the "like" operator for all string-valued properties. + + + The default is MatchMode.Exact. + + + + + Exclude a particular named property + + The name of the property to exclude. + + + + Create a new instance, which includes all non-null properties + by default + + + A new instance of . + + + + Initialize a new instance of the class for a particular + entity. + + The that the Example is being built from. + The the Example should use. + + + + Determines if the property should be included in the Query. + + The value of the property. + The name of the property. + The of the property. + + if the Property should be included, if + the Property should not be a part of the Query. + + + + + Adds a based on the value + and type parameters to the in the + list parameter. + + The value of the Property. + The of the Property. + The to add the to. + + This method will add objects to the list parameter. + + + + + A strategy for choosing property values for inclusion in the query criteria + + + + + Determine if the Property should be included. + + The value of the property that is being checked for inclusion. + The name of the property that is being checked for inclusion. + The of the property. + + if the Property should be included in the Query, + otherwise. + + + + + Implementation of that includes all + properties regardless of value. + + + + + Implementation of that includes the + properties that are not and do not have an + returned by propertyValue.ToString(). + + + This selector is not present in H2.1. It may be useful if nullable types + are used for some properties. + + + + + This class is semi-deprecated. Use . + + + + + + The namespace may be used by applications as a framework for building + new kinds of . + However, it is intended that most applications will + simply use the built-in criterion types via the static factory methods of this class. + + + + + + + Apply an "equal" constraint to the identifier property + + + ICriterion + + + + Apply an "equal" constraint from the projection to the identifier property + + The projection. + ICriterion + + + + Apply an "equal" constraint to the named property + + The name of the Property in the class. + The value for the Property. + + + + Apply an "equal" constraint to the projection + + The projection. + The value for the Property. + + + + Apply a "like" constraint to the named property + + The name of the Property in the class. + The value for the Property. + A . + + + + Apply a "like" constraint to the project + + The projection. + The value for the Property. + A . + + + + Apply a "like" constraint to the project + + The projection. + The value for the Property. + The match mode. + A . + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + The name of the Property in the class. + The value for the Property. + An . + + + + A case-insensitive "like", similar to Postgres "ilike" operator + + The projection. + The value for the Property. + + An . + + + + + Apply a "greater than" constraint to the named property + + The name of the Property in the class. + The value for the Property. + + + + Apply a "greater than" constraint to the projection + + The projection. + The value for the Property. + + + + Apply a "less than" constraint to the named property + + The name of the Property in the class. + The value for the Property. + + + + Apply a "less than" constraint to the projection + + The projection. + The value for the Property. + + + + Apply a "less than or equal" constraint to the named property + + The name of the Property in the class. + The value for the Property. + + + + Apply a "less than or equal" constraint to the projection + + The projection. + The value for the Property. + + + + Apply a "greater than or equal" constraint to the named property + + The name of the Property in the class. + The value for the Property. + + + + Apply a "greater than or equal" constraint to the projection + + The projection. + The value for the Property. + + + + Apply a "between" constraint to the named property + + The name of the Property in the class. + The low value for the Property. + The high value for the Property. + A . + + + + Apply a "between" constraint to the projection + + The projection. + The low value for the Property. + The high value for the Property. + A . + + + + Apply an "in" constraint to the named property + + The name of the Property in the class. + An array of values. + An . + + + + Apply an "in" constraint to the projection + + The projection. + An array of values. + An . + + + + Apply an "in" constraint to the projection + + The projection. + An ICollection of values. + An . + + + + Apply an "in" constraint to the named property + + The name of the Property in the class. + An ICollection of values. + An . + + + + Apply an "in" constraint to the named property. This is the generic equivalent + of , renamed to avoid ambiguity. + + The name of the Property in the class. + An + of values. + An . + + + + Apply an "in" constraint to the projection. This is the generic equivalent + of , renamed to avoid ambiguity. + + + The projection. + An + of values. + An . + + + + Apply an "is null" constraint to the named property + + The name of the Property in the class. + A . + + + + Apply an "is null" constraint to the projection + + The projection. + A . + + + + Apply an "equal" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply an "equal" constraint to projection and property + + The projection. + The rhs Property Name + A . + + + + Apply an "equal" constraint to lshProjection and rshProjection + + The LHS projection. + The RSH projection. + A . + + + + Apply an "equal" constraint to the property and rshProjection + + Name of the property. + The RSH projection. + A . + + + + Apply an "not equal" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply an "not equal" constraint to projection and property + + The projection. + The rhs Property Name + A . + + + + Apply an "not equal" constraint to the projections + + The LHS projection. + The RHS projection. + A . + + + + Apply an "not equal" constraint to the projections + + Name of the property. + The RHS projection. + A . + + + + Apply a "greater than" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply a "greater than" constraint to two properties + + The projection. + The rhs Property Name + A . + + + + Apply a "greater than" constraint to two properties + + Name of the property. + The projection. + A . + + + + Apply a "greater than" constraint to two properties + + The LHS projection. + The RHS projection. + A . + + + + Apply a "greater than or equal" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply a "greater than or equal" constraint to two properties + + The LHS projection. + The RHS projection. + A . + + + + Apply a "greater than or equal" constraint to two properties + + The projection. + The rhs Property Name + A . + + + + Apply a "greater than or equal" constraint to two properties + + The lhs Property Name + The projection. + A . + + + + Apply a "less than" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply a "less than" constraint to two properties + + The projection. + The rhs Property Name + A . + + + + Apply a "less than" constraint to two properties + + The lhs Property Name + The projection. + A . + + + + Apply a "less than" constraint to two properties + + The LHS projection. + The RHS projection. + A . + + + + Apply a "less than or equal" constraint to two properties + + The lhs Property Name + The rhs Property Name + A . + + + + Apply a "less than or equal" constraint to two properties + + The projection. + The rhs Property Name + A . + + + + Apply a "less than or equal" constraint to two properties + + The lhs Property Name + The projection. + A . + + + + Apply a "less than or equal" constraint to two properties + + The LHS projection. + The RHS projection. + A . + + + + Apply an "is not null" constraint to the named property + + The name of the Property in the class. + A . + + + + Apply an "is not null" constraint to the named property + + The projection. + A . + + + + Apply an "is not empty" constraint to the named property + + The name of the Property in the class. + A . + + + + Apply an "is not empty" constraint to the named property + + The name of the Property in the class. + A . + + + + Return the conjunction of two expressions + + The Expression to use as the Left Hand Side. + The Expression to use as the Right Hand Side. + An . + + + + Return the disjuction of two expressions + + The Expression to use as the Left Hand Side. + The Expression to use as the Right Hand Side. + An . + + + + Return the negation of an expression + + The Expression to negate. + A . + + + + Group expressions together in a single conjunction (A and B and C...) + + + + + Group expressions together in a single disjunction (A or B or C...) + + + + + Apply an "equals" constraint to each property in the key set of a IDictionary + + a dictionary from property names to values + + + + + Create an ICriterion for the supplied LambdaExpression + + generic type + lambda expression + return NHibernate.Criterion.ICriterion + + + + Create an ICriterion for the supplied LambdaExpression + + lambda expression + return NHibernate.Criterion.ICriterion + + + + Create an ICriterion for the negation of the supplied LambdaExpression + + generic type + lambda expression + return NHibernate.Criterion.ICriterion + + + + Create an ICriterion for the negation of the supplied LambdaExpression + + lambda expression + return NHibernate.Criterion.ICriterion + + + + Build an ICriterion for the given property + + lambda expression identifying property + returns LambdaRestrictionBuilder + + + + Build an ICriterion for the given property + + lambda expression identifying property + returns LambdaRestrictionBuilder + + + + Apply a constraint expressed in SQL, with the given SQL parameters + + + + + + + + + Apply a constraint expressed in SQL, with the given SQL parameter + + + + + + + + + Apply a constraint expressed in SQL, with the given SQL parameter + + + + + Apply a constraint expressed in SQL + + + + + + + Apply a constraint expressed in SQL + + + + + + + An that represents an "greater than or equal" constraint + between two properties. + + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class + that compares two mapped properties using an "greater than or equal" constraint. + + The name of the Property to use as the left hand side. + The name of the Property to use as the right hand side. + + + + Get the Sql operator to use for the . + + The string " < " + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + An that represents an "greater than" constraint + between two properties. + + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class + that compares two mapped properties using an "greater than" constraint. + + The name of the Property to use as the left hand side. + The name of the Property to use as the right hand side. + + + + Get the Sql operator to use for the . + + The string " < " + + + + An instance of is passed to criterion, + order and projection instances when actually compiling and + executing the query. This interface is not used by application + code. + + + + Get the name of the column mapped by a property path, ignoring projection alias + + + Get the names of the columns mapped by a property path, ignoring projection aliases + + + Get the type of a property path, ignoring projection aliases + + + Get the names of the columns mapped by a property path + + + Get the type of a property path + + + Get the a typed value for the given property value. + + + Get the entity name of an entity + + + + Get the entity name of an entity, taking into account + the qualifier of the property path + + + + Get the root table alias of an entity + + + + Get the root table alias of an entity, taking into account + the qualifier of the property path + + + + Get the property name, given a possibly qualified property name + + + Get the identifier column names of this entity + + + Get the identifier type of this entity + + + + Create a new query parameter to use in a + + The value and the of the parameter. + A new instance of a query parameter to be added to a . + + + + An identifier constraint + + + + + An that constrains the property + to a specified list of values. + + + InExpression - should only be used with a Single Value column - no multicolumn properties... + + + + + Initializes a new instance of the class. + + The projection. + The _values. + + + + Determine the type of the elements in the IN clause. + + + + + An that represents an "like" constraint + that is not case sensitive. + + + + + Initializes a new instance of the class. + + The projection. + The value. + The match mode. + + + + Initializes a new instance of the class. + + The projection. + The value. + + + + Initialize a new instance of the + class for a named Property and its value. + + The name of the Property in the class. + The value for the Property. + + + + An that represents empty association constraint. + + + + + An that represents non-empty association constraint. + + + + + An that represents an "less than or equal" constraint + between two properties. + + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class + that compares two mapped properties using an "less than or equal" constraint. + + The name of the Property to use as the left hand side. + The name of the Property to use as the right hand side. + + + + Get the Sql operator to use for the . + + The string " <= " + + + + An that represents an "like" constraint. + + + The case sensitivity depends on the database settings for string + comparisons. Use if the + string comparison should not be case sensitive. + + + + + An that represents an "less than" constraint + between two properties. + + + + + Initializes a new instance of the class. + + Name of the LHS property. + The RHS projection. + + + + Initializes a new instance of the class. + + The LHS projection. + The RHS projection. + + + + Initializes a new instance of the class. + + The projection. + Name of the RHS property. + + + + Initializes a new instance of the class + that compares two mapped properties using an "less than" constraint. + + The name of the Property to use as the left hand side. + The name of the Property to use as the right hand side. + + + + Get the Sql operator to use for the . + + The string " < " + + + + Represents an strategy for matching strings using "like". + + + + + Initialize a new instance of the class. + + The code that identifies the match mode. + The friendly name of the match mode. + + The parameter intCode is used as the key of + to store instances and to ensure only instance of a particular + is created. + + + + + The string representation of the . + + The friendly name used to describe the . + + + + Convert the pattern, by appending/prepending "%" + + The string to convert to the appropriate match pattern. + + A that contains a "%" in the appropriate place + for the Match Strategy. + + + + + Match the entire string to the pattern + + + + + Match the start of the string to the pattern + + + + + Match the end of the string to the pattern + + + + + Match the pattern anywhere in the string + + + + + The that matches the entire string to the pattern. + + + + + Initialize a new instance of the class. + + + + + Converts the string to the Exact MatchMode. + + The string to convert to the appropriate match pattern. + The pattern exactly the same as it was passed in. + + + + The that matches the start of the string to the pattern. + + + + + Initialize a new instance of the class. + + + + + Converts the string to the Start MatchMode. + + The string to convert to the appropriate match pattern. + The pattern with a "%" appended at the end. + + + + The that matches the end of the string to the pattern. + + + + + Initialize a new instance of the class. + + + + + Converts the string to the End MatchMode. + + The string to convert to the appropriate match pattern. + The pattern with a "%" appended at the beginning. + + + + The that exactly matches the string + by appending "%" to the beginning and end. + + + + + Initialize a new instance of the class. + + + + + Converts the string to the Exact MatchMode. + + The string to convert to the appropriate match pattern. + The pattern with a "%" appended at the beginning and the end. + + + + An that negates another . + + + + + Initialize a new instance of the class for an + + + The to negate. + + + + An that represents "not null" constraint. + + + + + Initializes a new instance of the class. + + The projection. + + + + Initialize a new instance of the class for a named + Property that should not be null. + + The name of the Property in the class. + + + + An that represents "null" constraint. + + + + + Initializes a new instance of the class. + + The projection. + + + + Initialize a new instance of the class for a named + Property that should be null. + + The name of the Property in the class. + + + + + + + Represents an order imposed upon a + result set. + + + Should Order implement ICriteriaQuery? + + + + + Render the SQL fragment + + + + + Ascending order + + + + + + + Ascending order + + + + + + + Descending order + + + + + + + Descending order + + + + + + + An that combines two s with an + "or" between them. + + + + + Initialize a new instance of the class for + two s. + + The to use as the left hand side. + The to use as the right hand side. + + + + Get the Sql operator to put between the two s. + + Returns "or" + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + The criterion package may be used by applications as a framework for building + new kinds of Projection. However, it is intended that most applications will + simply use the built-in projection types via the static factory methods of this class.
+
+ The factory methods that take an alias allow the projected value to be referred to by + criterion and order instances. +
+
+ + + Create a distinct projection from a projection + + + + + + + Create a new projection list + + + + + + The query row count, ie. count(*) + + The RowCount projection mapped to an . + + + + The query row count, ie. count(*) + + The RowCount projection mapped to an . + + + + A property value count + + + + + + + A property value count + + + + + + + A distinct property value count + + + + + + + A property maximum value + + + + + + + A projection maximum value + + + + + + + A property minimum value + + + + + + + A projection minimum value + + + + + + + A property average value + + + + + + + A property average value + + + + + + + A property value sum + + + + + + + A property value sum + + + + + + + A SQL projection, a typed select clause fragment + + + + + + + + + A grouping SQL projection, specifying both select clause and group by clause fragments + + + + + + + + + + A grouping property value + + + + + + + A grouping projection value + + + + + + + A projected property value + + + + + + + A projected identifier value + + + + + + Assign an alias to a projection, by wrapping it + + + + + + + + Casts the projection result to the specified type. + + The type. + The projection. + + + + + Return a constant value + + The obj. + + + + + Return a constant value + + The obj. + + + + + + Calls the named + + Name of the function. + The type. + The projections. + + + + + Calls the specified + + the function. + The type. + The projections. + + + + + Conditionally return the true or false part, dependention on the criterion + + The criterion. + The when true. + The when false. + + + + + A property average value + + + + + A property average value + + + + + A property value count + + + + + A property value count + + + + + A distinct property value count + + + + + A distinct property value count + + + + + A grouping property value + + + + + A grouping property value + + + + + A property maximum value + + + + + A property maximum value + + + + + A property minimum value + + + + + A property minimum value + + + + + A projected property value + + + + + A projected property value + + + + + A property value sum + + + + + A property value sum + + + + + Project SQL function concat() + Note: throws an exception outside of a QueryOver expression + + + + + Create an alias for a projection + + the projection instance + LambdaExpression returning an alias + return NHibernate.Criterion.IProjection + + + + Project SQL function year() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function day() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function month() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function hour() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function minute() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function second() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function sqrt() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function sqrt() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function sqrt() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function sqrt() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function sqrt() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function lower() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function upper() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function abs() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function abs() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function abs() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function trim() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function length() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function bit_length() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function substring() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function locate() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function coalesce() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function coalesce() + Note: throws an exception outside of a QueryOver expression + + + + + Project SQL function mod() + Note: throws an exception outside of a QueryOver expression + + + + + A factory for property-specific AbstractCriterion and projection instances + + + + + A property value, or grouped property value + + + + + Get a component attribute of this property + + + + + A comparison between a property value in the outer query and the + result of a subquery + + + + + QueryOver<TRoot> is an API for retrieving entities by composing + objects expressed using Lambda expression syntax. + + + + IList<Cat> cats = session.QueryOver<Cat>() + .Where( c => c.Name == "Tigger" ) + .And( c => c.Weight > minWeight ) ) + .List(); + + + + + + Access the underlying ICriteria + + + + + Access the root underlying ICriteria + + + + + Get the results of the root type and fill the + + The list filled with the results. + + + + Get the results of the root type and fill the + + The list filled with the results. + + + + Clones the QueryOver, removes orders and paging, and projects the row-count + for the query + + + + + Clones the QueryOver, removes orders and paging, and projects the row-count (Int64) + for the query + + + + + Short for ToRowCountQuery().SingleOrDefault<int>() + + + + + Short for ToRowCountInt64Query().SingleOrDefault<long>() + + + + + Convenience method to return a single instance that matches + the query, or null if the query returns no results. + + the single result or + + If there is more than one matching result + + + + + Override type of . + + + + + Get a enumerable that when enumerated will execute + a batch of queries in a single database roundtrip + + + + + Get a enumerable that when enumerated will execute + a batch of queries in a single database roundtrip + + + + + Get an IFutureValue instance, whose value can be retrieved through + its Value property. The query is not executed until the Value property + is retrieved, which will execute other Future queries as well in a + single roundtrip + + + + + Get an IFutureValue instance, whose value can be retrieved through + its Value property. The query is not executed until the Value property + is retrieved, which will execute other Future queries as well in a + single roundtrip + + + + + Creates an exact clone of the IQueryOver + + + + + Clear all orders from the query. + + + + + Set the first result to be retrieved + + + + + + Set a limit upon the number of objects to be retrieved + + + + + + Enable caching of this query result set + + + + Override the cache mode for this particular query. + The cache mode to use. + this (for method chaining) + + + + Set the name of the cache region. + + the name of a query cache region, or + for the default query cache + + + + Set the read-only mode for entities (and proxies) loaded by this QueryOver. + (see ). + + + + + Get an executable instance of IQueryOver<TRoot>, + to actually run the query. + + + + Get an executable instance of IQueryOver<TRoot>, + to actually run the query. + + + + Clones the QueryOver, clears the orders and paging, and projects the RowCount + + + + + + Clones the QueryOver, clears the orders and paging, and projects the RowCount (Int64) + + + + + + Creates an exact clone of the QueryOver + + + + + Method to allow comparison of detached query in Lambda expression + e.g., p => p.Name == myQuery.As<string> + + type returned (projected) by query + throws an exception if evaluated directly at runtime. + + + + Implementation of the interface + + + + + QueryOver<TRoot,TSubType> is an API for retrieving entities by composing + objects expressed using Lambda expression syntax. + + + + IList<Cat> cats = session.QueryOver<Cat>() + .Where( c => c.Name == "Tigger" ) + .And( c => c.Weight > minWeight ) ) + .List(); + + + + + + Add criterion expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add criterion expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add arbitrary ICriterion (e.g., to allow protected member access) + + + + + Add negation of criterion expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add negation of criterion expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add restriction to a property + + Lambda expression containing path to property + criteria instance + + + + Add restriction to a property + + Lambda expression containing path to property + criteria instance + + + + Identical semantics to And() to allow more readable queries + + Lambda expression + criteria instance + + + + Identical semantics to And() to allow more readable queries + + Lambda expression + criteria instance + + + + Add arbitrary ICriterion (e.g., to allow protected member access) + + + + + Identical semantics to AndNot() to allow more readable queries + + Lambda expression + criteria instance + + + + Identical semantics to AndNot() to allow more readable queries + + Lambda expression + criteria instance + + + + Identical semantics to AndRestrictionOn() to allow more readable queries + + Lambda expression + criteria instance + + + + Identical semantics to AndRestrictionOn() to allow more readable queries + + Lambda expression + criteria instance + + + + Add projection expressed as a lambda expression + + Lambda expressions + criteria instance + + + + Add arbitrary IProjections to query + + + + + Create a list of projections using a projection builder + + + + + Add order expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add order expressed as a lambda expression + + Lambda expression + criteria instance + + + + Order by arbitrary IProjection (e.g., to allow protected member access) + + + + + Add order for an aliased projection expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add order expressed as a lambda expression + + Lambda expression + criteria instance + + + + Add order expressed as a lambda expression + + Lambda expression + criteria instance + + + + Order by arbitrary IProjection (e.g., to allow protected member access) + + + + + Add order for an aliased projection expressed as a lambda expression + + Lambda expression + criteria instance + + + + Transform the results using the supplied IResultTransformer + + + + + Specify an association fetching strategy. Currently, only + one-to-many and one-to-one associations are supported. + + A lambda expression path (e.g., ChildList[0].Granchildren[0].Pets). + + + + + Set the lock mode of the current entity + + + + + Set the lock mode of the aliased entity + + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + + Type of sub-criteria + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + The created "sub criteria" + + + + Creates a new NHibernate.IQueryOver<TRoot, U>, "rooted" at the associated entity + specifying a collection for the join. + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + The created "sub criteria" + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + criteria instance + + + + Join an association, assigning an alias to the joined entity + + Type of sub-criteria (type of the collection) + Lambda expression returning association path + Lambda expression returning alias reference + Type of join + Additional criterion for the SQL on clause + criteria instance + + + + Add a subquery expression + + + + + Apply a "like" restriction in a QueryOver expression + Note: throws an exception outside of a QueryOver expression + + + + + Apply a "like" restriction in a QueryOver expression + Note: throws an exception outside of a QueryOver expression + + + + + Apply a "like" restriction in a QueryOver expression + Note: throws an exception outside of a QueryOver expression + + + + + Apply a "like" restriction in a QueryOver expression + Note: throws an exception outside of a QueryOver expression + + + + + Apply a "like" restriction in a QueryOver expression + Note: throws an exception outside of a QueryOver expression + + + + + Apply an "in" constraint to the named property + Note: throws an exception outside of a QueryOver expression + + + + + Apply an "in" constraint to the named property + Note: throws an exception outside of a QueryOver expression + + + + + Apply a "between" constraint to the named property + Note: throws an exception outside of a QueryOver expression + + + + + A comparison between a property value in the outer query and the + result of a subquery + + + + + The base class for an that compares a single Property + to a value. + + + + + Initialize a new instance of the class for a named + Property and its value. + + The name of the Property in the class. + The value for the Property. + The SQL operation. + + + + Converts the SimpleExpression to a . + + A SqlString that contains a valid Sql fragment. + + + + Gets the named Property for the Expression. + + A string that is the name of the Property. + + + + Gets the Value for the Expression. + + An object that is the value for the Expression. + + + + Get the Sql operator to use for the specific + subclass of . + + + + + A comparison between a constant value and the the result of a subquery + + + + + An that creates a SQLExpression. + The string {alias} will be replaced by the alias of the root entity. + + + This allows for database specific Expressions at the cost of needing to + write a correct . + + + + + A SQL fragment. The string {alias} will be replaced by the alias of the root entity. + + + + + Gets the typed values for parameters in this projection + + The criteria. + The criteria query. + + + + + Factory class for AbstractCriterion instances that represent + involving subqueries. + Expression + Projection + AbstractCriterion + + + + + Create a ICriterion for the specified property subquery expression + + generic type + lambda expression + returns LambdaSubqueryBuilder + + + + Create a ICriterion for the specified property subquery expression + + lambda expression + returns LambdaSubqueryBuilder + + + + Create a ICriterion for the specified value subquery expression + + value + returns LambdaSubqueryBuilder + + + + Create ICriterion for subquery expression using lambda syntax + + type of property + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Create ICriterion for (exact) subquery expression using lambda syntax + + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Create ICriterion for (all) subquery expression using lambda syntax + + type of property + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Create ICriterion for (all) subquery expression using lambda syntax + + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Create ICriterion for (some) subquery expression using lambda syntax + + type of property + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Create ICriterion for (some) subquery expression using lambda syntax + + lambda expression + NHibernate.ICriterion.AbstractCriterion + + + + Add an Exists subquery criterion + + + + + Add a NotExists subquery criterion + + + + + A property value, or grouped property value + + + + + Used to show a better debug display for dictionaries + + + + + + + + ::= + EXTRACT FROM + + ::= + | + + + + Represents HQL functions that can have different representations in different SQL dialects. + E.g. in HQL we can define function concat(?1, ?2) to concatenate two strings + p1 and p2. Target SQL function will be dialect-specific, e.g. (?1 || ?2) for + Oracle, concat(?1, ?2) for MySql, (?1 + ?2) for MS SQL. + Each dialect will define a template as a string (exactly like above) marking function + parameters with '?' followed by parameter's index (first index is 1). + + + + + Provides support routines for the HQL functions as used + in the various SQL Dialects + + Provides an interface for supporting various HQL functions that are + translated to SQL. The Dialect and its sub-classes use this interface to + provide details required for processing of the function. + + + + + The function return type + + The type of the first argument + + + + + + Render the function call as SQL. + + List of arguments + + SQL fragment for the fuction. + + + + Does this function have any arguments? + + + + + If there are no arguments, are parens required? + + + + + Applies the template to passed in arguments. + + args function arguments + generated SQL function call + + + + + ANSI-SQL substring + Documented in: + ANSI X3.135-1992 + American National Standard for Information Systems - Database Language - SQL + + + Syntax: + ::= + SUBSTRING FROM < start position> + [ FOR ] + ]]> + + + + + A SQLFunction implementation that emulates the ANSI SQL trim function + on dialects which do not support the full definition. However, this function + definition does assume the availability of ltrim, rtrim, and replace functions + which it uses in various combinations to emulate the desired ANSI trim() + functionality. + + + + + + + + + + + according to both the ANSI-SQL and EJB3 specs, trim can either take + exactly one parameter or a variable number of parameters between 1 and 4. + from the SQL spec: + ::= + TRIM + + ::= + [ [ ] [ ] FROM ] + + ::= + LEADING + | TRAILING + | BOTH + ]]> + If only trim specification is omitted, BOTH is assumed; + if trim character is omitted, space is assumed + + + + + Initializes a new instance of the StandardSQLFunction class. + + SQL function name. + Whether the function accepts an asterisk (*) in place of arguments + + + + Initializes a new instance of the StandardSQLFunction class. + + SQL function name. + True if accept asterisk like argument + Return type for the fuction. + + + + ANSI-SQL style cast(foo as type) where the type is a NHibernate type + + + + + Emulation of locate() on Sybase + + + + + Classic AVG sqlfunction that return types as it was done in Hibernate 3.1 + + + + + Classic COUNT sqlfunction that return types as it was done in Hibernate 3.1 + + + + + Classic SUM sqlfunction that return types as it was done in Hibernate 3.1 + + + + + Provides a substring implementation of the form substring(expr, start, length) + for SQL dialects where the length argument is mandatory. If this is called + from HQL with only two arguments, this implementation will generate the length + parameter as (len(expr) + 1 - start). + + + + + Provides a standard implementation that supports the majority of the HQL + functions that are translated to SQL. + + + The Dialect and its sub-classes use this class to provide details required + for processing of the associated function. + + + + + Initializes a new instance of the StandardSQLFunction class. + + SQL function name. + + + + Initializes a new instance of the StandardSQLFunction class. + + SQL function name. + Return type for the fuction. + + + + Initializes a new instance of the EmulatedLengthSubstringFunction class. + + + + + Summary description for NoArgSQLFunction. + + + + + Emulation of coalesce() on Oracle, using multiple nvl() calls + + + + + Emulation of locate() on PostgreSQL + + + + + Provides a standard implementation that supports the majority of the HQL + functions that are translated to SQL. + + + The Dialect and its sub-classes use this class to provide details required + for processing of the associated function. + + + + + Initializes a new instance of the StandardSafeSQLFunction class. + + SQL function name. + Exact number of arguments expected. + + + + Initializes a new instance of the StandardSafeSQLFunction class. + + SQL function name. + Return type for the fuction. + Exact number of arguments expected. + + + + Support for slightly more general templating than StandardSQLFunction, + with an unlimited number of arguments. + + + + + A strategy abstraction for how locks are obtained in the underlying database. + + + All locking provided implemenations assume the underlying database supports + (and that the connection is in) at least read-committed transaction isolation. + The most glaring exclusion to this is HSQLDB which only offers support for + READ_UNCOMMITTED isolation. + + + + + + Acquire an appropriate type of lock on the underlying data that will + endure until the end of the current transaction. + + The id of the row to be locked + The current version (or null if not versioned) + The object logically being locked (currently not used) + The session from which the lock request originated + + + + A locking strategy where the locks are obtained through select statements. + + + + + For non-read locks, this is achieved through the Dialect's specific + SELECT ... FOR UPDATE syntax. + + + + + A locking strategy where the locks are obtained through update statements. + + This strategy is not valid for read style locks. + + + + Construct a locking strategy based on SQL UPDATE statements. + + The metadata for the entity to be locked. + Indictates the type of lock to be acquired. + + read-locks are not valid for this strategy. + + + + + Common implementation of schema reader. + + + This implementation of is based on the new of + .NET 2.0. + + + + + + This class is specific of NHibernate and supply DatabaseMetaData of Java. + In the .NET Framework, there is no direct equivalent. + + + Implementation is provide by a dialect. + + + + + Gets a description of the tables available for the catalog + + A catalog, retrieves those without a catalog + Schema pattern, retrieves those without the schema + A table name pattern + a list of table types to include + Each row + + + + Get the Table MetaData. + + The resultSet of . + Include FKs and indexes + + + + + Gets a description of the table columns available + + A catalog, retrieves those without a catalog + Schema pattern, retrieves those without the schema + A table name pattern + a columng name patterm + A description of the table columns available + + + + Get a description of the given table's indices and statistics. + + A catalog, retrieves those without a catalog + Schema pattern, retrieves those without the schema + A table name pattern + A description of the table's indices available + The result is relative to the schema collections "Indexes". + + + + Get a description of the given table's indices and statistics. + + A catalog, retrieves those without a catalog + Schema pattern, retrieves those without the schema + A table name pattern + The name of the index + A description of the table's indices available + The result is relative to the schema collections "IndexColumns". + + + + Gets a description of the foreign keys available + + A catalog, retrieves those without a catalog + Schema name, retrieves those without the schema + A table name + A description of the foreign keys available + + + + Get all reserved words + + A set of reserved words + + + + In the Java language, this field indicates that the database treats mixed-case, + quoted SQL identifiers as case-insensitive and stores them in mixed case. + + + + + In the Java language, this field indicates that the database treats mixed-case, + quoted SQL identifiers as case-insensitive and stores them in upper case. + + + + + In the Java language, this field indicates that the database treats mixed-case, + unquoted SQL identifiers as case-insensitive and stores them in upper case. + + + + + In the Java language, this field indicates that the database treats mixed-case, + quoted SQL identifiers as case-insensitive and stores them in lower case. + + + + + In the Java language, this field indicates that the database treats mixed-case, + unquoted SQL identifiers as case-insensitive and stores them in lower case, + + + + + The name of the column that represent the TABLE_NAME in the + returned by . + + + + + Get a value from the DataRow. Multiple alternative column names can be given. + The names are tried in order, and the value from the first present column + is returned. + + + + + Get a string value from the DataRow. Multiple alternative column names can be given. + The names are tried in order, and the value from the first present column + is returned. + + + + + An SQL dialect for DB2 on iSeries OS/400. + + + The DB2400Dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + An SQL dialect for DB2. + + + The DB2Dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + Represents a dialect of SQL implemented by a particular RDBMS. Subclasses + implement NHibernate compatibility with different systems. + + + Subclasses should provide a public default constructor that Register() + a set of type mappings and default Hibernate properties. + + + + Characters used for quoting sql identifiers + + + Characters used for closing quoted sql identifiers + + + + The base constructor for Dialect. + + + Every subclass should override this and call Register() with every except + , , , , + , . + + + The Default properties for this Dialect should also be set - such as whether or not to use outer-joins + and what the batch size should be. + + + + + Get an instance of the dialect specified by the current properties. + The specified Dialect + + + + Get from a property bag (prop name ) + + The property bag. + An instance of . + When is null. + When the property bag don't contains de property . + + + + Get the name of the database type associated with the given + , + + The SqlType + The database type name used by ddl. + + + + Get the name of the database type associated with the given + . + + The SqlType + The datatype length + The datatype precision + The datatype scale + The database type name used by ddl. + + + + Gets the name of the longest registered type for a particular DbType. + + + + + + + Get the name of the database type appropriate for casting operations + (via the CAST() SQL function) for the given typecode. + + The typecode + The database type name + + + + Subclasses register a typename for the given type code and maximum + column length. $l in the type name will be replaced by the column + length (if appropriate) + + The typecode + Maximum length of database type + The database type name + + + + Suclasses register a typename for the given type code. $l in the + typename will be replaced by the column length (if appropriate). + + The typecode + The database type name + + + + The syntax used to add a foreign key constraint to a table. If SupportsForeignKeyConstraintInAlterTable is false, the returned string will be added to the create table statement instead. In this case, extra strings, like "add", that apply when using alter table should be omitted. + + The FK constraint name. + The names of the columns comprising the FK + The table referenced by the FK + The explicit columns in the referencedTable referenced by this FK. + + if false, constraint should be explicit about which column names the constraint refers to + + the "add FK" fragment + + + + The syntax used to add a primary key constraint to a table + + + + + + Get a strategy instance which knows how to acquire a database-level lock + of the specified mode for this dialect. + + The persister for the entity to be locked. + The type of lock to be acquired. + The appropriate locking strategy. + + + + Given a lock mode, determine the appropriate for update fragment to use. + + The lock mode to apply. + The appropriate for update fragment. + + + + Get the FOR UPDATE OF column_list fragment appropriate for this + dialect given the aliases of the columns to be write locked. + + The columns to be write locked. + The appropriate FOR UPDATE OF column_list clause string. + + + + Get the FOR UPDATE OF column_list NOWAIT fragment appropriate + for this dialect given the aliases of the columns to be write locked. + + The columns to be write locked. + The appropriate FOR UPDATE colunm_list NOWAIT clause string. + + + + Modifies the given SQL by applying the appropriate updates for the specified + lock modes and key columns. + + the SQL string to modify + a map of lock modes indexed by aliased table names. + a map of key columns indexed by aliased table names. + the modified SQL string. + + The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This + method is really intended to allow dialects which do not support + SELECT FOR UPDATE to achieve this in their own fashion. + + + + + Some dialects support an alternative means to SELECT FOR UPDATE, + whereby a "lock hint" is appends to the table name in the from clause. + + The lock mode to apply + The name of the table to which to apply the lock hint. + The table with any required lock hints. + + + + Return SQL needed to drop the named table. May (and should) use + some form of "if exists" clause, and cascade constraints. + + + + + + Generate a temporary table name given the bas table. + The table name from which to base the temp table name. + The generated temp table name. + + + + Does the dialect require that temporary table DDL statements occur in + isolation from other statements? This would be the case if the creation + would cause any current transaction to get committed implicitly. + + see the result matrix above. + + JDBC defines a standard way to query for this information via the + {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()} + method. However, that does not distinguish between temporary table + DDL and other forms of DDL; MySQL, for example, reports DDL causing a + transaction commit via its driver, even though that is not the case for + temporary table DDL. +

+ Possible return values and their meanings:

    +
  • {@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL in isolation.
  • +
  • {@link Boolean#FALSE} - Unequivocally, do not perform the temporary table DDL in isolation.
  • +
  • null - defer to the JDBC driver response in regards to {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}
  • +
+
+
+ + Do we need to drop the temporary table after use? + + + + Registers an OUT parameter which will be returing a + . How this is accomplished varies greatly + from DB to DB, hence its inclusion (along with {@link #getResultSet}) here. + + The callable statement. + The bind position at which to register the OUT param. + The number of (contiguous) bind positions used. + + + + Given a callable statement previously processed by , + extract the from the OUT parameter. + + The callable statement. + The extracted result set. + SQLException Indicates problems extracting the result set. + + + + The syntax used to drop a foreign key constraint from a table. + + The name of the foreign key constraint to drop. + + The SQL string to drop the foreign key constraint. + + + + + The syntax that is used to check if a constraint does not exists before creating it + + The table. + The name. + + + + + The syntax that is used to close the if for a constraint exists check, used + for dialects that requires begin/end for ifs + + The table. + The name. + + + + + The syntax that is used to check if a constraint exists before dropping it + + The table. + The name. + + + + + The syntax that is used to close the if for a constraint exists check, used + for dialects that requires begin/end for ifs + + The table. + The name. + + + + + The syntax used to drop a primary key constraint from a table. + + The name of the primary key constraint to drop. + + The SQL string to drop the primary key constraint. + + + + + The syntax used to drop an index constraint from a table. + + The name of the index constraint to drop. + + The SQL string to drop the primary key constraint. + + + + + Provided we , then attch the + "select identity" clause to the insert statement. + + The insert command + + The insert command with any necessary identity select clause attached. + Note, if == false then + the insert-string should be returned without modification. + + + + + Get the select command to use to retrieve the last generated IDENTITY + value for a particular table + + The table into which the insert was done + The PK column. + The type code. + The appropriate select command + + + + The syntax used during DDL to define a column as being an IDENTITY of + a particular type. + + The type code. + The appropriate DDL fragment. + + + + Generate the appropriate select statement to to retreive the next value + of a sequence. + + the name of the sequence + String The "nextval" select string. + This should be a "stand alone" select statement. + + + + Typically dialects which support sequences can drop a sequence + with a single command. + + The name of the sequence + The sequence drop commands + + This is convenience form of + to help facilitate that. + + Dialects which support sequences and can drop a sequence in a + single command need *only* override this method. Dialects + which support sequences but require multiple commands to drop + a sequence should instead override . + + + + + The multiline script used to drop a sequence. + + The name of the sequence + The sequence drop commands + + + + Generate the select expression fragment that will retrieve the next + value of a sequence as part of another (typically DML) statement. + + the name of the sequence + The "nextval" fragment. + + This differs from in that this + should return an expression usable within another statement. + + + + + Typically dialects which support sequences can create a sequence + with a single command. + + The name of the sequence + The sequence creation command + + This is convenience form of to help facilitate that. + Dialects which support sequences and can create a sequence in a + single command need *only* override this method. Dialects + which support sequences but require multiple commands to create + a sequence should instead override . + + + + + An optional multi-line form for databases which . + + The name of the sequence + The initial value to apply to 'create sequence' statement + The increment value to apply to 'create sequence' statement + The sequence creation commands + + + + Overloaded form of , additionally + taking the initial value and increment size to be applied to the sequence + definition. + + The name of the sequence + The initial value to apply to 'create sequence' statement + The increment value to apply to 'create sequence' statement + The sequence creation command + + The default definition is to suffix + with the string: " start with {initialValue} increment by {incrementSize}" where + {initialValue} and {incrementSize} are replacement placeholders. Generally + dialects should only need to override this method if different key phrases + are used to apply the allocation information. + + + + + Create a strategy responsible + for handling this dialect's variations in how joins are handled. + + This dialect's strategy. + + + + Create a strategy responsible + for handling this dialect's variations in how CASE statements are + handled. + + This dialect's strategy. + + + The SQL literal value to which this database maps boolean values. + The boolean value + The appropriate SQL literal. + + + + Add a LIMIT clause to the given SQL SELECT. + Expects any database-specific offset and limit adjustments to have already been performed (ex. UseMaxForLimit, OffsetStartsAtOne). + + The to base the limit query off. + Offset of the first row to be returned by the query. This may be represented as a parameter, a string literal, or a null value if no limit is requested. This should have already been adjusted to account for OffsetStartsAtOne. + Maximum number of rows to be returned by the query. This may be represented as a parameter, a string literal, or a null value if no offset is requested. This should have already been adjusted to account for UseMaxForLimit. + A new that contains the LIMIT clause. + + + + Generates a string to limit the result set to a number of maximum results with a specified offset into the results. + Expects any database-specific offset and limit adjustments to have already been performed (ex. UseMaxForLimit, OffsetStartsAtOne). + Performs error checking based on the various dialect limit support options. If both parameters and fixed valeus are + specified, this will use the parameter option if possible. Otherwise, it will fall back to a fixed string. + + + + + + + + + + + Some databases require that a limit statement contain the maximum row number + instead of the number of rows to retrieve. This method adjusts source + limit and offset values to account for this. + + + + + + + + Some databases use limit row offsets that start at one instead of zero. + This method adjusts a desired offset using the OffsetStartsAtOne flag. + + + + + + + Checks to see if the name has been quoted. + + The name to check if it is quoted + true if name is already quoted. + + The default implementation is to compare the first character + to Dialect.OpenQuote and the last char to Dialect.CloseQuote + + + + + Quotes a name. + + The string that needs to be Quoted. + A QuotedName + +

+ This method assumes that the name is not already Quoted. So if the name passed + in is "name then it will return """name". It escapes the first char + - the " with "" and encloses the escaped string with OpenQuote and CloseQuote. +

+
+
+ + + Quotes a name for being used as a aliasname + + Original implementation calls + Name of the alias + A Quoted name in the format of OpenQuote + aliasName + CloseQuote + +

+ If the aliasName is already enclosed in the OpenQuote and CloseQuote then this + method will return the aliasName that was passed in without going through any + Quoting process. So if aliasName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +

+
+
+ + + Quotes a name for being used as a columnname + + Original implementation calls + Name of the column + A Quoted name in the format of OpenQuote + columnName + CloseQuote + +

+ If the columnName is already enclosed in the OpenQuote and CloseQuote then this + method will return the columnName that was passed in without going through any + Quoting process. So if columnName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +

+
+
+ + + Quotes a name for being used as a tablename + + Name of the table + A Quoted name in the format of OpenQuote + tableName + CloseQuote + +

+ If the tableName is already enclosed in the OpenQuote and CloseQuote then this + method will return the tableName that was passed in without going through any + Quoting process. So if tableName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +

+
+
+ + + Quotes a name for being used as a schemaname + + Name of the schema + A Quoted name in the format of OpenQuote + schemaName + CloseQuote + +

+ If the schemaName is already enclosed in the OpenQuote and CloseQuote then this + method will return the schemaName that was passed in without going through any + Quoting process. So if schemaName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +

+
+
+ + + Unquotes and unescapes an already quoted name + + Quoted string + Unquoted string + +

+ This method checks the string quoted to see if it is + quoted. If the string quoted is already enclosed in the OpenQuote + and CloseQuote then those chars are removed. +

+

+ After the OpenQuote and CloseQuote have been cleaned from the string quoted + then any chars in the string quoted that have been escaped by doubling them + up are changed back to a single version. +

+

+ The following quoted values return these results + "quoted" = quoted + "quote""d" = quote"d + quote""d = quote"d +

+

+ If this implementation is not sufficient for your Dialect then it needs to be overridden. + MsSql2000Dialect is an example of where UnQuoting rules are different. +

+
+
+ + + Unquotes an array of Quoted Names. + + strings to Unquote + an array of unquoted strings. + + This use UnQuote(string) for each string in the quoted array so + it should not need to be overridden - only UnQuote(string) needs + to be overridden unless this implementation is not sufficient. + + + + + Given a type code, determine an appropriate + null value to use in a select clause. + + The type code. + The appropriate select clause value fragment. + + One thing to consider here is that certain databases might + require proper casting for the nulls here since the select here + will be part of a UNION/UNION ALL. + + + + + Registers a NHibernate name for the given type code. + + The typecode + The NHibernate name + + + + Build an instance of the preferred by this dialect for + converting into NHibernate's ADOException hierarchy. + + The Dialect's preferred . + + The default Dialect implementation simply returns a converter based on X/Open SQLState codes. + + It is strongly recommended that specific Dialect implementations override this + method, since interpretation of a SQL error is much more accurate when based on + the ErrorCode rather than the SQLState. Unfortunately, the ErrorCode is a vendor-specific approach. + + + + + Do we need to drop constraints before dropping tables in the dialect? + + + + + Do we need to qualify index names with the schema name? + + + + + Does this dialect support the UNIQUE column syntax? + + + + Does this dialect support adding Unique constraints via create and alter table ? + + + + Does this dialect support adding foreign key constraints via alter table? If not, it's assumed they can only be added through create table. + + + + + Does the dialect support the syntax 'drop table if exists NAME' + + + + + Does the dialect support the syntax 'drop table NAME if exists' + + + + Does this dialect support column-level check constraints? + True if column-level CHECK constraints are supported; false otherwise. + + + Does this dialect support table-level check constraints? + True if table-level CHECK constraints are supported; false otherwise. + + + + Get the string to append to SELECT statements to acquire locks + for this dialect. + + The appropriate FOR UPDATE clause string. + + + Is FOR UPDATE OF syntax supported? + True if the database supports FOR UPDATE OF syntax; false otherwise. + + + + Does this dialect support FOR UPDATE in conjunction with outer joined rows? + + True if outer joined rows can be locked via FOR UPDATE. + + + + Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect + + The appropriate FOR UPDATE NOWAIT clause string. + + + Does this dialect support temporary tables? + + + Does this dialect support a way to retrieve the database's current timestamp value? + + + + Gives the best resolution that the database can use for storing + date/time values, in ticks. + + + + For example, if the database can store values with 100-nanosecond + precision, this property is equal to 1L. If the database can only + store values with 1-millisecond precision, this property is equal + to 10000L (number of ticks in a millisecond). + + + Used in TimestampType. + + + + + + Completely optional cascading drop clause + + + + Only needed if the Dialect does not have SupportsForeignKeyConstraintInAlterTable. + + + Only needed if the Dialect does not have SupportsForeignKeyConstraintInAlterTable. + + + + Does this dialect support identity column key generation? + + + + + Does the dialect support some form of inserting and selecting + the generated IDENTITY value all in the same statement. + + + + + Whether this dialect has an identity clause added to the data type or a + completely separate identity data type. + + + + + Get the select command to use to retrieve the last generated IDENTITY value. + + The appropriate select command + + + + The keyword used to specify an identity column, if native key generation is supported + + + + + Set this to false if no table-level primary key constraint should be generated when an identity column has been specified for the table. + This is used as a work-around for SQLite so it doesn't tell us we have "more than one primary key". + + + + + The keyword used to insert a generated value into an identity column (or null). + Need if the dialect does not support inserts that specify no column values. + + + + + Does this dialect support sequences? + + + + + Does this dialect support "pooled" sequences? + + True if such "pooled" sequences are supported; false otherwise. + + A pooled sequence is one that has a configurable initial size and increment + size. It enables NHibernate to be allocated a pool/block/range of IDs, + which can reduce the frequency of round trips to the database during ID + generation. + + + + + + Get the select command used retrieve the names of all sequences. + The select command; or null if sequences are not supported. + + + + The class (which implements ) + which acts as this dialects identity-style generation strategy. + + The native generator class. + + Comes into play whenever the user specifies the "identity" generator. + + + + + The class (which implements ) + which acts as this dialects native generation strategy. + + The native generator class. + + Comes into play whenever the user specifies the native generator. + + + + + Does this Dialect have some kind of LIMIT syntax? + + False, unless overridden. + + + + Does this Dialect support an offset? + + + + + Can parameters be used for a statement containing a LIMIT? + + + + + Does the LIMIT clause take a "maximum" row number instead + of a total number of returned rows? + + True if limit is relative from offset; false otherwise. + + This is easiest understood via an example. Consider you have a table + with 20 rows, but you only want to retrieve rows number 11 through 20. + Generally, a limit with offset would say that the offset = 11 and the + limit = 10 (we only want 10 rows at a time); this is specifying the + total number of returned rows. Some dialects require that we instead + specify offset = 11 and limit = 20, where 20 is the "last" row we want + relative to offset (i.e. total number of rows = 20 - 11 = 9) + So essentially, is limit relative from offset? Or is limit absolute? + + + + + For limit clauses, indicates whether to use 0 or 1 as the offset that returns the first row. Should be true if the first row is at offset 1. + + + + + The opening quote for a quoted identifier. + + + + + The closing quote for a quoted identifier. + + + + + Does this dialect support UNION ALL, which is generally a faster variant of UNION? + True if UNION ALL is supported; false otherwise. + + + + + Does this dialect support empty IN lists? + For example, is [where XYZ in ()] a supported construct? + + True if empty in lists are supported; false otherwise. + + + + Are string comparisons implicitly case insensitive. + In other words, does [where 'XYZ' = 'xyz'] resolve to true? + + True if comparisons are case insensitive. + + + + Is this dialect known to support what ANSI-SQL terms "row value + constructor" syntax; sometimes called tuple syntax. +

+ Basically, does it support syntax like + "... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...". +

+ + True if this SQL dialect is known to support "row value + constructor" syntax; false otherwise. + +
+ + + If the dialect supports {@link #supportsRowValueConstructorSyntax() row values}, + does it offer such support in IN lists as well? +

+ For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..." +

+ + True if this SQL dialect is known to support "row value + constructor" syntax in the IN list; false otherwise. + +
+ + + Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. + {@link java.sql.PreparedStatement#setBinaryStream}). + + True if BLOBs and CLOBs should be bound using stream operations. + + + + Does this dialect support parameters within the select clause of + INSERT ... SELECT ... statements? + + True if this is supported; false otherwise. + + + + Does this dialect support asking the result set its positioning + information on forward only cursors. Specifically, in the case of + scrolling fetches, Hibernate needs to use + {@link java.sql.ResultSet#isAfterLast} and + {@link java.sql.ResultSet#isBeforeFirst}. Certain drivers do not + allow access to these methods for forward only cursors. +

+ NOTE : this is highly driver dependent! +

+ + True if methods like {@link java.sql.ResultSet#isAfterLast} and + {@link java.sql.ResultSet#isBeforeFirst} are supported for forward + only cursors; false otherwise. + +
+ + + Does this dialect support definition of cascade delete constraints + which can cause circular chains? + + True if circular cascade delete constraints are supported; false otherwise. + + + + Are subselects supported as the left-hand-side (LHS) of + IN-predicates. + + In other words, is syntax like "... {subquery} IN (1, 2, 3) ..." supported? + + True if subselects can appear as the LHS of an in-predicate;false otherwise. + + + + Expected LOB usage pattern is such that I can perform an insert + via prepared statement with a parameter binding for a LOB value + without crazy casting to JDBC driver implementation-specific classes... +

+ Part of the trickiness here is the fact that this is largely + driver dependent. For example, Oracle (which is notoriously bad with + LOB support in their drivers historically) actually does a pretty good + job with LOB support as of the 10.2.x versions of their drivers... +

+ + True if normal LOB usage patterns can be used with this driver; + false if driver-specific hookiness needs to be applied. + +
+ + Does the dialect support propagating changes to LOB + values back to the database? Talking about mutating the + internal value of the locator as opposed to supplying a new + locator instance... +

+ For BLOBs, the internal value might be changed by: + {@link java.sql.Blob#setBinaryStream}, + {@link java.sql.Blob#setBytes(long, byte[])}, + {@link java.sql.Blob#setBytes(long, byte[], int, int)}, + or {@link java.sql.Blob#truncate(long)}. +

+ For CLOBs, the internal value might be changed by: + {@link java.sql.Clob#setAsciiStream(long)}, + {@link java.sql.Clob#setCharacterStream(long)}, + {@link java.sql.Clob#setString(long, String)}, + {@link java.sql.Clob#setString(long, String, int, int)}, + or {@link java.sql.Clob#truncate(long)}. +

+ NOTE : I do not know the correct answer currently for + databases which (1) are not part of the cruise control process + or (2) do not {@link #supportsExpectedLobUsagePattern}. +

+ True if the changes are propagated back to the database; false otherwise. +
+ + + Is it supported to materialize a LOB locator outside the transaction in + which it was created? +

+ Again, part of the trickiness here is the fact that this is largely + driver dependent. +

+ NOTE: all database I have tested which {@link #supportsExpectedLobUsagePattern()} + also support the ability to materialize a LOB outside the owning transaction... +

+ True if unbounded materialization is supported; false otherwise. +
+ + + Does this dialect support referencing the table being mutated in + a subquery. The "table being mutated" is the table referenced in + an UPDATE or a DELETE query. And so can that table then be + referenced in a subquery of said UPDATE/DELETE query. +

+ For example, would the following two syntaxes be supported:

    +
  • delete from TABLE_A where ID not in ( select ID from TABLE_A )
  • +
  • update TABLE_A set NON_ID = 'something' where ID in ( select ID from TABLE_A)
  • +
+
+ True if this dialect allows references the mutating table from a subquery. +
+ + Does the dialect support an exists statement in the select clause? + True if exists checks are allowed in the select clause; false otherwise. + + + + For the underlying database, is READ_COMMITTED isolation implemented by + forcing readers to wait for write locks to be released? + + True if writers block readers to achieve READ_COMMITTED; false otherwise. + + + + For the underlying database, is REPEATABLE_READ isolation implemented by + forcing writers to wait for read locks to be released? + + True if readers block writers to achieve REPEATABLE_READ; false otherwise. + + + + Does this dialect support using a JDBC bind parameter as an argument + to a function or procedure call? + + True if the database supports accepting bind params as args; false otherwise. + + + + Does this dialect support subselects? + + + + + Retrieve a set of default Hibernate properties for this database. + + + + + Aggregate SQL functions as defined in general. This is + a case-insensitive hashtable! + + + The results of this method should be integrated with the + specialization's data. + + + + + Get the command used to select a GUID from the underlying database. + (Optional operation.) + + The appropriate command. + + + Command used to create a table. + + + + Slight variation on . + The command used to create a multiset table. + + + Here, we have the command used to create a table when there is no primary key and + duplicate rows are expected. +

+ Most databases do not care about the distinction; originally added for + Teradata support which does care. + + + +

Command used to create a temporary table. +
+ + + Get any fragments needing to be postfixed to the command for + temporary table creation. + + + + + Should the value returned by + be treated as callable. Typically this indicates that JDBC escape + sytnax is being used... + + + + + Retrieve the command used to retrieve the current timestammp from the database. + + + + + The name of the database-specific SQL function for retrieving the + current timestamp. + + + + + The keyword used to insert a row without specifying any column values + + + + + The name of the SQL function that transforms a string to lowercase + + + + + The syntax used to add a column to a table. Note this is deprecated + + + + + The keyword used to specify a nullable column + + + + + The keyword used to create a primary key constraint + + + + + Supports splitting batches using GO T-SQL command + + + Batches http://msdn.microsoft.com/en-us/library/ms175502.aspx + + + + + This specialized string tokenizier will break a string to tokens, taking + into account single quotes, parenthesis and commas and [ ] + Notice that we aren't differenciating between [ ) and ( ] on purpose, it would complicate + the code and it is not legal at any rate. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Summary description for FirebirdDialect. + + + The FirebirdDialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + A generic SQL dialect which may or may not work on any actual databases + + + + + + + + + + + Summary description for InformixDialect. + This dialect is intended to work with IDS version 7.31 + However I can test only version 10.00 as I have only this version at work + + + The InformixDialect defaults the following configuration properties: + + + ConnectionDriver + NHibernate.Driver.OdbcDriver + PrepareSql + true + + + connection.driver_class + + + + + + + + + + + Get the FOR UPDATE OF column_list fragment appropriate for this + dialect given the aliases of the columns to be write locked. + + The columns to be write locked. + The appropriate FOR UPDATE OF column_list clause string. + + + + Does the dialect require that temporary table DDL statements occur in + isolation from other statements? This would be the case if the creation + would cause any current transaction to get committed implicitly. + + see the result matrix above. + + JDBC defines a standard way to query for this information via the + {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()} + method. However, that does not distinguish between temporary table + DDL and other forms of DDL; MySQL, for example, reports DDL causing a + transaction commit via its driver, even though that is not the case for + temporary table DDL. +

+ Possible return values and their meanings:

    +
  • {@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL in isolation.
  • +
  • {@link Boolean#FALSE} - Unequivocally, do not perform the temporary table DDL in isolation.
  • +
  • null - defer to the JDBC driver response in regards to {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}
  • +
+
+
+ + + Get the select command to use to retrieve the last generated IDENTITY + value for a particular table + + The table into which the insert was done + The PK column. + The type code. + The appropriate select command + + + + The syntax used during DDL to define a column as being an IDENTITY of + a particular type. + + The type code. + The appropriate DDL fragment. + + + + Create a strategy responsible + for handling this dialect's variations in how joins are handled. + + This dialect's strategy. + + + The SQL literal value to which this database maps boolean values. + The boolean value + The appropriate SQL literal. + + + + The keyword used to insert a generated value into an identity column (or null). + Need if the dialect does not support inserts that specify no column values. + + + + Command used to create a temporary table. + + + + Get any fragments needing to be postfixed to the command for + temporary table creation. + + + + + Should the value returned by + be treated as callable. Typically this indicates that JDBC escape + sytnax is being used... + + + + + Retrieve the command used to retrieve the current timestammp from the database. + + + + + The name of the database-specific SQL function for retrieving the + current timestamp. + + + + + + + Is FOR UPDATE OF syntax supported? + True if the database supports FOR UPDATE OF syntax; false otherwise. + + + + Does this dialect support FOR UPDATE in conjunction with outer joined rows? + + True if outer joined rows can be locked via FOR UPDATE. + + + Does this dialect support temporary tables? + + + Does this dialect support a way to retrieve the database's current timestamp value? + + + + Whether this dialect have an Identity clause added to the data type or a + completely separate identity data type + + + + + The syntax that returns the identity value of the last insert, if native + key generation is supported + + + + + The keyword used to specify an identity column, if native key generation is supported + + + + + Does this dialect support sequences? + + + + + Does this Dialect have some kind of LIMIT syntax? + + False, unless overridden. + + + + Does this Dialect support an offset? + + + + + Can parameters be used for a statement containing a LIMIT? + + + + + Does this dialect support UNION ALL, which is generally a faster variant of UNION? + True if UNION ALL is supported; false otherwise. + + + + + Knows how to extract a violated constraint name from an error message based on the + fact that the constraint name is templated within the message. + + + + + Defines a contract for implementations that can extract the name of a violated + constraint from a SQLException that is the result of that constraint violation. + + + + + Extract the name of the violated constraint from the given SQLException. + + The exception that was the result of the constraint violation. + The extracted constraint name. + + + + Extracts the constraint name based on a template (i.e., templateStartconstraintNametemplateEnd). + + The pattern denoting the start of the constraint name within the message. + The pattern denoting the end of the constraint name within the message. + The templated error message containing the constraint name. + The found constraint name, or null. + + + + Extract the name of the violated constraint from the given SQLException. + + The exception that was the result of the constraint violation. + The extracted constraint name. + + + + Extract the name of the violated constraint from the given DbException. + + The exception that was the result of the constraint violation. + The extracted constraint name. + + + + Summary description for InformixDialect. + This dialect is intended to work with IDS version 9.40 + + + The InformixDialect defaults the following configuration properties: + + + ConnectionDriver + NHibernate.Driver.OdbcDriver + PrepareSql + true + + + connection.driver_class + + + + + + + + + + + Generate the appropriate select statement to to retreive the next value + of a sequence. + + the name of the sequence + String The "nextval" select string. + This should be a "stand alone" select statement. + + + + Generate the select expression fragment that will retrieve the next + value of a sequence as part of another (typically DML) statement. + + the name of the sequence + The "nextval" fragment. + + This differs from in that this + should return an expression usable within another statement. + + + + + Create a strategy responsible + for handling this dialect's variations in how joins are handled. + + This dialect's strategy. + + + Get the select command used retrieve the names of all sequences. + The select command; or null if sequences are not supported. + + + + Does this dialect support sequences? + + + + + Does this dialect support "pooled" sequences. Not aware of a better + name for this. Essentially can we specify the initial and increment values? + + True if such "pooled" sequences are supported; false otherwise. + + + + Does this Dialect have some kind of LIMIT syntax? + + False, unless overridden. + + + + Does this Dialect support an offset? + + + + + Summary description for InformixDialect. + This dialect is intended to work with IDS version 10.00 + + + The InformixDialect defaults the following configuration properties: + + + ConnectionDriver + NHibernate.Driver.OdbcDriver + PrepareSql + true + + + connection.driver_class + + + + + + + + + + + Does this Dialect have some kind of LIMIT syntax? + + False, unless overridden. + + + + Does this Dialect support an offset? + + + + + An SQL dialect for IngresSQL. + + + The IngresDialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + Use a parameter with ParameterDirection.Output + + + + + Use a parameter with ParameterDirection.ReturnValue + + + + + An SQL dialect compatible with Microsoft SQL Server 2000. + + + The MsSql2000Dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + adonet.batch_size + 10 + + + query.substitutions + true 1, false 0, yes 'Y', no 'N' + + + + + + + Generates the string to drop the table using SQL Server syntax. + + The name of the table to drop. + The SQL with the inserted. + + + + + + + MsSql does not require the OpenQuote to be escaped as long as the first char + is an OpenQuote. + + + + + Does this Dialect have some kind of LIMIT syntax? + + True, we'll use the SELECT TOP nn syntax. + + + + Does this Dialect support an offset? + + + + + Can parameters be used for a statement containing a LIMIT? + + + + + Does the LIMIT clause take a "maximum" row number + instead of a total number of returned rows? + + false, unless overridden + + + + Sql Server 2005 supports a query statement that provides LIMIT + functionality. + + true + + + + Sql Server 2005 supports a query statement that provides LIMIT + functionality with an offset. + + true + + + + Sql Server 2005 supports a query statement that provides LIMIT + functionality with an offset. + + false + + + + Transforms a T-SQL SELECT statement into a statement that will - when executed - return a 'page' of results. The page is defined + by a page size ('limit'), and/or a starting page number ('offset'). + + + + + Returns a TSQL SELECT statement that will - when executed - return a 'page' of results. + + + + + + + + Identify the columns for the ROW_NUMBER OVER(ORDER BY ...) expression. + + + + + + This method translates aliased columns (as appear in the SELECT list) to straight column names, to be included in the + ROW_NUMBER() OVER(ORDER BY ...) expression. For example, datapoint0_.xval as xval4_ to + datapoint0_.xval. + + + + + For a DISTINCT query, identify the columns for the ROW_NUMBER() OVER(ORDER BY ...) expression. + + + + + + For a paged DISTINCT query, the columns on which ordering will be performed are returned by a sub-query. Therefore the + columns in the ROW_NUMBER() OVER(ORDER BY ...) expression need to use the aliased column name from the subquery, + prefixed by the subquery alias, q_. + + + + + Indicates whether the string fragment contains matching parenthesis + + the statement to evaluate + true if the statment contains no parenthesis or an equal number of + opening and closing parenthesis;otherwise false + + + + Perhaps SqlString should have these types of method on it... + + + + + + An SQL dialect compatible with Microsoft SQL Server 7. + + + There have been no test run with this because the NHibernate team does not + have a machine with Sql 7 installed on it. But there have been users using + Ms Sql 7 with NHibernate. As issues with Ms Sql 7 and NHibernate become known + this Dialect will be updated. + + + + + Uses @@identity to get the Id value. + + + There is a well known problem with @@identity and triggers that insert into + rows into other tables that also use an identity column. The only way I know + of to get around this problem is to upgrade your database server to Ms Sql 2000. + + + + + A dialect for SQL Server Everywhere (SQL Server CE). + + + + + A SQL dialect for MySQL + + + The MySQLDialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + Create the SQL string to drop a foreign key constraint. + + The name of the foreign key to drop. + The SQL string to drop the foreign key constraint. + + + + Create the SQL string to drop a primary key constraint. + + The name of the primary key to drop. + The SQL string to drop the primary key constraint. + + + + Create the SQL string to drop an index. + + The name of the index to drop. + The SQL string to drop the index constraint. + + + + Subclasses register a typename for the given type code, to be used in CAST() + statements. + + The typecode + The database type name + + + + Subclasses register a typename for the given type code, to be used in CAST() + statements. + + The typecode + + The database type name + + + + Get the name of the database type appropriate for casting operations + (via the CAST() SQL function) for the given typecode. + + The typecode + The database type name + + + + + + + + + + + + + + + + + + + + + + + + + + + + A dialect specifically for use with Oracle 10g. + + + The main difference between this dialect and + is the use of "ANSI join syntax" here... + + + + + A dialect for Oracle 8i. + + + + + Support for the oracle proprietary join syntax... + + The orqacle join fragment + + + + Map case support to the Oracle DECODE function. Oracle did not + add support for CASE until 9i. + + The oracle CASE -> DECODE fragment + + + + Allows access to the basic + implementation... + + The mapping type + The appropriate select cluse fragment + + + + It's a immature version, it just work. + An SQL dialect for Oracle Lite + + + The OracleLiteDialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + + + + + + + An SQL dialect for PostgreSQL 8.1 and above. + + + + PostgreSQL 8.1 supports FOR UPDATE ... NOWAIT syntax. + + + PostgreSQL supports Identity column using the "SERIAL" type. + Serial type is a "virtual" type that will automatically: + + + Create a sequence named tablename_colname_seq. + Set the default value of this column to the next value of the + sequence. (using function nextval('tablename_colname_seq')) + Add a "NOT NULL" constraint to this column. + Set the sequence as "owned by" the table. + + + To insert the next value of the sequence into the serial column, + exclude the column from the list of columns + in the INSERT statement or use the DEFAULT key word. + + + If the table or the column is dropped, the sequence is dropped too. + + + + + + + An SQL dialect for PostgreSQL. + + + The PostgreSQLDialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + PostgreSQL requires to cast NULL values to correctly handle UNION/UNION ALL + + See + PostgreSQL BUG #1847: Error in some kind of UNION query. + + The type code. + null casted as : "null::sqltypename" + + + + Supported with SQL 2003 syntax since 7.4, released 2003-11-17. For older versions + we need to override GetCreateSequenceString(string, int, int) and provide alternative + syntax, but I don't think we need to bother for such ancient releases (considered EOL). + + + + PostgreSQL supports UNION ALL clause + + Reference: + PostgreSQL 8.0 UNION Clause documentation + + + + + + PostgreSQL supports serial and serial4 type for 4 bytes integer auto increment column. + bigserial or serial8 can be used for 8 bytes integer auto increment column. + + bigserial if equal Int64, + serial otherwise + + + + PostgreSQL supports Identity column using the "SERIAL" type. + + + + + PostgreSQL doesn't have type in identity column. + + + To create an identity column it uses the SQL syntax + CREATE TABLE tablename (colname SERIAL); or + CREATE TABLE tablename (colname BIGSERIAL); + + + + + The sql syntax to insert a row without specifying any column in PostgreSQL is + INSERT INTO table DEFAULT VALUES; + + + + + PostgreSQL 8.1 and above defined the fuction lastval() that returns the + value of the last sequence that nextval() was used on in the current session. + Call lastval() if nextval() has not yet been called in the current + session throw an exception. + + + + + An SQL dialect for PostgreSQL 8.2 and above. + + + PostgreSQL 8.2 supports DROP TABLE IF EXISTS tablename + and DROP SEQUENCE IF EXISTS sequencename syntax. + See for more information. + + + + + A SQL dialect for SQLite. + + +

+ Author: Ioan Bizau +

+
+
+ + + + + + + + SQLite does not currently support dropping foreign key constraints by alter statements. + This means that tables cannot be dropped if there are any rows that depend on those. + If there are cycles between tables, it would even be excessively difficult to delete + the data in the right order first. Because of this, we just turn off the foreign + constraints before we drop the schema and hope that we're not going to break anything. :( + We could theoretically check for data consistency afterwards, but we don't currently. + + + + + An SQL dialect for Sybase Adaptive Server Anywhere 9.0 + + +

+ This dialect probably will not work with schema-export. If anyone out there + can fill in the ctor with DbTypes to Strings that would be helpful. +

+ The dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + prepare_sql + + + +
+
+ + + ASA does not require to drop constraint before dropping tables, and DROP statement + syntax used by Hibernate to drop constraint is not compatible with ASA, so disable it. + Comments matchs SybaseAnywhereDialect from Hibernate-3.1 src + + + + + An SQL dialect targeting Sybase Adaptive Server Enterprise (ASE) 15 and higher. + + + The dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + + + + + Sybase ASE 15 temporary tables are not supported + + + By default, temporary tables in Sybase ASE 15 can only be created outside a transaction. + This is not supported by NHibernate. Temporary tables (and other DDL) statements can only + be run in a transaction if the 'ddl in tran' database option on tempdb is set to 'true'. + However, Sybase does not recommend this setting due to the performance impact arising from + locking and contention on tempdb system tables. + + + + + This is false only by default. The database can be configured to be + case-insensitive. + + + + + SQL Dialect for SQL Anywhere 10 - for the NHibernate 3.0.0 distribution + Copyright (C) 2010 Glenn Paulley + Contact: http://iablog.sybase.com/paulley + + This NHibernate dialect should be considered BETA software. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + The dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + prepare_sql + + + + + + + + SQL Anywhere 10 supports READ, WRITE, and INTENT row + locks. INTENT locks are sufficient to ensure that other + concurrent connections cannot modify a row (though other + connections can still read that row). SQL Anywhere also + supports 3 modes of snapshot isolation (multi-version + concurrency control (MVCC). + + SQL Anywhere's FOR UPDATE clause supports + FOR UPDATE BY [ LOCK | VALUES ] + FOR UPDATE OF ( COLUMN LIST ) + + though they cannot be specified at the same time. BY LOCK is + the syntax that acquires INTENT locks. FOR UPDATE BY VALUES + forces the use of the KEYSET cursor, which returns a warning to + the application when a row in the cursor has been subsequently + modified by another connection, and an error if the row has + been deleted. + + SQL Anywhere does not support the FOR UPDATE NOWAIT syntax of + Oracle on a statement-by-statement basis. However, the + identical functionality is provided by setting the connection + option BLOCKING to "OFF", or setting an appropriate timeout + period through the connection option BLOCKING_TIMEOUT. + + + + + SQL Anywhere 10 does not perform a COMMIT upon creation of + a temporary table. However, it does perform an implicit + COMMIT when creating an index over a temporary table, or + upon ALTERing the definition of temporary table. + + + + + SQL Anywhere does support OUT parameters with callable stored procedures. + + + + + SQL Anywhere uses DEFAULT AUTOINCREMENT to identify an IDENTITY + column in a CREATE TABLE statement. + + + + + SQL Anywhere does support FOR UPDATE OF syntax. However, + in SQL Anywhere one cannot specify both FOR UPDATE OF syntax + and FOR UPDATE BY LOCK in the same statement. To achieve INTENT + locking when using FOR UPDATE OF syntax one must use a table hint + in the query's FROM clause, ie. + + SELECT * FROM FOO WITH( UPDLOCK ) FOR UPDATE OF ( column-list ). + + In this dialect, we avoid this issue by supporting only + FOR UPDATE BY LOCK. + + + + + SQL Anywhere supports FOR UPDATE over cursors containing + outer joins. + + + + + Lock rows in the cursor explicitly using INTENT row locks. + + + + + Enforce the condition that this query is read-only. This ensure that certain + query rewrite optimizations, such as join elimination, can be used. + + + + + Lock rows in the cursor explicitly using INTENT row locks. + + + + + SQL Anywhere does not support FOR UPDATE NOWAIT. However, the intent + is to acquire pessimistic locks on the underlying rows; with NHibernate + one can accomplish this through setting the BLOCKING connection option. + Hence, with this API we lock rows in the cursor explicitly using INTENT row locks. + + + + + We assume that applications using this dialect are NOT using + SQL Anywhere's snapshot isolation modes. + + + + + We assume that applications using this dialect are NOT using + SQL Anywhere's snapshot isolation modes. + + + + + SQL Anywhere supports both double quotes or '[' (Microsoft syntax) for + quoted identifiers. + + Note that quoted identifiers are controlled through + the QUOTED_IDENTIFIER connection option. + + + + + SQL Anywhere supports both double quotes or '[' (Microsoft syntax) for + quoted identifiers. + + + + + SQL Anywhere's implementation of KEYSET-DRIVEN cursors does not + permit absolute postioning. With jConnect as the driver, this support + will succeed because jConnect FETCHes the entire result set to the client + first; it will fail with the iAnywhere JDBC driver. Because the server + may decide to use a KEYSET cursor even if the cursor is declared as + FORWARD ONLY, this support is disabled. + + + + + By default, the SQL Anywhere dbinit utility creates a + case-insensitive database for the CHAR collation. This can + be changed through the use of the -c command line switch on + dbinit, and the setting may differ for the NCHAR collation + for national character sets. Whether or not a database + supports case-sensitive comparisons can be determined via + the DB_Extended_property() function, for example + + SELECT DB_EXTENDED_PROPERTY( 'Collation', 'CaseSensitivity'); + + + + + SQL Anywhere supports COMMENT ON statements for a wide variety of + database objects. When the COMMENT statement is executed an implicit + COMMIT is performed. However, COMMENT syntax for CREATE TABLE, as + expected by NHibernate (see Table.cs), is not supported. + + + + + SQL Anywhere currently supports only "VALUES (DEFAULT)", not + the ANSI standard "DEFAULT VALUES". This latter syntax will be + supported in the SQL Anywhere 11.0.1 release. For the moment, + "VALUES (DEFAULT)" works only for a single-column table. + + + + + SQL Anywhere does not require dropping a constraint before + dropping a table, and the DROP statement syntax used by Hibernate + to drop a constraint is not compatible with SQL Anywhere, so disable it. + + + + + In SQL Anywhere, the syntax, DECLARE LOCAL TEMPORARY TABLE ..., + can also be used, which creates a temporary table with procedure scope, + which may be important for stored procedures. + + + + + Assume that temporary table rows should be preserved across COMMITs. + + + + + SQL Dialect for SQL Anywhere 11 - for the NHibernate 3.0.0 distribution + Copyright (C) 2010 Glenn Paulley + Contact: http://iablog.sybase.com/paulley + + This NHibernate dialect should be considered BETA software. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + The dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + prepare_sql + + + + + + + + SQL Dialect for SQL Anywhere 12 - for the NHibernate 3.2.0 distribution + Copyright (C) 2011 Glenn Paulley + Contact: http://iablog.sybase.com/paulley + + This NHibernate dialect for SQL Anywhere 12 is a contribution to the NHibernate + open-source project. It is intended to be included in the NHibernate + distribution and is licensed under LGPL. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + The SybaseSQLAnywhere12Dialect uses the SybaseSQLAnywhere11Dialect as its + base class. SybaseSQLAnywhere12Dialect includes support for ISO SQL standard + sequences, which are defined in the catalog table SYSSEQUENCE. + The dialect uses the SybaseSQLAnywhe11MetaData class for metadata API + calls, which correctly supports reserved words defined by SQL Anywhere. + + The dialect defaults the following configuration properties: + + + Property + Default Value + + + connection.driver_class + + + + prepare_sql + + + + + + + + SQL Anywhere supports SEQUENCES using a primarily SQL Standard + syntax. Sequence values can be queried using the .CURRVAL identifier, and the next + value in a sequence can be retrieved using the .NEXTVAL identifier. Sequences + are retained in the SYS.SYSSEQUENCE catalog table. + + + + + Pooled sequences does not refer to the CACHE parameter of the CREATE SEQUENCE + statement, but merely if the DBMS supports sequences that can be incremented or decremented + by values greater than 1. + + + + Get the SELECT command used to retrieve the names of all sequences. + The SELECT command; or NULL if sequences are not supported. + + + + This class maps a DbType to names. + + + Associations may be marked with a capacity. Calling the Get() + method with a type and actual size n will return the associated + name with smallest capacity >= n, if available and an unmarked + default type otherwise. + Eg, setting + + Names.Put(DbType, "TEXT" ); + Names.Put(DbType, 255, "VARCHAR($l)" ); + Names.Put(DbType, 65534, "LONGVARCHAR($l)" ); + + will give you back the following: + + Names.Get(DbType) // --> "TEXT" (default) + Names.Get(DbType,100) // --> "VARCHAR(100)" (100 is in [0:255]) + Names.Get(DbType,1000) // --> "LONGVARCHAR(1000)" (100 is in [256:65534]) + Names.Get(DbType,100000) // --> "TEXT" (default) + + On the other hand, simply putting + + Names.Put(DbType, "VARCHAR($l)" ); + + would result in + + Names.Get(DbType) // --> "VARCHAR($l)" (will cause trouble) + Names.Get(DbType,100) // --> "VARCHAR(100)" + Names.Get(DbType,1000) // --> "VARCHAR(1000)" + Names.Get(DbType,10000) // --> "VARCHAR(10000)" + + + + + + Get default type name for specified type + + the type key + the default type name associated with the specified key + + + + Get the type name specified type and size + + the type key + the SQL length + the SQL scale + the SQL precision + + The associated name with smallest capacity >= size if available and the + default type name otherwise + + + + + For types with a simple length, this method returns the definition + for the longest registered type. + + + + + + + Set a type name for specified type key and capacity + + the type key + the (maximum) type size/length + The associated name + + + + + + + + + + + The SybaseSQLAnywhereDriver Driver provides a database driver for Sybase SQL Anywhere 10 and above + + + + + Base class for the implementation of IDriver + + + + + A strategy for describing how NHibernate should interact with the different .NET Data + Providers. + + + + The IDriver interface is not intended to be exposed to the application. + Instead it is used internally by NHibernate to obtain connection objects, command objects, and + to generate and prepare IDbCommands. Implementors should provide a + public default constructor. + + + This is the interface to implement, or you can inherit from + if you have an ADO.NET data provider that NHibernate does not have built in support for. + To use the driver, NHibernate property connection.driver_class should be + set to the assembly-qualified name of the driver class. + + + key="connection.driver_class" + value="FullyQualifiedClassName, AssemblyName" + + + + + + Configure the driver using . + + + + + Creates an uninitialized IDbConnection object for the specific Driver + + + + + Generates an IDbCommand from the SqlString according to the requirements of the DataProvider. + + The of the command to generate. + The SqlString that contains the SQL. + The types of the parameters to generate for the command. + An IDbCommand with the CommandText and Parameters fully set. + + + + Prepare the by calling . + May be a no-op if the driver does not support preparing commands, or for any other reason. + + The command. + + + + Generates an IDbDataParameter for the IDbCommand. It does not add the IDbDataParameter to the IDbCommand's + Parameter collection. + + The IDbCommand to use to create the IDbDataParameter. + The name to set for IDbDataParameter.Name + The SqlType to set for IDbDataParameter. + An IDbDataParameter ready to be added to an IDbCommand. + + + + Remove 'extra' parameters from the IDbCommand + + + We sometimes create more parameters than necessary (see NH-2792 & also comments in SqlStringFormatter.ISqlStringVisitor.Parameter) + + + + + Expand the parameters of the cmd to have a single parameter for each parameter in the + sql string + + + This is for databases that do not support named parameters. So, instead of a single parameter + for 'select ... from MyTable t where t.Col1 = @p0 and t.Col2 = @p0' we can issue + 'select ... from MyTable t where t.Col1 = ? and t.Col2 = ?' + + + + + Make any adjustments to each IDbCommand object before it is added to the batcher. + + The command. + + This method should be executed before add each single command to the batcher. + If you have to adjust parameters values/type (when the command is full filled) this is a good place where do it. + + + + + Does this Driver support having more than 1 open IDataReader with + the same IDbConnection. + + + + A value of indicates that an exception would be thrown if NHibernate + attempted to have 2 IDataReaders open using the same IDbConnection. NHibernate + (since this version is a close to straight port of Hibernate) relies on the + ability to recursively open 2 IDataReaders. If the Driver does not support it + then NHibernate will read the values from the IDataReader into an . + + + A value of will result in greater performance because an IDataReader can be used + instead of the . So if the Driver supports it then make sure + it is set to . + + + + + + Change the parameterName into the correct format IDbCommand.CommandText + for the ConnectionProvider + + The unformatted name of the parameter + A parameter formatted for an IDbCommand.CommandText + + + + Changes the parameterName into the correct format for an IDbParameter + for the Driver. + + + For SqlServerConnectionProvider it will change id to @id + + The unformatted name of the parameter + A parameter formatted for an IDbParameter. + + + + Generates an IDbDataParameter for the IDbCommand. It does not add the IDbDataParameter to the IDbCommand's + Parameter collection. + + The IDbCommand to use to create the IDbDataParameter. + The name to set for IDbDataParameter.Name + The SqlType to set for IDbDataParameter. + An IDbDataParameter ready to be added to an IDbCommand. + + + + Override to make any adjustments to the IDbCommand object. (e.g., Oracle custom OUT parameter) + Parameters have been bound by this point, so their order can be adjusted too. + This is analagous to the RegisterResultSetOutParameter() function in Hibernate. + + + + + Override to make any adjustments to each IDbCommand object before it added to the batcher. + + The command. + + This method is similar to the but, instead be called just before execute the command (that can be a batch) + is executed before add each single command to the batcher and before . + If you have to adjust parameters values/type (when the command is full filled) this is a good place where do it. + + + + + Does this Driver require the use of a Named Prefix in the SQL statement. + + + For example, SqlClient requires select * from simple where simple_id = @simple_id + If this is false, like with the OleDb provider, then it is assumed that + the ? can be a placeholder for the parameter in the SQL statement. + + + + + Does this Driver require the use of the Named Prefix when trying + to reference the Parameter in the Command's Parameter collection. + + + This is really only useful when the UseNamedPrefixInSql == true. When this is true the + code will look like: + IDbParameter param = cmd.Parameters["@paramName"] + if this is false the code will be + IDbParameter param = cmd.Parameters["paramName"]. + + + + + The Named Prefix for parameters. + + + Sql Server uses "@" and Oracle uses ":". + + + + + Does this Driver support IDbCommand.Prepare(). + + + + A value of indicates that an exception would be thrown or the + company that produces the Driver we are wrapping does not recommend using + IDbCommand.Prepare(). + + + A value of indicates that calling IDbCommand.Prepare() will function + fine on this Driver. + + + + + + Initializes a new instance of with + type names that are loaded from the specified assembly. + + Assembly to load the types from. + Connection type name. + Command type name. + + + + Initializes a new instance of with + type names that are loaded from the specified assembly. + + The Invariant name of a provider. + Assembly to load the types from. + Connection type name. + Command type name. + + + + + Initializes a new instance of the class. + + + Thrown when the iAnywhere.Data.SQLAnywhere assembly is not and can not be loaded. + + + + + The SybaseAsaClientDriver driver provides a database driver for Adaptive Server Anywhere 9.0. + + + + + Initializes a new instance of the class. + + + Thrown when the iAnywhere.Data.AsaClient assembly is not and can not be loaded. + + + + + Execute the given for each command of the resultset. + + The action to perform where the first parameter is the and the second parameter is the parameters offset of the . + + + + Datareader wrapper with the same life cycle of its command (through the batcher) + + + + + NHibernate driver for the Community CsharpSqlite data provider. +

+ Author: Nikolaos Tountas +

+
+ +

+ In order to use this Driver you must have the Community.CsharpSqlite.dll and Community.CsharpSqlite.SQLiteClient assemblies referenced. +

+

+ Please check http://code.google.com/p/csharp-sqlite/ for more information regarding csharp-sqlite. +

+
+
+ + + Initializes a new instance of . + + + Thrown when the Community.CsharpSqlite.dll assembly can not be loaded. + + + + + A NHibernate Driver for using the IBM.Data.DB2.iSeries DataProvider. + + + + + Initializes a new instance of the class. + + + Thrown when the IBM.Data.DB2.iSeries assembly can not be loaded. + + + + + A NHibernate Driver for using the IBM.Data.DB2 DataProvider. + + + + + Initializes a new instance of the class. + + + Thrown when the IBM.Data.DB2 assembly can not be loaded. + + + + + Provides a database driver for dotConnect for MySQL by DevArt. + + + + In order to use this driver you must have the assembly Devart.Data.MySql.dll available for + NHibernate to load, including its dependencies (Devart.Data.dll). + + + Please check the product's website + for any updates and/or documentation regarding dotConnect for MySQL. + + + + + + Initializes a new instance of the class. + + + Thrown when the Devart.Data.MySql assembly can not be loaded. + + + + + Devart.Data.MySql uses named parameters in the sql. + + - MySql uses @ in the sql. + + + + + + + Devart.Data.MySql use the @ to locate parameters in sql. + + @ is used to locate parameters in sql. + + + + A NHibernate Driver for using the Firebird data provider located in + FirebirdSql.Data.FirebirdClient assembly. + + + + + Initializes a new instance of the class. + + + Thrown when the FirebirdSql.Data.Firebird assembly can not be loaded. + + + + + A NHibernate Driver for using the FirebirdSql.Data.Firebird DataProvider. + + + + + Initializes a new instance of the class. + + + Thrown when the FirebirdSql.Data.FirebirdClient assembly can not be loaded. + + + + + A NHibernate Driver for using the Informix DataProvider + + + + + Initializes a new instance of the class. + + + Thrown when the IBM.Data.Informix assembly can not be loaded. + + + + + A NHibernate Driver for using the Ingres DataProvider + + + + + + + Provides a database driver for MySQL. + + + + In order to use this driver you must have the assembly MySql.Data.dll available for + NHibernate to load, including its dependencies (ICSharpCode.SharpZipLib.dll is required by + the assembly MySql.Data.dll as of the time of this writing). + + + Please check the product's website + for any updates and/or documentation regarding MySQL. + + + + + + Initializes a new instance of the class. + + + Thrown when the MySql.Data assembly can not be loaded. + + + + + MySql.Data uses named parameters in the sql. + + - MySql uses ? in the sql. + + + + + + + MySql.Data use the ? to locate parameters in sql. + + ? is used to locate parameters in sql. + + + + The MySql.Data driver does NOT support more than 1 open IDataReader + with only 1 IDbConnection. + + - it is not supported. + + + + MySql.Data does not support preparing of commands. + + - it is not supported. + + With the Gamma MySql.Data provider it is throwing an exception with the + message "Expected End of data packet" when a select command is prepared. + + + + + Some Data Providers (ie - SqlClient) do not support Multiple Active Result Sets (MARS). + NHibernate relies on being able to create MARS to read Components and entities inside + of Collections. + + + This is a completely off-line DataReader - the underlying IDataReader that was used to create + this has been closed and no connections to the Db exists. + + + + + Creates a NDataReader from a + + The to get the records from the Database. + if we are loading the in the middle of reading it. + + NHibernate attempts to not have to read the contents of an into memory until it absolutely + has to. What that means is that it might have processed some records from the and will + pick up the midstream so that the underlying can be closed + so a new one can be opened. + + + + + Sets the values that can be cached back to null and sets the + index of the cached column to -1 + + + + + + + + + + + + + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + There are not any unmanaged resources or any disposable managed + resources that this class is holding onto. It is in here + to comply with the interface. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Stores a Result from a DataReader in memory. + + + + + Initializes a new instance of the NResult class. + + The IDataReader to populate the Result with. + + if the is already positioned on the record + to start reading from. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An implementation of that will work with either an + returned by Execute or with an + whose contents have been read into a . + + + + This allows NHibernate to use the underlying for as long as + possible without the need to read everything into the . + + + The consumer of the returned from does + not need to know the underlying reader and can use it the same even if it switches from an + to in the middle of its use. + + + + + + Initializes a new instance of the class. + + The underlying IDataReader to use. + + + + Initializes a new instance of the NHybridDataReader class. + + The underlying IDataReader to use. + if the contents of the IDataReader should be read into memory right away. + + + + Reads all of the contents into memory because another + needs to be opened. + + + This will result in a no op if the reader is closed or is already in memory. + + + + + + + + + + + + + + + + + A flag to indicate if Disose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this NHybridDataReader is being Disposed of or Finalized. + + If this NHybridDataReader is being Finalized (isDisposing==false) then make sure not + to call any methods that could potentially bring this NHybridDataReader back to life. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets if the object is in the middle of reading a Result. + + if NextResult and Read have been called on the . + + + + + + + + + + + + + + + + + + + + + + The PostgreSQL data provider provides a database driver for PostgreSQL. +

+ Author: Oliver Weichhold +

+
+ +

+ In order to use this Driver you must have the Npgsql.dll Assembly available for + NHibernate to load it. +

+

+ Please check the products website + http://www.postgresql.org/ + for any updates and or documentation. +

+

+ The homepage for the .NET DataProvider is: + http://pgfoundry.org/projects/npgsql. +

+
+
+ + + Initializes a new instance of the class. + + + Thrown when the Npgsql assembly can not be loaded. + + + + + A NHibernate Driver for using the Odbc DataProvider + + + Always look for a native .NET DataProvider before using the Odbc DataProvider. + + + + + A NHibernate Driver for using the OleDb DataProvider + + + Always look for a native .NET DataProvider before using the OleDb DataProvider. + + + + + OLE DB provider does not support multiple open data readers + + + + + A NHibernate Driver for using the Oracle DataProvider. + + + + + A NHibernate Driver for using the Oracle.DataAccess DataProvider + + + Code was contributed by James Mills + on the NHibernate forums in this + post. + + + + + Initializes a new instance of . + + + Thrown when the Oracle.DataAccess assembly can not be loaded. + + + + + This adds logic to ensure that a DbType.Boolean parameter is not created since + ODP.NET doesn't support it. + + + + + + + + + + + + + + A NHibernate Driver for using the Oracle.DataAccess.Lite DataProvider + + + + + Initializes a new instance of . + + + Thrown when the Oracle.DataAccess.Lite_w32 assembly can not be loaded. + + + + + This adds logic to ensure that a DbType.Boolean parameter is not created since + ODP.NET doesn't support it. + + + + + A NHibernate Driver for using the SqlClient DataProvider + + + + + Creates an uninitialized object for + the SqlClientDriver. + + An unitialized object. + + + + Creates an uninitialized object for + the SqlClientDriver. + + An unitialized object. + + + + Interprets if a parameter is a Clob (for the purposes of setting its default size) + + The parameter + The of the parameter + True, if the parameter should be interpreted as a Clob, otherwise False + + + + Interprets if a parameter is a Blob (for the purposes of setting its default size) + + The parameter + The of the parameter + True, if the parameter should be interpreted as a Blob, otherwise False + + + + MsSql requires the use of a Named Prefix in the SQL statement. + + + because MsSql uses "@". + + + + + MsSql requires the use of a Named Prefix in the Parameter. + + + because MsSql uses "@". + + + + + The Named Prefix for parameters. + + + Sql Server uses "@". + + + + + The SqlClient driver does NOT support more than 1 open IDataReader + with only 1 IDbConnection. + + - it is not supported. + + MS SQL Server 2000 (and 7) throws an exception when multiple IDataReaders are + attempted to be opened. When SQL Server 2005 comes out a new driver will be + created for it because SQL Server 2005 is supposed to support it. + + + + + NHibernate driver for the System.Data.SQLite data provider for .NET 2.0. + + +

+ In order to use this driver you must have the System.Data.SQLite.dll assembly available + for NHibernate to load. This assembly includes the SQLite.dll or SQLite3.dll libraries. +

+

+ You can get the System.Data.SQLite.dll assembly from http://sourceforge.net/projects/sqlite-dotnet2. +

+

+ Please check http://www.sqlite.org/ for more information regarding SQLite. +

+
+
+ + + Initializes a new instance of . + + + Thrown when the SQLite.NET assembly can not be loaded. + + + + + NHibernate driver for the SQLite.NET data provider. +

+ Author: Ioan Bizau +

+
+ +

+ In order to use this Driver you must have the SQLite.NET.dll Assembly available for NHibernate to load it. + You must also have the SQLite.dll and SQLite3.dll libraries. +

+

+ Please check http://www.sqlite.org/ for more information regarding SQLite. +

+
+
+ + + Initializes a new instance of . + + + Thrown when the SQLite.NET assembly can not be loaded. + + + + + A NHibernate driver for Microsoft SQL Server CE data provider + + + + + Initializes a new instance of the class. + + + + + MsSql requires the use of a Named Prefix in the SQL statement. + + + because MsSql uses "@". + + + + + MsSql requires the use of a Named Prefix in the Parameter. + + + because MsSql uses "@". + + + + + The Named Prefix for parameters. + + + Sql Server uses "@". + + + + + The SqlClient driver does NOT support more than 1 open IDataReader + with only 1 IDbConnection. + + - it is not supported. + + Ms Sql 2000 (and 7) throws an Exception when multiple DataReaders are + attempted to be Opened. When Yukon comes out a new Driver will be + created for Yukon because it is supposed to support it. + + + + + This provides a driver for Sybase ASE 15 using the ADO.NET driver. + + + You will need the following libraries available to your application: +
    +
  • Sybase.AdoNet2.AseClient.dll
  • +
  • sybdrvado20.dll
  • +
+
+
+ + + SQL Dialect for SQL Anywhere 12 - for the NHibernate 3.2.0 distribution + Copyright (C) 2011 Glenn Paulley + Contact: http://iablog.sybase.com/paulley + + This NHibernate dialect for SQL Anywhere 12 is a contribution to the NHibernate + open-source project. It is intended to be included in the NHibernate + distribution and is licensed under LGPL. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + The SybaseSQLAnywhereDotNet4Driver provides a .NET 4 database driver for + Sybase SQL Anywhere 12 using the versioned ADO.NET driver + iAnywhere.Data.SQLAnywhere.v4.0. + + + + + Initializes a new instance of the class. + + + Thrown when the iAnywhere.Data.SQLAnywhere.v4.0 assembly is not and can not be loaded. + + + + + Represents state associated with the processing of a given + in regards to loading collections. + + + Another implementation option to consider is to not expose ResultSets + directly (in the JDBC redesign) but to always "wrap" them and apply a [series of] context[s] to that wrapper. + + + + + Creates a collection load context for the given result set. + + Callback to other collection load contexts. + The result set this is "wrapping". + + + + Retrieve the collection that is being loaded as part of processing this result set. + + The persister for the collection being requested. + The key of the collection being requested. + The loading collection (see discussion above). + + Basically, there are two valid return values from this method:
    +
  • an instance of {@link PersistentCollection} which indicates to + continue loading the result set row data into that returned collection + instance; this may be either an instance already associated and in the + midst of being loaded, or a newly instantiated instance as a matching + associated collection was not found.
  • +
  • null indicates to ignore the corresponding result set row + data relating to the requested collection; this indicates that either + the collection was found to already be associated with the persistence + context in a fully loaded state, or it was found in a loading state + associated with another result set processing context.
  • +
+
+
+ + + Finish the process of collection-loading for this bound result set. Mainly this + involves cleaning up resources and notifying the collections that loading is + complete. + + The persister for which to complete loading. + + + Add the collection to the second-level cache + The entry representing the collection to add + The persister + + + + Maps to specific contextual data + related to processing that . + + + Implementation note: internally an is used to maintain + the mappings; was chosen because I'd rather not be + dependent upon potentially bad and + implementations. + Considering the JDBC-redesign work, would further like this contextual info + not mapped separately, but available based on the result set being processed. + This would also allow maintaining a single mapping as we could reliably get + notification of the result-set closing... + + + + Creates and binds this to the given persistence context. + The persistence context to which this will be bound. + + + + Release internal state associated with the given result set. + + The result set for which it is ok to release associated resources. + + This should be called when we are done with processing said result set, + ideally as the result set is being closed. + + + + Release internal state associated with *all* result sets. + + This is intended as a "failsafe" process to make sure we get everything + cleaned up and released. + + + + + Get the {@link CollectionLoadContext} associated with the given + {@link ResultSet}, creating one if needed. + + The result set for which to retrieve the context. + The processing context. + + + + Attempt to locate the loading collection given the owner's key. The lookup here + occurs against all result-set contexts... + + The collection persister + The owner key + The loading collection, or null if not found. + + + + Register a loading collection xref. + + The xref collection key + The corresponding loading collection entry + + This xref map is used because sometimes a collection is in process of + being loaded from one result set, but needs to be accessed from the + context of another "nested" result set processing. + Implementation note: package protected, as this is meant solely for use + by {@link CollectionLoadContext} to be able to locate collections + being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s. + + + + + The inverse of {@link #registerLoadingCollectionXRef}. Here, we are done + processing the said collection entry, so we remove it from the + load context. + + The key of the collection we are done processing. + + The idea here is that other loading collections can now reference said + collection directly from the {@link PersistenceContext} because it + has completed its load cycle. + Implementation note: package protected, as this is meant solely for use + by {@link CollectionLoadContext} to be able to locate collections + being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s. + + + + + Locate the LoadingCollectionEntry within *any* of the tracked + s. + + The collection key. + The located entry; or null. + + Implementation note: package protected, as this is meant solely for use + by to be able to locate collections + being loaded by other s/ResultSets. + + + + + Retrieves the persistence context to which this is bound. + + + + + Do we currently have any internal entries corresponding to loading + collections? + + True if we currently hold state pertaining to loading collections; false otherwise. + + + + Do we currently have any registered internal entries corresponding to loading + collections? + True if we currently hold state pertaining to a registered loading collections; false otherwise. + + + + + Represents a collection currently being loaded. + + + + Describes a return in a native SQL query. + + + + Represents a return defined as part of a native sql query which + names a collection role in the form {classname}.{collectionrole}; it + is used in defining a custom sql query for loading an entity's + collection in non-fetching scenarios (i.e., loading the collection + itself as the "root" of the result). + + + + + Represents the base information for a non-scalar return defined as part of + a native sql query. + + + + Constructs some form of non-scalar return descriptor + The result alias + Any user-supplied column->property mappings + The lock mode to apply to the return. + + + Retrieve the defined result alias + + + Retrieve the lock-mode to apply to this return + + + Retrieve the user-supplied column->property mappings. + + + Construct a native-sql return representing a collection initializer + The result alias + + The entity-name of the entity owning the collection to be initialized. + + + The property name (on the owner) which represents + the collection to be initialized. + + Any user-supplied column->property mappings + The lock mode to apply to the collection. + + + + The class owning the collection. + + + + + The name of the property representing the collection from the . + + + + + Represents a return defined as part of a native sql query which + names a fetched role. + + + + Construct a return descriptor representing some form of fetch. + The result alias + The owner's result alias + The owner's property representing the thing to be fetched + Any user-supplied column->property mappings + The lock mode to apply + + + The alias of the owner of this fetched association. + + + + Retrieve the property name (relative to the owner) which maps to + the association to be fetched. + + + + + Represents a return defined as part of a native sql query which + names a "root" entity. A root entity means it is explicitly a + "column" in the result, as opposed to a fetched relationship or role. + + + + + Construct a return representing an entity returned at the root + of the result. + + The result alias + The entity name. + The lock mode to apply + + + + Construct a return representing an entity returned at the root + of the result. + + The result alias + The entity name. + Any user-supplied column->property mappings + The lock mode to apply + + + The name of the entity to be returned. + + + Describes a scalar return in a native SQL query. + + + + Extends an HQLQueryPlan to maintain a reference to the collection-role name + being filtered. + + + + Defines a query execution plan for an HQL query (or filter). + + + Descriptor regarding a named parameter. + + + + Not supported yet (AST parse needed) + + + + Defines a query execution plan for a native-SQL query. + + + Encapsulates metadata about parameters encountered within a query. + + + + The single available method + is responsible for parsing a query string and recognizing tokens in + relation to parameters (either named, ejb3-style, or ordinal) and + providing callbacks about such recognitions. + + + + + Performs the actual parsing and tokenizing of the query string making appropriate + callbacks to the given recognizer upon recognition of the various tokens. + + + Note that currently, this only knows how to deal with a single output + parameter (for callable statements). If we later add support for + multiple output params, this, obviously, needs to change. + + The string to be parsed/tokenized. + The thing which handles recognition events. + + + + + Implements a parameter parser recognizer specifically for the purpose + of journaling parameter locations. + + + + + Convenience method for creating a param location recognizer and + initiating the parse. + + The query to be parsed for parameter locations. + The generated recognizer, with journaled location info. + + + + The dictionary of named parameter locations. + The dictionary is keyed by parameter name. + + + + + The list of ordinal parameter locations. + + + The list elements are integers, representing the location for that given ordinal. + Thus OrdinalParameterLocationList[n] represents the location for the nth parameter. + + + + Acts as a cache for compiled query plans, as well as query-parameter metadata. + + + + Represents work that needs to be performed in a manner + which isolates it from any current application unit of + work transaction. + + + + + Perform the actual work to be done. + + The ADP connection to use. + The active transaction of the connection. + + + + Class which provides the isolation semantics required by + an . + + + + + Processing comes in two flavors: + + + + makes sure the work to be done is performed in a separate, distinct transaction + + + + makes sure the work to be done is performed outside the scope of any transaction + + + + + + + Ensures that all processing actually performed by the given work will + occur on a separate transaction. + + The work to be performed. + The session from which this request is originating. + + + + Ensures that all processing actually performed by the given work will + occur outside of a transaction. + + The work to be performed. + The session from which this request is originating. + + + + Responsible for maintaining the queue of actions related to events. + + The ActionQueue holds the DML operations queued as part of a session's + transactional-write-behind semantics. DML operations are queued here + until a flush forces them to be executed against the database. + + + + + + Perform all currently queued entity-insertion actions. + + + + + Perform all currently queued actions. + + + + + Prepares the internal action queues for execution. + + + + + Execute any registered + + + + + Performs cleanup of any held cache softlocks. + + Was the transaction successful. + + + + Check whether the given tables/query-spaces are to be executed against + given the currently queued actions. + + The table/query-spaces to check. + True if we contain pending actions against any of the given tables; false otherwise. + + + + Check whether any insertion or deletion actions are currently queued. + + True if insertions or deletions are currently queued; false otherwise. + + + + Identifies a named association belonging to a particular + entity instance. Used to record the fact that an association + is null during loading. + + + + + Defines a sequence of elements that are currently + eligible for batch fetching. + + + Even though this is a map, we only use the keys. A map was chosen in + order to utilize a to maintain sequencing + as well as uniqueness. + + + + + A map of subselect-fetch descriptors + keyed by the against which the descriptor is + registered. + + + + + The owning persistence context. + + + + + Constructs a queue for the given context. + + The owning persistence context. + + + + Clears all entries from this fetch queue. + + + + + Retrieve the fetch descriptor associated with the given entity key. + + The entity key for which to locate any defined subselect fetch. + The fetch descriptor; may return null if no subselect fetch queued for + this entity key. + + + + Adds a subselect fetch decriptor for the given entity key. + + The entity for which to register the subselect fetch. + The fetch descriptor. + + + + After evicting or deleting an entity, we don't need to + know the query that was used to load it anymore (don't + call this after loading the entity, since we might still + need to load its collections) + + + + + Clears all pending subselect fetches from the queue. + + + Called after flushing. + + + + + If an EntityKey represents a batch loadable entity, add + it to the queue. + + + Note that the contract here is such that any key passed in should + previously have been been checked for existence within the + ; failure to do so may cause the + referenced entity to be included in a batch even though it is + already associated with the . + + + + + After evicting or deleting or loading an entity, we don't + need to batch fetch it anymore, remove it from the queue + if necessary + + + + + Get a batch of uninitialized collection keys for a given role + + The persister for the collection role. + A key that must be included in the batch fetch + the maximum number of keys to return + The entity mode. + an array of collection keys, of length batchSize (padded with nulls) + + + + Get a batch of unloaded identifiers for this class, using a slightly + complex algorithm that tries to grab keys registered immediately after + the given key. + + The persister for the entities being loaded. + The identifier of the entity currently demanding load. + The maximum number of keys to return + The entity mode. + an array of identifiers, of length batchSize (possibly padded with nulls) + + + + The types of children to cascade to + + + + + A cascade point that occurs just after the insertion of the parent + entity and just before deletion + + + + + A cascade point that occurs just before the insertion of the parent entity + and just after deletion + + + + + A cascade point that occurs just after the insertion of the parent entity + and just before deletion, inside a collection + + + + + A cascade point that occurs just after the update of the parent entity + + + + A cascade point that occurs just before the session is flushed + + + + A cascade point that occurs just after eviction of the parent entity from the + session cache + + + + + A cascade point that occurs just after locking a transient parent entity into the + session cache + + + + + A cascade point that occurs just after locking a transient parent entity into the session cache + + + + + A cascade point that occurs just before merging from a transient parent entity into + the object in the session cache + + + + + Delegate responsible, in conjunction with the various + , for implementing cascade processing. + + + + Cascade an action from the parent entity instance to all its children. + The parent's entity persister + The parent reference. + + + + Cascade an action from the parent entity instance to all its children. This + form is typicaly called from within cascade actions. + + The parent's entity persister + The parent reference. + + Typically some form of cascade-local cache + which is specific to each CascadingAction type + + + + Cascade an action to the child or children + + + Cascade an action to a collection + + + Cascade an action to a to-one association or any type + + + Cascade to the collection elements + + + Delete any entities that were removed from the collection + + + A contract for defining the aspects of cascading various persistence actions. + + + + package-protected constructor + + + For this style, should the given action be cascaded? + The action to be checked for cascade-ability. + True if the action should be cascaded under this style; false otherwise. + + + + Probably more aptly named something like doCascadeToCollectionElements(); + it is however used from both the collection and to-one logic branches... + + The action to be checked for cascade-ability. + True if the action should be really cascaded under this style; false otherwise. + + For this style, should the given action really be cascaded? The default + implementation is simply to return {@link #doCascade}; for certain + styles (currently only delete-orphan), however, we need to be able to + control this separately. + + + + Factory method for obtaining named cascade styles + The named cascade style name. + The appropriate CascadeStyle + + + save / delete / update / evict / lock / replicate / merge / persist + delete orphans + + + save / delete / update / evict / lock / replicate / merge / persist + + + save / update + + + lock + + + refresh + + + evict + + + replicate + + + merge + + + create + + + delete + + + delete + delete orphans + + + no cascades + + + Do we need to delete orphaned collection elements? + True if this style need to account for orphan delete operations; false otherwise. + + + + A session action that may be cascaded from parent entity to its children + + + + Cascade the action to the child object. + The session within which the cascade is occurring. + The child to which cascading should be performed. + The child's entity name + Typically some form of cascade-local cache which is specific to each CascadingAction type + Are cascading deletes enabled. + + + + Given a collection, get an iterator of the children upon which the + current cascading action should be visited. + + The session within which the cascade is occurring. + The mapping type of the collection. + The collection instance. + The children iterator. + + + + Called (in the case of returning true) to validate + that no cascade on the given property is considered a valid semantic. + + The session within which the cascade is occurring. + The property value + The property value owner + The entity persister for the owner + The index of the property within the owner. + + + + Given a collection, get an iterator of all its children, loading them + from the database if necessary. + + The session within which the cascade is occurring. + The mapping type of the collection. + The collection instance. + The children iterator. + + + + Iterate just the elements of the collection that are already there. Don't load + any new elements from the database. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute persist during flush time + + + + + + + Does this action potentially extrapolate to orphan deletes? + True if this action can lead to deletions of orphans. + + + Does the specified cascading action require verification of no cascade validity? + True if this action requires no-cascade verification; false otherwise. + + + Should this action be performed (or noCascade consulted) in the case of lazy properties. + + + + We need an entry to tell us all about the current state + of a collection with respect to its persistent state + + + + session-start/post-flush persistent state + + + allow the snapshot to be serialized + + + + The when the Collection was loaded. + + + This can be if the Collection was not loaded by NHibernate and + was passed in along with a transient object. + + + + + The identifier of the Entity that is the owner of this Collection + during the load or post flush. + + + + + Indicates that the Collection can still be reached by an Entity + that exist in the . + + + It is also used to ensure that the Collection is not shared between + two Entities. + + + + + Indicates that the Collection has been processed and is ready + to have its state synchronized with the database. + + + + + Indicates that a Collection needs to be updated. + + + A Collection needs to be updated whenever the contents of the Collection + have been changed. + + + + + Indicates that a Collection has old elements that need to be removed. + + + A Collection needs to have removals performed whenever its role changes or + the key changes and it has a loadedPersister - ie - it was loaded by NHibernate. + + + + + Indicates that a Collection needs to be recreated. + + + A Collection needs to be recreated whenever its role changes + or the owner changes. + + + + + If we instantiate a collection during the + process, we must ignore it for the rest of the flush. + + + + + The that is currently responsible + for the Collection. + + + This is set when NHibernate is updating a reachable or an + unreachable collection. + + + + + Initializes a new instance of . + + + For newly wrapped collections, or dereferenced collection wrappers + + + + For collections just loaded from the database + + + + Initializes a new instance of for initialized detached collections. + + + For initialized detached collections + + + + + Determine if the collection is "really" dirty, by checking dirtiness + of the collection elements, if necessary + + + + + Prepares this CollectionEntry for the Flush process. + + The that this CollectionEntry will be responsible for flushing. + + + + Updates the CollectionEntry to reflect that the + has been initialized. + + The initialized that this Entry is for. + + + + Updates the CollectionEntry to reflect that it is has been successfully flushed to the database. + + The that was flushed. + + Called after a successful flush. + + + + + Sets the information in this CollectionEntry that is specific to the + . + + + The that is + responsible for the Collection. + + + + + + + + + + + + + + Uniquely identifies a collection instance in a particular session. + + + + + Record the fact that this collection was dereferenced + + The collection to be updated by unreachability. + The session. + + + + Initialize the role of the collection. + + The collection to be updated by reachibility. + The type of the collection. + The owner of the collection. + The session. + + + + We need an entry to tell us all about the current state + of an object with respect to its persistent state + + + + + Initializes a new instance of EntityEntry. + + The current of the Entity. + The snapshot of the Entity's state when it was loaded. + + The identifier of the Entity in the database. + The version of the Entity. + The for the Entity. + A boolean indicating if the Entity exists in the database. + The that is responsible for this Entity. + + + + + + + After actually inserting a row, record the fact that the instance exists on the + database (needed for identity-column key generation) + + + + + After actually updating the database, update the snapshot information, + and escalate the lock mode. + + + + + After actually deleting a row, record the fact that the instance no longer + exists in the database + + + + + Can the entity be modified? + The entity is modifiable if all of the following are true: + - the entity class is mutable + - the entity is not read-only + - if the current status is Status.Deleted, then the entity was not read-only when it was deleted + + true, if the entity is modifiable; false, otherwise + + + + Gets or sets the current of the Entity. + + The of the Entity. + + + + Gets or sets the of this Entity with respect to its + persistence in the database. + + The of this Entity. + + + + Gets or sets the identifier of the Entity in the database. + + The identifier of the Entity in the database if one has been assigned. + This might be when the is + and the database generates the id. + + + + Gets or sets the snapshot of the Entity when it was loaded from the database. + + The snapshot of the Entity. + + There will only be a value when the Entity was loaded in the current Session. + + + + + Gets or sets the snapshot of the Entity when it was marked as being ready for deletion. + + The snapshot of the Entity. + This will be if the Entity is not being deleted. + + + + Gets or sets a indicating if this Entity exists in the database. + + if it is already in the database. + + It can also be if it does not exists in the database yet and the + is . + + + + + Gets or sets the version of the Entity. + + The version of the Entity. + + + + Gets or sets the that is responsible for this Entity. + + The that is responsible for this Entity. + + + + Gets the Fully Qualified Name of the class this Entity is an instance of. + + The Fully Qualified Name of the class this Entity is an instance of. + + + + Get the EntityKey based on this EntityEntry. + + + + + A globally unique identifier of an instance, consisting of the user-visible identifier + and the identifier space (eg. tablename) + + + + Construct a unique identifier for an entity class instance + + + Used to reconstruct an EntityKey during deserialization. + The identifier value + The root entity name + The specific entity name + The type of the identifier value + Whether represented entity is eligible for batch loading + The session factory + The entity's entity mode + + + + To use in deserialization callback + + + + + + Used to uniquely key an entity instance in relation to a particular session + by some unique property reference, as opposed to identifier. + Uniqueing information consists of the entity-name, the referenced + property name, and the referenced property value. + + + + + + A FilterDefinition defines the global attributes of a dynamic filter. This + information includes its name as well as its defined parameters (name and type). + + + + + Set the named parameter's value list for this filter. + + The name of the filter for which this configuration is in effect. + The default filter condition. + A dictionary storing the NHibernate type + of each parameter under its name. + if set to true used in many to one rel + + + + Retreive the type of the named parameter defined for this filter. + + The name of the filter parameter for which to return the type. + The type of the named parameter. + + + + Gets a value indicating whether to use this filter-def in manytoone refs. + + true if [use in many to one]; otherwise, false. + + + + Get the name of the filter this configuration defines. + + The filter name for this configuration. + + + + Get a set of the parameters defined by this configuration. + + The parameters named by this configuration. + + + Algorithms related to foreign key constraint transparency + + + + Is this instance persistent or detached? + + + If is non-null, don't hit the database to make the + determination, instead assume that value; the client code must be + prepared to "recover" in the case that this assumed result is incorrect. + + + + + Is this instance, which we know is not persistent, actually transient? + If assumed is non-null, don't hit the database to make the + determination, instead assume that value; the client code must be + prepared to "recover" in the case that this assumed result is incorrect. + + + If is non-null, don't hit the database to make the + determination, instead assume that value; the client code must be + prepared to "recover" in the case that this assumed result is incorrect. + + + + + Return the identifier of the persistent or transient object, or throw + an exception if the instance is "unsaved" + + + Used by OneToOneType and ManyToOneType to determine what id value should + be used for an object that may or may not be associated with the session. + This does a "best guess" using any/all info available to use (not just the + EntityEntry). + + + + + Nullify all references to entities that have not yet + been inserted in the database, where the foreign key + points toward that entity + + + + + Return null if the argument is an "unsaved" entity (ie. + one with no existing database row), or the input argument + otherwise. This is how Hibernate avoids foreign key constraint + violations. + + + + + Determine if the object already exists in the database, using a "best guess" + + + + + A strategy for determining if an identifier value is an identifier of a new + transient instance or a previously persistent transient instance. The strategy + is determined by the Unsaved-Value attribute in the mapping file. + + + + + + + + Assume the transient instance is newly instantiated if its identifier is null or + equal to Value + + + + + + Does the given identifier belong to a new instance + + + + + Always assume the transient instance is newly instantiated + + + + + Never assume that transient instance is newly instantiated + + + + + Assume the transient instance is newly instantiated if the identifier + is null. + + + + Assume nothing. + + + + Holds the state of the persistence context, including the + first-level cache, entries, snapshots, proxies, etc. + + + + Add a collection which has no owner loaded + + + + Get and remove a collection whose owner is not yet loaded, + when its owner is being loaded + + + + Clear the state of the persistence context + + + Set the status of an entry + + + Called after transactions end + + + + Get the current state of the entity as known to the underlying + database, or null if there is no corresponding row + + + + + Retrieve the cached database snapshot for the requested entity key. + + The entity key for which to retrieve the cached snapshot + The cached snapshot + + + This differs from is two important respects: + no snapshot is obtained from the database if not already cached + an entry of NO_ROW here is interpreted as an exception + + + + + + Get the values of the natural id fields as known to the underlying + database, or null if the entity has no natural id or there is no + corresponding row. + + + + Add a canonical mapping from entity key to entity instance + + + + Get the entity instance associated with the given EntityKey + + + + Is there an entity with the given key in the persistence context + + + + Remove an entity from the session cache, also clear + up other state associated with the entity, all except + for the EntityEntry + + + + Get an entity cached by unique key + + + Add an entity to the cache by unique key + + + + Retrieve the EntityEntry representation of the given entity. + + The entity for which to locate the EntityEntry. + The EntityEntry for the given entity. + + + Remove an entity entry from the session cache + + + Is there an EntityEntry for this instance? + + + Get the collection entry for a persistent collection + + + Adds an entity to the internal caches. + + + + Generates an appropriate EntityEntry instance and adds it + to the event source's internal caches. + + + + Is the given collection associated with this persistence context? + + + Is the given proxy associated with this persistence context? + + + + Takes the given object and, if it represents a proxy, reassociates it with this event source. + + The possible proxy to be reassociated. + Whether the passed value represented an actual proxy which got initialized. + + + + If a deleted entity instance is re-saved, and it has a proxy, we need to + reset the identifier of the proxy + + + + + Get the entity instance underlying the given proxy, throwing + an exception if the proxy is uninitialized. If the given object + is not a proxy, simply return the argument. + + + + + Possibly unproxy the given reference and reassociate it with the current session. + + The reference to be unproxied if it currently represents a proxy. + The unproxied instance. + + + + Attempts to check whether the given key represents an entity already loaded within the + current session. + + The entity reference against which to perform the uniqueness check. + The entity key. + + + + If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy + and overwrite the registration of the old one. This breaks == and occurs only for + "class" proxies rather than "interface" proxies. Also init the proxy to point to + the given target implementation if necessary. + + The proxy instance to be narrowed. + The persister for the proxied entity. + The internal cache key for the proxied entity. + (optional) the actual proxied entity instance. + An appropriately narrowed instance. + + + + Return the existing proxy associated with the given EntityKey, or the + third argument (the entity associated with the key) if no proxy exists. Init + the proxy to the target implementation, if necessary. + + + + + Return the existing proxy associated with the given EntityKey, or the + argument (the entity associated with the key) if no proxy exists. + (slower than the form above) + + + + Get the entity that owns this persistent collection + + + Get the entity that owned this persistent collection when it was loaded + The persistent collection + + The owner if its entity ID is available from the collection's loaded key + and the owner entity is in the persistence context; otherwise, returns null + + + + Get the ID for the entity that owned this persistent collection when it was loaded + The persistent collection + the owner ID if available from the collection's loaded key; otherwise, returns null + + + add a collection we just loaded up (still needs initializing) + + + add a detached uninitialized collection + + + + Add a new collection (ie. a newly created one, just instantiated by the + application, with no database state or snapshot) + + The collection to be associated with the persistence context + + + + + add an (initialized) collection that was created by another session and passed + into update() (ie. one with a snapshot and existing state on the database) + + + + add a collection we just pulled out of the cache (does not need initializing) + + + Get the collection instance associated with the CollectionKey + + + + Register a collection for non-lazy loading at the end of the two-phase load + + + + + Force initialization of all non-lazy collections encountered during + the current two-phase load (actually, this is a no-op, unless this + is the "outermost" load) + + + + Get the PersistentCollection object for an array + + + Register a PersistentCollection object for an array. + Associates a holder with an array - MUST be called after loading + array, since the array instance is not created until endLoad(). + + + + + Remove the mapping of collection to holder during eviction of the owning entity + + + + Get the snapshot of the pre-flush collection state + + + + Get the collection entry for a collection passed to filter, + which might be a collection wrapper, an array, or an unwrapped + collection. Return null if there is no entry. + + + + Get an existing proxy by key + + + Add a proxy to the session cache + + + Remove a proxy from the session cache + + + Called before cascading + + + Called after cascading + + + Call this before beginning a two-phase load + + + Call this after finishing a two-phase load + + + + Search the persistence context for an owner for the child object, + given a collection role + + + + + Search the persistence context for an index of the child object, given a collection role + + + + + Record the fact that the association belonging to the keyed entity is null. + + + + Is the association property belonging to the keyed entity null? + + + + Change the read-only status of an entity (or proxy). + + + + Read-only entities can be modified, but changes are not persisted. They are not dirty-checked + and snapshots of persistent state are not maintained. + + + Immutable entities cannot be made read-only. + + + To set the default read-only setting for entities and proxies that are loaded + into the persistence context, see . + + + An entity (or ). + If true, the entity or proxy is made read-only; if false, it is made modifiable. + + + + + + Is the specified entity (or proxy) read-only? + + An entity (or ) + + true if the entity or proxy is read-only, otherwise false. + + + + + + + Add child/parent relation to cache for cascading operations + + The child. + The parent. + + + + Remove child/parent relation from cache + + The child. + + + + Get the session to which this persistence context is bound. + + + + + Retrieve this persistence context's managed load context. + + + + + Get the BatchFetchQueue, instantiating one if necessary. + + + + Retrieve the set of EntityKeys representing nullifiable references + + + Get the mapping from key value to entity instance + + + Get the mapping from entity instance to entity entry + + + Get the mapping from collection instance to collection entry + + + Get the mapping from collection key to collection instance + + + How deep are we cascaded? + + + Is a flush cycle currently in process? + Called before and after the flushcycle + + + + The read-only status for entities (and proxies) loaded into this persistence context. + + + + When a proxy is initialized, the loaded entity will have the same read-only + setting as the uninitialized proxy has, regardless of the persistence context's + current setting. + + + To change the read-only setting for a particular entity or proxy that is already + in the current persistence context, use . + + + + + + + False if we know for certain that all the entities are read-only + + + Is in a two-phase load? + + + + Defines the internal contract between the ISessionFactory and other parts of NHibernate + such as implementors of IType. + + + + + Creates ISessions. + + + + Usually an application has a single SessionFactory. Threads servicing client requests + obtain ISessions from the factory. Implementors must be threadsafe. + + + ISessionFactorys are immutable. The behaviour of a SessionFactory + is controlled by properties supplied at configuration time. + These properties are defined on Environment + + + + + + Open a ISession on the given connection + + A connection provided by the application + A session + + Note that the second-level cache will be disabled if you + supply a ADO.NET connection. NHibernate will not be able to track + any statements you might have executed in the same transaction. + Consider implementing your own . + + + + + Create database connection and open a ISession on it, specifying an interceptor + + A session-scoped interceptor + A session + + + + Open a ISession on the given connection, specifying an interceptor + + A connection provided by the application + A session-scoped interceptor + A session + + Note that the second-level cache will be disabled if you + supply a ADO.NET connection. NHibernate will not be able to track + any statements you might have executed in the same transaction. + Consider implementing your own . + + + + + Create a database connection and open a ISession on it + + + + + + Get the associated with the given entity class + + the given entity type. + The class metadata or if not found. + + + + Get the associated with the given entity name + the given entity name. + The class metadata or if not found. + + + + + Get the CollectionMetadata associated with the named collection role + + + + + + + Get all as a from entityname + to metadata object + + A dictionary from an entity name to + + + + Get all CollectionMetadata as a IDictionary from role name + to metadata object + + + + + + Destroy this SessionFactory and release all resources + connection pools, etc). It is the responsibility of the application + to ensure that there are no open Sessions before calling + close(). + + + + + Evict all entries from the process-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + + Evict an entry from the process-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + + + Evict all entries from the second-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + Evict an entry from the second-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + Evict all entries from the process-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + + Evict an entry from the process-level cache. This method occurs outside + of any transaction; it performs an immediate "hard" remove, so does not respect + any transaction isolation semantics of the usage strategy. Use with care. + + + + + + + Evict any query result sets cached in the default query cache region. + + + + + Evict any query result sets cached in the named query cache region. + + + + + Get a new stateless session. + + + Get a new stateless session for the given ADO.NET connection. + + + + Obtain the definition of a filter by name. + + The name of the filter for which to obtain the definition. + The filter definition. + + + + Obtains the current session. + + + + The definition of what exactly "current" means is controlled by the + implementation configured for use. + + + The current session. + Indicates an issue locating a suitable current session. + + + Get the statistics for this session factory + + + Was this already closed? + + + + Obtain a set of the names of all filters defined on this SessionFactory. + + The set of filter names. + + + + Get the persister for the named entity + + The name of the entity that is persisted. + The for the entity. + If no can be found. + + + + Get the persister object for a collection role + + + + + + + Get the return types of a query + + + + + + Get the return aliases of a query + + + + Get the names of all persistent classes that implement/extend the given interface/class + + The entity-name, the class name or full name, the imported class name. + All implementors class names. + + + + Get a class name, using query language imports + + + + + + + Get a particular named query cache, or the default cache + + the name of the cache region, or null for the default + query cache + the existing cache, or a newly created cache if none by that + region name + + + + Gets the hql query identified by the name. + + The name of that identifies the query. + + A hql query or if the named + query does not exist. + + + + + Get the identifier generator for the hierarchy + + + + Get a named second-level cache region + + + + Open a session conforming to the given parameters. Used mainly + for current session processing. + + The external ado.net connection to use, if one (i.e., optional). + + Should the session be auto-flushed + prior to transaction completion? + + + Should the session be auto-closed after + transaction completion? + + The release mode for managed jdbc connections. + An appropriate session. + + + + Retrieves a set of all the collection roles in which the given entity + is a participant, as either an index or an element. + + The entity name for which to get the collection roles. + + Set of all the collection roles in which the given entityName participates. + + + + + Get the persister for the named entity + + The name of the entity that is persisted. + + The for the entity or is the name was not found. + + + + + Get the entity-name for a given mapped class. + + the mapped class + the enntity name where available or null + + + + Get the SQL . + + + + + Get the used. + + + + The cache of table update timestamps + + + Statistics SPI + + + Retrieves the SQLExceptionConverter in effect for this SessionFactory. + The SQLExceptionConverter for this SessionFactory. + + + + Get the default query cache + + + + + Gets the ICurrentSessionContext instance attached to this session factory. + + + + + Defines the internal contract between the Session and other parts of NHibernate + such as implementors of Type or ClassPersister + + + + + Initialize the session after its construction was complete + + + + + Initialize the collection (if not already initialized) + + + + + + + Load an instance without checking if it was deleted. If it does not exist and isn't nullable, throw an exception. + This method may create a new proxy or return an existing proxy. + + The entityName (or class full name) to load. + The identifier of the object in the database. + Allow null instance + When enabled, the object is eagerly fetched. + + A proxy of the object or an instance of the object if the persistentClass does not have a proxy. + + No object could be found with that id. + + + + Load an instance immediately. Do not return a proxy. + + + + + + + + Execute a List() query + + + + + + + + Execute a List() expression query + + + + + + + + Create a new instance of Query for the given query expression + A hibernate query expression + The query + + + + + Strongly-typed version of + + + + + Strongly-typed version of + + + + + Execute an Iterate() query + + + + + + + + Strongly-typed version of + + + + + Execute a filter + + + + + Execute a filter (strongly-typed version). + + + + + Collection from a filter + + + + + Strongly-typed version of + + + + Get the for any instance + optional entity name + the entity instance + + + + Notify the session that an NHibernate transaction has begun. + + + + + Notify the session that the transaction is about to complete + + + + + Notify the session that the transaction completed, so we no longer own the old locks. + (Also we should release cache softlocks). May be called multiple times during the transaction + completion process. + + + + + Return the identifier of the persistent object, or null if transient + + + + + Instantiate the entity class, initializing with the given identifier + + + + + Execute an SQL Query + + + + + Strongly-typed version of + + + + Execute an SQL Query + + + + Retrieve the currently set value for a filter parameter. + + The filter parameter name in the format + {FILTER_NAME.PARAMETER_NAME}. + The filter parameter value. + + + + Retrieve the type for a given filter parameter. + + The filter parameter name in the format + {FILTER_NAME.PARAMETER_NAME}. + The filter parameter type. + + + + Get the entity instance associated with the given Key, + calling the Interceptor if necessary + + + + The best guess entity name for an entity not in an association + + + The guessed entity name for an entity not in an association + + + Execute a native SQL update or delete query + + + Execute a HQL update or delete query + + + + System time before the start of the transaction + + + + + + Get the creating SessionFactoryImplementor + + + + + + Get the prepared statement Batcher for this session + + + + + Return the currently enabled filters. The filter map is keyed by filter + name, with values corresponding to the + instance. + + The currently enabled filters. + + + Retrieves the configured event listeners from this event source. + + + Get the persistence context for this session + + + + Is the ISession still open? + + + + + Is the ISession currently connected? + + + + Determine whether the session is closed. Provided separately from + {@link #isOpen()} as this method does not attempt any JTA synch + registration, where as {@link #isOpen()} does; which makes this one + nicer to use for most internal purposes. + + True if the session is closed; false otherwise. + + + + + Does this Session have an active Hibernate transaction + or is there a JTA transaction in progress? + + + + Retrieve the entity mode in effect for this session. + + + + Get the columns of the associated table which are to + be used in the join + + + + + Get the aliased columns of the owning entity which are to + be used in the join + + + + + Get the columns of the owning entity which are to + be used in the join + + + + + Implements the algorithm for validating property values + for illegal null values + + + + + Check nullability of the class persister properties + + entity properties + class persister + wether it is intended to be updated or saved + + + + Check sub elements-nullability. Returns property path that break + nullability or null if none + + type to check + value to check + property path + + + + Check component nullability. Returns property path that break + nullability or null if none + + component properties + component not-nullable type + property path + + + + Return a well formed property path. + Basicaly, it will return parent.child + + parent in path + child in path + parent-child path + + + + Container for data that is used during the NHibernate query/load process. + + + + + Ensure the Types and Values are the same length. + + + If the Lengths of and + are not equal. + + + + + Gets or sets an array of objects that is stored at the index + of the Parameter. + + + + + Gets or sets an array of objects that is stored at the index + of the Parameter. + + + + + Gets or sets the for the Query. + + + + + Gets or sets an that contains the alias name of the + object from hql as the key and the as the value. + + An of lock modes. + + + + Information to determine how to run an IDbCommand and what + records to return from the IDataReader. + + + + + Indicates that the no value has been set on the Property. + + + + + Gets or Sets the Index of the First Row to Select + + The Index of the First Rows to Select + Defaults to 0 unless specifically set. + + + + Gets or Sets the Maximum Number of Rows to Select + + The Maximum Number of Rows to Select + Defaults to NoValue unless specifically set. + + + + Gets or Sets the Timeout of the Query + + The Query Timeout + Defaults to NoValue unless specifically set. + + + + A represents the state of persistent "stuff" which + NHibernate is tracking. This includes persistent entities, collections, + as well as proxies generated. + + + There is meant to be a one-to-one correspondence between a SessionImpl and + a PersistentContext. The SessionImpl uses the PersistentContext to track + the current state of its context. Event-listeners then use the + PersistentContext to drive their processing. + + + + Constructs a PersistentContext, bound to the given session. + The session "owning" this context. + + + Add a collection which has no owner loaded + + + + Get and remove a collection whose owner is not yet loaded, + when its owner is being loaded + + + + Clear the state of the persistence context + + + Set the status of an entry + + + Called after transactions end + + + + Get the current state of the entity as known to the underlying + database, or null if there is no corresponding row + + + + + Retrieve the cached database snapshot for the requested entity key. + + The entity key for which to retrieve the cached snapshot + The cached snapshot + + + This differs from is two important respects: + no snapshot is obtained from the database if not already cached + an entry of NO_ROW here is interpreted as an exception + + + + + + Get the values of the natural id fields as known to the underlying + database, or null if the entity has no natural id or there is no + corresponding row. + + + + Add a canonical mapping from entity key to entity instance + + + + Get the entity instance associated with the given EntityKey + + + + Is there an entity with the given key in the persistence context + + + + Remove an entity from the session cache, also clear + up other state associated with the entity, all except + for the EntityEntry + + + + Get an entity cached by unique key + + + Add an entity to the cache by unique key + + + + Retrieve the EntityEntry representation of the given entity. + + The entity for which to locate the EntityEntry. + The EntityEntry for the given entity. + + + Remove an entity entry from the session cache + + + Is there an EntityEntry for this instance? + + + Get the collection entry for a persistent collection + + + Adds an entity to the internal caches. + + + + Generates an appropriate EntityEntry instance and adds it + to the event source's internal caches. + + + + Is the given collection associated with this persistence context? + + + Is the given proxy associated with this persistence context? + + + + Takes the given object and, if it represents a proxy, reassociates it with this event source. + + The possible proxy to be reassociated. + Whether the passed value represented an actual proxy which got initialized. + + + + If a deleted entity instance is re-saved, and it has a proxy, we need to + reset the identifier of the proxy + + + + + Associate a proxy that was instantiated by another session with this session + + The proxy initializer. + The proxy to reassociate. + + + + Get the entity instance underlying the given proxy, throwing + an exception if the proxy is uninitialized. If the given object + is not a proxy, simply return the argument. + + + + + Possibly unproxy the given reference and reassociate it with the current session. + + The reference to be unproxied if it currently represents a proxy. + The unproxied instance. + + + + Attempts to check whether the given key represents an entity already loaded within the + current session. + + The entity reference against which to perform the uniqueness check. + The entity key. + + + + If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy + and overwrite the registration of the old one. This breaks == and occurs only for + "class" proxies rather than "interface" proxies. Also init the proxy to point to + the given target implementation if necessary. + + The proxy instance to be narrowed. + The persister for the proxied entity. + The internal cache key for the proxied entity. + (optional) the actual proxied entity instance. + An appropriately narrowed instance. + + + + Return the existing proxy associated with the given EntityKey, or the + third argument (the entity associated with the key) if no proxy exists. Init + the proxy to the target implementation, if necessary. + + + + + Return the existing proxy associated with the given EntityKey, or the + argument (the entity associated with the key) if no proxy exists. + (slower than the form above) + + + + Get the entity that owns this persistent collection + + + Get the entity that owned this persistent collection when it was loaded + The persistent collection + + The owner, if its entity ID is available from the collection's loaded key + and the owner entity is in the persistence context; otherwise, returns null + + + + Get the ID for the entity that owned this persistent collection when it was loaded + The persistent collection + the owner ID if available from the collection's loaded key; otherwise, returns null + + + Get the ID for the entity that owned this persistent collection when it was loaded + The collection entry + the owner ID if available from the collection's loaded key; otherwise, returns null + + + add a collection we just loaded up (still needs initializing) + + + add a detached uninitialized collection + + + + Add a new collection (ie. a newly created one, just instantiated by the + application, with no database state or snapshot) + + The collection to be associated with the persistence context + + + + Add an collection to the cache, with a given collection entry. + The collection for which we are adding an entry. + The entry representing the collection. + The key of the collection's entry. + + + Add a collection to the cache, creating a new collection entry for it + The collection for which we are adding an entry. + The collection persister + + + + add an (initialized) collection that was created by another session and passed + into update() (ie. one with a snapshot and existing state on the database) + + + + add a collection we just pulled out of the cache (does not need initializing) + + + Get the collection instance associated with the CollectionKey + + + + Register a collection for non-lazy loading at the end of the two-phase load + + + + + Force initialization of all non-lazy collections encountered during + the current two-phase load (actually, this is a no-op, unless this + is the "outermost" load) + + + + Get the PersistentCollection object for an array + + + Register a PersistentCollection object for an array. + Associates a holder with an array - MUST be called after loading + array, since the array instance is not created until endLoad(). + + + + + Remove the mapping of collection to holder during eviction of the owning entity + + + + Get the snapshot of the pre-flush collection state + + + + Get the collection entry for a collection passed to filter, + which might be a collection wrapper, an array, or an unwrapped + collection. Return null if there is no entry. + + + + Get an existing proxy by key + + + Add a proxy to the session cache + + + Remove a proxy from the session cache + + + Called before cascading + + + Called after cascading + + + Call this before begining a two-phase load + + + Call this after finishing a two-phase load + + + + Search the persistence context for an owner for the child object, + given a collection role + + + + + Search the persistence context for an index of the child object, given a collection role + + + + + Record the fact that the association belonging to the keyed entity is null. + + + + Is the association property belonging to the keyed entity null? + + + + + + + + + + Get the session to which this persistence context is bound. + + + + + Retrieve this persistence context's managed load context. + + + + + Get the BatchFetchQueue, instantiating one if necessary. + + + + Retrieve the set of EntityKeys representing nullifiable references + + + Get the mapping from key value to entity instance + + + Get the mapping from entity instance to entity entry + + + Get the mapping from collection instance to collection entry + + + Get the mapping from collection key to collection instance + + + How deep are we cascaded? + + + Is a flush cycle currently in process? + Called before and after the flushcycle + + + False if we know for certain that all the entities are read-only + + + + + + + Represents the status of an entity with respect to + this session. These statuses are for internal + book-keeping only and are not intended to represent + any notion that is visible to the application. + + + + + The Entity is snapshotted in the Session with the same state as the database + (called Managed in H3). + + + + + The Entity is in the Session and has been marked for deletion but not + deleted from the database yet. + + + + + The Entity has been deleted from database. + + + + + The Entity is in the process of being loaded. + + + + + The Entity is in the process of being saved. + + + + + The entity is read-only. + + + + + Allows work to be done outside the current transaction, by suspending it, + and performing work in a new transaction + + + + The work to be done + + + Suspend the current transaction and perform work in a new transaction + + + + Functionality relating to Hibernate's two-phase loading process, + that may be reused by persisters that do not use the Loader + framework + + + + + Register the "hydrated" state of an entity instance, after the first step of 2-phase loading. + + Add the "hydrated state" (an array) of an uninitialized entity to the session. We don't try + to resolve any associations yet, because there might be other entities waiting to be + read from the JDBC result set we are currently processing + + + + + Perform the second step of 2-phase load. Fully initialize the entity instance. + After processing a JDBC result set, we "resolve" all the associations + between the entities which were instantiated and had their state + "hydrated" into an array + + + + + Add an uninitialized instance of an entity class, as a placeholder to ensure object + identity. Must be called before postHydrate(). + Create a "temporary" entry for a newly instantiated entity. The entity is uninitialized, + but we need the mapping from id to instance in order to guarantee uniqueness. + + + + An ordered pair of a value and its Hibernate type. + + + + Return an IdentifierValue for the specified unsaved-value. If none is specified, + guess the unsaved value by instantiating a test instance of the class and + reading it's id property, or if that is not possible, using the java default + value for the type + + + + + An enum of the different ways a value might be "included". + + + This is really an expanded true/false notion with Partial being the + expansion. Partial deals with components in the cases where + parts of the referenced component might define inclusion, but the + component overall does not. + + + + + Utility methods for managing versions and timestamps + + + + + Increment the given version number + + The value of the current version. + The of the versioned property. + The current . + Returns the next value for the version. + + + + Create an initial version number + + The of the versioned property. + The current . + A seed value to initialize the versioned property with. + + + + Seed the given instance state snapshot with an initial version number + + An array of objects that contains a snapshot of a persistent object. + The index of the version property in the fields parameter. + The of the versioned property. + Force the version to initialize + The current session, if any. + if the version property needs to be seeded with an initial value. + + + + Set the version number of the given instance state snapshot + + An array of objects that contains a snapshot of a persistent object. + The value the version should be set to in the fields parameter. + The that is responsible for persisting the values of the fields parameter. + + + + Get the version number of the given instance state snapshot + + An array of objects that contains a snapshot of a persistent object. + The that is responsible for persisting the values of the fields parameter. + + The value of the version contained in the fields parameter or null if the + Entity is not versioned. + + + + Do we need to increment the version number, given the dirty properties? + The array of property indexes which were deemed dirty + Were any collections found to be dirty (structurally changed) + An array indicating versionability of each property. + True if a version increment is required; false otherwise. + + + + A strategy for determining if a version value is an version of + a new transient instance or a previously persistent transient instance. + The strategy is determined by the Unsaved-Value attribute in the mapping file. + + + + + + + + Assume the transient instance is newly instantiated if its version is null or + equal to Value + + + + + + Does the given identifier belong to a new instance + + + + + Assume the transient instance is newly instantiated if the version + is null, otherwise assume it is a detached instance. + + + + + Assume the transient instance is newly instantiated if the version + is null, otherwise defer to the identifier unsaved-value. + + + + + Assume the transient instance is newly instantiated if the identifier + is null. + + + + + A convenience base class for listeners whose functionality results in flushing. + + + + + Coordinates the processing necessary to get things ready for executions + as db calls by preparing the session caches and moving the appropriate + entities and collections to their respective execution queues. + + The flush event. + + + + Execute all SQL and second-level cache updates, in a + special order so that foreign-key constraints cannot + be violated: + + Inserts, in the order they were performed + Updates + Deletion of collection elements + Insertion of collection elements + Deletes, in the order they were performed + + + + + + 1. Recreate the collection key -> collection map + 2. rebuild the collection entries + 3. call Interceptor.postFlush() + + + + + A convenience base class for listeners that respond to requests to perform a + pessimistic lock upgrade on an entity. + + + + + A convenience base class for listeners that respond to requests to reassociate an entity + to a session ( such as through lock() or update() ). + + + + + Associates a given entity (either transient or associated with another session) to the given session. + + The event triggering the re-association + The entity to be associated + The id of the entity. + The entity's persister instance. + An EntityEntry representing the entity within this session. + + + + Performs a pessimistic lock upgrade on a given entity, if needed. + + The entity for which to upgrade the lock. + The entity's EntityEntry instance. + The lock mode being requested for locking. + The session which is the source of the event being processed. + + + + A convenience bas class for listeners responding to save events. + + + + + Prepares the save call using the given requested id. + + The entity to be saved. + The id to which to associate the entity. + The name of the entity being saved. + Generally cascade-specific information. + The session which is the source of this save event. + The id used to save the entity. + + + + Prepares the save call using a newly generated id. + + The entity to be saved + The entity-name for the entity to be saved + Generally cascade-specific information. + The session which is the source of this save event. + + does the event context require + access to the identifier immediately after execution of this method (if + not, post-insert style id generators may be postponed if we are outside + a transaction). + + + The id used to save the entity; may be null depending on the + type of id generator used and the requiresImmediateIdAccess value + + + + + Prepares the save call by checking the session caches for a pre-existing + entity and performing any lifecycle callbacks. + + The entity to be saved. + The id by which to save the entity. + The entity's persister instance. + Is an identity column being used? + Generally cascade-specific information. + The session from which the event originated. + + does the event context require + access to the identifier immediately after execution of this method (if + not, post-insert style id generators may be postponed if we are outside + a transaction). + + + The id used to save the entity; may be null depending on the + type of id generator used and the requiresImmediateIdAccess value + + + + + Performs all the actual work needed to save an entity (well to get the save moved to + the execution queue). + + The entity to be saved + The id to be used for saving the entity (or null, in the case of identity columns) + The entity's persister instance. + Should an identity column be used for id generation? + Generally cascade-specific information. + The session which is the source of the current event. + + Is access to the identifier required immediately + after the completion of the save? persist(), for example, does not require this... + + + The id used to save the entity; may be null depending on the + type of id generator used and the requiresImmediateIdAccess value + + + + + Perform any property value substitution that is necessary + (interceptor callback, version initialization...) + + The entity + The entity identifier + The snapshot entity state + The entity persister + The originating session + + True if the snapshot state changed such that + reinjection of the values into the entity is required. + + + + Handles the calls needed to perform pre-save cascades for the given entity. + The session from which the save event originated. + The entity's persister instance. + The entity to be saved. + Generally cascade-specific data + + + Handles to calls needed to perform post-save cascades. + The session from which the event originated. + The entity's persister instance. + The entity being saved. + Generally cascade-specific data + + + + Determine whether the entity is persistent, detached, or transient + + The entity to check + The name of the entity + The entity's entry in the persistence context + The originating session. + The state. + + + + After the save, will te version number be incremented + if the instance is modified? + + True if the version will be incremented on an entity change after save; false otherwise. + + + + Abstract superclass of algorithms that walk a tree of property values of an entity, and + perform specific functionality for collections, components and associated entities. + + + + Dispatch each property value to ProcessValue(). + + + + + + Visit a property value. Dispatch to the correct handler for the property type. + + + + + + + Visit a component. Dispatch each property to + + + + + + + + Visit a many-to-one or one-to-one associated entity. Default superclass implementation is a no-op. + + + + + + + + Visit a collection. Default superclass implementation is a no-op. + + + + + + + + Walk the tree starting from the given entity. + + + + + + + Defines the default flush event listeners used by hibernate for + flushing session state in response to generated auto-flush events. + + + + Defines the contract for handling of session auto-flush events. + + + + Handle the given auto-flush event. + + The auto-flush event to be handled. + + + + Handle the given auto-flush event. + + The auto-flush event to be handled. + + + + Defines the default delete event listener used by hibernate for deleting entities + from the datastore in response to generated delete events. + + + + Defines the contract for handling of deletion events generated from a session. + + + Handle the given delete event. + The delete event to be handled. + + + Handle the given delete event. + The delete event to be handled. + + + Called when we have recognized an attempt to delete a detached entity. + The event. + + This is perfectly valid in Hibernate usage; JPA, however, forbids this. + Thus, this is a hook for HEM to affect this behavior. + + + + + We encountered a delete request on a transient instance. +

+ This is a deviation from historical Hibernate (pre-3.2) behavior to + align with the JPA spec, which states that transient entities can be + passed to remove operation in which case cascades still need to be + performed. +

+ The session which is the source of the event + The entity being delete processed + Is cascading of deletes enabled + The entity persister + + A cache of already visited transient entities (to avoid infinite recursion). + +
+ + + Perform the entity deletion. Well, as with most operations, does not + really perform it; just schedules an action/execution with the + for execution during flush. + + The originating session + The entity to delete + The entity's entry in the + Is delete cascading enabled? + The entity persister. + A cache of already deleted entities. + + + + Defines the default dirty-check event listener used by hibernate for + checking the session for dirtiness in response to generated dirty-check events. + + + + Defines the contract for handling of session dirty-check events. + + + Handle the given dirty-check event. + The dirty-check event to be handled. + + + + Defines the default evict event listener used by hibernate for evicting entities + in response to generated flush events. In particular, this implementation will + remove any hard references to the entity that are held by the infrastructure + (references held by application or other persistent instances are okay) + + + + Defines the contract for handling of evict events generated from a session. + + + Handle the given evict event. + The evict event to be handled. + + + + An event that occurs for each entity instance at flush time + + + + + Flushes a single entity's state to the database, by scheduling an update action, if necessary + + + + + make sure user didn't mangle the id + + The obj. + The persister. + The id. + The entity mode. + + + + Performs all necessary checking to determine if an entity needs an SQL update + to synchronize its state to the database. Modifies the event by side-effect! + Note: this method is quite slow, avoid calling if possible! + + + + Perform a dirty check, and attach the results to the event + + + + Defines the default flush event listeners used by hibernate for + flushing session state in response to generated flush events. + + + + Defines the contract for handling of session flush events. + + + Handle the given flush event. + The flush event to be handled. + + + + Defines the contract for handling of collection initialization events + generated by a session. + + + + called by a collection that wants to initialize itself + + + Try to initialize a collection from the cache + + + + Defines the default load event listeners used by NHibernate for loading entities + in response to generated load events. + + + + + Defines the contract for handling of load events generated from a session. + + + + + Handle the given load event. + + The load event to be handled. + + The result (i.e., the loaded entity). + + + Perfoms the load of an entity. + The loaded entity. + + + + Based on configured options, will either return a pre-existing proxy, + generate a new proxy, or perform an actual load. + + The result of the proxy/load operation. + + + + Given that there is a pre-existing proxy. + Initialize it if necessary; narrow if necessary. + + + + + Given that there is no pre-existing proxy. + Check if the entity is already loaded. If it is, return the entity, + otherwise create and return a proxy. + + + + + If the class to be loaded has been configured with a cache, then lock + given id in that cache and then perform the load. + + The loaded entity + + + + Coordinates the efforts to load a given entity. First, an attempt is + made to load the entity from the session-level cache. If not found there, + an attempt is made to locate it in second-level cache. Lastly, an + attempt is made to load it directly from the datasource. + + The load event + The persister for the entity being requested for load + The EntityKey representing the entity to be loaded. + The load options. + The loaded entity, or null. + + + + Performs the process of loading an entity from the configured underlying datasource. + + The load event + The persister for the entity being requested for load + The EntityKey representing the entity to be loaded. + The load options. + The object loaded from the datasource, or null if not found. + + + + Attempts to locate the entity in the session-level cache. + + The load event + The EntityKey representing the entity to be loaded. + The load options. + The entity from the session-level cache, or null. + + If allowed to return nulls, then if the entity happens to be found in + the session cache, we check the entity type for proper handling + of entity hierarchies. + If checkDeleted was set to true, then if the entity is found in the + session-level cache, it's current status within the session cache + is checked to see if it has previously been scheduled for deletion. + + + + Attempts to load the entity from the second-level cache. + The load event + The persister for the entity being requested for load + The load options. + The entity from the second-level cache, or null. + + + + Defines the default lock event listeners used by hibernate to lock entities + in response to generated lock events. + + + + + Defines the contract for handling of lock events generated from a session. + + + + Handle the given lock event. + The lock event to be handled. + + + Handle the given lock event. + The lock event to be handled. + + + + Defines the default event listener for handling of merge events generated from a session. + + + + + Defines the contract for handling of merge events generated from a session. + + + + Handle the given merge event. + The merge event to be handled. + + + Handle the given merge event. + The merge event to be handled. + + + + + Perform any cascades needed as part of this copy event. + + The merge event being processed. + The persister of the entity being copied. + The entity being copied. + A cache of already copied instance. + + + + Determine which merged entities in the copyCache are transient. + + + + + Should this method be on the EventCache class? + + + + Retry merging transient entities + + + + + + + Cascade behavior is redefined by this subclass, disable superclass behavior + + + Cascade behavior is redefined by this subclass, disable superclass behavior + + + + Defines the default create event listener used by hibernate for creating + transient entities in response to generated create events. + + + + + Defines the contract for handling of create events generated from a session. + + + + Handle the given create event. + The create event to be handled. + + + Handle the given create event. + The create event to be handled. + + + + Handle the given create event. + The save event to be handled. + + + + When persist is used as the cascade action, persistOnFlush should be used + + + Call interface if necessary + + + + Occurs after an an entity instance is fully loaded. + + + + + + + + + + + Called before injecting property values into a newly + loaded entity instance. + + + + + Called before injecting property values into a newly loaded entity instance. + + + + + + + + + + + Defines the default refresh event listener used by hibernate for refreshing entities + in response to generated refresh events. + + + + + Defines the contract for handling of refresh events generated from a session. + + + + Handle the given refresh event. + The refresh event to be handled. + + + + + + + + + + + Defines the default replicate event listener used by Hibernate to replicate + entities in response to generated replicate events. + + + + + Defines the contract for handling of replicate events generated from a session. + + + + Handle the given replicate event. + The replicate event to be handled. + + + An event handler for save() events + + + + Defines the default listener used by Hibernate for handling save-update events. + + + + + Defines the contract for handling of update events generated from a session. + + + + Handle the given update event. + The update event to be handled. + + + + The given save-update event named a transient entity. + Here, we will perform the save processing. + + The save event to be handled. + The entity's identifier after saving. + + + + Save the transient instance, assigning the right identifier + + The initiating event. + The entity's identifier value after saving. + + + + The given save-update event named a detached entity. + Here, we will perform the update processing. + + The update event to be handled. + + + Determine the id to use for updating. + The entity. + The entity persister + The requested identifier + The entity mode. + The id. + + + + Handles the calls needed to perform cascades as part of an update request + for the given entity. + + The event currently being processed. + The defined persister for the entity being updated. + The entity being updated. + + + An event handler for update() events + + + + If the user specified an id, assign it to the instance and use that, + otherwise use the id already assigned to the instance + + + + + A Visitor that determines if a dirty collection was found. + + + + + Reason for dirty collection + + + + If it is a new application-instantiated collection, return true (does not occur anymore!) + + + + + If it is a component, recurse. + + + + + If it is a wrapped collection, ask the collection entry. + + + + + + + + Gets a indicating if a dirty collection was found. + + if a dirty collection was found. + + + + Associates the specified entity with the specified copy in this EventCache; + + + + indicates if the operation is performed on the entity + + + + Returns copy-entity mappings + + + + + + Returns true if the listener is performing the operation on the specified entity. + + Must be non-null and this EventCache must contain a mapping for this entity + + + + + Set flag to indicate if the listener is performing the operation on the specified entity. + + + + + + + Returns the number of entity-copy mappings in this EventCache + + + + + Evict any collections referenced by the object from the session cache. + This will NOT pick up any collections that were dereferenced, so they + will be deleted (suboptimal but not exactly incorrect). + + + + + Process collections reachable from an entity. + This visitor assumes that wrap was already performed for the entity. + + + + + When a transient entity is passed to lock(), we must inspect all its collections and + 1. associate any uninitialized PersistentCollections with this session + 2. associate any initialized PersistentCollections with this session, using the existing snapshot + 3. throw an exception for each "new" collection + + + + + Abstract superclass of visitors that reattach collections + + + + + Reassociates uninitialized proxies with the session + + + + + Visit a many-to-one or one-to-one associated entity. Default superclass implementation is a no-op. + + + + + + + + Has the owner of the collection changed since the collection was snapshotted and detached? + + + + + Reattach a detached (disassociated) initialized or uninitialized + collection wrapper, using a snapshot carried with the collection wrapper + + + + + Schedules a collection for deletion. + + The persister representing the collection to be removed. + The collection key (differs from owner-id in the case of property-refs). + The session from which the request originated. + + + + This version is slightly different in that here we need to assume that + the owner is not yet associated with the session, and thus we cannot + rely on the owner's EntityEntry snapshot... + + The persister for the collection role being processed. + + + + + When an entity is passed to replicate(), and there is an existing row, we must + inspect all its collections and + 1. associate any uninitialized PersistentCollections with this session + 2. associate any initialized PersistentCollections with this session, using the existing snapshot + 3. execute a collection removal (SQL DELETE) for each null collection property or "new" collection + + + + + When an entity is passed to update(), we must inspect all its collections and + 1. associate any uninitialized PersistentCollections with this session + 2. associate any initialized PersistentCollections with this session, using the existing snapshot + 3. execute a collection removal (SQL DELETE) for each null collection property or "new" collection + + + + + Wrap collections in a Hibernate collection wrapper. + + + + Defines a base class for events involving collections. + + + + Defines a base class for Session generated events. + + + + + Returns the session event source for this event. + This is the underlying session from which this event was generated. + + + + + Constructs an event from the given event session. + + The session event source. + + + + Returns the session event source for this event. + This is the underlying session from which this event was generated. + + + + Constructs an AbstractCollectionEvent object. + The collection persister. + The collection + The Session source + The owner that is affected by this event; can be null if unavailable + + The ID for the owner that is affected by this event; can be null if unavailable + that is affected by this event; can be null if unavailable + + + + Get the entity name for the collection owner entity that is affected by this event. + + The entity name; if the owner is not in the PersistenceContext, the + returned value may be a superclass name, instead of the actual class name + + + + The collection owner entity that is affected by this event. + + Returns null if the entity is not in the persistence context + (e.g., because the collection from a detached entity was moved to a new owner) + + + + Get the ID for the collection owner entity that is affected by this event. + + Returns null if the ID cannot be obtained + from the collection's loaded key (e.g., a property-ref is used for the + collection and does not include the entity's ID) + + + + + Represents an operation we performed against the database. + + + + + Represents an operation we performed against the database. + + + + The entity involved in the database operation. + + + The id to be used in the database operation. + + + + The persister for the . + + + + Constructs an event containing the pertinent information. + The session from which the event originated. + The entity to be invloved in the database operation. + The entity id to be invloved in the database operation. + The entity's persister. + + + The entity involved in the database operation. + + + The id to be used in the database operation. + + + + The persister for the . + + + + + Represents an operation we are about to perform against the database. + + + + The entity involved in the database operation. + + + The id to be used in the database operation. + + + + The persister for the . + + + + Constructs an event containing the pertinent information. + The session from which the event originated. + The entity to be invloved in the database operation. + The entity id to be invloved in the database operation. + The entity's persister. + + + The entity involved in the database operation. + + + The id to be used in the database operation. + + + + The persister for the . + + + + Defines an event class for the auto-flushing of a session. + + + Defines an event class for the flushing of a session. + + + Defines an event class for the deletion of an entity. + + + Constructs a new DeleteEvent instance. + The entity to be deleted. + The session from which the delete event was generated. + + + + + Returns the encapsulated entity to be deleed. + + + + Defines an event class for the dirty-checking of a session. + + + + A convience holder for all defined session event listeners. + + + + + Call on any listeners that implement + . + + + + + Defines an event class for the evicting of an entity. + + + + Contract for listeners which require notification of SessionFactory closing, + presumably to destroy internal state. + + + + + Notification of shutdown. + + + + + The main runtime interface between a .NET application and NHibernate. This is the central + API class abstracting the notion of a persistence service. + + + + The lifecycle of a ISession is bounded by the beginning and end of a logical + transaction. (Long transactions might span several database transactions.) + + + The main function of the ISession is to offer create, find and delete operations + for instances of mapped entity classes. Instances may exist in one of two states: + + transient: not associated with any ISession + persistent: associated with a ISession + + + + Transient instances may be made persistent by calling Save(), Insert(), + or Update(). Persistent instances may be made transient by calling Delete(). + Any instance returned by a List(), Enumerable(), Load(), or Create() + method is persistent. + + + Save() results in an SQL INSERT, Delete() + in an SQL DELETE and Update() in an SQL UPDATE. Changes to + persistent instances are detected at flush time and also result in an SQL + UPDATE. + + + It is not intended that implementors be threadsafe. Instead each thread/transaction should obtain + its own instance from an ISessionFactory. + + + A ISession instance is serializable if its persistent classes are serializable + + + A typical transaction should use the following idiom: + + using (ISession session = factory.OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + try + { + // do some work + ... + tx.Commit(); + } + catch (Exception e) + { + if (tx != null) tx.Rollback(); + throw; + } + } + + + + If the ISession throws an exception, the transaction must be rolled back and the session + discarded. The internal state of the ISession might not be consistent with the database + after the exception occurs. + + + + + + + Force the ISession to flush. + + + Must be called at the end of a unit of work, before commiting the transaction and closing + the session (Transaction.Commit() calls this method). Flushing if the process + of synchronising the underlying persistent store with persistable state held in memory. + + + + + Disconnect the ISession from the current ADO.NET connection. + + + If the connection was obtained by Hibernate, close it or return it to the connection + pool. Otherwise return it to the application. This is used by applications which require + long transactions. + + The connection provided by the application or + + + + Obtain a new ADO.NET connection. + + + This is used by applications which require long transactions + + + + + Reconnect to the given ADO.NET connection. + + This is used by applications which require long transactions + An ADO.NET connection + + + + End the ISession by disconnecting from the ADO.NET connection and cleaning up. + + + It is not strictly necessary to Close() the ISession but you must + at least Disconnect() it. + + The connection provided by the application or + + + + Cancel execution of the current query. + + + May be called from one thread to stop execution of a query in another thread. + Use with care! + + + + + Does this ISession contain any changes which must be + synchronized with the database? Would any SQL be executed if + we flushed this session? + + + + + Is the specified entity (or proxy) read-only? + + + Facade for . + + An entity (or ) + + true if the entity (or proxy) is read-only, otherwise false. + + + + + + + Change the read-only status of an entity (or proxy). + + + + Read-only entities can be modified, but changes are not persisted. They are not dirty-checked + and snapshots of persistent state are not maintained. + + + Immutable entities cannot be made read-only. + + + To set the default read-only setting for entities and proxies that are loaded + into the session, see . + + + This method a facade for . + + + An entity (or ). + If true, the entity or proxy is made read-only; if false, it is made modifiable. + + + + + + Return the identifier of an entity instance cached by the ISession + + + Throws an exception if the instance is transient or associated with a different + ISession + + a persistent instance + the identifier + + + + Is this instance associated with this Session? + + an instance of a persistent class + true if the given instance is associated with this Session + + + + Remove this instance from the session cache. + + + Changes to the instance will not be synchronized with the database. + This operation cascades to associated instances if the association is mapped + with cascade="all" or cascade="all-delete-orphan". + + a persistent instance + + + + Return the persistent instance of the given entity class with the given identifier, + obtaining the specified lock mode. + + A persistent class + A valid identifier of an existing persistent instance of the class + The lock level + the persistent instance + + + + Return the persistent instance of the given entity class with the given identifier, + obtaining the specified lock mode, assuming the instance exists. + + The entity-name of a persistent class + a valid identifier of an existing persistent instance of the class + the lock level + the persistent instance or proxy + + + + Return the persistent instance of the given entity class with the given identifier, + assuming that the instance exists. + + + You should not use this method to determine if an instance exists (use a query or + instead). Use this only to retrieve an instance + that you assume exists, where non-existence would be an actual error. + + A persistent class + A valid identifier of an existing persistent instance of the class + The persistent instance or proxy + + + + Return the persistent instance of the given entity class with the given identifier, + obtaining the specified lock mode. + + A persistent class + A valid identifier of an existing persistent instance of the class + The lock level + the persistent instance + + + + Return the persistent instance of the given entity class with the given identifier, + assuming that the instance exists. + + + You should not use this method to determine if an instance exists (use a query or + instead). Use this only to retrieve an instance that you + assume exists, where non-existence would be an actual error. + + A persistent class + A valid identifier of an existing persistent instance of the class + The persistent instance or proxy + + + + Return the persistent instance of the given with the given identifier, + assuming that the instance exists. + + The entity-name of a persistent class + a valid identifier of an existing persistent instance of the class + The persistent instance or proxy + + You should not use this method to determine if an instance exists (use + instead). Use this only to retrieve an instance that you assume exists, where non-existence + would be an actual error. + + + + + Read the persistent state associated with the given identifier into the given transient + instance. + + An "empty" instance of the persistent class + A valid identifier of an existing persistent instance of the class + + + + Persist all reachable transient objects, reusing the current identifier + values. Note that this will not trigger the Interceptor of the Session. + + a detached instance of a persistent class + + + + + Persist the state of the given detached instance, reusing the current + identifier value. This operation cascades to associated instances if + the association is mapped with cascade="replicate". + + + a detached instance of a persistent class + + + + + Persist the given transient instance, first assigning a generated identifier. + + + Save will use the current value of the identifier property if the Assigned + generator is used. + + A transient instance of a persistent class + The generated identifier + + + + Persist the given transient instance, using the given identifier. + + A transient instance of a persistent class + An unused valid identifier + + + + Persist the given transient instance, first assigning a generated identifier. (Or + using the current value of the identifier property if the assigned + generator is used.) + + The Entity name. + a transient instance of a persistent class + the generated identifier + + This operation cascades to associated instances if the + association is mapped with cascade="save-update". + + + + + Either Save() or Update() the given instance, depending upon the value of + its identifier property. + + + By default the instance is always saved. This behaviour may be adjusted by specifying + an unsaved-value attribute of the identifier property mapping + + A transient instance containing new or updated state + + + + Either or + the given instance, depending upon resolution of the unsaved-value checks + (see the manual for discussion of unsaved-value checking). + + The name of the entity + a transient or detached instance containing new or updated state + + + + This operation cascades to associated instances if the association is mapped + with cascade="save-update". + + + + + Update the persistent instance with the identifier of the given transient instance. + + + If there is a persistent instance with the same identifier, an exception is thrown. If + the given transient instance has a identifier, an exception will be thrown. + + A transient instance containing updated state + + + + Update the persistent state associated with the given identifier. + + + An exception is thrown if there is a persistent instance with the same identifier + in the current session. + + A transient instance containing updated state + Identifier of persistent instance + + + + Update the persistent instance with the identifier of the given detached + instance. + + The Entity name. + a detached instance containing updated state + + If there is a persistent instance with the same identifier, + an exception is thrown. This operation cascades to associated instances + if the association is mapped with cascade="save-update". + + + + + Copy the state of the given object onto the persistent object with the same + identifier. If there is no persistent instance currently associated with + the session, it will be loaded. Return the persistent instance. If the + given instance is unsaved, save a copy of and return it as a newly persistent + instance. The given instance does not become associated with the session. + This operation cascades to associated instances if the association is mapped + with cascade="merge".
+ The semantics of this method are defined by JSR-220. +
+ a detached instance with state to be copied + an updated persistent instance +
+ + + Copy the state of the given object onto the persistent object with the same + identifier. If there is no persistent instance currently associated with + the session, it will be loaded. Return the persistent instance. If the + given instance is unsaved, save a copy of and return it as a newly persistent + instance. The given instance does not become associated with the session. + This operation cascades to associated instances if the association is mapped + with cascade="merge".
+ The semantics of this method are defined by JSR-220. + Name of the entity. + a detached instance with state to be copied + an updated persistent instance +
+ +
+ + + Copy the state of the given object onto the persistent object with the same + identifier. If there is no persistent instance currently associated with + the session, it will be loaded. Return the persistent instance. If the + given instance is unsaved, save a copy of and return it as a newly persistent + instance. The given instance does not become associated with the session. + This operation cascades to associated instances if the association is mapped + with cascade="merge".
+ The semantics of this method are defined by JSR-220. +
+ a detached instance with state to be copied + an updated persistent instance +
+ + + Copy the state of the given object onto the persistent object with the same + identifier. If there is no persistent instance currently associated with + the session, it will be loaded. Return the persistent instance. If the + given instance is unsaved, save a copy of and return it as a newly persistent + instance. The given instance does not become associated with the session. + This operation cascades to associated instances if the association is mapped + with cascade="merge".
+ The semantics of this method are defined by JSR-220. + Name of the entity. + a detached instance with state to be copied + an updated persistent instance +
+ +
+ + + Make a transient instance persistent. This operation cascades to associated + instances if the association is mapped with cascade="persist".
+ The semantics of this method are defined by JSR-220. +
+ a transient instance to be made persistent +
+ + + Make a transient instance persistent. This operation cascades to associated + instances if the association is mapped with cascade="persist".
+ The semantics of this method are defined by JSR-220. +
+ Name of the entity. + a transient instance to be made persistent +
+ + + Copy the state of the given object onto the persistent object with the same + identifier. If there is no persistent instance currently associated with + the session, it will be loaded. Return the persistent instance. If the + given instance is unsaved or does not exist in the database, save it and + return it as a newly persistent instance. Otherwise, the given instance + does not become associated with the session. + + a transient instance with state to be copied + an updated persistent instance + + + + Copy the state of the given object onto the persistent object with the + given identifier. If there is no persistent instance currently associated + with the session, it will be loaded. Return the persistent instance. If + there is no database row with the given identifier, save the given instance + and return it as a newly persistent instance. Otherwise, the given instance + does not become associated with the session. + + a persistent or transient instance with state to be copied + the identifier of the instance to copy to + an updated persistent instance + + + + Remove a persistent instance from the datastore. + + + The argument may be an instance associated with the receiving ISession or a + transient instance with an identifier associated with existing persistent state. + + The instance to be removed + + + + Remove a persistent instance from the datastore. The object argument may be + an instance associated with the receiving or a transient + instance with an identifier associated with existing persistent state. + This operation cascades to associated instances if the association is mapped + with cascade="delete". + + The entity name for the instance to be removed. + the instance to be removed + + + + Delete all objects returned by the query. + + The query string + Returns the number of objects deleted. + + + + Delete all objects returned by the query. + + The query string + A value to be written to a "?" placeholer in the query + The hibernate type of value. + The number of instances deleted + + + + Delete all objects returned by the query. + + The query string + A list of values to be written to "?" placeholders in the query + A list of Hibernate types of the values + The number of instances deleted + + + + Obtain the specified lock level upon the given object. + + A persistent instance + The lock level + + + + Obtain the specified lock level upon the given object. + + The Entity name. + a persistent or transient instance + the lock level + + This may be used to perform a version check (), to upgrade to a pessimistic + lock (), or to simply reassociate a transient instance + with a session (). This operation cascades to associated + instances if the association is mapped with cascade="lock". + + + + + Re-read the state of the given instance from the underlying database. + + + + It is inadvisable to use this to implement long-running sessions that span many + business tasks. This method is, however, useful in certain special circumstances. + + + For example, + + Where a database trigger alters the object state upon insert or update + After executing direct SQL (eg. a mass update) in the same session + After inserting a Blob or Clob + + + + A persistent instance + + + + Re-read the state of the given instance from the underlying database, with + the given LockMode. + + + It is inadvisable to use this to implement long-running sessions that span many + business tasks. This method is, however, useful in certain special circumstances. + + a persistent or transient instance + the lock mode to use + + + + Determine the current lock mode of the given object + + A persistent instance + The current lock mode + + + + Begin a unit of work and return the associated ITransaction object. + + + If a new underlying transaction is required, begin the transaction. Otherwise + continue the new work in the context of the existing underlying transaction. + The class of the returned object is determined by + the property transaction_factory + + A transaction instance + + + + Begin a transaction with the specified isolationLevel + + Isolation level for the new transaction + A transaction instance having the specified isolation level + + + + Creates a new Criteria for the entity class. + + The entity class + An ICriteria object + + + + Creates a new Criteria for the entity class with a specific alias + + The entity class + The alias of the entity + An ICriteria object + + + + Creates a new Criteria for the entity class. + + The class to Query + An ICriteria object + + + + Creates a new Criteria for the entity class with a specific alias + + The class to Query + The alias of the entity + An ICriteria object + + + + Create a new Criteria instance, for the given entity name. + + The name of the entity to Query + An ICriteria object + + + + Create a new Criteria instance, for the given entity name, + with the given alias. + + The name of the entity to Query + The alias of the entity + An ICriteria object + + + + Creates a new IQueryOver<T> for the entity class. + + The entity class + An IQueryOver<T> object + + + + Creates a new IQueryOver<T> for the entity class. + + The entity class + The alias of the entity + An IQueryOver<T> object + + + + Creates a new IQueryOver{T}; for the entity class. + + The entity class + The name of the entity to Query + An IQueryOver{T} object + + + + Creates a new IQueryOver{T} for the entity class. + + The entity class + The name of the entity to Query + The alias of the entity + An IQueryOver{T} object + + + + Create a new instance of Query for the given query string + + A hibernate query string + The query + + + + Create a new instance of Query for the given collection and filter string + + A persistent collection + A hibernate query + A query + + + + Obtain an instance of for a named query string defined in the + mapping file. + + The name of a query defined externally. + An from a named query string. + + The query can be either in HQL or SQL format. + + + + + Create a new instance of for the given SQL query string. + + a query expressed in SQL + An from the SQL string + + + + Completely clear the session. Evict all loaded instances and cancel all pending + saves, updates and deletions. Do not close open enumerables or instances of + ScrollableResults. + + + + + Return the persistent instance of the given entity class with the given identifier, or null + if there is no such persistent instance. (If the instance, or a proxy for the instance, is + already associated with the session, return that instance or proxy.) + + a persistent class + an identifier + a persistent instance or null + + + + Return the persistent instance of the given entity class with the given identifier, or null + if there is no such persistent instance. Obtain the specified lock mode if the instance + exists. + + a persistent class + an identifier + the lock mode + a persistent instance or null + + + + Return the persistent instance of the given named entity with the given identifier, + or null if there is no such persistent instance. (If the instance, or a proxy for the + instance, is already associated with the session, return that instance or proxy.) + + the entity name + an identifier + a persistent instance or null + + + + Strongly-typed version of + + + + + Strongly-typed version of + + + + + Return the entity name for a persistent entity + + a persistent entity + the entity name + + + + Enable the named filter for this current session. + + The name of the filter to be enabled. + The Filter instance representing the enabled filter. + + + + Retrieve a currently enabled filter by name. + + The name of the filter to be retrieved. + The Filter instance representing the enabled filter. + + + + Disable the named filter for the current session. + + The name of the filter to be disabled. + + + + Create a multi query, a query that can send several + queries to the server, and return all their results in a single + call. + + + An that can return + a list of all the results of all the queries. + Note that each query result is itself usually a list. + + + + + Sets the batch size of the session + + + + + + + Gets the session implementation. + + + This method is provided in order to get the NHibernate implementation of the session from wrapper implementions. + Implementors of the interface should return the NHibernate implementation of this method. + + + An NHibernate implementation of the interface + + + + + An that can return a list of all the results + of all the criterias. + + + + + + Starts a new Session with the given entity mode in effect. This secondary + Session inherits the connection, transaction, and other context + information from the primary Session. It doesn't need to be flushed + or closed by the developer. + + The entity mode to use for the new session. + The new session + + + The entity mode in effect for this session. + + + + Determines at which points Hibernate automatically flushes the session. + + + For a readonly session, it is reasonable to set the flush mode to FlushMode.Never + at the start of the session (in order to achieve some extra performance). + + + + The current cache mode. + + Cache mode determines the manner in which this session can interact with + the second level cache. + + + + + Get the that created this instance. + + + + + Gets the ADO.NET connection. + + + Applications are responsible for calling commit/rollback upon the connection before + closing the ISession. + + + + + Is the ISession still open? + + + + + Is the ISession currently connected? + + + + + The read-only status for entities (and proxies) loaded into this Session. + + + + When a proxy is initialized, the loaded entity will have the same read-only setting + as the uninitialized proxy, regardless of the session's current setting. + + + To change the read-only setting for a particular entity or proxy that is already in + this session, see . + + + To override this session's read-only setting for entities and proxies loaded by a query, + see . + + + This method is a facade for . + + + + + + + + Get the current Unit of Work and return the associated ITransaction object. + + + + Get the statistics for this session. + + + + Instantiate an entity instance, using either an interceptor, + or the given persister + + + + Force an immediate flush + + + Cascade merge an entity instance + + + Cascade persist an entity instance + + + Cascade persist an entity instance during the flush process + + + Cascade refresh an entity instance + + + Cascade copy an entity instance + + + Cascade delete an entity instance + + + Get the ActionQueue for this session + + + + An event listener that requires access to mappings to + initialize state at initialization time. + + + + + An event that occurs when a collection wants to be initialized + + + + Called after recreating a collection + + + Called after removing a collection + + + Called after updating a collection + + + Called after deleting an item from the datastore + + + + + + + + + Called after inserting an item in the datastore + + + + + + + + + + Called after updating the datastore + + + + + + + + + + Called before recreating a collection + + + Called before removing a collection + + + Called before updating a collection + + + + Called before deleting an item from the datastore + + + + Return true if the operation should be vetoed + + + + + Called before inserting an item in the datastore + + + + Return true if the operation should be vetoed + + + + + Called before updating the datastore + + + + Return true if the operation should be vetoed + + + + + Values for listener type property. + + + + Not allowed in Xml. It represents the default value when an explicit type is assigned. + + + Xml value: auto-flush + + + Xml value: merge + + + Xml value: create + + + Xml value: create-onflush + + + Xml value: delete + + + Xml value: dirty-check + + + Xml value: evict + + + Xml value: flush + + + Xml value: flush-entity + + + Xml value: load + + + Xml value: load-collection + + + Xml value: lock + + + Xml value: refresh + + + Xml value: replicate + + + Xml value: save-update + + + Xml value: save + + + Xml value: pre-update + + + Xml value: update + + + Xml value: pre-load + + + Xml value: pre-delete + + + Xml value: pre-insert + + + Xml value: pre-collection-recreate + + + Xml value: pre-collection-remove + + + Xml value: pre-collection-update + + + Xml value: post-load + + + Xml value: post-insert + + + Xml value: post-update + + + Xml value: post-delete + + + Xml value: post-commit-update + + + Xml value: post-commit-insert + + + Xml value: post-commit-delete + + + Xml value: post-collection-recreate + + + Xml value: post-collection-remove + + + Xml value: post-collection-update + + + Defines an event class for the loading of an entity. + + + + Defines an event class for the locking of an entity. + + + + + An event class for merge() and saveOrUpdateCopy() + + + + An event class for persist() + + + An event that occurs after a collection is recreated + + + An event that occurs after a collection is removed + + + An event that occurs after a collection is updated + + + + Occurs after deleting an item from the datastore + + + + + Occurs after inserting an item in the datastore + + + + + Occurs after an an entity instance is fully loaded. + + + + + Occurs after the datastore is updated + + + + An event that occurs before a collection is recreated + + + An event that occurs before a collection is removed + + + An event that occurs before a collection is updated + + + + Represents a pre-delete event, which occurs just prior to + performing the deletion of an entity from the database. + + + + + Constructs an event containing the pertinent information. + + The entity to be deleted. + The id to use in the deletion. + The entity's state at deletion time. + The entity's persister. + The session from which the event originated. + + + + This is the entity state at the + time of deletion (useful for optomistic locking and such). + + + + + Represents a pre-insert event, which occurs just prior to + performing the insert of an entity into the database. + + + + + These are the values to be inserted. + + + + + Called before injecting property values into a newly loaded entity instance. + + + + + Represents a pre-update event, which occurs just prior to + performing the update of an entity in the database. + + + + + Retrieves the state to be used in the update. + + + + + The old state of the entity at the time it was last loaded from the + database; can be null in the case of detached entities. + + + + + Defines an event class for the refreshing of an object. + + + + + Defines an event class for the replication of an entity. + + + + + An event class for saveOrUpdate() + + + + + Implementation of ADOException indicating problems with communicating with the + database (can also include incorrect ADO setup). + + + + + Wraps exceptions that occur during ADO.NET calls. + + + Exceptions thrown by various ADO.NET providers are not derived from + a common base class (SQLException in Java), so + is used instead in NHibernate. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Collect data of an to be converted. + + + + + The to be converted. + + + + + An optional error message. + + + + + The SQL that generate the exception + + + + + Optional EntityName where available in the original exception context. + + + + + Optional EntityId where available in the original exception context. + + + + + Converts the given SQLException into Exception hierarchy, as well as performing + appropriate logging. + + The converter to use. + The exception to convert. + An optional error message. + The SQL executed. + The converted . + + + + Converts the given SQLException into Exception hierarchy, as well as performing + appropriate logging. + + The converter to use. + The exception to convert. + An optional error message. + The converted . + + + For the given , locates the . + The exception from which to extract the + The , or null. + + + + Implementation of ADOException indicating that the requested DML operation + resulted in a violation of a defined integrity constraint. + + + + + Returns the name of the violated constraint, if known. + + The name of the violated constraint, or null if not known. + + + + Implementation of ADOException indicating that evaluation of the + valid SQL statement against the given data resulted in some + illegal operation, mismatched types or incorrect cardinality. + + + + + The Configurable interface defines the contract for impls that + want to be configured prior to usage given the currently defined Hibernate properties. + + + + Configure the component, using the given settings and properties. + All defined startup properties. + + + + Defines a contract for implementations that know how to convert a + into NHibernate's hierarchy. + + + Inspired by Spring's SQLExceptionTranslator. + + Implementations must have a constructor which takes a + parameter. + + Implementations may implement if they need to perform + configuration steps prior to first use. + + + + + + Convert the given into custom Exception. + + Available information during exception throw. + The resulting Exception to throw. + + + + Implementation of ADOException indicating a problem acquiring lock + on the database. + + + + A factory for building SQLExceptionConverter instances. + + + Build a SQLExceptionConverter instance. + The defined dialect. + The configuration properties. + An appropriate instance. + + First, looks for a property to see + if the configuration specified the class of a specific converter to use. If this + property is set, attempt to construct an instance of that class. If not set, or + if construction fails, the converter specific to the dialect will be used. + + + + + Builds a minimal converter. The instance returned here just always converts to . + + The minimal converter. + + + + Implementation of ADOException indicating that the SQL sent to the database + server was invalid (syntax error, invalid object references, etc). + + + + + A SQLExceptionConverter implementation which performs no conversion of + the underlying . + Interpretation of a SQL error based on + is not possible as using the ErrorCode (which is, however, vendor- + specific). Use of a ErrorCode-based converter should be preferred approach + for converting/interpreting SQLExceptions. + + + + Handle an exception not converted to a specific type based on the SQLState. + The exception to be handled. + An optional message + Optionally, the sql being performed when the exception occurred. + The converted exception; should never be null. + + + + Encapsulates the strategy required to execute various types of update, delete, + and insert statements issued through HQL. + + + + + Execute the sql managed by this executor using the given parameters. + + Essentially bind information for this processing. + The session originating the request. + The number of entities updated/deleted. + + + + True if this is a filter query (allow no FROM clause). * + + + + Returns to the previous 'FROM' context. + + + + + + Implementations will report or handle errors invoked by an ANTLR base parser. + Author: josh + Ported by: Steve Strong + + + + all append invocations on the buf should go through this Output instance variable. + The value of this variable may be temporarily substitued by sql function processing code + to catch generated arguments. + This is because sql function templates need arguments as separate string chunks + that will be assembled into the target dialect-specific function call. + + + + Handles parser errors. + + + + + Add a space if the previous token was not a space or a parenthesis. + + + + + The default SQL writer. + + + + + Writes SQL fragments. + + + + todo remove this hack + The parameter is either ", " or " , ". This is needed to pass sql generating tests as the old + sql generator uses " , " in the WHERE and ", " in SELECT. + + @param comma either " , " or ", " + + + + The default SQL writer. + + + + + Abstract superclass of object loading (and querying) strategies. + + +

+ This class implements useful common functionality that concrete loaders would delegate to. + It is not intended that this functionality would be directly accessed by client code (Hence, + all methods of this class are declared protected or private.) This class relies heavily upon the + interface, which is the contract between this class and + s that may be loaded by it. +

+

+ The present implementation is able to load any number of columns of entities and at most + one collection role per query. +

+
+ +
+ + + What lock mode does this load entities with? + + A Collection of lock modes specified dynamically via the Query Interface + + + + + Append FOR UPDATE OF clause, if necessary. This + empty superclass implementation merely returns its first + argument. + + + + + Does this query return objects that might be already cached by + the session, whose lock mode may need upgrading. + + + + + + Modify the SQL, adding lock hints and comments, if necessary + + + + + Execute an SQL query and attempt to instantiate instances of the class mapped by the given + persister from each row of the DataReader. If an object is supplied, will attempt to + initialize that object. If a collection is supplied, attempt to initialize that collection. + + + + + Loads a single row from the result set. This is the processing used from the + ScrollableResults where no collection fetches were encountered. + + The result set from which to do the load. + The session from which the request originated. + The query parameters specified by the user. + Should proxies be generated + The loaded "row". + + + + + Read any collection elements contained in a single row of the result set + + + + + Get the actual object that is returned in the user-visible result list. + + + This empty implementation merely returns its first argument. This is + overridden by some subclasses. + + + + + For missing objects associated by one-to-one with another object in the + result set, register the fact that the the object is missing with the + session. + + + + + Read one collection element from the current row of the ADO.NET result set + + + + + If this is a collection initializer, we need to tell the session that a collection + is being initilized, to account for the possibility of the collection having + no elements (hence no rows in the result set). + + + + + Read a row of EntityKeys from the IDataReader into the given array. + + + Warning: this method is side-effecty. If an id is given, don't bother going + to the IDataReader + + + + + Check the version of the object in the IDataReader against + the object version in the session cache, throwing an exception + if the version numbers are different. + + + + + + Resolve any ids for currently loaded objects, duplications within the IDataReader, + etc. Instanciate empty objects to be initialized from the IDataReader. Return an + array of objects (a row of results) and an array of booleans (by side-effect) that determine + wheter the corresponding object should be initialized + + + + + The entity instance is already in the session cache + + + + + The entity instance is not in the session cache + + + + + Hydrate the state of an object from the SQL IDataReader, into + an array of "hydrated" values (do not resolve associations yet), + and pass the hydrated state to the session. + + + + + Determine the concrete class of an instance for the IDataReader + + + + + Advance the cursor to the first required row of the IDataReader + + + + + Should we pre-process the SQL string, adding a dialect-specific + LIMIT clause. + + + + + + + + Performs dialect-specific manipulations on the offset value before returning it. + This method is applicable for use in limit statements only. + + + + + Performs dialect-specific manipulations on the limit value before returning it. + This method is applicable for use in limit statements only. + + + + + Obtain an IDbCommand with all parameters pre-bound. Bind positional parameters, + named parameters, and limit parameters. + + + Creates an IDbCommand object and populates it with the values necessary to execute it against the + database to Load an Entity. + + The to use for the IDbCommand. + TODO: find out where this is used... + The SessionImpl this Command is being prepared in. + A CommandWrapper wrapping an IDbCommand that is ready to be executed. + + + + Some dialect-specific LIMIT clauses require the maximium last row number + (aka, first_row_number + total_row_count), while others require the maximum + returned row count (the total maximum number of rows to return). + + The selection criteria + The dialect + The appropriate value to bind into the limit clause. + + + + Fetch a IDbCommand, call SetMaxRows and then execute it, + advance to the first result and return an SQL IDataReader + + The to execute. + The to apply to the and . + true if result types need to be auto-discovered by the loader; false otherwise. + The to load in. + + An IDataReader advanced to the first record in RowSelection. + + + + Called by subclasses that load entities + + + + + Called by subclasses that batch load entities + + + + + Called by subclasses that load collections + + + + + Called by wrappers that batch initialize collections + + + + + Called by subclasses that batch initialize collections + + + + + Return the query results, using the query cache, called + by subclasses that implement cacheable queries + + + + + + + + + + Actually execute a query, ignoring the query cache + + + + + + + + Calculate and cache select-clause suffixes. Must be + called by subclasses after instantiation. + + + + + An array indicating whether the entities have eager property fetching + enabled. + + Eager property fetching indicators. + + + + An array of indexes of the entity that owns a one-to-one association + to the entity at the given index (-1 if there is no "owner") + + + The indexes contained here are relative to the result of . + + + + + An array of the owner types corresponding to the + returns. Indices indicating no owner would be null here. + + + + + Get the index of the entity that owns the collection, or -1 + if there is no owner in the query results (i.e. in the case of a + collection initializer) or no collection. + + + + + Return false is this loader is a batch entity loader + + + + + Get the result set descriptor + + + + + The SqlString to be called; implemented by all subclasses + + + + The setter was added so that class inheriting from Loader could write a + value using the Property instead of directly to the field. + + + The scope is protected internal because the needs to + be able to get the SqlString of the when + it is parsing a subquery. + + + + + + An array of persisters of entity classes contained in each row of results; + implemented by all subclasses + + + The setter was added so that classes inheriting from Loader could write a + value using the Property instead of directly to the field. + + + + + An (optional) persister for a collection to be initialized; only collection loaders + return a non-null value + + + + + Get the SQL table aliases of entities whose + associations are subselect-loadable, returning + null if this loader does not support subselect + loading + + + + + Identifies the query for statistics reporting, if null, + no statistics will be reported + + + + + Utility method that generates 0_, 1_ suffixes. Subclasses don't + necessarily need to use this algorithm, but it is intended that + they will in most cases. + + + + + + + a collection of lock modes specified dynamically via the Query interface + + + + + Base class for nodes dealing 'is null' and 'is not null' operators. + todo : a good deal of this is copied from BinaryLogicOperatorNode; look at consolidating these code fragments + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Represents a unary operator node. + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + A semantic analysis node, that points back to the main analyzer. + Authoer: josh + Ported by: Steve Strong + + + + + A base AST node for the intermediate tree. + + + + The original text for the node, mostly for debugging. + + + The data type of this node. Null for 'no type'. + + + + Retrieve the text to be used for rendering this particular node. + + The session factory + The text to use for rendering + + + + An interface for initializeable AST nodes. + + + + + Initializes the node with the parameter. + + the initialization parameter. + + + A pointer back to the phase 2 processor. + + + + Contract for nodes representing unary operators. + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Contract for nodes representing operators (logic or arithmetic). + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Called by the tree walker during hql-sql semantic analysis + after the operator sub-tree is completely built. + + + + + Retrieves the data type for the overall operator expression. + + The expression's data type. + + + + Retrieves the node representing the operator's single operand. + + + + + When (if) we need to expand a row value constructor, what is the type of connector to use between the + expansion fragments. + + The expansion connector type. + + + + When (if) we need to expand a row value constructor, what is the text of connector to use between the + expansion fragments. + + The expansion connector text. + + + + Convenience implementation of Statement to centralize common functionality. + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Implementors will return additional display text, which will be used + by the ASTPrinter to display information (besides the node type and node + text). + + + + + Returns additional display text for the AST node. + + The additional display text. + + + + Common interface modeling the different HQL statements (i.e., INSERT, UPDATE, DELETE, SELECT). + Author: Steve Ebersole + Ported by: Steve Strong + + + + + The "phase 2" walker which generated this statement tree. + + + + + The main token type representing the type of this statement. + + + + + Does this statement require the StatementExecutor? + Essentially, at the JDBC level, does this require an executeUpdate()? + + + + + Returns additional display text for the AST node. + + The additional display text. + + + + Type definition for Statements which are restrictable via a where-clause (and + thus also having a from-clause). + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Retreives the from-clause in effect for this statement; could be null if the from-clause + has not yet been parsed/generated. + + + + + Does this statement tree currently contain a where clause? + Returns True if a where-clause is found in the statement tree and + that where clause actually defines restrictions; false otherwise. + + + + + Retreives the where-clause defining the restriction(s) in effect for + this statement. + Note that this will generate a where-clause if one was not found, so caution + needs to taken prior to calling this that restrictions will actually exist + in the resulting statement tree (otherwise "unexpected end of subtree" errors + might occur during rendering). + + + + + Represents an element of a projection list, i.e. a select expression. + Author: josh + Ported by: Steve Strong + + + + + Appends AST nodes that represent the columns after the current AST node. + (e.g. 'as col0_O_') + + The index of the select expression in the projection list. + + + + Returns the data type of the select expression. + + + + + Returns the FROM element that this expression refers to. + + + + + Returns true if the element is a constructor (e.g. new Foo). + + + + + Returns true if this select expression represents an entity that can be returned. + + + + + Sets the text of the node. + + + + + Represents an aggregate function i.e. min, max, sum, avg. + + Author: Joshua Davis + Ported by: Steve Strong + + + + + Encapsulates the information relating to an individual assignment within the + set clause of an HQL update statement. This information is used during execution + of the update statements when the updates occur against "multi-table" stuff. + + + + + Contract for nodes representing logcial BETWEEN (ternary) operators. + + + + + Nodes which represent binary arithmetic operators. + + + + + Contract for nodes representing binary operators. + Author: Steve Ebersole + Ported by: Steve Strong + + + + + The left-hand operand of the operator. + + + + + The right-hand operand of the operator. + + + + Retrieves the left-hand operand of the operator. + + @return The left-hand operand + + + Retrieves the right-hand operand of the operator. + + @return The right-hand operand + + + + Contract for nodes representing binary operators. + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Currently this is needed in order to deal with {@link FromElement FromElements} which + contain "hidden" JDBC parameters from applying filters. + Would love for this to go away, but that would require that Hibernate's + internal {@link org.hibernate.engine.JoinSequence join handling} be able to either:
    +
  • render the same AST structures
  • +
  • render structures capable of being converted to these AST structures
  • +
+ In the interim, this allows us to at least treat these "hidden" parameters properly which is + the most pressing need. + Author: Steve Ebersole + Ported by: Steve Strong +
+
+ + + Adds a parameter specification for a parameter encountered within this node. We use the term 'embedded' here + because of the fact that the parameter was simply encountered as part of the node's text; it does not exist + as part of a subtree as it might in a true AST. + + The generated specification. + + + + Retrieve all embedded parameter specifications. + + All embedded parameter specifications; may return null. + + + + Set the renderable text of this node. + + + + + Determine whether this node contans embedded parameters. The implication is that + {@link #getEmbeddedParameters()} is allowed to return null if this method returns false. + + + + + Performs the operator node initialization by seeking out any parameter + nodes and setting their expected type, if possible. + + + + Mutate the subtree relating to a row-value-constructor to instead use + a series of ANDed predicates. This allows multi-column type comparisons + and explicit row-value-constructor syntax even on databases which do + not support row-value-constructor. +

+ For example, here we'd mutate "... where (col1, col2) = ('val1', 'val2) ..." to + "... where col1 = 'val1' and col2 = 'val2' ..." + + @param valueElements The number of elements in the row value constructor list. + + +

+ Represents a boolean literal within a query. + +
+ + + Represents a literal. + + Author: josh + Ported by: Steve Strong + + + + + Interface for nodes which wish to be made aware of any determined "expected + type" based on the context within they appear in the query. + Author: Steve Ebersole + Ported by: Steve Strong + + + + Expected-types really only pertinent here for boolean literals... + + @param expectedType + + + + Represents a case ... when .. then ... else ... end expression in a select. + + + + + Represents a case ... when .. then ... else ... end expression in a select. + + Author: Gavin King + Ported by: Steve Strong + + + + + Represents 'elements()' or 'indices()'. + Author: josh + Ported by: Steve strong + + + + + Represents a method call + Author: josh + Ported by: Steve Strong + + + + + Constructor form used to initialize . + + The FROM clause to which this element belongs. + The origin (LHS) of this element. + The alias applied to this element. + + + + Returns the identifier select SQL fragment. + + The total number of returned types. + The sequence of the current returned type. + the identifier select SQL fragment. + + + + Returns the property select SQL fragment. + + The total number of returned types. + The sequence of the current returned type. + the property select SQL fragment. + + + + Render the identifier select, but in a 'scalar' context (i.e. generate the column alias). + + the sequence of the returned type + the identifier select with the column alias. + + + + Returns true if this FromElement was implied by a path, or false if this FROM element is explicitly declared in + the FROM clause. + + + + + Delegate that handles the type and join sequence information for a FromElement. + Author: josh + Ported by: Steve Strong + + + + + Returns the identifier select SQL fragment. + + The total number of returned types. + The sequence of the current returned type. + the identifier select SQL fragment. + + + + Render the identifier select, but in a 'scalar' context (i.e. generate the column alias). + + the sequence of the returned type + the identifier select with the column alias. + + + + Returns the property select SQL fragment. + + The total number of returned types. + The sequence of the current returned type. + + the property select SQL fragment. + + + + Returns the type of a property, given it's name (the last part) and the full path. + + The last part of the full path to the property. + The full property path. + The type + + + + This accounts for a quirk in Queryable, where it sometimes generates ', ' in front of the + SQL fragment. :-P + + A SQL fragment. + The fragment, without the leading comma and spaces. + + + + Returns the Hibernate queryable implementation for the HQL class. + + + + + Abstraction of all mappings that define properties: entities, collection elements. + + + + + Given a component path expression, get the type of the property + + + + + + + Given a component path expression, get the type of the property. + + + + true if a type was found, false if not + + + + Given a query alias and a property path, return the qualified column name + + + + + + + Given a property path, return the corresponding column name(s). + + + + Get the type of the thing containing the properties + + + + + Common behavior - a node that contains a list of select expressions. + Author: josh + Ported by: Steve Strong + + + + + Returns an array of SelectExpressions gathered from the children of the given parent AST node. + + + + + Returns an array of SelectExpressions gathered from the children of the given parent AST node. + + + + + Returns the first select expression node that should be considered when building the array of select + expressions. + + + + + Represents a COUNT expression in a select. + Author: josh + Ported by: Steve Strong + + + + + Defines a top-level AST node representing an HQL delete statement. + + + + + Represents a reference to a property or alias expression. This should duplicate the relevant behaviors in + PathExpressionParser. + Author: Joshua Davis + Ported by: Steve Strong + + + + + The contract for expression sub-trees that can resolve themselves. + Author: josh + Ported by: Steve Strong + + + + + Does the work of resolving an identifier or a dot + + + + + Does the work of resolving an identifier or a dot, but without a parent node + + + + + Does the work of resolving an identifier or a dot, but without a parent node or alias + + + + + Does the work of resolving inside of the scope of a function call + + + + + Does the work of resolving an an index []. + + + + + An AST node with a path property. This path property will be the fully qualified name. + Author: josh + Ported by: Steve Strong + + + + + Returns the full path name represented by the node. + + the full path name represented by the node. + + + + Sub-classes can override this method if they produce implied joins (e.g. DotNode). + + an implied join created by this from reference. + + + + The full path, to the root alias of this dot node. + + + + + The type of dereference that hapened (DEREF_xxx). + + + + + The identifier that is the name of the property. + + + + + The unresolved property path relative to this dot node. + + + + + The column names that this resolves to. + + + + + Fetch join or not. + + + + + The type of join to create. Default is an inner join. + + + + + Is the given property name a reference to the primary key of the associated + entity construed by the given entity type? + For example, consider a fragment like order.customer.id + (where order is a from-element alias). Here, we'd have: + propertyName = "id" AND + owningType = ManyToOneType(Customer) + and are being asked to determine whether "customer.id" is a reference + to customer's PK... + + The name of the property to check. + The type represeting the entity "owning" the property + True if propertyName references the entity's (owningType->associatedEntity) primary key; false otherwise. + + + + Sets the join type for this '.' node structure. + + + + + Returns the full path of the node. + + + + + Represents the 'FROM' part of a query or subquery, containing all mapped class references. + Author: josh + Ported by: Steve Strong + + + + + Counts the from elements as they are added. + + + + + All of the implicit FROM xxx JOIN yyy elements that are the destination of a collection. These are created from + index operators on collection property references. + + + + + Pointer to the parent FROM clause, if there is one. + + + + + Collection of FROM clauses of which this is the parent. + + + + + Convenience method to check whether a given token represents a from-element alias. + + The potential from-element alias to check. + True if the possibleAlias is an alias to a from-element visible from this point in the query graph. + + + + Returns true if the from node contains the class alias name. + + The HQL class alias name. + true if the from node contains the class alias name. + + + + Returns true if the from node contains the table alias name. + + The SQL table alias name. + true if the from node contains the table alias name. + + + + Adds a new from element to the from node. + + The reference to the class. + The alias AST. + The new FROM element. + + + + Retreives the from-element represented by the given alias. + + The alias by which to locate the from-element. + The from-element assigned the given alias, or null if none. + + + + Returns the list of from elements in order. + + The list of from elements (instances of FromElement). + + + + Returns the list of from elements that will be part of the result set. + + the list of from elements that will be part of the result set. + + + + Look for an existing implicit or explicit join by the given path. + + + + + Creates entity from elements. + + + + + + + + Creates collection from elements. + + + + + + + + + + + Insert a new node into both the Tree and the Node Array. Add DOWN and UP nodes if needed. + + The parent node + The child node + + + + Count the number of child nodes (including DOWNs and UPs) of a parent node + + The index of the parent in the node array + The number of child nodes + + + + Represents the [] operator and provides it's semantics. + Author: josh + Ported by: Steve Strong + + + + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Defines a top-level AST node representing an HQL "insert select" statement. + + + + Performs detailed semantic validation on this insert statement tree. + Indicates validation failure. + + + Retreive this insert statement's into-clause. + The into-clause + + + Retreive this insert statement's select-clause. + The select-clause. + + + + Represents an entity referenced in the INTO clause of an HQL + INSERT statement. + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Returns additional display text for the AST node. + + The additional display text. + + + + Determine whether the two types are "assignment compatible". + + The type defined in the into-clause. + The type defined in the select clause. + True if they are assignment compatible. + + + + Interface for nodes which require access to the SessionFactory + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + IsNotNullLogicOperatorNode implementation + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Represents a 'is null' check. + + + + + A node representing a static Java constant. + + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Implementation of OrderByClause. + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Implementation of ParameterNode. + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Locate the select clause that is part of this select statement. + Note, that this might return null as derived select clauses (i.e., no + select clause at the HQL-level) get generated much later than when we + get created; thus it depends upon lifecycle. + + Our select clause, or null. + + + + Represents the list of expressions in a SELECT clause. + Author: josh + Ported by: Steve Strong + + + + + Prepares a derived (i.e., not explicitly defined in the query) select clause. + + The from clause to which this select clause is linked. + + + + Prepares an explicitly defined select clause. + + The from clause linked to this select clause. + + + + + FromElements which need to be accounted for in the load phase (either for return or for fetch). + + + + + The column alias names being used in the generated SQL. + + + + + The constructor to use for dynamic instantiation queries. + + + + + The HQL aliases, or generated aliases + + + + + The types actually being returned from this query at the "object level". + + + + + A select expression that was generated by a FROM element. + Author: josh + Ported by: Steve Strong + + + + + Represents an SQL fragment in the AST. + Author: josh + Ported by: Steve Strong + + + + + Defines a top-level AST node representing an HQL update statement. + + + + + Generates class/table/column aliases during semantic analysis and SQL rendering. + Its essential purpose is to keep an internal counter to ensure that the + generated aliases are unique. + + + + + Appends child nodes to a parent efficiently. + + + + + Depth first iteration of an ANTLR AST. + Author: josh + Ported by: Steve Strong + + + + + Returns the 'list' representation with some brackets around it for debugging. + + The tree. + The list representation of the tree. + + + + Determine if a given node (test) is contained anywhere in the subtree + of another given node (fixture). + + The node against which to be checked for children. + The node to be tested as being a subtree child of the parent. + True if child is contained in the parent's collection of children. + + + + Finds the first node of the specified type in the chain of children. + + The parent + The type to find. + The first node of the specified type, or null if not found. + + + + Filters nodes in/out of a tree. + + The node to check. + true to keep the node, false if the node should be filtered out. + + + + Generates the scalar column AST nodes for a given array of SQL columns + + + + + Performs the post-processing of the join information gathered during semantic analysis. + The join generating classes are complex, this encapsulates some of the JoinSequence-related + code. + Author: Joshua Davis + Ported by: Steve Strong + + + + + Constructs a new JoinProcessor. + + The walker to which we are bound, giving us access to needed resources. + + + + Translates an AST join type (i.e., the token type) into a JoinFragment.XXX join type. + + The AST join type (from HqlSqlWalker) + a JoinType.XXX join type. + + + + Indicates that Float and Double literal values should + be treated using the SQL "exact" format (i.e., '.001') + + + + + Indicates that Float and Double literal values should + be treated using the SQL "approximate" format (i.e., '1E-3') + + + + + In what format should Float and Double literal values be sent + to the database? + See #EXACT, #APPROXIMATE + + + + + Traverse the AST tree depth first. Note that the AST passed in is not visited itself. Visitation starts + with its children. + + ast + + + + Turns a path into an AST. + + The path. + The AST factory to use. + An HQL AST representing the path. + + + + Creates synthetic and nodes based on the where fragment part of a JoinSequence. + Author: josh + Ported by: Steve Strong + + + + + Generates translators which uses the Antlr-based parser to perform + the translation. + + Author: Gavin King + Ported by: Steve Strong + + + + + Facade for generation of + and instances. + + + + + Facade for generation of + and instances. + + + + + Construct a instance + capable of translating an HQL query string. + + The query string to be translated + + + Currently enabled filters + The session factory + An appropriate translator. + + + + Construct a instance + capable of translating a Linq expression. + + + The query-identifier (used in collection). + This is typically the same as the queryString parameter except for the case of + split polymorphic queries which result in multiple physical sql queries. + + The query expression to be translated + + + Currently enabled filters + The session factory + An appropriate translator. + + + + Look ahead for tokenizing is all lowercase, whereas the original case of an input stream is preserved. + Copied from http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782 + + + + + Provides a map of collection function names to the corresponding property names. + Authoer: josh + Ported by: Steve Strong + + + + + A problem occurred translating a Hibernate query to SQL due to invalid query syntax, etc. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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. + + The message that describes the error. + The query that contains the error. + + + + Initializes a new instance of the class. + + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Gets or sets the of HQL that caused the Exception. + + + + + Gets a message that describes the current . + + The error message that explains the reason for this exception including the HQL. + + + + An error handler that counts parsing errors and warnings. + + + + + Defines the behavior of an error handler for the HQL parsers. + Author: josh + Ported by: Steve Strong + + + + + A custom token class for the HQL grammar. + + + + + The previous token type. + + + + + Public constructor + + + + + Public constructor + + + + + Returns a string representation of the object. + + The debug string + + + + Indicates if the token could be an identifier. + + + + + Gets or Sets the type of the token, remembering the previous type on Sets. + + + + + Returns the previous token type. + + + + + Exception thrown when an invalid path is found in a query. + Author: josh + Ported by: Steve Strong + + + + + Specialized interface for filters. + + + + + Defines the constract of an HQL->SQL translator. + + + + + Compile a "normal" query. This method may be called multiple times. Subsequent invocations are no-ops. + + Defined query substitutions. + Does this represent a shallow (scalar or entity-id) select? + There was a problem parsing the query string. + There was a problem querying defined mappings. + + + + Perform a list operation given the underlying query definition. + + The session owning this query. + The query bind parameters. + The query list results. + + + + + Perform a bulk update/delete operation given the underlying query defintion. + + The query bind parameters. + The session owning this query. + The number of entities updated or deleted. + + + + + Returns the column names in the generated SQL. + + the column names in the generated SQL. + + + + The set of query spaces (table names) that the query referrs to. + + + + + The SQL string generated by the translator. + + + + + The HQL string processed by the translator. + + + + + Returns the filters enabled for this query translator. + + Filters enabled for this query execution. + + + + Returns an array of Types represented in the query result. + + Query return types. + + + + Returns an array of HQL aliases + + Returns an array of HQL aliases + + + + Does the translated query contain collection fetches? + + True if the query does contain collection fetched; false otherwise. + + + + Compile a filter. This method may be called multiple + times. Subsequent invocations are no-ops. + + the role name of the collection used as the basis for the filter. + Defined query substitutions. + Does this represent a shallow (scalar or entity-id) select? + + + + Creates a new AST-based query translator. + + The query-identifier (used in stats collection) + The hql query to translate + Currently enabled filters + The session factory constructing this translator instance. + + + + Compile a "normal" query. This method may be called multiple + times. Subsequent invocations are no-ops. + + Defined query substitutions. + Does this represent a shallow (scalar or entity-id) select? + + + + Compile a filter. This method may be called multiple + times. Subsequent invocations are no-ops. + + the role name of the collection used as the basis for the filter. + Defined query substitutions. + Does this represent a shallow (scalar or entity-id) select? + + + + Performs both filter and non-filter compiling. + + Defined query substitutions. + Does this represent a shallow (scalar or entity-id) select? + the role name of the collection used as the basis for the filter, NULL if this is not a filter. + + + + Construct a new SessionFactoryHelperExtensions instance. + + The SessionFactory impl to be encapsulated. + + + + Locate a registered sql function by name. + + The name of the function to locate + The sql function, or null if not found. + + + + Locate a registered sql function by name. + + The name of the function to locate + The sql function, or throws QueryException if no matching sql functions could be found. + + + + Find the function return type given the function name and the first argument expression node. + + The function name. + The first argument expression. + the function return type given the function name and the first argument expression node. + + + + Given a (potentially unqualified) class name, locate its imported qualified name. + + The potentially unqualified class name + The qualified class name. + + + + Does the given persister define a physical discriminator column + for the purpose of inheritence discrimination? + + The persister to be checked. + True if the persister does define an actual discriminator column. + + + + Locate the collection persister by the collection role. + + The collection role name. + The defined CollectionPersister for this collection role, or null. + + + + Determine the name of the property for the entity encapsulated by the + given type which represents the id or unique-key. + + The type representing the entity. + The corresponding property name + + + + Retrieves the column names corresponding to the collection elements for the given + collection role. + + The collection role + The sql column-qualification alias (i.e., the table alias) + the collection element columns + + + + Essentially the same as GetElementType, but requiring that the + element type be an association type. + + The collection type to be checked. + The AssociationType of the elements of the collection. + + + + Locate the collection persister by the collection role, requiring that + such a persister exist. + + The collection role name. + The defined CollectionPersister for this collection role. + + + + Locate the persister by class or entity name, requiring that such a persister + exist. + + The class or entity name + The defined persister for this entity + + + + Given a (potentially unqualified) class name, locate its persister. + + The (potentially unqualified) class name. + The defined persister for this class, or null if none found. + + + + Given a (potentially unqualified) class name, locate its persister. + + The session factory implementor. + The (potentially unqualified) class name. + The defined persister for this class, or null if none found. + + + + Locate the persister by class or entity name. + + The class or entity name + The defined persister for this entity, or null if none found. + + + + Create a join sequence rooted at the given collection. + + The persister for the collection at which the join should be rooted. + The alias to use for qualifying column references. + The generated join sequence. + + + + Generate an empty join sequence instance. + + The generated join sequence. + + + + Generate a join sequence representing the given association type. + + Should implicit joins (theta-style) or explicit joins (ANSI-style) be rendered + The type representing the thing to be joined into. + The table alias to use in qualifing the join conditions + The type of join to render (inner, outer, etc) + The columns making up the condition of the join. + The generated join sequence. + + + + Retreive a PropertyMapping describing the given collection role. + + The collection role for whcih to retrieve the property mapping. + The property mapping. + + + + Given a collection type, determine the Type representing elements + within instances of that collection. + + The collection type to be checked. + The Type of the elements of the collection. + + + + Generates translators which uses the older hand-written parser to perform the translation. + + + + + Parses the hibernate query into its constituent clauses. + + + + + A parser is a state machine that accepts a string of tokens, + bounded by start() and end() and modifies a QueryTranslator. Parsers + are NOT intended to be threadsafe. They SHOULD be reuseable + for more than one token stream. + + + + + + + + + + + + + + + + + + + + + + + + Parses the from clause of a hibernate query, looking for tables and + aliases for the SQL query. + + + + + + + + FromPathExpressionParser + + + + + Parses an expression of the form foo.bar.baz and builds up an expression + involving two less table joins than there are path components. + + + + + + + + + + NOTE: we avoid joining to the next table if the named property is just the foreign key value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used to hold column type in nested functions. + + + + + Parses the GROUP BY clause of an aggregate query + + + + + Parses the having clause of a hibernate query and translates it to an + SQL having clause. + + + + Parses the where clause of a hibernate query and translates it to an + SQL where clause. + + + + + + + + + + + + + + + + + + + + + + + + Parses the ORDER BY clause of a query + + + + + + + HQL lexical analyzer (not really a parser) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An instance of QueryTranslator translates a Hibernate query string to SQL. + + + + Construct a query translator + + A unique identifier for the query of which this + translation is part; typically this is the original, user-supplied query string. + + + The "preprocessed" query string; at the very least + already processed by {@link org.hibernate.hql.QuerySplitter}. + + Any enabled filters. + The session factory. + + + + Construct a query translator + + + + + Compile a subquery + + + + + + Compile a "normal" query. This method may be called multiple + times. Subsequent invocations are no-ops. + + + + + Compile a filter. This method may be called multiple + times. Subsequent invocations are no-ops. + + + + + Compile the query (generate the SQL). + + + + + WARNING: side-effecty + + + + + Extract the complete clause of function. + + The list of tokens + The index of the list that represent the founded function. + String trepresentation of each token. + Each token can be string or SqlString + + + Used for collection filters + + + + + + + Persisters for the return values of a List style query + + + The Persisters stored by QueryTranslator have to be . The + setter will attempt to cast the ILoadable array passed in into an + IQueryable array. + + + + + Types of the return values of an Enumerate() style query. + Return an array of s. + + + + + + + + Is this query called by Scroll() or Iterate()? + + true if it is, false if it is called by find() or list() + + + + + + + + + + Parsers the select clause of a hibernate query, looking + for a table (well, really class) alias. + + + + + + + + + + + + + + + + + + + + + + + Wraps SessionFactoryImpl, adding more lookup behaviors and encapsulating some of the error handling. + + + + + Locate the collection persister by the collection role. + + The collection role name. + The defined CollectionPersister for this collection role, or null. + + + + Locate the persister by class or entity name, requiring that such a persister + exists + + The class or entity name + The defined persister for this entity + + + + Locate the persister by class or entity name. + + The class or entity name + The defined persister for this entity, or null if none found. + + + + Retreive a PropertyMapping describing the given collection role. + + The collection role for whcih to retrieve the property mapping. + The property mapping. + + + + Provides utility methods for generating HQL / SQL names. + Shared by both the 'classic' and 'new' query translators. + + + + + Handle Hibernate "implicit" polymorphism, by translating the query string into + several "concrete" queries against mapped classes. + + + + + + + + + Contract for providing callback access to an , + typically from the . + + + + + Retrieve the next value from the underlying source. + + + + + Encapsulates definition of the underlying data structure backing a sequence-style generator. + + + + + A callback to be able to get the next value from the underlying + structure as needed. + + The session. + The next value. + + + + Prepare this structure for use. Called sometime after instantiation, + but before first use. + + The optimizer being applied to the generator. + + + Commands needed to create the underlying structures. + The database dialect being used. + The creation commands. + + + Commands needed to drop the underlying structures. + The database dialect being used. + The drop commands. + + + The name of the database structure (table or sequence). + + + How many times has this structure been accessed through this reference? + + + The configured increment size + + + + Performs optimization on an optimizable identifier generator. Typically + this optimization takes the form of trying to ensure we do not have to + hit the database on each and every request to get an identifier value. + + + + Optimizers work on constructor injection. They should provide + a constructor with the following arguments. + + - The return type for the generated values. + - int The increment size. + + + + + Generate an identifier value accounting for this specific optimization. + + Callback to access the underlying value source. + The generated identifier value. + + + + A common means to access the last value obtained from the underlying + source. This is intended for testing purposes, since accessing the + unerlying database source directly is much more difficult. + + + The last value we obtained from the underlying source; -1 indicates we have not yet consulted with the source. + + + + + Defined increment size. + + The increment size. + + + + Are increments to be applied to the values stored in the underlying + value source? + + + True if the values in the source are to be incremented + according to the defined increment size; false otherwise, in which + case the increment is totally an in memory construct. + + + + + Marker interface for an optimizer that wishes to know the user-specified initial value. +

+ Used instead of constructor injection since that is already a public understanding and + because not all optimizers care. +

+
+ + + Reports the user-specified initial value to the optimizer. +

+ -1 is used to indicate that the user did not specify. + The initial value specified by the user, or -1 to indicate that the + user did not specify. +

+
+ + + Common support for optimizer implementations. + + + + + Construct an optimizer + + The expected id class. + The increment size. + + + + Exposure intended for testing purposes. + + + + + Exposure intended for testing purposes. + + + + + Optimizer which uses a pool of values, storing the next low value of the range in the database. + + Note that this optimizer works essentially the same as the HiLoOptimizer, except that here the + bucket ranges are actually encoded into the database structures. + + + Note that if you prefer that the database value be interpreted as the bottom end of our current + range, then use the PooledLoOptimizer strategy. + + + + + + Exposure intended for testing purposes. + + + + + Exposure intended for testing purposes. + + + + + Describes a sequence. + + + + + Generates identifier values based on an sequence-style database structure. + Variations range from actually using a sequence to using a table to mimic + a sequence. These variations are encapsulated by the + interface internally. + + + General configuration parameters: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMEDEFAULTDESCRIPTION
The name of the sequence/table to use to store/retrieve values
The initial value to be stored for the given segment; the effect in terms of storage varies based on and
The increment size for the underlying segment; the effect in terms of storage varies based on and
depends on defined increment sizeAllows explicit definition of which optimization strategy to use
falseAllows explicit definition of which optimization strategy to use
+

+ Configuration parameters used specifically when the underlying structure is a table: + + + + + + + + + + + +
NAMEDEFAULTDESCRIPTION
The name of column which holds the sequence value for the given segment
+ + + +

+ An that requires creation of database objects + All s that also implement + An have access to a special mapping parameter: schema + +
+ + + The general contract between a class that generates unique + identifiers and the . + + + + It is not intended that this interface ever be exposed to the + application. It is intended that users implement this interface + to provide custom identifier generation strategies. + + + Implementors should provide a public default constructor. + + + Implementations that accept configuration parameters should also + implement . + + + Implementors must be threadsafe. + + + + + + Generate a new identifier + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier + + + + The SQL required to create the underlying database objects + + The to help with creating the sql. + + An array of objects that contain the sql to create the + necessary database objects. + + + + + The SQL required to remove the underlying database objects + + The to help with creating the sql. + + A that will drop the database objects. + + + + + Return a key unique to the underlying database objects. + + + A key unique to the underlying database objects. + + + Prevents us from trying to create/remove them multiple times + + + + + An IdentiferGenerator that supports "configuration". + + + + + Configure this instance, given the values of parameters + specified by the user as <param> elements. + This method is called just once, followed by instantiation. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Determine the name of the sequence (or table if this resolves to a physical table) to use. + Called during configuration. + + + + + + + + Determine the name of the column used to store the generator value in + the db. Called during configuration, if a physical table is being used. + + + + + Determine the initial sequence value to use. This value is used when + initializing the database structure (i.e. sequence/table). Called + during configuration. + + + + + Determine the increment size to be applied. The exact implications of + this value depends on the optimizer being used. Called during configuration. + + + + + Determine the optimizer to use. Called during configuration. + + + + + In certain cases we need to adjust the increment size based on the + selected optimizer. This is the hook to achieve that. + + The determined optimizer strategy. + The determined, unadjusted, increment size. + + + + Do we require a sequence with the ability to set initialValue and incrementSize + larger than 1? + + + + + An enhanced version of table-based id generation. + + + Unlike the simplistic legacy one (which, btw, was only ever intended for subclassing + support) we "segment" the table into multiple values. Thus a single table can + actually serve as the persistent storage for multiple independent generators. One + approach would be to segment the values by the name of the entity for which we are + performing generation, which would mean that we would have a row in the generator + table for each entity name. Or any configuration really; the setup is very flexible. + + In this respect it is very similar to the legacy + MultipleHiLoPerTableGenerator (not available in NHibernate) in terms of the + underlying storage structure (namely a single table capable of holding + multiple generator values). The differentiator is, as with + as well, the externalized notion + of an optimizer. + + + NOTE that by default we use a single row for all generators (based + on ). The configuration parameter + can be used to change that to + instead default to using a row for each entity name. + + Configuration parameters: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMEDEFAULTDESCRIPTION
The name of the table to use to store/retrieve values
The name of column which holds the sequence value for the given segment
The name of the column which holds the segment key
The value indicating which segment is used by this generator; refers to values in the column
The data length of the column; used for schema creation
The initial value to be stored for the given segment
The increment size for the underlying segment; see the discussion on for more details.
depends on defined increment sizeAllows explicit definition of which optimization strategy to use
+
+
+ + + Determine the table name to use for the generator values. Called during configuration. + + The parameters supplied in the generator config (plus some standard useful extras). + + + + Determine the name of the column used to indicate the segment for each + row. This column acts as the primary key. + Called during configuration. + + The parameters supplied in the generator config (plus some standard useful extras). + + + + Determine the name of the column in which we will store the generator persistent value. + Called during configuration. + + + + + Determine the segment value corresponding to this generator instance. Called during configuration. + + + + + Used in the cases where is unable to + determine the value to use. + + + + + Determine the size of the segment column. + Called during configuration. + + + + + Type mapping for the identifier. + + + + + The name of the table in which we store this generator's persistent state. + + + + + The name of the column in which we store the segment to which each row + belongs. The value here acts as primary key. + + + + + The value in the column identified by which + corresponds to this generator instance. In other words, this value + indicates the row in which this generator instance will store values. + + + + + The size of the column identified by + in the underlying table. + + + Should really have been called 'segmentColumnLength' or even better 'segmentColumnSize'. + + + + + The name of the column in which we store our persistent generator value. + + + + + The initial value to use when we find no previous state in the + generator table corresponding to this instance. + + + + + The amount of increment to use. The exact implications of this + depends on the optimizer being used, see . + + + + + The optimizer being used by this generator. This mechanism + allows avoiding calling the database each time a new identifier + is needed. + + + + + The table access count. Only really useful for unit test assertions. + + + + + Describes a table used to mimic sequence behavior + + + + + Abstract InsertGeneratedIdentifierDelegate implementation where the + underlying strategy causes the generated identitifer to be returned as an + effect of performing the insert statement. Thus, there is no need for an + additional sql statement to determine the generated identitifer. + + + + + Responsible for handling delegation relating to variants in how + insert-generated-identifier generator strategies dictate processing: +
    +
  • building the sql insert statement
  • +
  • determination of the generated identifier value
  • +
+
+
+ + + Build a specific to the delegate's mode + of handling generated key values. + + The insert object. + + + + Perform the indicated insert SQL statement and determine the identifier value generated. + + + + + The generated identifier value. + + + + Abstract InsertGeneratedIdentifierDelegate implementation where the + underlying strategy requires an subsequent select after the insert + to determine the generated identifier. + + + + Extract the generated key value from the given result set. + The session + The result set containing the generated primay key values. + The entity being saved. + The generated identifier + + + Bind any required parameter values into the SQL command . + The session + The prepared command + The entity being saved. + + + Get the SQL statement to be used to retrieve generated key values. + The SQL command string + + + + Types of any required parameter values into the SQL command . + + + + + Nothing more than a distinguishing subclass of Insert used to indicate + intent. + Some subclasses of this also provided some additional + functionality or semantic to the genernated SQL statement string. + + + + + A class that builds an INSERT sql statement. + + + + + + + + Builds a SqlString from the internal data. + + A valid SqlString that can be converted into an IDbCommand + + + + Adds the Property's columns to the INSERT sql + + The column name for the Property + The IType of the property. + The SqlInsertBuilder. + The column will be associated with a parameter. + + + + Add a column with a specific value to the INSERT sql + + The name of the Column to add. + The value to set for the column. + The NHibernateType to use to convert the value to a sql string. + The SqlInsertBuilder. + + + + Add a column with a specific value to the INSERT sql + + The name of the Column to add. + A valid sql string to set as the value of the column. + The SqlInsertBuilder. + + + + Specialized IdentifierGeneratingInsert which appends the database + specific clause which signifies to return generated IDENTITY values + to the end of the insert statement. + + + + + Disable comments on insert. + + + + + implementation where the + underlying strategy causes the generated identitifer to be returned, as an + effect of performing the insert statement, in a Output parameter. + Thus, there is no need for an additional sql statement to determine the generated identitifer. + + + + + Specialized IdentifierGeneratingInsert which appends the database + specific clause which signifies to return generated identifier values + to the end of the insert statement. + + + + + + + The IdentityGenerator for autoincrement/identity key generation. + + The this id is being generated in. + The entity the id is being generated for. + + IdentityColumnIndicator Indicates to the Session that identity (i.e. identity/autoincrement column) + key generation should be used. + + + + + An that returns the current identifier + assigned to an instance. + + +

+ This id generation strategy is specified in the mapping file as + <generator class="assigned" /> +

+
+
+ + + Generates a new identifier by getting the value of the identifier + for the obj parameter. + + The this id is being generated in. + The entity for which the id is being generated. + The value that was assigned to the mapped id's property. + + Thrown when a is passed in as the obj or + if the identifier of obj is null. + + + + + An that returns a Int64 constructed from the system + time and a counter value. Not safe for use in a clustser! + + + + + An that uses the value of + the id property of an associated object + + + + This id generation strategy is specified in the mapping file as + + <generator class="foreign"> + <param name="property">AssociatedObject</param> + </generator> + + + The mapping parameter property is required. + + + + + Generates an identifer from the value of a Property. + + The this id is being generated in. + The entity for which the id is being generated. + + The identifier value from the associated object or + if the session + already contains obj. + + + + + Configures the ForeignGenerator by reading the value of property + from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + Thrown if the key property is not found in the parms parameter. + + + + + An that generates values + using a strategy suggested Jimmy Nilsson's + article + on informit.com. + + +

+ This id generation strategy is specified in the mapping file as + <generator class="guid.comb" /> +

+

+ The comb algorithm is designed to make the use of GUIDs as Primary Keys, Foreign Keys, + and Indexes nearly as efficient as ints. +

+

+ This code was contributed by Donald Mull. +

+
+
+ + + Generate a new using the comb algorithm. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a . + + + + Generate a new using the comb algorithm. + + + + + An that generates values + using Guid.NewGuid(). + + +

+ This id generation strategy is specified in the mapping file as + <generator class="guid" /> +

+
+
+ + + Generate a new for the identifier. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a . + + + + Thrown by implementation class when ID generation fails + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Factory methods for IdentifierGenerator framework. + + +

The built in strategies for identifier generation in NHibernate are:

+ + + strategy + Implementation of strategy + + + assigned + + + + counter + + + + foreign + + + + guid + + + + guid.comb + + + + guid.native + + + + hilo + + + + identity + + + + native + + Chooses between , + , and based on the + 's capabilities. + + + + seqhilo + + + + sequence + + + + enhanced-sequence + + + + uuid.hex + + + + uuid.string + + + +
+
+ + Get the generated identifier when using identity columns + The to read the identifier value from. + The the value should be converted to. + The the value is retrieved in. + The value for the identifier. + + + + Gets the value of the identifier from the and + ensures it is the correct . + + The to read the identifier value from. + The the value should be converted to. + The the value is retrieved in. + + The value for the identifier. + + + Thrown if there is any problem getting the value from the + or with converting it to the . + + + + + An where the key is the strategy and + the value is the for the strategy. + + + + + When this is returned by Generate() it indicates that the object + has already been saved. + + + String.Empty + + + + + When this is return + + + + + Initializes the static fields in . + + + + + Creates an from the named strategy. + + + The name of the generator to create. This can be one of the NHibernate abbreviations (ie - native, + sequence, guid.comb, etc...), a full class name if the Type is in the NHibernate assembly, or + a full type name if the strategy is in an external assembly. + + The that the retured identifier should be. + An of <param> values from the mapping. + The to help with Configuration. + + An instantiated and configured . + + + Thrown if there are any exceptions while creating the . + + + + + Create the correct boxed for the identifier. + + The value of the new identifier. + The the identifier should be. + + The identifier value converted to the . + + + The type parameter must be an , , + or . + + + + + An that indicates to the that identity + (ie. identity/autoincrement column) key generation should be used. + + +

+ This id generation strategy is specified in the mapping file as + <generator class="identity" /> + or if the database natively supports identity columns + <generator class="native" /> +

+

+ This indicates to NHibernate that the database generates the id when + the entity is inserted. +

+
+
+ + + Delegate for dealing with IDENTITY columns where the dialect supports returning + the generated IDENTITY value directly from the insert statement. + + + + + Delegate for dealing with IDENTITY columns where the dialect requires an + additional command execution to retrieve the generated IDENTITY value + + + + The configuration parameter holding the entity name + + + + An IIdentifierGenerator that returns a Int64, constructed by + counting from the maximum primary key value at startup. Not safe for use in a + cluster! + + + + java author Gavin King, .NET port Mark Holden + + + Mapping parameters supported, but not usually needed: table, column. + + + + + + + + + + + + + + + + + + + + + The configuration parameter holding the schema name + + + + The configuration parameter holding the table name for the + generated id + + + + + The configuration parameter holding the table names for all + tables for which the id must be unique + + + + + The configuration parameter holding the primary key column + name of the generated id + + + + The configuration parameter holding the catalog name + + + + A persister that may have an identity assigned by execution of a SQL INSERT. + + + + + Get a SQL select string that performs a select based on a unique + key determined by the given property name). + + + The name of the property which maps to the + column(s) to use in the select statement restriction. + + The SQL select string + + + + Get the database-specific SQL command to retrieve the last + generated IDENTITY value. + + + + The names of the primary key columns in the root table. + The primary key column names. + + + + Get the identifier type + + + + + Generates Guid values using the server side Guid function. + + + + + A generator that selects the just inserted row to determine the identifier + value assigned by the database. The correct row is located using a unique key. + + One mapping parameter is required: key (unless a natural-id is defined in the mapping). + + + The delegate for the select generation strategy. + + + + An that generates Int64 values using an + oracle-style sequence. A higher performance algorithm is + . + + +

+ This id generation strategy is specified in the mapping file as + + <generator class="sequence"> + <param name="sequence">uid_sequence</param> + <param name="schema">db_schema</param> + </generator> + +

+

+ The sequence parameter is required while the schema is optional. +

+
+
+ + + The name of the sequence parameter. + + + + + The parameters parameter, appended to the create sequence DDL. + For example (Oracle): INCREMENT BY 1 START WITH 1 MAXVALUE 100 NOCACHE. + + + + + Configures the SequenceGenerator by reading the value of sequence and + schema from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Generate an , , or + for the identifier by using a database sequence. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a , , or . + + + + The SQL required to create the database objects for a SequenceGenerator. + + The to help with creating the sql. + + An array of objects that contain the Dialect specific sql to + create the necessary database objects for the SequenceGenerator. + + + + + The SQL required to remove the underlying database objects for a SequenceGenerator. + + The to help with creating the sql. + + A that will drop the database objects for the SequenceGenerator. + + + + + Return a key unique to the underlying database objects for a SequenceGenerator. + + + The configured sequence name. + + + + + An that combines a hi/lo algorithm with an underlying + oracle-style sequence that generates hi values. + + +

+ This id generation strategy is specified in the mapping file as + + <generator class="seqhilo"> + <param name="sequence">uid_sequence</param> + <param name="max_lo">max_lo_value</param> + <param name="schema">db_schema</param> + </generator> + +

+

+ The sequence parameter is required, the max_lo and schema are optional. +

+

+ The user may specify a max_lo value to determine how often new hi values are + fetched. If sequences are not avaliable, TableHiLoGenerator might be an + alternative. +

+
+
+ + + The name of the maximum low value parameter. + + + + + Configures the SequenceHiLoGenerator by reading the value of sequence, max_lo, + and schema from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Generate an , , or + for the identifier by using a database sequence. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a , , or . + + + + A generator which combines sequence generation with immediate retrieval + by attaching a output parameter to the SQL command + In this respect it works much like ANSI-SQL IDENTITY generation. + + + + + An that uses a database table to store the last + generated value. + + +

+ It is not intended that applications use this strategy directly. However, + it may be used to build other (efficient) strategies. The return type is + System.Int32 +

+

+ The hi value MUST be fetched in a separate transaction to the ISession + transaction so the generator must be able to obtain a new connection and commit it. + Hence this implementation may not be used when the user is supplying connections. +

+

+ The mapping parameters table and column are required. +

+
+
+ + + An additional where clause that is added to + the queries against the table. + + + + + The name of the column parameter. + + + + + The name of the table parameter. + + + + Default column name + + + Default table name + + + + Configures the TableGenerator by reading the value of table, + column, and schema from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Generate a , , or + for the identifier by selecting and updating a value in a table. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a , , or . + + + + The SQL required to create the database objects for a TableGenerator. + + The to help with creating the sql. + + An array of objects that contain the Dialect specific sql to + create the necessary database objects and to create the first value as 1 + for the TableGenerator. + + + + + The SQL required to remove the underlying database objects for a TableGenerator. + + The to help with creating the sql. + + A that will drop the database objects for the TableGenerator. + + + + + Return a key unique to the underlying database objects for a TableGenerator. + + + The configured table name. + + + + + An that returns an Int64, constructed using + a hi/lo algorithm. + + +

+ This id generation strategy is specified in the mapping file as + + <generator class="hilo"> + <param name="table">table</param> + <param name="column">id_column</param> + <param name="max_lo">max_lo_value</param> + <param name="schema">db_schema</param> + </generator> + +

+

+ The table and column parameters are required, the max_lo and + schema are optional. +

+

+ The hi value MUST be fecthed in a separate transaction to the ISession + transaction so the generator must be able to obtain a new connection and + commit it. Hence this implementation may not be used when the user is supplying + connections. In that case a would be a + better choice (where supported). +

+
+
+ + + The name of the max lo parameter. + + + + + Configures the TableHiLoGenerator by reading the value of table, + column, max_lo, and schema from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Generate a for the identifier by selecting and updating a value in a table. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a . + + + + An that returns a string of length + 32, 36, or 38 depending on the configuration. + + +

+ This id generation strategy is specified in the mapping file as + + <generator class="uuid.hex"> + <param name="format">format_string</param> + <param name="seperator">seperator_string</param> + </generator> + +

+

+ The format and seperator parameters are optional. +

+

+ The identifier string will consist of only hex digits. Optionally, the identifier string + may be generated with enclosing characters and seperators between each component + of the UUID. If there are seperators then the string length will be 36. If a format + that has enclosing brackets is used, then the string length will be 38. +

+

+ format is either + "N" (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx), + "D" (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), + "B" ({xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}), + or "P" ((xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)). These formats are described in + the Guid.ToString(String) method. + If no format is specified the default is "N". +

+

+ seperator is the char that will replace the "-" if specified. If no value is + configured then the default seperator for the format will be used. If the format "D", "B", or + "P" is specified, then the seperator will replace the "-". If the format is "N" then this + parameter will be ignored. +

+

+ This class is based on +

+
+
+ + + Generate a new for the identifier using the "uuid.hex" algorithm. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a . + + + + Configures the UUIDHexGenerator by reading the value of format and + seperator from the parms parameter. + + The the identifier should be. + An of Param values that are keyed by parameter name. + The to help with Configuration. + + + + Generate a Guid into a string using the format. + + A new Guid string + + + + An that returns a string of length + 16. + + +

+ This id generation strategy is specified in the mapping file as + <generator class="uuid.string" /> +

+ + The identifier string will NOT consist of only alphanumeric characters. Use + this only if you don't mind unreadable identifiers. + + + This impelementation was known to be incompatible with Postgres. + +
+
+ + + Generate a new for the identifier using the "uuid.string" algorithm. + + The this id is being generated in. + The entity for which the id is being generated. + The new identifier as a . + + + + Base class to create queries in "detached mode" where the NHibernate session is not available. + + + + + The behaviour of each method is basically the same of methods. + The main difference is on : + If you mix with named parameters setter, if same param name are found, + the value of the parameter setter override the value read from the POCO. + + + + + Interface to create queries in "detached mode" where the NHibernate session is not available. + All methods have the same semantics as the corresponding methods of the interface. + + + + + Get an executable instance of , + to actually run the query. + + + + Set the maximum number of rows to retrieve. + + The maximum number of rows to retreive. + + + + Sets the first row to retrieve. + + The first row to retreive. + + + + Enable caching of this query result set. + + Should the query results be cacheable? + + + Set the name of the cache region. + The name of a query cache region, or + for the default query cache + + + + Entities retrieved by this query will be loaded in + a read-only mode where Hibernate will never dirty-check + them or make changes persistent. + + Enable/Disable read -only mode + + + + The timeout for the underlying ADO query + + + + + Set a fetch size for the underlying ADO query. + the fetch size + + + + Set the lockmode for the objects idententified by the + given alias that appears in the FROM clause. + + alias a query alias, or this for a collection filter + + + + Add a comment to the generated SQL. + a human-readable string + + + + Bind a value to an indexed parameter. + + Position of the parameter in the query, numbered from 0 + The possibly null parameter value + The Hibernate type + + + + Bind a value to a named query parameter + + The name of the parameter + The possibly null parameter value + The NHibernate . + + + + Bind a value to an indexed parameter, guessing the Hibernate type from + the class of the given object. + + The position of the parameter in the query, numbered from 0 + The non-null parameter value + + + + Bind a value to a named query parameter, guessing the NHibernate + from the class of the given object. + + The name of the parameter + The non-null parameter value + + + + Bind multiple values to a named query parameter. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + The Hibernate type of the values + + + + Bind multiple values to a named query parameter, guessing the Hibernate + type from the class of the first object in the collection. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + + + + Bind the property values of the given object to named parameters of the query, + matching property names with parameter names and mapping property types to + Hibernate types using heuristics. + + Any POCO + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a array to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a array. + + + + Bind an instance of a array to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a array. + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + A non-null instance of a . + The name of the parameter + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a mapped persistent class to an indexed parameter. + + Position of the parameter in the query string, numbered from 0 + A non-null instance of a persistent class + + + + Bind an instance of a mapped persistent class to a named parameter. + + The name of the parameter + A non-null instance of a persistent class + + + + Bind an instance of a persistent enumeration class to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a persistent enumeration + + + + Bind an instance of a persistent enumeration class to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a persistent enumeration + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + An instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + An instance of a . + + + + Override the current session flush mode, just for this query. + + + + + Set a strategy for handling the query results. This can be used to change + "shape" of the query result. + + + + + Set the value to ignore unknown parameters names. + + True to ignore unknown parameters names. + + + Override the current session cache mode, just for this query. + The cache mode to use. + this (for method chaining) + + + + Interface for DetachedQuery implementors. + + + When you are working with queries in "detached mode" you may need some additional services like clone, + copy of parameters from another query and so on. + + + + + Copy all properties to a given . + + The given . + + Usually the implementation use to set properties to the . + This mean that existing properties are merged/overriden. + + + + + Set only parameters to a given . + + The given . + + Existing parameters are merged/overriden. + + + + + Override all properties reading new values from a given . + + The given origin. + + + + Override all parameters reading new values from a given . + + The given origin. + + + Override the current session cache mode, just for this query. + The cache mode to use. + this (for method chaining) + + + + Fill all properties. + + The . + + Query properties are overriden/merged. + + + + + Copy all properties to a given . + + The given . + + The method use to set properties of . + + + + + Set only parameters to a given . + + The given . + + The method use to set properties of . + Existing parameters in are merged/overriden. + + + + + Clear all existing parameters and copy new parameters from a given origin. + + The origin of parameters. + The current instance + If is null. + + + + Abstract implementation of the IQuery interface. + + + + + An object-oriented representation of a NHibernate query. + + + An IQuery instance is obtained by calling . + Key features of this interface include: + + + Paging: A particular page of the result set may be selected by calling + , . The generated SQL + depends on the capabilities of the . Some + Dialects are for databases that have built in paging (LIMIT) and those capabilities + will be used to limit the number of records returned by the SQL statement. + If the database does not support LIMITs then all of the records will be returned, + but the objects created will be limited to the specific results requested. + + + Named parameters + + + Ability to return 'read-only' entities + + + + Named query parameters are tokens of the form :name in the query string. For example, a + value is bound to the Int32 parameter :foo by calling: + + SetParameter("foo", foo, NHibernateUtil.Int32); + + A name may appear multiple times in the query string. + + + Unnamed parameters ? are also supported. To bind a value to an unnamed + parameter use a Set method that accepts an Int32 positional argument - numbered from + zero. + + + You may not mix and match unnamed parameters and named parameters in the same query. + + + Queries are executed by calling or . A query + may be re-executed by subsequent invocations. Its lifespan is, however, bounded by the lifespan + of the ISession that created it. + + + Implementors are not intended to be threadsafe. + + + + + + Return the query results as an . If the query contains multiple results + per row, the results are returned in an instance of object[]. + + +

+ Entities returned as results are initialized on demand. The first SQL query returns + identifiers only. +

+

+ This is a good strategy to use if you expect a high number of the objects + returned to be already loaded in the or in the 2nd level cache. +

+
+
+ + + Strongly-typed version of . + + + + + + + Return the query results as an . If the query contains multiple results per row, + the results are returned in an instance of object[]. + + The filled with the results. + + This is a good strategy to use if you expect few of the objects being returned are already loaded + or if you want to fill the 2nd level cache. + + + + + Return the query results an place them into the . + + The to place the results in. + + + + Strongly-typed version of . + + + + + Convenience method to return a single instance that matches + the query, or null if the query returns no results. + + the single result or + + Thrown when there is more than one matching result. + + + + + Strongly-typed version of . + + + + + Execute the update or delete statement. + + The number of entities updated or deleted. + + + + Set the maximum number of rows to retrieve. + + The maximum number of rows to retreive. + + + + Sets the first row to retrieve. + + The first row to retreive. + + + + Set the read-only mode for entities (and proxies) loaded by this query. This setting + overrides the default setting for the session (see ). + + + + Read-only entities can be modified, but changes are not persisted. They are not + dirty-checked and snapshots of persistent state are not maintained. + + + When a proxy is initialized, the loaded entity will have the same read-only setting + as the uninitialized proxy, regardless of the session's current setting. + + + The read-only setting has no impact on entities or proxies returned by the criteria + that existed in the session before the criteria was executed. + + + + If true, entities (and proxies) loaded by the query will be read-only. + + this (for method chaining) + + + + + Enable caching of this query result set. + + Should the query results be cacheable? + + + Set the name of the cache region. + The name of a query cache region, or + for the default query cache + + + + The timeout for the underlying ADO query + + + + + Set a fetch size for the underlying ADO query. + the fetch size + + + + Set the lockmode for the objects idententified by the + given alias that appears in the FROM clause. + + alias a query alias, or this for a collection filter + + + + Add a comment to the generated SQL. + a human-readable string + + + + Override the current session flush mode, just for this query. + + + + Override the current session cache mode, just for this query. + The cache mode to use. + this (for method chaining) + + + + Bind a value to an indexed parameter. + + Position of the parameter in the query, numbered from 0 + The possibly null parameter value + The NHibernate type + + + + Bind a value to a named query parameter + + The name of the parameter + The possibly null parameter value + The NHibernate . + + + + Bind a value to an indexed parameter. + + Position of the parameter in the query, numbered from 0 + The possibly null parameter value + The parameter's + + + + Bind a value to a named query parameter + + The name of the parameter + The possibly null parameter value + The parameter's + + + + Bind a value to an indexed parameter, guessing the NHibernate type from + the class of the given object. + + The position of the parameter in the query, numbered from 0 + The non-null parameter value + + + + Bind a value to a named query parameter, guessing the NHibernate + from the class of the given object. + + The name of the parameter + The non-null parameter value + + + + Bind multiple values to a named query parameter. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + The NHibernate type of the values + + + + Bind multiple values to a named query parameter, guessing the NHibernate + type from the class of the first object in the collection. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + + + + Bind the property values of the given object to named parameters of the query, + matching property names with parameter names and mapping property types to + NHibernate types using heuristics. + + Any PONO + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a array to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a array. + + + + Bind an instance of a array to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a array. + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + A non-null instance of a . + The name of the parameter + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a persistent enumeration class to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a persistent enumeration + + + + Bind an instance of a persistent enumeration class to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a persistent enumeration + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to an indexed parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The position of the parameter in the query string, numbered from 0 + An instance of a . + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + An instance of a . + + + + Bind an instance of a mapped persistent class to an indexed parameter. + + Position of the parameter in the query string, numbered from 0 + A non-null instance of a persistent class + + + + Bind an instance of a mapped persistent class to a named parameter. + + The name of the parameter + A non-null instance of a persistent class + + + + Set a strategy for handling the query results. This can be used to change + "shape" of the query result. + + + + + Get a enumerable that when enumerated will execute + a batch of queries in a single database roundtrip + + + + + + + Get an IFutureValue instance, whose value can be retrieved through + its Value property. The query is not executed until the Value property + is retrieved, which will execute other Future queries as well in a + single roundtrip + + + + + + + The query string + + + + + The NHibernate types of the query result set. + + + + Return the HQL select clause aliases (if any) + An array of aliases as strings + + + + The names of all named parameters of the query + + The parameter names, in no particular order + + + + Will entities (and proxies) returned by the query be loaded in read-only mode? + + + + If the query's read-only setting is not initialized (with ), + the value of the session's property is + returned instead. + + + The value of this property has no effect on entities or proxies returned by the + query that existed in the session before the query was executed. + + + + true if entities and proxies loaded by the query will be put in read-only mode, otherwise false. + + + + + + Perform parameter validation. Used prior to executing the encapsulated query. + + + if true, the first ? will not be verified since + its needed for e.g. callable statements returning a out parameter + + + + + Guesses the from the param's value. + + The object to guess the of. + An for the object. + + Thrown when the param is null because the + can't be guess from a null value. + + + + + Guesses the from the . + + The to guess the of. + An for the . + + Thrown when the clazz is null because the + can't be guess from a null type. + + + + + Warning: adds new parameters to the argument by side-effect, as well as mutating the query string! + + + + + Warning: adds new parameters to the argument by side-effect, as well as mutating the query string! + + + + + + + Override the current session cache mode, just for this query. + + The cache mode to use. + this (for method chaining) + + + + + + Functionality common to stateless and stateful sessions + + + + Implementation of the interface for collection filters. + + + + + Default implementation of the , + for "ordinary" HQL queries (not collection filters) + + + + + + Implementation of the interface + + + + + Criteria is a simplified API for retrieving entities by composing + objects. + + + + Using criteria is a very convenient approach for functionality like "search" screens + where there is a variable number of conditions to be placed upon the result set. + + + The Session is a factory for ICriteria. Expression instances are usually obtained via + the factory methods on . eg: + + + IList cats = session.CreateCriteria(typeof(Cat)) + .Add(Expression.Like("name", "Iz%")) + .Add(Expression.Gt("weight", minWeight)) + .AddOrder(Order.Asc("age")) + .List(); + + You may navigate associations using + or . eg: + + IList<Cat> cats = session.CreateCriteria<Cat> + .CreateCriteria("kittens") + .Add(Expression.like("name", "Iz%")) + .List<Cat>(); + + + You may specify projection and aggregation using Projection instances obtained + via the factory methods on Projections. eg: + + IList<Cat> cats = session.CreateCriteria<Cat> + .SetProjection( + Projections.ProjectionList() + .Add(Projections.RowCount()) + .Add(Projections.Avg("weight")) + .Add(Projections.Max("weight")) + .Add(Projections.Min("weight")) + .Add(Projections.GroupProperty("color"))) + .AddOrder(Order.Asc("color")) + .List<Cat>(); + + + + + + + Used to specify that the query results will be a projection (scalar in + nature). Implicitly specifies the projection result transformer. + + The projection representing the overall "shape" of the + query results. + This instance (for method chaining) + + + The individual components contained within the given + determines the overall "shape" of the query result. + + + + + + Add an Expression to constrain the results to be retrieved. + + + + + + + An an Order to the result set + + + + + + Specify an association fetching strategy. Currently, only + one-to-many and one-to-one associations are supported. + + A dot separated property path. + The Fetch mode. + + + + + Set the lock mode of the current entity + + the lock mode + + + + + Set the lock mode of the aliased entity + + an alias + the lock mode + + + + + Join an association, assigning an alias to the joined entity + + + + + + + + Join an association using the specified join-type, assigning an alias to the joined + association + + + + The type of join to use. + this (for method chaining) + + + + Join an association using the specified join-type, assigning an alias to the joined + association + + + + The type of join to use. + The criteria to be added to the join condition (ON clause) + this (for method chaining) + + + + Create a new , "rooted" at the associated entity + + + + + + + Create a new , "rooted" at the associated entity, + using the specified join type. + + A dot-separated property path + The type of join to use + The created "sub criteria" + + + + Create a new , "rooted" at the associated entity, + assigning the given alias + + + + + + + + Create a new , "rooted" at the associated entity, + assigning the given alias and using the specified join type. + + A dot-separated property path + The alias to assign to the joined association (for later reference). + The type of join to use. + The created "sub criteria" + + + + Create a new , "rooted" at the associated entity, + assigning the given alias and using the specified join type. + + A dot-separated property path + The alias to assign to the joined association (for later reference). + The type of join to use. + The criteria to be added to the join condition (ON clause) + The created "sub criteria" + + + + Set a strategy for handling the query results. This determines the + "shape" of the query result set. + + + + + + + + + + Set a limit upon the number of objects to be retrieved + + + + + + Set the first result to be retrieved + + + + + Set a fetch size for the underlying ADO query. + the fetch size + this (for method chaining) + + + + Set a timeout for the underlying ADO.NET query + + + + + + + Enable caching of this query result set + + + + + + + Set the name of the cache region. + + the name of a query cache region, or + for the default query cache + + + + Add a comment to the generated SQL. + a human-readable string + this (for method chaining) + + + Override the flush mode for this particular query. + The flush mode to use. + this (for method chaining) + + + Override the cache mode for this particular query. + The cache mode to use. + this (for method chaining) + + + + Get the results + + + + + + Convenience method to return a single instance that matches + the query, or null if the query returns no results. + + the single result or + + If there is more than one matching result + + + + + Get a enumerable that when enumerated will execute + a batch of queries in a single database roundtrip + + + + + + + Get an IFutureValue instance, whose value can be retrieved through + its Value property. The query is not executed until the Value property + is retrieved, which will execute other Future queries as well in a + single roundtrip + + + + + + + Set the read-only mode for entities (and proxies) loaded by this Criteria. This + setting overrides the default for the session (see ). + + + + To set the default read-only setting for entities and proxies that are loaded + into the session, see . + + + Read-only entities can be modified, but changes are not persisted. They are not + dirty-checked and snapshots of persistent state are not maintained. + + + When a proxy is initialized, the loaded entity will have the same read-only setting + as the uninitialized proxy has, regardless of the session's current setting. + + + The read-only setting has no impact on entities or proxies returned by the criteria + that existed in the session before the criteria was executed. + + + + If true, entities (and proxies) loaded by the criteria will be read-only. + + this (for method chaining) + + + + + + Get the results and fill the + + The list to fill with the results. + + + + Strongly-typed version of . + + + + + Strongly-typed version of . + + + + + Clear all orders from criteria. + + + + + Allows to get a sub criteria by path. + Will return null if the criteria does not exists. + + The path. + + + + Alows to get a sub criteria by alias. + Will return null if the criteria does not exists + + The alias. + + + + + Gets the root entity type if available, throws otherwise + + + This is an NHibernate specific method, used by several dependent + frameworks for advance integration with NHibernate. + + + + + Get the alias of the entity encapsulated by this criteria instance. + + The alias for the encapsulated entity. + + + + Was the read-only mode explicitly initialized? + + true if the read-only mode was explicitly initialized, otherwise false. + + /// + + + + Will entities (and proxies) loaded by this Criteria be put in read-only mode? + + + + If the read-only setting was not initialized, then the value of the session's + property is returned instead. + + + The read-only setting has no impact on entities or proxies returned by the + Criteria that existed in the session before the Criteria was executed. + + + + true if entities and proxies loaded by the criteria will be put in read-only mode, + otherwise false. + + + + + + + + + Override the cache mode for this particular query. + The cache mode to use. + this (for method chaining) + + + + + + + + + Override the cache mode for this particular query. + The cache mode to use. + this (for method chaining) + + + + The Clone is supported only by a root criteria. + + The clone of the root criteria. + + + + Named query in "detached mode" where the NHibernate session is not available. + + + + + + + + + Create a new instance of for a named query string defined in the mapping file. + + The name of a query defined externally. + + The query can be either in HQL or SQL format. + + + + + Get an executable instance of , to actually run the query. + + + + + Creates a new DetachedNamedQuery that is a deep copy of the current instance. + + The clone. + + + + Get the query name. + + + + + Query in "detached mode" where the NHibernate session is not available. + + + + + + + + Create a new instance of for the given query string. + + A hibernate query string + + + + Get an executable instance of , to actually run the query. + + + + + Creates a new DetachedQuery that is a deep copy of the current instance. + + The clone. + + + + Get the HQL string. + + + + + Provides an wrapper over the results of an . + + + This is the IteratorImpl in H2.0.3 + + + + + Create an wrapper over an . + + The to enumerate over. + The used to create the . + The to use to load objects. + + The s contained in the . + The names of the columns in the . + The that should be applied to the . + Instantiator of the result holder (used for "select new SomeClass(...)" queries). + + The should already be positioned on the first record in . + + + + + Returns an enumerator that can iterate through the query results. + + + An that can be used to iterate through the query results. + + + + + Advances the enumerator to the next element of the query results. + + + if the enumerator was successfully advanced to the next query results + ; if the enumerator has passed the end of the query results. + + + + + A flag to indicate if Dispose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this EnumerableImpl is being Disposed of or Finalized. + + The command is closed and the reader is disposed. This allows other ADO.NET + related actions to occur without needing to move all the way through the + EnumerableImpl. + + + + + Gets the current element in the query results. + + + The current element in the query results which is either an object or + an object array. + + + If the only returns one type of Entity then an object will + be returned. If this is a multi-column resultset then an object array will be + returned. + + + + + Subquery type enumeration + + + + exact + + + all + + + some + + + + Converts lambda expressions to NHibernate criterion/order + + + + + Invoke the expression to extract its runtime value + + + + + Retrieves the projection for the expression + + + + + Retrieves the name of the property from a member expression + + An expression tree that can contain either a member, or a conversion from a member. + If the member is referenced from a null valued object, then the container is treated as an alias. + The name of the member property + + + + Retrieves the name of the property from a member expression (without leading member access) + + + + + Retrieves a detached criteria from an appropriate lambda expression + + Expresson for detached criteria using .As<>() extension"/> + Evaluated detached criteria + + + + Convert a lambda expression to NHibernate ICriterion + + The type of the lambda expression + The lambda expression to convert + NHibernate ICriterion + + + + Convert a lambda expression to NHibernate ICriterion + + The lambda expression to convert + NHibernate ICriterion + + + + Convert a lambda expression to NHibernate Order + + The type of the lambda expression + The lambda expression to convert + The appropriate order delegate (order direction) + NHibernate Order + + + + Convert a lambda expression to NHibernate Order + + The lambda expression to convert + The appropriate order delegate (order direction) + NHibernate Order + + + + Convert a lambda expression to NHibernate Order + + The lambda expression to convert + The appropriate order delegate (order direction) + NHibernate Order + + + + Convert a lambda expression to NHibernate Order + + The lambda expression to convert + The appropriate order delegate (order direction) + The appropriate order delegate (order direction) + NHibernate Order + + + + Convert a lambda expression to NHibernate subquery AbstractCriterion + + type of member expression + type of subquery + lambda expression to convert + NHibernate.ICriterion.AbstractCriterion + + + + Convert a lambda expression to NHibernate subquery AbstractCriterion + + type of subquery + lambda expression to convert + NHibernate.ICriterion.AbstractCriterion + + + + Register a custom method for use in a QueryOver expression + + Lambda expression demonstrating call of custom method + function to convert MethodCallExpression to ICriterion + + + + Register a custom projection for use in a QueryOver expression + + Lambda expression demonstrating call of custom method + function to convert MethodCallExpression to IProjection + + + + Retreive the property name from a supplied PropertyProjection + Note: throws is the supplied IProjection is not a PropertyProjection + + + + + Warning: adds new parameters to the argument by side-effect, as well as mutating the query expression tree! + + + + + + + + + Type definition of Filter. Filter defines the user's view into enabled dynamic filters, + allowing them to set filter parameter values. + + + + + Set the named parameter's value list for this filter. + + The parameter's name. + The values to be applied. + This FilterImpl instance (for method chaining). + + + + Set the named parameter's value list for this filter. Used + in conjunction with IN-style filter criteria. + + The parameter's name. + The values to be expanded into an SQL IN list. + This FilterImpl instance (for method chaining). + + + + Set the named parameter's value list for this filter. Used + in conjunction with IN-style filter criteria. + + The parameter's name. + The values to be expanded into an SQL IN list. + This FilterImpl instance (for method chaining). + + + + Perform validation of the filter state. This is used to verify the + state of the filter after its enablement and before its use. + + + + + + Get the name of this filter. + + This filter's name. + + + + Get the filter definition containing additional information about the + filter (such as default-condition and expected parameter names/types). + + The filter definition + + + + Set the named parameter's value for this filter. + + The parameter's name. + The value to be applied. + This FilterImpl instance (for method chaining). + + + + Set the named parameter's value list for this filter. Used + in conjunction with IN-style filter criteria. + + The parameter's name. + The values to be expanded into an SQL IN list. + This FilterImpl instance (for method chaining). + + + + Set the named parameter's value list for this filter. Used + in conjunction with IN-style filter criteria. + + The parameter's name. + The values to be expanded into an SQL IN list. + This FilterImpl instance (for method chaining). + + + + Perform validation of the filter state. This is used to verify the + state of the filter after its enablement and before its use. + + + + + Get the name of this filter. + + + + + Helper methods for rendering log messages and exception messages + + + + + Generate small message that can be used in traces and exception messages. + + The to create the string from. + The identifier of the object. + A descriptive in the format of [classname#id] + + + + Generate small message that can be used in traces and exception messages. + + The for the class in question. + The identifier of the object. + The . + A descriptive in the format of [classname#id] + + + + Generate small message that can be used in traces and exception messages. + + The for the class in question. + The identifier of the object. + The . + The NHibernate type of the identifier. + A descriptive in the format of [classname#id] + + + + Generate small message that can be used in traces and exception messages. + + The for the class in question + The id + A descriptive in the form [FooBar#id] + + + + Generate small message that can be used in traces and exception messages. + + The for the class in question + A descriptive in the form [FooBar] + + + + Generate small message that can be used in traces and exception messages. + + The for the class in question + The id + A descriptive in the form [collectionrole#id] + + + + Generate an info message string relating to a given property value + for an entity. + + The entity name + The name of the property + The property value. + An info string, in the form [Foo.bars#1] + + + + Generate an info message string relating to a particular managed + collection. + + The persister for the collection + The id value of the owner + The session factory + An info string, in the form [Foo.bars#1] + + + + Generate an info message string relating to a particular entity, + based on the given entityName and id. + + The defined entity name. + The entity id value. + An info string, in the form [FooBar#1]. + + + + Combines several queries into a single DB call + + + + + Get all the results + + + + + Adds the specified criteria to the query. The result will be contained in a + + Return results in a + The criteria. + + + + + Adds the specified criteria to the query. The result will be contained in a + + The criteria. + + + + + Adds the specified criteria to the query, and associates it with the given key. The result will be contained in a + + The key + The criteria + + + + + Adds the specified detached criteria. The result will be contained in a + + The detached criteria. + + + + + Adds the specified detached criteria, and associates it with the given key. The result will be contained in a + + The key + The detached criteria + + + + + Adds the specified criteria to the query + + The criteria. + + + + + Adds the specified criteria to the query, and associates it with the given key + + The key + The criteria + + + + + Adds the specified detached criteria. + + The detached criteria. + + + + + Adds the specified detached criteria, and associates it with the given key + + The key + The detached criteria + + + + + Adds the specified IQueryOver to the query. The result will be contained in a + + Return results in a + The IQueryOver. + + + + + Adds the specified IQueryOver to the query. The result will be contained in a + + The IQueryOver. + + + + + Adds the specified IQueryOver to the query. The result will be contained in a + + The IQueryOver. + + + + + Adds the specified IQueryOver to the query, and associates it with the given key. The result will be contained in a + + The key + The IQueryOver + + + + + Adds the specified IQueryOver to the query, and associates it with the given key. The result will be contained in a + + The key + The IQueryOver + + + + + Sets whatevert this criteria is cacheable. + + if set to true [cachable]. + + + + Set the cache region for thie criteria + + The region + + + + + Force a cache refresh + + + + + + + Sets the result transformer for all the results in this mutli criteria instance + + The result transformer. + + + + + Returns the result of one of the Criteria based on the key + + The key + + + + + Initializes a new instance of the class. + + The session. + The factory. + + + Return a cacheable "disassembled" representation of the object. + the value to cache + the session + optional parent entity object (needed for collections) + the disassembled, deep cloned state + + + Reconstruct the object from its cached "disassembled" state. + the disassembled state from the cache + the session + the parent entity object + the the object + + + + Called before assembling a query result set from the query cache, to allow batch fetching + of entities missing from the second-level cache. + + + + + Combines sevaral queries into a single database call + + + + + Get all the results + + + The result is a IList of IList. + + + + + Adds the specified query to the query. The result will be contained in a + + Return results in a + The query. + The instance for method chain. + + + + Add the specified HQL query to the multi query. The result will be contained in a + + The query + + + + Add the specified HQL query to the multi query, and associate it with the given key. The result will be contained in a + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Add the specified HQL Query to the multi query, and associate it with the given key. The result will be contained in a + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Add the specified HQL query to the multi query. The result will be contained in a + + The query + The instance for method chain. + + + + Add a named query to the multi query. The result will be contained in a + + The query + The instance for method chain. + + + + Add a named query to the multi query, and associate it with the given key. The result will be contained in a + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Add the specified HQL query to the multi query, and associate it with the given key + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Add the specified HQL query to the multi query + + The query + The instance for method chain. + + + + Add the specified HQL Query to the multi query, and associate it with the given key + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Add the specified HQL query to the multi query + + The instance for method chain. + + + + Add a named query to the multi query + + The query + The instance for method chain. + + + + Add a named query to the multi query, and associate it with the given key + + The key to get results of the specific query. + The query + The instance for method chain. + + + + + Enable caching of this query result set. + + Should the query results be cacheable? + The instance for method chain. + + + Set the name of the cache region. + The name of a query cache region, or + for the default query cache + The instance for method chain. + + + Should the query force a refresh of the specified query cache region? + This is particularly useful in cases where underlying data may have been + updated via a separate process (i.e., not modified through Hibernate) and + allows the application to selectively refresh the query cache regions + based on its knowledge of those events. + Should the query result in a forcible refresh of + the query cache? + The instance for method chain. + + + + The timeout for the underlying ADO query + + + The instance for method chain. + + + + Bind a value to a named query parameter + + The name of the parameter + The possibly null parameter value + The NHibernate . + The instance for method chain. + + + + Bind a value to a named query parameter, guessing the NHibernate + from the class of the given object. + + The name of the parameter + The non-null parameter value + The instance for method chain. + + + + Bind multiple values to a named query parameter. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + The Hibernate type of the values + The instance for method chain. + + + + Bind multiple values to a named query parameter, guessing the Hibernate + type from the class of the first object in the collection. This is useful for binding a list + of values to an expression such as foo.bar in (:value_list) + + The name of the parameter + A collection of values to list + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a array to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a array. + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + A non-null instance of a . + The name of the parameter + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a mapped persistent class to a named parameter. + + The name of the parameter + A non-null instance of a persistent class + The instance for method chain. + + + + Bind an instance of a persistent enumeration class to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a persistent enumeration + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + An instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Bind an instance of a to a named parameter + using an NHibernate . + + The name of the parameter + A non-null instance of a . + The instance for method chain. + + + + Override the current session flush mode, just for this query. + + The instance for method chain. + + + + Set a strategy for handling the query results. This can be used to change + "shape" of the query result. + + + The will be applied after the transformer of each single query. + + The instance for method chain. + + + + Returns the result of one of the query based on the key + + The key + The instance for method chain. + + + + Return the query results of all the queries + + + + + + + an actual entity object, not a proxy! + + + + + + Concrete implementation of a SessionFactory. + + + Has the following responsibilities: + + + Caches configuration settings (immutably) + + Caches "compiled" mappings - ie. + and + + + Caches "compiled" queries (memory sensitive cache) + + + Manages PreparedStatements/IDbCommands - how true in NH? + + + Delegates IDbConnection management to the + + + Factory for instances of + + + + This class must appear immutable to clients, even if it does all kinds of caching + and pooling under the covers. It is crucial that the class is not only thread safe + , but also highly concurrent. Synchronization must be used extremely sparingly. + + + + + + + + + + + NH specific : to avoid the use of entityName for generic implementation + + this is a shortcut. + + + + Gets the hql query identified by the name. + + The name of that identifies the query. + + A hql query or if the named + query does not exist. + + + + Get the return aliases of a query + + + + Return the names of all persistent (mapped) classes that extend or implement the + given class or interface, accounting for implicit/explicit polymorphism settings + and excluding mapped subclasses/joined-subclasses of other classes in the result. + + + + + + + + + + + Closes the session factory, releasing all held resources. + + cleans up used cache regions and "stops" the cache provider. + close the ADO.NET connection + + + + + Get a new stateless session. + + + Get a new stateless session for the given ADO.NET connection. + + + + + + + + + Statistics SPI + + + Get the statistics for this session factory + + + + Gets the ICurrentSessionContext instance attached to this session factory. + + + + + Delegate to handle the scenario of an entity not found by a specified id. + + + + + Delegate method to handle the scenario of an entity not found. + + The entityName (may be the class fullname) + The requested id not founded. + + + + Resolves lookups and deserialization. + + + + This is used heavily be Deserialization. Currently a SessionFactory is not really serialized. + All that is serialized is it's name and uid. During Deserializaiton the serialized SessionFactory + is converted to the one contained in this object. So if you are serializing across AppDomains + you should make sure that "name" is specified for the SessionFactory in the hbm.xml file and that the + other AppDomain has a configured SessionFactory with the same name. If + you are serializing in the same AppDomain then there will be no problem because the uid will + be in this object. + + + + + + + + + Adds an Instance of the SessionFactory to the local "cache". + + The identifier of the ISessionFactory. + The name of the ISessionFactory. + The ISessionFactory. + The configured properties for the ISessionFactory. + + + + Removes the Instance of the SessionFactory from the local "cache". + + The identifier of the ISessionFactory. + The name of the ISessionFactory. + The configured properties for the ISessionFactory. + + + + Returns a Named Instance of the SessionFactory from the local "cache" identified by name. + + The name of the ISessionFactory. + An instantiated ISessionFactory. + + + + Returns an Instance of the SessionFactory from the local "cache" identified by UUID. + + The identifier of the ISessionFactory. + An instantiated ISessionFactory. + + + + We always set the result to use a thread static variable, on the face of it, + it looks like it is not a valid choice, since ASP.Net and WCF may decide to switch + threads on us. But, since SessionIdLoggingContext is only used inside NH calls, and since + NH calls are never async, this isn't an issue for us. + In addition to that, attempting to match to the current context has proven to be performance hit. + + + + + Concrete implementation of an , also the central, organizing component + of NHibernate's internal implementation. + + + Exposes two interfaces: itself, to the application and + to other components of NHibernate. This is where the + hard stuff is... This class is NOT THREADSAFE. + + + + + Constructor used to recreate the Session during the deserialization. + + + + + This is needed because we have to do some checking before the serialization process + begins. I don't know how to add logic in ISerializable.GetObjectData and have .net + write all of the serializable fields out. + + + + + Verify the ISession can be serialized and write the fields to the Serializer. + + + + + The fields are marked with [NonSerializable] as just a point of reference. This method + has complete control and what is serialized and those attributes are ignored. However, + this method should be in synch with the attributes for easy readability. + + + + + Once the entire object graph has been deserialized then we can hook the + collections, proxies, and entities back up to the ISession. + + + + + + Constructor used for OpenSession(...) processing, as well as construction + of sessions for GetCurrentSession(). + + The user-supplied connection to use for this session. + The factory from which this session was obtained + NOT USED + The timestamp for this session + The interceptor to be applied to this session + The entity-mode for this session + Should we auto flush before completion of transaction + Should we auto close after completion of transaction + The mode by which we should release JDBC connections. + + + + Constructor used in building "child sessions". + + The parent Session + The entity mode + + + + Close the session and release all resources + + Do not call this method inside a transaction scope, use Dispose instead, since + Close() is not aware of distributed transactions + + + + + + Ensure that the locks are downgraded to + and that all of the softlocks in the have + been released. + + + + + Save a transient object. An id is generated, assigned to the object and returned + + + + + + + Save a transient object with a manually assigned ID + + + + + + + Delete a persistent object + + + + + Delete a persistent object (by explicit entity name) + + + + + + + + + + + + Give the interceptor an opportunity to override the default instantiation + + + + + + + Force an immediate flush + + + Cascade merge an entity instance + + + Cascade persist an entity instance + + + Cascade persist an entity instance during the flush process + + + Cascade refresh an entity instance + + + Cascade copy an entity instance + + + Cascade delete an entity instance + + + + detect in-memory changes, determine if the changes are to tables + named in the query and, if so, complete execution the flush + + + + + + + Load the data for the object with the specified id into a newly created object + using "for update", if supported. A new key will be assigned to the object. + This should return an existing proxy where appropriate. + + If the object does not exist in the database, an exception is thrown. + + + + + + + Thrown when the object with the specified id does not exist in the database. + + + + + Load the data for the object with the specified id into a newly created object + using "for update", if supported. A new key will be assigned to the object. + This should return an existing proxy where appropriate. + + If the object does not exist in the database, null is returned. + + + + + + + + + Load the data for the object with the specified id into a newly created object. + This is only called when lazily initializing a proxy. + Do NOT return a proxy. + + + + + Return the object with the specified id or throw exception if no row with that id exists. Defer the load, + return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. + + + + + + + + This can be called from commit() or at the start of a List() method. + + Perform all the necessary SQL statements in a sensible order, to allow + users to repect foreign key constraints: + + Inserts, in the order they were performed + Updates + Deletion of collection elements + Insertion of collection elements + Deletes, in the order they were performed + + + + Go through all the persistent objects and look for collections they might be + holding. If they had a nonpersistable collection, substitute a persistable one + + + + + + Not for internal use + + + + + + + Get the id value for an object that is actually associated with the session. + This is a bit stricter than GetEntityIdentifierIfNotUnsaved(). + + + + + + + called by a collection that wants to initialize itself + + + + + + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Perform a soft (distributed transaction aware) close of the session + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this Session is being Disposed of or Finalized. + + If this Session is being Finalized (isDisposing==false) then make sure not + to call any methods that could potentially bring this Session back to life. + + + + + remove any hard references to the entity that are held by the infrastructure + (references held by application or other persistant instances are okay) + + + + + + + + + + + + + + + + + + + + Get the ActionQueue for this session + + + + + + + Gets if the ISession is connected. + + + if the ISession is connected. + + + An ISession is considered connected if there is an (regardless + of its state) or if it the field connect is true. Meaning that it will connect + at the next operation that requires a connection. + + + + Get the statistics for this session. + + + Retrieves the configured event listeners from this event source. + + + + + + + Implements SQL query passthrough + + + An example mapping is: + + <sql-query-name name="mySqlQuery"> + <return alias="person" class="eg.Person" /> + SELECT {person}.NAME AS {person.name}, {person}.AGE AS {person.age}, {person}.SEX AS {person.sex} + FROM PERSON {person} WHERE {person}.NAME LIKE 'Hiber%' + </sql-query-name> + + + + + + Declare a "root" entity, without specifying an alias + + + + + Declare a "root" entity + + + + + Declare a "root" entity, specifying a lock mode + + + + + Declare a "root" entity, without specifying an alias + + + + + Declare a "root" entity + + + + + Declare a "root" entity, specifying a lock mode + + + + + Declare a "joined" entity + + + + + Declare a "joined" entity, specifying a lock mode + + + + + Declare a scalar query result + + + + + Use a predefined named ResultSetMapping + + + + Constructs a SQLQueryImpl given a sql query defined in the mappings. + The representation of the defined sql-query. + The session to which this SQLQueryImpl belongs. + Metadata about parameters found in the query. + + + + A command-oriented API for performing bulk operations against a database. + + + A stateless session does not implement a first-level cache nor + interact with any second-level cache, nor does it implement + transactional write-behind or automatic dirty checking, nor do + operations cascade to associated instances. Collections are + ignored by a stateless session. Operations performed via a + stateless session bypass NHibernate's event model and + interceptors. Stateless sessions are vulnerable to data + aliasing effects, due to the lack of a first-level cache. + + For certain kinds of transactions, a stateless session may + perform slightly faster than a stateful session. + + + + + Gets the stateless session implementation. + + + This method is provided in order to get the NHibernate implementation of the session from wrapper implementations. + Implementors of the interface should return the NHibernate implementation of this method. + + + An NHibernate implementation of the interface + + + + Close the stateless session and release the ADO.NET connection. + + + Insert an entity. + A new transient instance + The identifier of the instance + + + Insert a row. + The name of the entity to be inserted + A new transient instance + The identifier of the instance + + + Update an entity. + A detached entity instance + + + Update an entity. + The name of the entity to be updated + A detached entity instance + + + Delete an entity. + A detached entity instance + + + Delete an entity. + The name of the entity to be deleted + A detached entity instance + + + Retrieve a entity. + A detached entity instance + + + + Retrieve an entity. + + A detached entity instance + + + + Retrieve an entity, obtaining the specified lock mode. + + A detached entity instance + + + + Retrieve an entity, obtaining the specified lock mode. + + A detached entity instance + + + + Refresh the entity instance state from the database. + + The entity to be refreshed. + + + + Refresh the entity instance state from the database. + + The name of the entity to be refreshed. + The entity to be refreshed. + + + + Refresh the entity instance state from the database. + + The entity to be refreshed. + The LockMode to be applied. + + + + Refresh the entity instance state from the database. + + The name of the entity to be refreshed. + The entity to be refreshed. + The LockMode to be applied. + + + + Create a new instance of Query for the given HQL query string. + + Entities returned by the query are detached. + + + + Obtain an instance of for a named query string defined in + the mapping file. + + + The query can be either in HQL or SQL format. + Entities returned by the query are detached. + + + + + Create a new instance, for the given entity class, + or a superclass of an entity class. + + A class, which is persistent, or has persistent subclasses + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity class, + or a superclass of an entity class, with the given alias. + + A class, which is persistent, or has persistent subclasses + The alias of the entity + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity class, + or a superclass of an entity class. + + A class, which is persistent, or has persistent subclasses + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity class, + or a superclass of an entity class, with the given alias. + + A class, which is persistent, or has persistent subclasses + The alias of the entity + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity name. + + The entity name. + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity name, + with the given alias. + + The entity name. + The alias of the entity + The . + Entities returned by the query are detached. + + + + Creates a new IQueryOver<T> for the entity class. + + The entity class + An ICriteria<T> object + + + + Creates a new IQueryOver<T> for the entity class. + + The entity class + An ICriteria<T> object + + + + Create a new instance of for the given SQL query string. + Entities returned by the query are detached. + + A SQL query + The + + + + Begin a NHibernate transaction + + A NHibernate transaction + + + + Begin a NHibernate transaction with the specified isolation level + + The isolation level + A NHibernate transaction + + + + Sets the batch size of the session + + The batch size. + The same instance of the session for methods chain. + + + + Returns the current ADO.NET connection associated with this instance. + + + If the session is using aggressive connection release (as in a + CMT environment), it is the application's responsibility to + close the connection returned by this call. Otherwise, the + application should not close the connection. + + + + Get the current NHibernate transaction. + + + + Is the IStatelessSession still open? + + + + + Is the IStatelessSession currently connected? + + + + + Gets the stateless session implementation. + + + This method is provided in order to get the NHibernate implementation of the session from wrapper implementations. + Implementors of the interface should return the NHibernate implementation of this method. + + + An NHibernate implementation of the interface + + + + Close the stateless session and release the ADO.NET connection. + + + Insert a entity. + A new transient instance + the identifier of the instance + + + Insert a row. + The entityName for the entity to be inserted + a new transient instance + the identifier of the instance + + + Update a entity. + a detached entity instance + + + Update a entity. + The entityName for the entity to be updated + a detached entity instance + + + Delete a entity. + a detached entity instance + + + Delete a entity. + The entityName for the entity to be deleted + a detached entity instance + + + Retrieve a entity. + a detached entity instance + + + Retrieve a entity. + + + a detached entity instance + + + + + Retrieve a entity, obtaining the specified lock mode. + + a detached entity instance + + + + Retrieve a entity, obtaining the specified lock mode. + + a detached entity instance + + + + Refresh the entity instance state from the database. + + The entity to be refreshed. + + + + Refresh the entity instance state from the database. + + The entityName for the entity to be refreshed. + The entity to be refreshed. + + + + Refresh the entity instance state from the database. + + The entity to be refreshed. + The LockMode to be applied. + + + + Refresh the entity instance state from the database. + + The entityName for the entity to be refreshed. + The entity to be refreshed. + The LockMode to be applied. + + + + Create a new instance, for the given entity class, + or a superclass of an entity class. + + A class, which is persistent, or has persistent subclasses + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity class, + or a superclass of an entity class, with the given alias. + + A class, which is persistent, or has persistent subclasses + The alias of the entity + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity name. + + The entity name. + The . + Entities returned by the query are detached. + + + + Create a new instance, for the given entity name, + with the given alias. + + The entity name. + The alias of the entity + The . + Entities returned by the query are detached. + + + + Begin a NHibernate transaction + + A NHibernate transaction + + + + Begin a NHibernate transaction with the specified isolation level + + The isolation level + A NHibernate transaction + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + Get the current Hibernate transaction. + + + Contract for field interception handlers. + + + The the given field initialized for the entity to which we are bound? + The name of the field to check + True if the given field is initialized; otherwise false. + + + Forcefully mark the entity as being dirty. + + + Clear the internal dirty flag. + + + Intercept field set/get + + + Is the entity considered dirty? + True if the entity is dirty; otherwise false. + + + Use to associate the entity to which we are bound to the given session. + + + Is the entity to which we are bound completely initialized? + + + Get the entity-name of the field DeclaringType. + + + Get the MappedClass (field container). + + + Helper class for dealing with enhanced entity classes. + + + Marker value for uninitialized properties + + + Contract for controlling how lazy properties get initialized. + + + Initialize the property, and return its new value + + + + All joins are created as outer joins. An optimization in finds + joins that may be inner joined and calls on them. + 's will + then emit the correct HQL join. + + + + + Remove unwanted char-to-int conversions in binary expressions + + + The LINQ expression tree may contain unwanted type conversions that were not in the original expression written by the user. For example, + list.Where(someChar => someChar == 'A') becomes the equivalent of list.Where(someChar => (int)someChar == 55) in the expression + tree. Converting this directly to a HQL/SQL statement would yield CAST(x AS INT) which does not work in MSSQLSERVER, and possibly + other databases. + + + + + Remove redundant casts to the same type or to superclass (upcast) in , + and s + + + + + Applications of the string.Compare(a,b) and a.CompareTo(b) (for various types) + that are then immediately compared to 0 can be simplified by removing the + Compare/CompareTo method call. The comparison operator is then applied + directly to the arguments for the Compare/CompareTo call. + + + + + An AggregatingGroupBy is a query such as: + + from p in db.Products + group p by p.Category.CategoryId + into g + select new + { + g.Key, + MaxPrice = g.Max(p => p.UnitPrice) + }; + + + Where the grouping operation is being fully aggregated and hence does not create any form of hierarchy. + This class takes such queries, flattens out the re-linq sub-query and re-writes the outer select + + + + + + Detects if an expression tree contains naked QuerySourceReferenceExpression + + + + + An AggregatingGroupJoin is a query such as: + + from c in db.Customers + join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into ords + join e in db.Employees on c.Address.City equals e.Address.City into emps + select new { c.ContactName, ords = ords.Count(), emps = emps.Count() }; + + where the results of the joins are being fully aggregated and hence do not create any form of hierarchy. + This class takes such expressions and turns them into this form: + + from c in db.Customers + select new + { + c.ContactName, + ords = (from o2 in db.Orders where o2.Customer.CustomerId == c.CustomerId select o2).Count(), + emps = (from e2 in db.Employees where e2.Address.City == c.Address.City select e2).Count() + }; + + + + + + This re-writer is responsible to re-write a query without a body (no where-clause and so on). + + + + + Removes various result operators from a query so that they can be processed at the same + tree level as the query itself. + + + + + Rewrites expressions so that they sit in the outermost portion of the query. + + + + + Gets an of that were rewritten. + + + + + Gets the representing the type of data that the operator works upon. + + + + + Result of . + + + + + Gets an of implementations that were + rewritten. + + + + + Gets the representing the type of data that the operator works upon. + + + + + Builds HQL Equality nodes and used in joins + + + + + Performs the equivalent of a ToString() on an expression. Swaps out constants for + parameters so that, for example: + from c in Customers where c.City = "London" + generate the same key as + from c in Customers where c.City = "Madrid" + + + + + Locates constants in the expression tree and generates parameters for each one + + + + + If the querySource is a subquery, return the SelectClause's selector if it's + NewExpression. Otherwise, return null. + + + + + Represents a possible set of values for a computation. For example, an expression may + be null, it may be a non-null value, or we may even have a constant value that is known + precisely. This class contains operators that know how to combine these values with + each other. This class is intended to be used to provide static analysis of expressions + before we hit the database. As an example for future improvement, we could handle + ranges of numeric values. We can also improve this by handling operators such as the + comparison operators and arithmetic operators. They are currently handled by naive + null checks. + + + + + Verify that ExpressionType of both this and the other set is bool or nullable bool, + and return the negotiated type (nullable bool if either side is nullable). + + + + + Verify that ExpressionType is bool or nullable bool. + + + + + Identifies and names - using - all QueryModel query sources + + + It may seem expensive to do this as a separate visitation of the query model, but unfortunately + trying to identify query sources on the fly (i.e. while parsing the query model to generate + the HQL expression tree) means a query source may be referenced by a QuerySourceReference + before it has been identified - and named. + + + + + + Possible values of expression if there's set of values for the requested member expression. + For example, if we have an expression "3" and we request the state for "a.B.C", we'll + use "3" from Values since it won't exist in MemberExpressionValuesIfEmptyOuterJoined. + + + + + Stores the possible values of an expression that would result if the given member expression + string was emptily outer joined. For example a.B.C would result in "null" if we try to + outer join to B and there are no rows. Even if an expression tree does contain a particular + member experssion, it may not appear in this list. In that case, the emptily outer joined + value set for that member expression will be whatever's in Values instead. + + + + + Extract the from a given expression. + + The declaring-type of the method. + The method. + The of the no-generic method or the generic-definition for a generic-method. + + + + + Extract the from a given expression. + + The declaring-type of the method. + The method. + The of the method. + + + + Extract the from a given expression. + + The method. + The of the no-generic method or the generic-definition for a generic-method. + + + + + Extract the from a given expression. + + The method. + The of the method. + + + + Gets the field or property to be accessed. + + The declaring-type of the property. + The type of the property. + The expression representing the property getter. + The of the property. + + + + If debug logging is enabled, log a string such as "msg: expression.ToString()". + + + + + Replace all occurances of ConstantExpression where the value is an NHibernate + proxy with a ParameterExpression. The name of the parameter will be a string + representing the proxied entity, without initializing it. + + + + + Provides the main entry point to a LINQ query. + + + + + Associate unique names to query sources. The HQL AST parser will rename them anyway, but we need to + ensure uniqueness that is not provided by IQuerySource.ItemName. + + + + + Implementors define a strategy for transforming criteria query + results into the actual application-visible query result list. + + + + + + + + + + + + + + + + + + + + + Use the SqlMethods.Like() method in a Linq2NHibernate expression to generate + an SQL LIKE expression. (Any 2-argument method named Like in a class named SqlMethods + will be translated.) + + + + + Peform an unsafe cast to T (i.e. (T)source). This is only for + syntactically more pleasing code. + + + + + Walker for collections of values and many-to-many associations + + + + + Superclass of walkers for collection initializers + + + + + + + + Add on association (one-to-one, many-to-one, or a collection) to a list + of associations to be fetched by outerjoin (if necessary) + + + + + Add on association (one-to-one, many-to-one, or a collection) to a list + of associations to be fetched by outerjoin + + + + + Adds an association and extracts the aliases the association's 'with clause' is dependent on + + + + + For an entity class, return a list of associations to be fetched by outerjoin + + + + + For a collection role, return a list of associations to be fetched by outerjoin + + + + + For a collection role, return a list of associations to be fetched by outerjoin + + + + + For an entity class, add to a list of associations to be fetched + by outerjoin + + + + + For a component, add to a list of associations to be fetched by outerjoin + + + + + For a composite element, add to a list of associations to be fetched by outerjoin + + + + + Extend the path by the given property name + + + + + Get the join type (inner, outer, etc) or -1 if the + association should not be joined. Override on + subclasses. + + + + + Use an inner join if it is a non-null association and this + is the "first" join in a series + + + + + Does the mapping, and Hibernate default semantics, specify that + this association should be fetched by outer joining + + + + + Override on subclasses to enable or suppress joining + of certain association types + + + + + Used to detect circularities in the joined graph, note that + this method is side-effecty + + + + + Used to detect circularities in the joined graph, note that + this method is side-effecty + + + + + Should we join this association? + + + + + Generate a sequence of LEFT OUTER JOIN clauses for the given associations. + + + + + Count the number of instances of IJoinable which are actually + also instances of ILoadable, or are one-to-many associations + + + + + Count the number of instances of which + are actually also instances of + which are being fetched by outer join + + + + + Get the order by string required for collection fetching + + + + + Render the where condition for a (batch) load by identifier / collection key + + + + + Generate a select list of columns containing all properties of the entity classes + + + + + Uniquely identifier a foreign key, so that we don't + join it more than once, and create circularities + + + + + We can use an inner join for first many-to-many association + + + + + Loads a collection of values or a many-to-many association. + + + The collection persister must implement . For + other collections, create a customized subclass of + + + + + + Superclass for loaders that initialize collections + + + + + + + Implements logic for walking a tree of associated classes. + + + Generates an SQL select string containing all properties of those classes. + Tablse are joined using an ANSI-style left outer join. + + + + + An interface for collection loaders + + + + + + + Initialize the given collection + + + + + "Batch" loads collections, using multiple foreign key values in the SQL Where clause + + + + + + + Walker for one-to-many associations + + + + + + Loads one-to-many associations + + + The collection persister must implement . + For other collections, create a customized subclass of . + + + + + Implements subselect fetching for a collection + + + + Implements subselect fetching for a one to many association + + + + + A for queries. + + + + + + The superclass deliberately excludes collections + + + + + Don't bother with the discriminator, unless overridden by subclass + + + + + Use the discriminator, to narrow the select to instances + of the queried subclass, also applying any filters. + + + + + A Loader for queries. + + + Note that criteria + queries are more like multi-object Load()s than like HQL queries. + + + + + Get the names of the columns constrained by this criterion. + + + + + Get the a typed value for the given property value. + + + + + Get the aliases of the columns constrained + by this criterion (for use in ORDER BY clause). + + + + Implements Hibernate's built-in support for native SQL queries. + This support is built on top of the notion of "custom queries"... + + + + Extension point allowing any SQL query with named and positional parameters + to be executed by Hibernate, returning managed entities, collections and + simple scalar values. + + + + The SQL query string to be performed. + + + + Any query spaces to apply to the query execution. Query spaces are + used in Hibernate's auto-flushing mechanism to determine which + entities need to be checked for pending changes. + + + + + A collection of descriptors describing the + ADO result set to be expected and how to map this result set. + + + + + Substitues ADO parameter placeholders (?) for all encountered + parameter specifications. It also tracks the positions of these + parameter specifications within the query string. This accounts for + ordinal-params, named-params, and ejb3-positional-params. + + The query string. + The SQL query with parameter substitution complete. + + + Spefically a fetch return that refers to a collection association. + + + Represents a return which names a fetched association. + + + Represents some non-scalar (entity/collection) return within the query result. + + + Represents a return in a custom query. + + + Retrieves the return descriptor for the owner of this fetch. + + + The name of the property on the owner which represents this association. + + + + Represents a return which names a collection role; it + is used in defining a custom query for loading an entity's + collection in non-fetching scenarios (i.e., loading the collection + itself as the "root" of the result). + + + + Returns the class owning the collection. + + + Returns the name of the property representing the collection from the . + + + + that uses columnnames instead of generated aliases. + Aliases can still be overwritten via <return-property> + + + + + Type definition of CollectionAliases. + + + + + Returns the suffixed result-set column-aliases for columns making + up the key for this collection (i.e., its FK to its owner). + + The key result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the columns + making up the collection's index (map or list). + + The index result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the columns + making up the collection's elements. + + The element result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the column + defining the collection's identifier (if any). + + The identifier result-set column aliases. + + + + Returns the suffix used to unique the column aliases for this + particular alias set. + + The uniqued column alias suffix. + + + + Returns the suffixed result-set column-aliases for columns making up the key for this collection (i.e., its FK to + its owner). + + The key result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the columns making up the collection's index (map or list). + + The index result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the columns making up the collection's elements. + + The element result-set column aliases. + + + + Returns the suffixed result-set column-aliases for the column defining the collection's identifier (if any). + + The identifier result-set column aliases. + + + + Returns the suffix used to unique the column aliases for this particular alias set. + + The uniqued column alias suffix. + + + + that chooses the column names over the alias names. + + + + + EntityAliases which handles the logic of selecting user provided aliases (via return-property), + before using the default aliases. + + + + + Metadata describing the SQL result set column aliases + for a particular entity + + + + + The result set column aliases for the property columns of a subclass + + + + + The result set column aliases for the primary key columns + + + + + The result set column aliases for the discriminator columns + + + + + The result set column aliases for the version columns + + + + + The result set column alias for the Oracle row id + + + + + The result set column aliases for the property columns + + + + + Calculate and cache select-clause suffixes. + + + + + Extension point for loaders which use a SQL result set with "unexpected" column aliases. + + + + Build a logical result row. + + Entity data defined as "root returns" and already handled by the normal Loader mechanism. + + The ADO result set (positioned at the row currently being processed). + Does this query have an associated . + The session from which the query request originated. + The logical result row + + At this point, Loader has already processed all non-scalar result data. We + just need to account for scalar result data here... + + + + + Encapsulates the metadata available from the database result set. + + + + + Initializes a new instance of the class. + + The result set. + + + + Gets the column count in the result set. + + The column count. + + + + Gets the (zero-based) position of the column with the specified name. + + Name of the column. + The column position. + + + + Gets the name of the column at the specified position. + + The (zero-based) position. + The column name. + + + + Gets the Hibernate type of the specified column. + + The column position. + The Hibernate type. + + + Specifically a fetch return that refers to an entity association. + + + + Represents a return which names a "root" entity. + + + A root entity means it is explicitly a "column" in the result, as opposed to + a fetched association. + + + + Represent a scalar (AKA simple value) return within a query result. + + + + Abstract superclass for entity loaders that use outer joins + + + + + Loads entities for a + + + + + Load an entity instance. If OptionalObject is supplied, load the entity + state into the given (uninitialized) object + + + + + "Batch" loads entities, using multiple primary key values in the + SQL where clause. + + + + + + A walker for loaders that fetch entities + + + + + + Override to use the persister to change the table-alias for columns in join-tables + + + + + Disable outer join fetching if this loader obtains an + upgrade lock mode + + + + + Load an entity using outerjoin fetching to fetch associated entities. + + + The must implement . For other entities, + create a customized subclass of . + + + + + CollectionAliases which handles the logic of selecting user provided aliases (via return-property), + before using the default aliases. + + + + + Returns the suffixed result-set column-aliases for columns making up the key for this collection (i.e., its FK to + its owner). + + + + + Returns the suffixed result-set column-aliases for the columns making up the collection's index (map or list). + + + + + Returns the suffixed result-set column-aliases for the columns making up the collection's elements. + + + + + Returns the suffixed result-set column-aliases for the column defining the collection's identifier (if any). + + + + + Returns the suffix used to unique the column aliases for this particular alias set. + + + + + Get the position of the join with the given alias in the + list of joins + + + + + Add or modify a value-class pair. + + The value of the DB-field dor a given association instance (should override ) + The class associated to the specific . + + + + Add or modify a value-class pair. + + The value of the DB-field dor a given association instance (should override ) + The class associated to the specific . + + + + + + + Not supported in NH3. + + + + Using the Join, it is possible to split properties of one class to several tables, when there's a 1-to-1 relationship between the table + + The split-group identifier. By default it is assigned to the join-table-name + The lambda to map the join. + + + + Force the component to a different type than the one of the property. + + Mapped component type. + + Useful when the property is an interface and you need the mapping to a concrete class mapped as component. + + + + + Get all candidate persistent properties, or fields, to be used as Persistent-Object-ID, for a given root-entity class or interface. + + The root-entity class or interface. + All candidate properties or fields to be used as Persistent-Object-ID. + + + + Get all candidate persistent properties or fields for a given root-entity class or interface. + + The root-entity class or interface. + All candidate properties or fields. + + + + Get all candidate persistent properties or fields for a given entity subclass or interface. + + The entity subclass or interface. + The superclass (it may be different from ) + All candidate properties or fields. + + In NHibernate, for a subclass, the method should return only those members not included in + its super-classes. + + + + + Get all candidate persistent properties or fields for a given entity subclass or interface. + + The class of the component or an interface. + All candidate properties or fields. + + + + Force the many-to-one to a different type than the one of the property. + + Mapped entity type. + + Useful when the property is an interface and you need the mapping to a concrete class mapped as entity. + + + + + Set the Foreign-Key name + + The name of the Foreign-Key + + Where the is "none" or or all white-spaces the FK won't be created. + Use null to reset the default NHibernate's behavior. + + + + + Manage the mapping of a HbmKeyProperty but implementing + instead a more limitated KeyProperty. + + + + + Defines behavior of soft-cascade actions. + + + To check the content or to include/exclude values, from cascade, is strongly recommanded the usage of extensions methods defined in + + + + + + + + Occurs before apply pattern-appliers on a root class. + + + + + Occurs before apply pattern-appliers on a subclass. + + + + + Occurs before apply pattern-appliers on a joined-subclass. + + + + + Occurs before apply pattern-appliers on a union-subclass. + + + + + Occurs after apply the last customizer on a root class. + + + + + Occurs after apply the last customizer on a subclass. + + + + + Occurs after apply the last customizer on a joined-subclass.. + + + + + Occurs after apply the last customizer on a union-subclass.. + + + + + Util extensions to use in your test or where you need to see the XML mappings + + + + + Provide the list of progressive-paths + + + + Given a path as : Pl1.Pl2.Pl3.Pl4.Pl5 returns paths-sequence as: + Pl5 + Pl4.Pl5 + Pl3.Pl4.Pl5 + Pl2.Pl3.Pl4.Pl5 + Pl1.Pl2.Pl3.Pl4.Pl5 + + + + + Dictionary containing the embedded strategies to find a field giving a property name. + The key is the "partial-name" of the strategy used in XML mapping. + The value is an instance of the strategy. + + + + + A which allows customization of conditions with explicitly declared members. + + + + + Decode a member access expression of a specific ReflectedType + + Type to reflect + The expression of the property getter + The os the ReflectedType. + + + + Decode a member access expression of a specific ReflectedType + + Type to reflect + Type of property + The expression of the property getter + The os the ReflectedType. + + + + Given a property or a field try to get the member from a given possible inherited type. + + The member to find. + The type where find the member. + The member from the reflected-type or the original where the is not accessible from . + + + + Try to find a property or field from a given type. + + The type + The property or field name. + + A or a where the member is found; null otherwise. + + + Where found the member is returned always from the declaring type. + + + + + Convenience base class for AuxiliaryDatabaseObjects. + + + This implementation performs dialect scoping checks strictly based on + dialect name comparisons. Custom implementations might want to do + instanceof-type checks. + + + + + Auxiliary database objects (i.e., triggers, stored procedures, etc) defined + in the mappings. Allows Hibernate to manage their lifecycle as part of + creating/dropping the schema. + + + + + Operations to create/drop the mapping element in the database. + + + + + When implemented by a class, generates the SQL string to create + the mapping element in the database. + + The to use for SQL rules. + + + + + A string that contains the SQL to create an object. + + + + + When implemented by a class, generates the SQL string to drop + the mapping element from the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop an object. + + + + + Add the given dialect name to the scope of dialects to which + this database object applies. + + The name of a dialect. + + + + Does this database object apply to the given dialect? + + The dialect to check against. + True if this database object does apply to the given dialect. + + + + Gets called by NHibernate to pass the configured type parameters to the implementation. + + + + + A NHibernate any type. + + + Polymorphic association to one of several tables. + + + + + Any value that maps to columns. + + + + + Represents an identifying key of a table: the value for primary key + of an entity, or a foreign key of a collection or join table or + joined subclass table. + + + + + A value is anything that is persisted by value, instead of + by reference. It is essentially a Hibernate IType, together + with zero or more columns. Values are wrapped by things with + higher level semantics, for example properties, collections, + classes. + + + + + + + + + + Determines if the Value is part of a valid mapping. + + The to validate. + + if the Value is part of a valid mapping, + otherwise. + + + + Mainly used to make sure that Value maps to the correct number + of columns. + + + + + Gets the number of columns that this value spans in the table. + + + + + Gets an of objects + that this value is stored in. + + + + + Gets the to read/write the Values. + + + + + Gets the this Value is stored in. + + + + + Gets a indicating if this Value is unique. + + + + + Gets a indicating if this Value can have + null values. + + + + + Gets a indicating if this is a SimpleValue + that does not involve foreign keys. + + + + + Get or set the identifier type name + + + + + Get or set the metatype + + + + + Represent the relation between a meta-value and the related entityName + + + + + An array has a primary key consisting of the key columns + index column + + + + + A list has a primary key consisting of the key columns + index column + + + + + Indexed collections include IList, IDictionary, Arrays + and primitive Arrays. + + + + + Base class that stores the mapping information for <array>, <bag>, + <id-bag>, <list>, <map>, and <set> + collections. + + + Subclasses are responsible for the specialization required for the particular + collection style. + + + + + Any mapping with an outer-join attribute + + + + + Defines mapping elements to which filters may be applied. + + + + + Gets or sets a indicating if this is a + mapping for a generic collection. + + + if a collection from the System.Collections.Generic namespace + should be used, if a collection from the System.Collections + namespace should be used. + + + This has no affect on any versions of the .net framework before .net-2.0. + + + + + Gets or sets an array of that contains the arguments + needed to construct an instance of a closed type. + + + + + Initializes a new instance of the class. + + The that contains this list mapping. + + + + Gets the appropriate that is + specialized for this list mapping. + + + + + Mapping for a property of a .NET class (entity + or component). + + + + Common interface for things that can handle meta attributes. + + + + Retrieve the + + The attribute name + The if exists; null otherwise + + + + Meta-Attribute collection. + + + + + Gets the number of columns this property uses in the db. + + + + + Gets an of s. + + + + + Gets or Sets the name of the Property in the class. + + + + + + + + A bag permits duplicates, so it has no primary key + + + + + A bag permits duplicates, so it has no primary key. + + The that contains this bag mapping. + + + + Gets the appropriate that is + specialized for this bag mapping. + + + + + Represents the mapping to a column in a database. + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + The name of the column. + + + + Gets the name of this Column in quoted form if it is necessary. + + + The that knows how to quote + the column name. + + + The column name in a form that is safe to use inside of a SQL statement. + Quoted if it needs to be, not quoted if it does not need to be. + + + + For any column name, generate an alias that is unique + to that column name, and also 10 characters or less + in length. + + + + Gets the name of the data type for the column. + + The to use to get the valid data types. + + + The name of the data type for the column. + + + If the mapping file contains a value of the attribute sql-type this will + return the string contained in that attribute. Otherwise it will use the + typename from the of the object. + + + + + Determines if this instance of and a specified object, + which must be a Column can be considered the same. + + An that should be a . + + if the name of this Column and the other Column are the same, + otherwise . + + + + + Determines if this instance of and the specified Column + can be considered the same. + + A to compare to this Column. + + if the name of this Column and the other Column are the same, + otherwise . + + + + + Returns the hash code for this instance. + + + + returns quoted name as it would be in the mapping file. + + + Shallow copy, the value is not copied + + + + Gets or sets the length of the datatype in the database. + + The length of the datatype in the database. + + + + Gets or sets the name of the column in the database. + + + The name of the column in the database. The get does + not return a Quoted column name. + + +

+ If a value is passed in that is wrapped by ` then + NHibernate will Quote the column whenever SQL is generated + for it. How the column is quoted depends on the Dialect. +

+

+ The value returned by the getter is not Quoted. To get the + column name in quoted form use . +

+
+
+ + + Gets or sets if the column can have null values in it. + + if the column can have a null value in it. + + + + Gets or sets the index of the column in the . + + + The index of the column in the . + + + + + Gets or sets if the column contains unique values. + + if the column contains unique values. + + + + Gets or sets the sql data type name of the column. + + + The sql data type name of the column. + + + This is usually read from the sql-type attribute. + + + + + Gets or sets if the column needs to be quoted in SQL statements. + + if the column is quoted. + + + + Gets or sets whether the column is unique. + + + + + Gets or sets a check constraint on the column + + + + + Do we have a check constraint? + + + + + The underlying columns SqlType. + + + If null, it is because the sqltype code is unknown. + + Use to retreive the sqltypecode used + for the columns associated Value/Type. + + + + + The mapping for a component, composite element, composite identifier, + etc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for relational constraints in the database. + + + + + Adds the to the of + Columns that are part of the constraint. + + The to include in the Constraint. + + + + Generates the SQL string to drop this Constraint in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Constraint. + + + + + Generates the SQL string to create this Constraint in the database. + + The to use for SQL rules. + + + + + A string that contains the SQL to create this Constraint. + + + + + When implemented by a class, generates the SQL string to create the named + Constraint in the database. + + The to use for SQL rules. + The name to use as the identifier of the constraint in the database. + + + + A string that contains the SQL to create the named Constraint. + + + + + Gets or sets the Name used to identify the constraint in the database. + + The Name used to identify the constraint in the database. + + + + Gets an of objects that are part of the constraint. + + + An of objects that are part of the constraint. + + + + + Gets the number of columns that this Constraint contains. + + + The number of columns that this Constraint contains. + + + + + Gets or sets the this Constraint is in. + + + The this Constraint is in. + + + + + Represents a Table in a database that an object gets mapped against. + + + + + Initializes a new instance of . + + + + + Generates the SQL string to create this Table in the database. + + The to use for SQL rules. + + + + + A string that contains the SQL to create this Table, Primary Key Constraints + , and Unique Key Constraints. + + + + + Generates the SQL string to drop this Table in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Table and to cascade the drop to + the constraints if the database supports it. + + + + + Gets the schema qualified name of the Table. + + The that knows how to Quote the Table name. + The name of the table qualified with the schema if one is specified. + + + + Gets the schema qualified name of the Table using the specified qualifier + + The that knows how to Quote the Table name. + The catalog name. + The schema name. + A String representing the Qualified name. + If this were used with MSSQL it would return a dbo.table_name. + + + returns quoted name as it would be in the mapping file. + + + + Gets the name of this Table in quoted form if it is necessary. + + + The that knows how to quote the Table name. + + + The Table name in a form that is safe to use inside of a SQL statement. + Quoted if it needs to be, not quoted if it does not need to be. + + + + returns quoted name as it is in the mapping file. + + + + Gets the schema for this table in quoted form if it is necessary. + + + The that knows how to quote the table name. + + + The schema name for this table in a form that is safe to use inside + of a SQL statement. Quoted if it needs to be, not quoted if it does not need to be. + + + + + Gets the at the specified index. + + The index of the Column to get. + + The at the specified index. + + + + + Adds the to the of + Columns that are part of the Table. + + The to include in the Table. + + + + Gets the identified by the name. + + The name of the to get. + + The identified by the name. If the + identified by the name does not exist then it is created. + + + + + Gets the identified by the name. + + The name of the to get. + + The identified by the name. If the + identified by the name does not exist then it is created. + + + + + Create a for the columns in the Table. + + + An of objects. + + + + A for the columns in the Table. + + + This does not necessarily create a , if + one already exists for the columns then it will return an + existing . + + + + + Generates a unique string for an of + objects. + + An of objects. + + An unique string for the objects. + + + + + Sets the Identifier of the Table. + + The that represents the Identifier. + + + + + + + + + Return the column which is identified by column provided as argument. + column with atleast a name. + + The underlying column or null if not inside this table. + Note: the instance *can* be different than the input parameter, but the name will be the same. + + + + + Gets or sets the name of the Table in the database. + + + The name of the Table in the database. The get does + not return a Quoted Table name. + + +

+ If a value is passed in that is wrapped by ` then + NHibernate will Quote the Table whenever SQL is generated + for it. How the Table is quoted depends on the Dialect. +

+

+ The value returned by the getter is not Quoted. To get the + column name in quoted form use . +

+
+
+ + + Gets the number of columns that this Table contains. + + + The number of columns that this Table contains. + + + + + Gets an of objects that + are part of the Table. + + + An of objects that are + part of the Table. + + + + + Gets an of objects that + are part of the Table. + + + An of objects that are + part of the Table. + + + + + Gets an of objects that + are part of the Table. + + + An of objects that are + part of the Table. + + + + + Gets an of objects that + are part of the Table. + + + An of objects that are + part of the Table. + + + + + Gets or sets the of the Table. + + The of the Table. + + + + Gets or sets the schema the table is in. + + + The schema the table is in or if no schema is specified. + + + + + Gets the unique number of the Table. + + The unique number of the Table. + + + + Gets or sets if the column needs to be quoted in SQL statements. + + if the column is quoted. + + + + A value which is "typed" by reference to some other value + (for example, a foreign key is typed by the referenced primary key). + + + + + A Foreign Key constraint in the database. + + + + + Generates the SQL string to create the named Foreign Key Constraint in the database. + + The to use for SQL rules. + The name to use as the identifier of the constraint in the database. + + + + A string that contains the SQL to create the named Foreign Key Constraint. + + + + + Get the SQL string to drop this Constraint in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Constraint. + + + + + Validates that columnspan of the foreignkey and the primarykey is the same. + Furthermore it aligns the length of the underlying tables columns. + + + + + Gets or sets the that the Foreign Key is referencing. + + The the Foreign Key is referencing. + + Thrown when the number of columns in this Foreign Key is not the same + amount of columns as the Primary Key in the ReferencedTable. + + + + Does this foreignkey reference the primary key of the reference table + + + + A formula is a derived column value. + + + + + + + + + + + + + + + + + + + An PersistentIdentifierBag has a primary key consistenting of just + the identifier column. + + + + + A collection with a synthetic "identifier" column. + + + + + + + + + + + + + + + + + + + + + + + + + + An Index in the database. + + + + + Generates the SQL string to create this Index in the database. + + The to use for SQL rules. + + + + + A string that contains the SQL to create this Index. + + + + + Generates the SQL string to drop this Index in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Index. + + + + + Adds the to the of + Columns that are part of the Index. + + The to include in the Index. + + + + Gets or sets the this Index is in. + + + The this Index is in. + + + + + Gets an of objects that are + part of the Index. + + + An of objects that are + part of the Index. + + + + + Gets or sets the Name used to identify the Index in the database. + + The Name used to identify the Index in the database. + + + + Declaration of a System.Type mapped with the <subclass> or + <joined-subclass> element. + + + + + Base class for the mapped by <class> and a + that is mapped by <subclass> or + <joined-subclass>. + + + + + + + + + + + Adds a to the class hierarchy. + + The to add to the hierarchy. + + + + Change the property definition or add a new property definition + + The to add. + + + + Adds a that is implemented by a subclass. + + The implemented by a subclass. + + + + Adds a that a subclass is stored in. + + The the subclass is stored in. + + + + Creates the for the + this type is persisted in. + + The that is used to Alias columns. + + + + Given a property path, locate the appropriate referenceable property reference. + + + A referenceable property is a property which can be a target of a foreign-key + mapping (an identifier or explicitly named in a property-ref). + + The property path to resolve into a property reference. + The property reference (never null). + If the property could not be found. + + + + + + + + + + Gets the that is being mapped. + + The that is being mapped. + + The value of this is set by the name attribute on the <class> + element. + + + + + Gets or sets the to use as a Proxy. + + The to use as a Proxy. + + The value of this is set by the proxy attribute. + + + + + Gets or Sets if the Insert Sql is built dynamically. + + if the Sql is built at runtime. + + The value of this is set by the dynamic-insert attribute. + + + + + Gets or Sets if the Update Sql is built dynamically. + + if the Sql is built at runtime. + + The value of this is set by the dynamic-update attribute. + + + + + Gets or Sets the value to use as the discriminator for the Class. + + + A value that distinguishes this subclass in the database. + + + The value of this is set by the discriminator-value attribute. Each <subclass> + in a hierarchy must define a unique discriminator-value. The default value + is the class name if no value is supplied. + + + + + Gets the number of subclasses that inherit either directly or indirectly. + + The number of subclasses that inherit from this PersistentClass. + + + + Iterate over subclasses in a special 'order', most derived subclasses first. + + + It will recursively go through Subclasses so that if a SubclassType has Subclasses + it will pick those up also. + + + + + Gets an of objects + that directly inherit from this PersistentClass. + + + An of objects + that directly inherit from this PersistentClass. + + + + + When implemented by a class, gets a boolean indicating if this + mapped class is inherited from another. + + + if this class is a subclass or joined-subclass + that inherited from another class. + + + + + When implemented by a class, gets a boolean indicating if the mapped class + has a version property. + + if there is a <version> property. + + + + When implemented by a class, gets an + of objects that this mapped class contains. + + + An of objects that + this mapped class contains. + + + This is all of the properties of this mapped class and each mapped class that + it is inheriting from. + + + + + When implemented by a class, gets an + of objects that this mapped class reads from + and writes to. + + + An of objects that + this mapped class reads from and writes to. + + + This is all of the tables of this mapped class and each mapped class that + it is inheriting from. + + + + + Gets an of objects that + this mapped class contains and that all of its subclasses contain. + + + An of objects that + this mapped class contains and that all of its subclasses contain. + + + + + Gets an of all of the objects that the + subclass finds its information in. + + An of objects. + It adds the TableClosureIterator and the subclassTables into the IEnumerable. + + + + When implemented by a class, gets or sets the of the Persister. + + + + + When implemented by a class, gets the of the class + that is mapped in the class element. + + + The of the class that is mapped in the class element. + + + + + + + + + + + + + + + Build a collection of properties which are "referenceable". + + + See for a discussion of "referenceable". + + + + + + + + + + + + + + + Build an iterator over the properties defined on this class. The returned + iterator only accounts for "normal" properties (i.e. non-identifier + properties). + + + An of objects. + + + Differs from in that the iterator + we return here will include properties defined as part of a join. + + + + + Build an enumerable over the properties defined on this class which + are not defined as part of a join. + As with the returned iterator only accounts + for non-identifier properties. + + An enumerable over the non-joined "normal" properties. + + + + + + + + + Gets a boolean indicating if this PersistentClass has any subclasses. + + if this PeristentClass has any subclasses. + + + + Gets or Sets the that this class is stored in. + + The this class is stored in. + + The value of this is set by the table attribute. + + + + + When implemented by a class, gets or set a boolean indicating + if the mapped class has properties that can be changed. + + if the object is mutable. + + The value of this is set by the mutable attribute. + + + + + When implemented by a class, gets a boolean indicating + if the mapped class has a Property for the id. + + if there is a Property for the id. + + + + When implemented by a class, gets or sets the + that is used as the id. + + + The that is used as the id. + + + + + When implemented by a class, gets or sets the + that contains information about the identifier. + + The that contains information about the identifier. + + + + When implemented by a class, gets or sets the + that is used as the version. + + The that is used as the version. + + + + When implemented by a class, gets or sets the + that contains information about the discriminator. + + The that contains information about the discriminator. + + + + When implemented by a class, gets or sets if the mapped class has subclasses or is + a subclass. + + + if the mapped class has subclasses or is a subclass. + + + + + When implemented by a class, gets or sets the CacheConcurrencyStrategy + to use to read/write instances of the persistent class to the Cache. + + The CacheConcurrencyStrategy used with the Cache. + + + + When implemented by a class, gets or sets the + that this mapped class is extending. + + + The that this mapped class is extending. + + + + + When implemented by a class, gets or sets a boolean indicating if + explicit polymorphism should be used in Queries. + + + if only classes queried on should be returned, + if any class in the heirarchy should implicitly be returned. + + The value of this is set by the polymorphism attribute. + + + + + + + + + + When implemented by a class, gets or sets a boolean indicating if the identifier is + embedded in the class. + + if the class identifies itself. + + An embedded identifier is true when using a composite-id specifying + properties of the class as the key-property instead of using a class + as the composite-id. + + + + + When implemented by a class, gets the of the class + that is mapped in the class element. + + + The of the class that is mapped in the class element. + + + + + When implemented by a class, gets or sets the + that contains information about the Key. + + The that contains information about the Key. + + + + When implemented by a class, gets or sets the sql string that should + be a part of the where clause. + + + The sql string that should be a part of the where clause. + + + The value of this is set by the where attribute. + + + + + Gets or sets a boolean indicating if only values in the discriminator column that + are mapped will be included in the sql. + + if the mapped discriminator values should be forced. + + The value of this is set by the force attribute on the discriminator element. + + + + + Initializes a new instance of the class. + + The that is the superclass. + + + + Add the to this PersistentClass. + + The to add. + + This also adds the to the Superclass' collection + of SubclassType Properties. + + + + + Adds a that is implemented by a subclass. + + The implemented by a subclass. + + This also adds the to the Superclass' collection + of SubclassType Properties. + + + + + Adds a that a subclass is stored in. + + The the subclass is stored in. + + This also adds the to the Superclass' collection + of SubclassType Tables. + + + + + + + + + + Gets a boolean indicating if this mapped class is inherited from another. + + + because this is a SubclassType. + + + + + Gets an of objects that this mapped class contains. + + + An of objects that + this mapped class contains. + + + This is all of the properties of this mapped class and each mapped class that + it is inheriting from. + + + + + Gets an of objects that this + mapped class reads from and writes to. + + + An of objects that + this mapped class reads from and writes to. + + + This is all of the tables of this mapped class and each mapped class that + it is inheriting from. + + + + + Gets a boolean indicating if the mapped class has a version property. + + if for the Superclass there is a Property for a version. + + + + + + + + + Gets the of the class + that is mapped in the class element. + + + The of the Superclass that is mapped in the class element. + + + + + + + + + + Gets or sets the CacheConcurrencyStrategy + to use to read/write instances of the persistent class to the Cache. + + The CacheConcurrencyStrategy used with the Cache. + + + + Gets the of the class that is mapped in the class element. + + + The of the Superclass that is mapped in the class element. + + + + + Gets or sets the that this mapped class is extending. + + + The that this mapped class is extending. + + + + + Gets or sets the that is used as the id. + + + The from the Superclass that is used as the id. + + + + + Gets or sets the that contains information about the identifier. + + The from the Superclass that contains information about the identifier. + + + + Gets a boolean indicating if the mapped class has a Property for the id. + + if in the Superclass there is a Property for the id. + + + + Gets or sets the that contains information about the discriminator. + + The from the Superclass that contains information about the discriminator. + + + + Gets or set a boolean indicating if the mapped class has properties that can be changed. + + if the Superclass is mutable. + + + + Gets or sets if the mapped class is a subclass. + + + since this mapped class is a subclass. + + + The setter should not be used to set the value to anything but . + + + + + Gets or sets the that is used as the version. + + The from the Superclass that is used as the version. + + + + Gets or sets a boolean indicating if the identifier is + embedded in the class. + + if the Superclass has an embedded identifier. + + An embedded identifier is true when using a composite-id specifying + properties of the class as the key-property instead of using a class + as the composite-id. + + + + + Gets or sets the that contains information about the Key. + + The that contains information about the Key. + + + + Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. + + + The value of the Superclasses IsExplicitPolymorphism property. + + + + + Gets the sql string that should be a part of the where clause. + + + The sql string that should be a part of the where clause. + + + Thrown when the setter is called. The where clause can not be set on the + SubclassType, only the RootClass. + + + + + Gets or Sets the that this class is stored in. + + The this class is stored in. + + This also adds the to the Superclass' collection + of SubclassType Tables. + + + + + + + + + A many-to-one association mapping + + + + A simple-point association (ie. a reference to another entity). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A map has a primary key consisting of the key columns + + index columns. + + + + + Initializes a new instance of the class. + + The that contains this map mapping. + + + + Gets the appropriate that is + specialized for this list mapping. + + + + + A meta attribute is a named value or values. + + + + + A mapping for a one-to-many association. + + + + + + + + + + No foreign key element for a one-to-many + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A mapping for a one-to-one association. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Primary Key constraint in the database. + + + + + Generates the SQL string to create the Primary Key Constraint in the database. + + The to use for SQL rules. + + + A string that contains the SQL to create the Primary Key Constraint. + + + + + Generates the SQL string to create the named Primary Key Constraint in the database. + + The to use for SQL rules. + The name to use as the identifier of the constraint in the database. + + + + A string that contains the SQL to create the named Primary Key Constraint. + + + + + Get the SQL string to drop this Constraint in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Constraint. + + + + + A primitive array has a primary key consisting + of the key columns + index column. + + + + + Indicates whether given properties are generated by the database and, if + so, at what time(s) they are generated. + + + + + Values for this property are never generated by the database. + + + + + Values for this property are generated by the database on insert. + + + + + Values for this property are generated by the database on both insert and update. + + + + + Declaration of a System.Type mapped with the <class> element that + is the root class of a table-per-subclass, or table-per-concrete-class + inheritance heirarchy. + + + + + The default name of the column for the Identifier + + id is the default column name for the Identifier. + + + + The default name of the column for the Discriminator + + class is the default column name for the Discriminator. + + + + Adds a to the class hierarchy. + + The to add to the hierarchy. + + When a is added this mapped class has the property + set to . + + + + + + + + + + + Gets a boolean indicating if this mapped class is inherited from another. + + + because this is the root mapped class. + + + + + Gets an of objects that this mapped class contains. + + + An of objects that + this mapped class contains. + + + + + Gets an of objects that this + mapped class reads from and writes to. + + + An of objects that + this mapped class reads from and writes to. + + + There is only one in the since + this is the root class. + + + + + Gets a boolean indicating if the mapped class has a version property. + + if there is a Property for a version. + + + + Gets the of the class + that is mapped in the class element. + + + The of the class this mapped class. + + + + + Gets or sets a boolean indicating if the identifier is + embedded in the class. + + if the class identifies itself. + + An embedded identifier is true when using a composite-id specifying + properties of the class as the key-property instead of using a class + as the composite-id. + + + + + Gets or sets the cache region name. + + The region name used with the Cache. + + + + + + + + + Gets or sets the that is used as the id. + + + The that is used as the id. + + + + + Gets or sets the that contains information about the identifier. + + The that contains information about the identifier. + + + + Gets a boolean indicating if the mapped class has a Property for the id. + + if there is a Property for the id. + + + + Gets or sets the that contains information about the discriminator. + + The that contains information about the discriminator. + + + + Gets or sets if the mapped class has subclasses. + + + if the mapped class has subclasses. + + + + + Gets the of the class that is mapped in the class element. + + + this since this is the root mapped class. + + + + + Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. + + + if only classes queried on should be returned, + if any class in the hierarchy should implicitly be returned. + + + + + Gets or sets the that is used as the version. + + The that is used as the version. + + + + Gets or set a boolean indicating if the mapped class has properties that can be changed. + + if the object is mutable. + + + + Gets or sets the that this mapped class is extending. + + + since this is the root class. + + + Thrown when the setter is called. The Superclass can not be set on the + RootClass, only the SubclassType can have a Superclass set. + + + + + Gets or sets the that contains information about the Key. + + The that contains information about the Key. + + + + + + + + + Gets or sets a boolean indicating if only values in the discriminator column that + are mapped will be included in the sql. + + if the mapped discriminator values should be forced. + + + + Gets or sets the sql string that should be a part of the where clause. + + + The sql string that should be a part of the where clause. + + + + + Gets or sets the CacheConcurrencyStrategy + to use to read/write instances of the persistent class to the Cache. + + The CacheConcurrencyStrategy used with the Cache. + + + + A Set with no nullable element columns will have a primary + key consisting of all table columns (ie - key columns + + element columns). + + + + + A simple implementation of AbstractAuxiliaryDatabaseObject in which the CREATE and DROP strings are + provided up front. + + + Contains simple facilities for templating the catalog and schema + names into the provided strings. + This is the form created when the mapping documents use <create/> and <drop/>. + + + + Placeholder for typedef information + + + + An Unique Key constraint in the database. + + + + + Generates the SQL string to create the Unique Key Constraint in the database. + + The to use for SQL rules. + A string that contains the SQL to create the Unique Key Constraint. + + + + Generates the SQL string to create the Unique Key Constraint in the database. + + The to use for SQL rules. + + + + + A string that contains the SQL to create the Unique Key Constraint. + + + + + Get the SQL string to drop this Constraint in the database. + + The to use for SQL rules. + + + + A string that contains the SQL to drop this Constraint. + + + + + Exposes entity class metadata to the application + + + + + Get the type of a particular (named) property + + + Return the values of the mapped properties of the object + + + + The persistent class + + + + + Create a class instance initialized with the given identifier + + + + + Get the value of a particular (named) property + + + + Extract the property values from the given entity. + The entity from which to extract the property values. + The entity-mode of the given entity + The property values. + + + + Set the value of a particular (named) property + + + + + Set the given values to the mapped properties of the given object + + + + + Get the identifier of an instance (throw an exception if no identifier property) + + + + + Set the identifier of an instance (or do nothing if no identifier property) + + + + Does the class implement the interface? + + + Does the class implement the interface? + + + + Get the version number (or timestamp) from the object's version property + (or return null if not versioned) + + + + + The name of the entity + + + + + The name of the identifier property (or return null) + + + + + The names of the class' persistent properties + + + + + The identifier Hibernate type + + + + + The Hibernate types of the classes properties + + + + + Are instances of this class mutable? + + + + + Are instances of this class versioned by a timestamp or version number column? + + + + + Gets the index of the version property + + + + + Get the nullability of the class' persistent properties + + + + Get the "laziness" of the properties of this class + + + Which properties hold the natural id? + + + Does this entity extend a mapped superclass? + + + Does the class support dynamic proxies? + + + Does the class have an identifier property? + + + Does this entity declare a natural id? + + + Does this entity have mapped subclasses? + + + + Exposes collection metadata to the application + + + + + The collection key type + + + + + The collection element type + + + + + The collection index type (or null if the collection has no index) + + + + + Is the collection indexed? + + + + + The name of this collection role + + + + + Is the collection an array? + + + + + Is the collection a primitive array? + + + + + Is the collection lazily initialized? + + + + + Additional information for potential paging parameters in HQL/LINQ + + + + + An additional contract for parameters which originate from parameters explicitly encountered in the source statement + (HQL or native-SQL). + Author: Steve Ebersole + Ported by: Steve Strong + + + + + Maintains information relating to parameters which need to get bound into a . + + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The list of Sql query parameter in the exact sequence they are present in the query. + The defined values for the current query execution. + The session against which the current execution is occuring. + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The parameter-list of the whole query of the command. + The offset from where start the list of in the given for the query where this was used. + The list of Sql query parameter in the exact sequence they are present in the query where this was used. + The defined values for the query where this was used. + The session against which the current execution is occuring. + + Suppose the is composed by two queries. The for the first query is zero. + If the first query in has 12 parameters (size of its SqlType array) the offset to bind all s of the second query in the + is 12 (for the first query we are using from 0 to 11). + + + + + Render this parameter into displayable info (for logging, etc). + + The displayable info + + + + An string array to unique identify this parameter-span inside an . + + The session-factory (used only because required by IType). + + The each id-for-backtrack is supposed to be unique in the context of a query. + + The number of elements returned depend on the column-span of the . + + + + + + Get or set the type which we are expeting for a bind into this parameter based + on translated contextual information. + + + + + Explicit parameters may have no set the during query parse. + + The defined values for the current query execution. + + This method should be removed when the parameter type is inferred during the parse. + + + + + Retrieves the line number on which this parameter occurs in the source query. + + + + + Retrieves the column number (within the {@link #getSourceLine()}) where this parameter occurs. + + + + + Notifies the parameter that it is a 'skip' parameter, and should calculate its value using the dialect settings + + + + + Notifies the parameter that it is a 'take' parameter, and should calculate its value using the dialect settings + and the value of the supplied skipParameter. + + The associated skip parameter (null if there is none). + + + + Retrieve the skip/offset value for the query + + The parameters for the query + The paging skip/offset value + + + + Constructs an AbstractExplicitParameterSpecification. + + sourceLine + sourceColumn + + + + Creates a specialized collection-filter collection-key parameter spec. + + The collection role being filtered. + The mapped collection-key type. + The position within QueryParameters where we can find the appropriate param value to bind. + + + + Constructs a parameter specification for a particular filter parameter. + + The name of the filter + The name of the parameter + The paremeter type specified on the filter metadata + + + + + Defines a mapping from a .NET to a SQL datatype. + This interface is intended to be implemented by applications that need custom types. + + Implementors should usually be immutable and MUST definately be threadsafe. + + + + + When implemented by a class, returns the SqlTypes for the columns mapped by this IType. + The that uses this IType.An array of s. + + + + When implemented by a class, returns how many columns are used to persist this type. + The that uses this IType.The number of columns this IType spans.MappingException + + + + When implemented by a class, should the parent be considered dirty, + given both the old and current field or element value? + The old valueThe current valueThe true if the field is dirty + + + + When implemented by a class, gets an instance of the object mapped by + this IType from the . + The that contains the values + The names of the columns in the that contain the + value to populate the IType with. + The object mapped by this IType. + Implementors should handle possibility of null values. + + + + + When implemented by a class, gets an instance of the object + mapped by this IType from the . + The that contains the valuesThe name of the column in the that contains the + value to populate the IType with.The object mapped by this IType. + Implementations should handle possibility of null values. + This method might be called if the IType is known to be a single-column type. + + + + + When implemented by a class, puts the value/values from the mapped + class into the . + The to put the values into.The object that contains the values.The index of the to start writing the values to.Indicates which columns are to be set. + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from . + + + + + When implemented by a class, puts the value/values from the mapped + class into the . + + The to put the values into. + The object that contains the values. + The index of the to start writing the values to. + + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from . + + + + + When implemented by a class, a representation of the value to be + embedded in an XML element + The object that contains the values.An Xml formatted string. + + + + When implemented by a class, returns a deep copy of the persistent + state, stopping at entities and at collections. + A Collection element or Entity fieldThe entityMode.The session factory.A deep copy of the object. + + + + When implemented by a class, retrieves an instance of the mapped class, + or the identifier of an entity or collection from a . + The that contains the values. + The names of the columns in the that contain the + value to populate the IType with. + the sessionThe parent EntityAn identifier or actual object mapped by this IType. + + This is useful for 2-phase property initialization - the second phase is a call to + ResolveIdentifier() + + + Most implementors of this method will just pass the call to NullSafeGet(). + + + + + + When implemented by a class, maps identifiers to Entities or Collections. + An identifier or value returned by Hydrate()The sessionThe parent EntityThe Entity or Collection referenced by this Identifier. + This is the second phase of 2-phase property initialization. + + + + + Given a hydrated, but unresolved value, return a value that may be used to + reconstruct property-ref associations. + + + + + + + + During merge, replace the existing (target) value in the entity we are merging to + with a new (original) value from the detached entity we are merging. For immutable + objects, or null values, it is safe to simply return the first parameter. For + mutable objects, it is safe to return a copy of the first parameter. For objects + with component values, it might make sense to recursively replace component values. + + the value from the detached entity being merged + the value in the managed entity + + + + + the value to be merged + + + + Compare two instances of the class mapped by this type for persistence + "equality" - equality of persistent state - taking a shortcut for + entity references. + + + + + boolean + + + + Compare two instances of the class mapped by this type for persistence + "equality" - equality of persistent state. + + + + + boolean + + + + Compare two instances of the class mapped by this type for persistence + "equality" - equality of persistent state. + + + + + + boolean + + + Get a hashcode, consistent with persistence "equality" + + + + + Get a hashcode, consistent with persistence "equality" + + + + + + compare two instances of the type + + + + + + Get the type of a semi-resolved value. + + + A representation of the value to be embedded in an XML element. + + + + + + Parse the XML representation of an instance. + + + an instance of the type + + + + Given an instance of the type, return an array of boolean, indicating + which mapped columns would be null. + + an instance of the type + + + + + When implemented by a class, gets the abbreviated name of the type. + The NHibernate type name. + + + + When implemented by a class, gets the returned + by the NullSafeGet() methods. + + The from the .NET framework. + + This is used to establish the class of an array of this Itype + + + + + When implemented by a class, gets the value indicating if the objects + of this IType are mutable. + true if the objects mapped by this IType are mutable. + With respect to the referencing object... + Entities and Collections are considered immutable because they manage their own internal state. + + + + + When implemented by a class, gets a value indicating if the implementor is castable to an an + true if this is an AssociationThis does not necessarily imply that the type actually represents an association. + + + + When implemented by a class, gets a value indicating if the implementor is a collection type + true if this is a . + + + + When implemented by a class, gets a value indicating if the implementor + is an . + true if this is an + If true, the implementation must be castable to . + A component type may own collections or associations and hence must provide certain extra functionality. + + + + + When implemented by a class, gets a value indicating if the implementor + extends + true if this is an + + + + + + + Parameter bind specification for an explicit named parameter. + + + + + Constructs a named parameter bind specification. + + sourceLine + sourceColumn + The named parameter name. + + + + The user parameter name. + + + + + Parameter bind specification for an explicit positional (or ordinal) parameter. + + + + + Constructs a position/ordinal parameter bind specification. + + sourceLine + sourceColumn + The position in the source query, relative to the other source positional parameters. + + + + Getter for property 'hqlPosition'. + + + + + Autogenerated parameter for . + + + + + Autogenerated parameter for . + + + + + Summary description for AbstractCollectionPersister. + + + + + A collection role that may be queried or loaded by outer join. + + + + + Anything that can be loaded by outer join - namely persisters for classes or collections. + + + + + All columns to select, when loading. + + + + + Get the where clause part of any joins (optional operation) + + + + + + + + + Get the from clause part of any joins (optional operation) + + + + + + + + + Get the where clause filter, given a query alias and considering enabled session filters + + + + + Very, very, very ugly... + + Does this persister "consume" entity column aliases in the result + set? + + + + Very, very, very ugly... + + Does this persister "consume" collection column aliases in the result + set? + + + + An identifying name; a class name or collection role name. + + + + + The columns to join on. + + + + + Is this instance actually a ICollectionPersister? + + + + + The table to join to. + + + + + A strategy for persisting a collection role. + + + Defines a contract between the persistence strategy and the actual persistent collection framework + and session. Does not define operations that are required for querying collections, or loading by outer join. + + Implements persistence of a collection instance while the instance is + referenced in a particular role. + + This class is highly coupled to the + hierarchy, since double dispatch is used to load and update collection + elements. + + May be considered an immutable view of the mapping object + + + + + Initialize the given collection with the given key + + + + + + + Read the key from a row of the + + + + + Read the element from a row of the + + + + + Read the index from a row of the + + + + + Read the identifier from a row of the + + + + + Completely remove the persistent state of the collection + + + + + + + (Re)create the collection's persistent state + + + + + + + + Delete the persistent state of any elements that were removed from the collection + + + + + + + + Update the persistent state of any elements that were modified + + + + + + + + Insert the persistent state of any new collection elements + + + + + + + + Generates the collection's key column aliases, based on the given + suffix. + + The suffix to use in the key column alias generation. + The key column aliases. + + + + Generates the collection's index column aliases, based on the given + suffix. + + The suffix to use in the index column alias generation. + The index column aliases, or null if not indexed. + + + + Generates the collection's element column aliases, based on the given + suffix. + + The suffix to use in the element column alias generation. + The element column aliases. + + + + Generates the collection's identifier column aliases, based on the given + suffix. + + The suffix to use in the identifier column alias generation. + The identifier column aliases. + + + + Try to find an element by a given index. + + The key of the collection (collection-owner identifier) + The given index. + The active . + The owner of the collection. + The value of the element where available; otherwise . + + + + Get the cache + + + + Get the cache structure + + + + Get the associated IType + + + + + Get the "key" type (the type of the foreign key) + + + + + Get the "index" type for a list or map (optional operation) + + + + + Get the "element" type + + + + + Return the element class of an array, or null otherwise + + + + + Is this an array or primitive values? + + + + + Is this an array? + + + + Is this a one-to-many association? + + + + Is this a many-to-many association? Note that this is mainly + a convenience feature as the single persister does not + contain all the information needed to handle a many-to-many + itself, as internally it is looked at as two many-to-ones. + + + + + Is this collection lazily initialized? + + + + + Is this collection "inverse", so state changes are not propogated to the database. + + + + + Get the name of this collection role (the fully qualified class name, extended by a "property path") + + + + Get the persister of the entity that "owns" this collection + + + + Get the surrogate key generation strategy (optional operation) + + + + + Get the type of the surrogate key + + + + Get the "space" that holds the persistent state + + + + Is cascade delete handled by the database-level + foreign key constraint definition? + + + + + Does this collection cause version increment of the owning entity? + + + + Can the elements of this collection change? + + + + Is this collection role cacheable + + + + + Is this an "indexed" collection? (list or map) + + + + + Does this collection implement "orphan delete"? + + + + + Is this an ordered collection? (An ordered collection is + ordered by the initialization operation, not by sorting + that happens in memory, as in the case of a sorted collection.) + + + + + A place-holder to inform that the data-reader was empty. + + + + + Generate a list of collection index and element columns + + + + + Get the names of the collection index columns if + this is an indexed collection (optional operation), + aliased by the given table alias + + + + + Get the names of the collection element columns (or the primary + key columns in the case of a one-to-many association), + aliased by the given table alias + + + + + Get the extra where clause filter SQL + + + + + + + Get the order by SQL + + + + + + + Get the order-by to be applied at the target table of a many to many + + The alias for the many-to-many target table + Appropriate order-by fragment or empty string. + + + + Get the index formulas if this is an indexed collection + (optional operation) + + + + + Get the persister of the element class, if this is a + collection of entities (optional operation). Note that + for a one-to-many association, the returned persister + must be OuterJoinLoadable. + + + + + Should we load this collection role by outer joining? + + + + + Get the names of the collection index columns if this is an indexed collection (optional operation) + + + + + Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association) + + + + + Does this collection role have a where clause filter? + + + + + Reads the Element from the IDataReader. The IDataReader will probably only contain + the id of the Element. + + See ReadElementIdentifier for an explanation of why this method will be depreciated. + + + + Perform an SQL INSERT, and then retrieve a generated identifier. + + the id of the collection entry + + This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, select, etc). + + + + + Return the element class of an array, or null otherwise + + + + + Get the name of this collection role (the fully qualified class name, + extended by a "property path") + + + + + Collection persister for collections of values and many-to-many associations. + + + + + Generate the SQL DELETE that deletes all rows + + + + + + Generate the SQL INSERT that creates a new row + + + + + + Generate the SQL UPDATE that updates a row + + + + + + Generate the SQL DELETE that deletes a particular row + + + + + + Create the + + + + + Summary description for CollectionPropertyMapping. + + + + + The names of all the collection properties. + + + + + Summary description for CompositeElementPropertyMapping. + + + + + Base implementation of a PropertyMapping. + + + + + Summary description for ElementPropertyMapping. + + + + + Generate the SQL UPDATE that updates all the foreign keys to null + + + + + + Generate the SQL UPDATE that updates a foreign key to a value + + + + + + Not needed for one-to-many association + + + + + + Generate the SQL UPDATE that updates a particular row's foreign + key to null + + + + + + Create the + + + + + Superclass for built-in mapping strategies. Implements functionalty common to both mapping + strategies + + + May be considered an immutable view of the mapping object + + + + + A ClassPersister that may be loaded by outer join using + the OuterJoinLoader hierarchy and may be an element + of a one-to-many association. + + + + + Implemented by ClassPersister that uses Loader. There are several optional + operations used only by loaders that inherit OuterJoinLoader + + + + + Concrete IEntityPersisters implement mapping and persistence logic for a particular class. + + + Implementors must be threadsafe (preferably immutable) and must provide a constructor of type + matching the signature of: (PersistentClass, SessionFactoryImplementor) + + + + + Finish the initialization of this object, once all ClassPersisters have been + instantiated. Called only once, before any other method. + + + + + Determine whether the given name represents a subclass entity + (or this entity itself) of the entity mapped by this persister. + + The entity name to be checked. + + True if the given entity name represents either the entity mapped by this persister or one of its subclass entities; + false otherwise. + + + + + Get the type of a particular property + + + + + + Locate the property-indices of all properties considered to be dirty. + The current state of the entity (the state to be checked). + The previous state of the entity (the state to be checked against). + The entity for which we are checking state dirtiness. + The session in which the check is ccurring. + or the indices of the dirty properties + + + Locate the property-indices of all properties considered to be dirty. + The old state of the entity. + The current state of the entity. + The entity for which we are checking state modification. + The session in which the check is ccurring. + return or the indicies of the modified properties + + + + Retrieve the current state of the natural-id properties from the database. + + + The identifier of the entity for which to retrieve the naturak-id values. + + + The session from which the request originated. + + The natural-id snapshot. + + + + Load an instance of the persistent class. + + + + + Do a version check (optional operation) + + + + + Persist an instance + + + + + Persist an instance, using a natively generated identifier (optional operation) + + + + + Delete a persistent instance + + + + + Update a persistent instance + + The id. + The fields. + The dirty fields. + if set to [has dirty collection]. + The old fields. + The old version. + The obj. + The rowId + The session. + + + + Get the current database state of the object, in a "hydrated" form, without resolving identifiers + + + + if select-before-update is not enabled or not supported + + + + Get the current version of the object, or return null if there is no row for + the given identifier. In the case of unversioned data, return any object + if the row exists. + + + + + + + Try to discover the entity mode from the entity instance + + + Has the class actually been bytecode instrumented? + + + Called just after the entities properties have been initialized + + + Called just after the entity has been reassociated with the session + + + + Create a new proxy instance + + + + + + + Is this a new transient instance? + + + Return the values of the insertable properties of the object (including backrefs) + + + + Perform a select to retrieve the values of any generated properties + back from the database, injecting these generated values into the + given entity as well as writing this state to the persistence context. + + + Note, that because we update the persistence context here, callers + need to take care that they have already written the initial snapshot + to the persistence context before calling this method. + + The entity's id value. + The entity for which to get the state. + The entity state (at the time of Save). + The session. + + + + Perform a select to retrieve the values of any generated properties + back from the database, injecting these generated values into the + given entity as well as writing this state to the persistence context. + + + Note, that because we update the persistence context here, callers + need to take care that they have already written the initial snapshot + to the persistence context before calling this method. + + The entity's id value. + The entity for which to get the state. + The entity state (at the time of Save). + The session. + + + + The persistent class, or null + + + + + Does the class implement the ILifecycle inteface? + + + + + Does the class implement the IValidatable interface? + + + + + Get the proxy interface that instances of this concrete class will be cast to + + + + + Set the given values to the mapped properties of the given object + + + + + Set the value of a particular property + + + + + Return the values of the mapped properties of the object + + + + + Get the value of a particular property + + + + + Get the value of a particular property + + + + + Get the identifier of an instance ( throw an exception if no identifier property) + + + + + Set the identifier of an instance (or do nothing if no identifier property) + + The object to set the Id property on. + The value to set the Id property to. + The EntityMode + + + + Get the version number (or timestamp) from the object's version property (or return null if not versioned) + + + + + Create a class instance initialized with the given identifier + + + + + Determines whether the specified entity is an instance of the class + managed by this persister. + + The entity. + The EntityMode + + if the specified entity is an instance; otherwise, . + + + + Does the given instance have any uninitialized lazy properties? + + + + Set the identifier and version of the given instance back + to its "unsaved" value, returning the id + + + + Get the persister for an instance of this class or a subclass + + + + Check the version value trough . + + The snapshot entity state + The result of . + NHibernate-specific feature, not present in H3.2 + + + + The ISessionFactory to which this persister "belongs". + + + + + Returns an object that identifies the space in which identifiers of + this entity hierarchy are unique. + + + + + The entity name which this persister maps. + + + + + Retrieve the underlying entity metamodel instance... + + The metamodel + + + + Returns an array of objects that identify spaces in which properties of + this entity are persisted, for instances of this class only. + + The property spaces. + + For most implementations, this returns the complete set of table names + to which instances of the mapped entity are persisted (not accounting + for superclass entity mappings). + + + + + Returns an array of objects that identify spaces in which properties of + this entity are persisted, for instances of this class and its subclasses. + + + Much like , except that here we include subclass + entity spaces. + + The query spaces. + + + + Are instances of this class mutable? + + + + + Determine whether the entity is inherited one or more other entities. + In other words, is this entity a subclass of other entities. + + True if other entities extend this entity; false otherwise. + + + + Is the identifier assigned before the insert by an IDGenerator or is it returned + by the Insert() method? + + + This determines which form of Insert() will be called. + + + + + Are instances of this class versioned by a timestamp or version number column? + + + + + Get the type of versioning (optional operation) + + + + + Which property holds the version number? (optional operation) + + + + + If the entity defines a natural id (), which + properties make up the natural id. + + + The indices of the properties making of the natural id; or + null, if no natural id is defined. + + + + + Return the IIdentifierGenerator for the class + + + + + Get the Hibernate types of the class properties + + + + + Get the names of the class properties - doesn't have to be the names of the actual + .NET properties (used for XML generation only) + + + + + Gets if the Property is insertable. + + if the Property's value can be inserted. + + This is for formula columns and if the user sets the insert attribute on the <property> element. + + + + Which of the properties of this class are database generated values on insert? + + + Which of the properties of this class are database generated values on update? + + + + Properties that may be dirty (and thus should be dirty-checked). These + include all updatable properties and some associations. + + + + + Get the nullability of the properties of this class + + + + + Get the "versionability" of the properties of this class (is the property optimistic-locked) + + if the property is optimistic-locked; otherwise, . + + + + Get the cascade styles of the properties (optional operation) + + + + + Get the identifier type + + + + + Get the name of the indentifier property (or return null) - need not return the + name of an actual .NET property + + + + + Should we always invalidate the cache instead of recaching updated state + + + + + Should lazy properties of this entity be cached? + + + + + Get the cache (optional operation) + + + + Get the cache structure + + + + Get the user-visible metadata for the class (optional operation) + + + + + Is batch loading enabled? + + + + Is select snapshot before update enabled? + + + + Does this entity contain a version property that is defined + to be database generated? + + + + + Does this class support dynamic proxies? + + + + + Do instances of this class contain collections? + + + + + Determine whether any properties of this entity are considered mutable. + + + True if any properties of the entity are mutable; false otherwise (meaning none are). + + + + + Determine whether this entity contains references to persistent collections + which are fetchable by subselect? + + + True if the entity contains collections fetchable by subselect; false otherwise. + + + + + Does this class declare any cascading save/update/deletes? + + + + + Does the class have a property holding the identifier value? + + + + + Determine whether detahced instances of this entity carry their own + identifier value. + + + True if either (1) or + (2) the identifier is an embedded composite identifier; false otherwise. + + + The other option is the deprecated feature where users could supply + the id during session calls. + + + + + Determine whether this entity defines a natural identifier. + + True if the entity defines a natural id; false otherwise. + + + + Determine whether this entity defines any lazy properties (ala + bytecode instrumentation). + + + True if the entity has properties mapped as lazy; false otherwise. + + + + + Gets if the Property is updatable + + if the Property's value can be updated. + + This is for formula columns and if the user sets the update attribute on the <property> element. + + + + + Does this class have a cache? + + + + + Does this entity define any properties as being database-generated on insert? + + + + + Does this entity define any properties as being database-generated on update? + + + + + Get the concrete subclass corresponding to the given discriminator value + + + + + Get the result set aliases used for the identifier columns, given a suffix + + + + + Get the result set aliases used for the property columns, given a suffix (properties of this class, only). + + + + + Get the result set column names mapped for this property (properties of this class, only). + + + + + Get the alias used for the discriminator column, given a suffix + + + + + Retrieve property values from one row of a result set + + + + + The discriminator type + + + + + Get the names of columns used to persist the identifier + + + + + Get the name of the column used as a discriminator + + + + + Does the persistent class have subclasses? + + + + Does the result set contain rowids? + + + + Generate a list of collection index and element columns + + + + + + + + How many properties are there, for this class and all subclasses? (optional operation) + + + + + + May this property be fetched using an SQL outerjoin? + + + + + + + Get the cascade style of this (subclass closure) property + + + + + Is this property defined on a subclass of the mapped class? + + + + + + + Get an array of the types of all properties of all subclasses (optional operation) + + + + + + + Get the name of the numbered property of the class or a subclass + (optional operation) + + + + + + + Is the numbered property of the class of subclass nullable? + + + + + Return the column names used to persist all properties of all sublasses of the persistent class + (optional operation) + + + + + Return the table name used to persist the numbered property of + the class or a subclass + (optional operation) + + + + + Given the number of a property of a subclass, and a table alias, return the aliased column names + (optional operation) + + + + + + + + Get the main from table fragment, given a query alias (optional operation) + + + + + + + Get the column names for the given property path + + + + + Get the table name for the given property path + + + + + Return the alised identifier column names + + + + + Get the table alias used for the supplied column + + + + + Extends the generic ILoadable contract to add operations required by HQL + + + + + Given a query alias and an identifying suffix, render the identifier select fragment. + + + + + + + + Given a query alias and an identifying suffix, render the property select fragment. + + + + + Given a property name, determine the number of the table which contains the column + to which this property is mapped. + + The name of the property. + The number of the table to which the property is mapped. + + Note that this is not relative to the results from {@link #getConstraintOrderedTableNameClosure()}. + It is relative to the subclass table name closure maintained internal to the persister (yick!). + It is also relative to the indexing used to resolve {@link #getSubclassTableName}... + + + + Determine whether the given property is declared by our + mapped class, our super class, or one of our subclasses... +

+ Note: the method is called 'subclass property...' simply + for consistency sake (e.g. {@link #getSubclassPropertyTableNumber} +

+ The property name. + The property declarer +
+ + + Get the name of the table with the given index from the internal array. + + The index into the internal array. + + + + + The alias used for any filter conditions (mapped where-fragments or + enabled-filters). + + The root alias + The alias used for "filter conditions" within the where clause. + + This may or may not be different from the root alias depending upon the + inheritance mapping strategy. + + + + + Is this class explicit polymorphism only? + + + + + The class that this class is mapped as a subclass of - not necessarily the direct superclass + + + + + The discriminator value for this particular concrete subclass, as a string that may be + embedded in a select statement + + + + + The discriminator value for this particular concrete subclass + + The DiscriminatorValue is specific of NH since we are using strongly typed parameters for SQL query. + + + + Is the inheritance hierarchy described by this persister contained across + multiple tables? + + True if the inheritance hierarchy is spread across multiple tables; false otherwise. + + + + Get the names of all tables used in the hierarchy (up and down) ordered such + that deletes in the given order would not cause constraint violations. + + The ordered array of table names. + + + + For each table specified in , get + the columns that define the key between the various hierarchy classes. + + + The first dimension here corresponds to the table indexes returned in + . + + The second dimension should have the same length across all the elements in + the first dimension. If not, that'd be a problem ;) + + + + + Get the name of the temporary table to be used to (potentially) store id values + when performing bulk update/deletes. + + The appropriate temporary table name. + + + + Get the appropriate DDL command for generating the temporary table to + be used to (potentially) store id values when performing bulk update/deletes. + + The appropriate temporary table creation command. + + + Is the version property included in insert statements? + + + + Describes a class that may be loaded via a unique key. + + + + + Load an instance of the persistent class, by a unique key other than the primary key. + + + + + Get the property number of the unique key property + + + + + A class persister that supports queries expressed in the platform native SQL dialect. + + + + + Returns the column alias names used to persist/query the numbered property of the class or a subclass (optional operation). + + + + + Return the column names used to persist/query the named property of the class or a subclass (optional operation). + + + + + All columns to select, when loading. + + + + + Get the type + + + + + Contract for things that can be locked via a . + + + Currently only the root table gets locked, except for the case of HQL and Criteria queries + against dialects which do not support either (1) FOR UPDATE OF or (2) support hint locking + (in which case *all* queried tables would be locked). + + + + + Get the SQL alias this persister would use for the root table + given the passed driving alias. + + + The driving alias; or the alias for the table mapped by this persister in the hierarchy. + + The root table alias. + + + + Locks are always applied to the "root table". + + + + + Get the names of columns on the root table used to persist the identifier. + + + + + For versioned entities, get the name of the column (again, expected on the + root table) used to store the version values. + + + + + To build the SQL command in pessimistic lock + + + + + Decide which tables need to be updated + + The indices of all the entity properties considered dirty. + Whether any collections owned by the entity which were considered dirty. + Array of booleans indicating which table require updating. + + The return here is an array of boolean values with each index corresponding + to a given table in the scope of this persister. + + + + + Generate the SQL that selects the version number by id + + + + + Retrieve the version number + + + + + Warning: + When there are duplicated property names in the subclasses + of the class, this method may return the wrong table + number for the duplicated subclass property (note that + SingleTableEntityPersister defines an overloaded form + which takes the entity name. + + + + + Get the column names for the numbered property of this class + + + + + Must be called by subclasses, at the end of their constructors + + + + Generate the SQL that updates a row by id (and version) + + + Generate the SQL that inserts a row + + + Marshall the fields of a persistent instance to a prepared statement + + + + Unmarshall the fields of a persistent instance from a result set, + without resolving associations or collections + + + + + Perform an SQL INSERT, and then retrieve a generated identifier. + + + This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, select, etc). + + + + + Perform an SQL INSERT. + + + This for is used for all non-root tables as well as the root table + in cases where the identifier value is known before the insert occurs. + + + + Perform an SQL UPDATE or SQL INSERT + + + + Perform an SQL DELETE + + + + + Load an instance using the appropriate loader (as determined by + + + + + Transform the array of property indexes to an array of booleans, true when the property is dirty + + + + Which properties appear in the SQL update? (Initialized, updateable ones!) + + + + Determines whether the specified entity is an instance of the class + managed by this persister. + + The entity. + The entity mode. + + if the specified entity is an instance; otherwise, . + + + + + The queries that delete rows by id (and version) + + + + + The queries that insert rows with a given id + + + + + The queries that update rows by id (and version) + + + + + The query that inserts a row, letting the database generate an id + + The IDENTITY-based insertion query. + + + + We can't immediately add to the cache if we have formulas + which must be evaluated, or if we have the possibility of + two concurrent updates to the same item being merged on + the database. This can happen if (a) the item is not + versioned and either (b) we have dynamic update enabled + or (c) we have multiple tables holding the state of the + item. + + + + The property name of the "special" identifier property in HQL + + + + A IEntityPersister implementing the normalized "table-per-subclass" mapping strategy + + + + + Constructs the NormalizedEntityPerister for the PersistentClass. + + The PersistentClass to create the EntityPersister for. + The configured . + The SessionFactory that this EntityPersister will be stored in. + The mapping used to retrieve type information. + + + + Find the Index of the table name from a list of table names. + + The name of the table to find. + The array of table names + The Index of the table in the array. + Thrown when the tableName specified can't be found + + + + Not really a Loader, just a wrapper around a named query. + + + + + Default implementation of the ClassPersister interface. Implements the + "table-per-class hierarchy" mapping strategy for an entity class. + + + + Generate the SQL that selects a row by id + + + + Factory for IEntityPersister and ICollectionPersister instances. + + + + + Creates a built in Entity Persister or a custom Persister. + + + + + Creates a specific Persister - could be a built in or custom persister. + + + + + A Strategy for converting a mapped property name to a Field name. + + + + + When implemented by a class, converts the Property's name into a Field name + + The name of the mapped property. + The name of the Field. + + + Represents a "back-reference" to the id of a collection owner. + + + + Abstracts the notion of a "property". Defines a strategy for accessing the + value of a mapped property. + + + + + When implemented by a class, create a "getter" for the mapped property. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to get the value of the Property from an + instance of the . + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + When implemented by a class, create a "setter" for the mapped property. + + The to find the Property in. + The name of the mapped Property to set. + + The to use to set the value of the Property on an + instance of the . + + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + Allow embedded and custom accessors to define if the ReflectionOptimizer can be used. + + + + The Setter implementation for id backrefs. + + + + Sets values of a particular mapped property. + + + + + When implemented by a class, sets the value of the Property/Field on the object. + + The object to set the Property value in. + The value to set the Property to. + + Thrown when there is a problem setting the value in the target. + + + + + When implemented by a class, gets the name of the Property. + + The name of the Property or . + + This is an optional operation - if it is not implemented then + is an acceptable value to return. + + + + + When implemented by a class, gets the for the set + accessor of the property. + + + This is an optional operation - if the is not + for a property set then is an acceptable value to return. + It is used by the proxies to determine which setter to intercept for the + identifier property. + + + + The Getter implementation for id backrefs. + + + + Gets values of a particular mapped property. + + + + + When implemented by a class, gets the value of the Property/Field from the object. + + The object to get the Property/Field value from. + + The value of the Property for the target. + + + Thrown when there is a problem getting the value from the target. + + + + Get the property value from the given owner instance. + The instance containing the value to be retrieved. + a map of merged persistent instances to detached instances + The session from which this request originated. + The extracted value. + + + + When implemented by a class, gets the that the Property/Field returns. + + The that the Property returns. + + + + When implemented by a class, gets the name of the Property. + + The name of the Property or . + + This is an optional operation - if the is not + for a Property get then is an acceptable value to return. + + + + + When implemented by a class, gets the for the get + accessor of the property. + + + This is an optional operation - if the is not + for a property get then is an acceptable value to return. + It is used by the proxies to determine which getter to intercept for the + identifier property. + + + + + Accesses mapped property values via a get/set pair, which may be nonpublic. + The default (and recommended strategy). + + + + + Create a for the mapped property. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to get the value of the Property from an + instance of the . + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + Create a for the mapped property. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to set the value of the Property on an + instance of the . + + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + Helper method to find the Property get. + + The to find the Property in. + The name of the mapped Property to get. + + The for the Property get or + if the Property could not be found. + + + + + Helper method to find the Property set. + + The to find the Property in. + The name of the mapped Property to set. + + The for the Property set or + if the Property could not be found. + + + + + An for a Property get. + + + + + An that can emit IL to get the property value. + + + + + Emit IL to get the property value from the object on top of the stack. + + + + + Initializes a new instance of . + + The that contains the Property get. + The for reflection. + The name of the Property. + + + + Gets the value of the Property from the object. + + The object to get the Property value from. + + The value of the Property for the target. + + + + + Gets the that the Property returns. + + The that the Property returns. + + + + Gets the name of the Property. + + The name of the Property. + + + + Gets the for the Property. + + + The for the Property. + + + + + An for a Property set. + + + + + An that can emit IL to set the property value. + + + + + Emit IL to set the property of an object to the value. The object + is loaded onto the stack first, then the value, then this method + is called. + + + + + Initializes a new instance of . + + The that contains the Property set. + The for reflection. + The name of the mapped Property. + + + + Sets the value of the Property on the object. + + The object to set the Property value in. + The value to set the Property to. + + Thrown when there is a problem setting the value in the target. + + + + + Gets the name of the mapped Property. + + The name of the mapped Property or . + + + + Gets the for the mapped Property. + + The for the mapped Property. + + + + Implementation of for fields that are prefixed with + an m_ and the PropertyName is changed to camelCase. + + + + + Converts the Property's name into a Field name by making the first character + of the propertyName lowercase and prefixing it with the letter 'm' + and an underscore. + + The name of the mapped property. + The name of the Field in CamelCase format prefixed with an 'm' and an underscore. + + + + Implementation of for fields that are the + camelCase version of the PropertyName + + + + + Converts the Property's name into a Field name by making the first character + lower case. + + The name of the mapped property. + The name of the Field in CamelCase format. + + + + Implementation of for fields that are prefixed with + an underscore and the PropertyName is changed to camelCase. + + + + + Converts the Property's name into a Field name by making the first character + of the propertyName lowercase and prefixing it with an underscore. + + The name of the mapped property. + The name of the Field in CamelCase format prefixed with an underscore. + + + + Access the mapped property by using a Field to get and set the value. + + + The is useful when you expose getter and setters + for a Property, but they have extra code in them that shouldn't be executed when NHibernate + is setting or getting the values for loads or saves. + + + + + Initializes a new instance of . + + + + + Initializes a new instance of . + + The to use. + + + + Create a to get the value of the mapped Property + through a Field. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to get the value of the Property from an + instance of the . + + Thrown when a Field specified by the propertyName could not + be found in the . + + + + + Create a to set the value of the mapped Property + through a Field. + + The to find the mapped Property in. + The name of the mapped Property to set. + + The to use to set the value of the Property on an + instance of the . + + + Thrown when a Field for the Property specified by the propertyName using the + could not be found in the . + + + + + Helper method to find the Field. + + The to find the Field in. + The name of the Field to find. + + The for the field. + + + Thrown when a field could not be found. + + + + + Converts the mapped property's name into a Field using + the if one exists. + + The name of the Property. + The name of the Field. + + + + Gets the used to convert the name of the + mapped Property in the hbm.xml file to the name of the field in the class. + + The or . + + + + An that uses a Field instead of the Property get. + + + + + Initializes a new instance of . + + The that contains the field to use for the Property get. + The for reflection. + The name of the Field. + + + + Gets the value of the Field from the object. + + The object to get the Field value from. + + The value of the Field for the target. + + + + + Gets the that the Field returns. + + The that the Field returns. + + + + Gets the name of the Property. + + since this is a Field - not a Property. + + + + Gets the for the Property. + + since this is a Field - not a Property. + + + + An that uses a Field instead of the Property set. + + + + + Initializes a new instance of . + + The that contains the Field to use for the Property set. + The for reflection. + The name of the Field. + + + + Sets the value of the Field on the object. + + The object to set the Field value in. + The value to set the Field to. + + Thrown when there is a problem setting the value in the target. + + + + + Gets the name of the Property. + + since this is a Field - not a Property. + + + + Gets the for the Property. + + since this is a Field - not a Property. + + + Represents a "back-reference" to the index of a collection. + + + Constructs a new instance of IndexPropertyAccessor. + The collection role which this back ref references. + The owner entity name. + + + The Setter implementation for index backrefs. + + + The Getter implementation for index backrefs. + + + + Implementation of for fields that are + the PropertyName in all LowerCase characters. + + + + + Converts the Property's name into a Field name by making the all characters + of the propertyName lowercase. + + The name of the mapped property. + The name of the Field in lowercase. + + + + Implementation of for fields that are prefixed with + an underscore and the PropertyName is changed to lower case. + + + + + Converts the Property's name into a Field name by making the all characters + of the propertyName lowercase and prefixing it with an underscore. + + The name of the mapped property. + The name of the Field in lowercase prefixed with an underscore. + + + Used to declare properties not represented at the pojo level + + + A Getter which will always return null. It should not be called anyway. + + + A Setter which will just do nothing. + + + + Access the mapped property through a Property get to get the value + and go directly to the Field to set the value. + + + This is most useful because Classes can provider a get for the Property + that is the <id> but tell NHibernate there is no setter for the Property + so the value should be written directly to the field. + + + + + Initializes a new instance of . + + The to use. + + + + Creates an to get the value from the Property. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to get the value of the Property from an + instance of the . + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + Create a to set the value of the mapped Property + through a Field. + + The to find the mapped Property in. + The name of the mapped Property to set. + + The to use to set the value of the Property on an + instance of the . + + + Thrown when a Field for the Property specified by the propertyName using the + could not be found in the . + + + + + Converts the Property's name into a Field name by making the first character + of the propertyName uppercase and prefixing it with the letter 'm'. + + The name of the mapped property. + The name of the Field in PascalCase format prefixed with an 'm'. + + + + Implementation of for fields that are prefixed with + an m_ and the first character in PropertyName capitalized. + + + + + Converts the Property's name into a Field name by making the first character + of the propertyName uppercase and prefixing it with the letter 'm' + and an underscore. + + The name of the mapped property. + The name of the Field in PascalCase format prefixed with an 'm' and an underscore. + + + + Implementation of for fields that are prefixed with + an _ and the first character in PropertyName capitalized. + + + + + Converts the Property's name into a Field name by making the first character + of the propertyName uppercase and prefixing it with an underscore. + + The name of the mapped property. + The name of the Field in PascalCase format prefixed with an underscore. + + + + Factory for creating the various PropertyAccessor strategies. + + + + + Initializes the static members in . + + + + + Gets or creates the specified by the type. + + + The specified by the type. + + + The built in ways of accessing the values of Properties in your domain class are: + + + + Access Method + How NHibernate accesses the Mapped Class. + + + property + + The name attribute is the name of the Property. This is the + default implementation. + + + + field + + The name attribute is the name of the field. If you have any Properties + in the Mapped Class those will be bypassed and NHibernate will go straight to the + field. This is a good option if your setters have business rules attached to them + or if you don't want to expose a field through a Getter & Setter. + + + + nosetter + + The name attribute is the name of the Property. NHibernate will use the + Property's get method to retrieve the value and will use the field + to set the value. This is a good option for <id> Properties because this access method + allows users of the Class to get the value of the Id but not set the value. + + + + readonly + + The name attribute is the name of the Property. NHibernate will use the + Property's get method to retrieve the value but will never set the value back in the domain. + This is used for read-only calculated properties with only a get method. + + + + Assembly Qualified Name + + If NHibernate's built in s are not what is needed for your + situation then you are free to build your own. Provide an Assembly Qualified Name so that + NHibernate can call Activator.CreateInstance(AssemblyQualifiedName) to create it. + + + + + In order for the nosetter to know the name of the field to access NHibernate needs to know + what the naming strategy is. The following naming strategies are built into NHibernate: + + + + Naming Strategy + How NHibernate converts the value of the name attribute to a field name. + + + camelcase + + The name attribute should be changed to CamelCase to find the field. + <property name="FooBar" ... > finds a field fooBar. + + + + camelcase-underscore + + The name attribute should be changed to CamelCase and prefixed with + an underscore to find the field. + <property name="FooBar" ... > finds a field _fooBar. + + + + camelcase-m-underscore + + The name attribute should be changed to CamelCase and prefixed with + an 'm' and underscore to find the field. + <property name="FooBar" ... > finds a field m_fooBar. + + + + pascalcase-underscore + + The name attribute should be prefixed with an underscore + to find the field. + <property name="FooBar" ... > finds a field _FooBar. + + + + pascalcase-m-underscore + + The name attribute should be prefixed with an 'm' and underscore + to find the field. + <property name="FooBar" ... > finds a field m_FooBar. + + + + pascalcase-m + + The name attribute should be prefixed with an 'm'. + <property name="FooBar" ... > finds a field mFooBar. + + + + lowercase + + The name attribute should be changed to lowercase to find the field. + <property name="FooBar" ... > finds a field foobar. + + + + lowercase-underscore + + The name attribute should be changed to lowercase and prefixed with + and underscore to find the field. + <property name="FooBar" ... > finds a field _foobar. + + + + + The naming strategy can also be appended at the end of the field access method. Where + this could be useful is a scenario where you do expose a get and set method in the Domain Class + but NHibernate should only use the fields. + + + With a naming strategy and a get/set for the Property available the user of the Domain Class + could write an Hql statement from Foo as foo where foo.SomeProperty = 'a'. If no naming + strategy was specified the Hql statement would have to be from Foo as foo where foo._someProperty + (assuming CamelCase with an underscore field naming strategy is used). + + + + + Retrieves a PropertyAccessor instance based on the given property definition and entity mode. + The property for which to retrieve an accessor. + The mode for the resulting entity. + An appropriate accessor. + + + + Access the mapped property through a Property get to get the value + and do nothing to set the value. + + + This is useful to allow calculated properties in the domain that will never + be recovered from the DB but can be used for querying. + + + + + Initializes a new instance of . + + + + + Creates an to get the value from the Property. + + The to find the Property in. + The name of the mapped Property to get. + + The to use to get the value of the Property from an + instance of the . + + Thrown when a Property specified by the propertyName could not + be found in the . + + + + + Create a to do nothing when trying to + se the value of the mapped Property + + The to find the mapped Property in. + The name of the mapped Property to set. + + An instance of . + + + + + Responsible for accessing property values represented as a XmlElement + or XmlAttribute. + + + + For nodes like "@bar" + + + Defines the strategy for getting property values out of a dom4j Node. + + + Get the declared type + + + Optional operation (return null) + + + Optional operation (return null) + + + For nodes like "@bar" + + + Optional operation (return null) + + + Optional operation (return null) + + + For nodes like "foo/@bar" + + + For nodes like "foo/@bar" + + + For nodes like "foo" + + + For nodes like "foo" + + + For nodes like "." + + + For nodes like "." + + + Lazy initializer for "dynamic-map" entity representations. + + + + Provides the base functionality to Handle Member calls into a dynamically + generated NHibernate Proxy. + + + This could be an extension point later if the .net framework ever gets a Proxy + class that is similar to the java.lang.reflect.Proxy or if a library similar + to cglib was made in .net. + + + + + Perform an ImmediateLoad of the actual object for the Proxy. + + + Thrown when the Proxy has no Session or the Session is closed or disconnected. + + + + + Return the underlying persistent object, initializing if necessary. + + The persistent object this proxy is proxying. + + + + Return the underlying persistent object in a given , or null. + + The session to get the object from. + The persistent object this proxy is proxying, or . + + + + Initialize the proxy manually by injecting its target. + + The proxy target (the actual entity being proxied). + + + + Associate the proxy with the given session. + + Care should be given to make certain that the proxy is added to the session's persistence context as well + to maintain the symmetry of the association. That must be done separately as this method simply sets an + internal reference. We do also check that if there is already an associated session that the proxy + reference was removed from that previous session's persistence context. + + The session + + + + Unset this initializer's reference to session. It is assumed that the caller is also taking care or + cleaning up the owning proxy's reference in the persistence context. + + Generally speaking this is intended to be called only during and + processing; most other use-cases should call instead. + + + + + The identifier value for the entity our owning proxy represents. + + + + + The entity-name of the entity our owning proxy represents. + + + + + Get the actual class of the entity. Generally, should be used instead. + + + + + Is the proxy uninitialzed? + + + + + Get the session to which this proxy is associated, or null if it is not attached. + + + + + Is the read-only setting available? + + + + + Read-only status + + + + Not available when the proxy is detached or its associated session is closed. + + + To check if the read-only setting is available, use + + + The read-only status of the entity will be made to match the read-only status of the proxy + upon initialization. + + + + + + If this is returned by Invoke then the subclass needs to Invoke the + method call against the object that is being proxied. + + + + + Create a LazyInitializer to handle all of the Methods/Properties that are called + on the Proxy. + + The entityName + The Id of the Object we are Proxying. + The ISession this Proxy is in. + + + + + + + + + + Perform an ImmediateLoad of the actual object for the Proxy. + + + Thrown when the Proxy has no Session or the Session is closed or disconnected. + + + + + Return the Underlying Persistent Object, initializing if necessary. + + The Persistent Object this proxy is Proxying. + + + + Return the Underlying Persistent Object in a given , or null. + + The Session to get the object from. + The Persistent Object this proxy is Proxying, or . + + + + + + + + + Proxy for "dynamic-map" entity representations. + + + + A marker interface so NHibernate can know if it is dealing with + an object that is a Proxy. + + + + This interface should not be implemented by anything other than + the Dynamically generated Proxy. If it is implemented by a class then + NHibernate will think that class is a Proxy and will not work. + + + It has to be public scope because + the Proxies are created in a separate DLL than NHibernate. + + + + + Get the underlying lazy initialization handler. + + + Contract for run-time, proxy-based lazy initialization proxies. + + + Called immediately after instantiation of this factory. + + The name of the entity for which this factory should generate proxies. + + + The entity class for which to generate proxies; not always the same as the entityName. + + + The interfaces to expose in the generated proxy; + is already included in this collection. + + + Reference to the identifier getter method; invocation on this method should not force initialization + + + Reference to the identifier setter method; invocation on this method should not force initialization + + + For composite identifier types, a reference to + the type of the identifier + property; again accessing the id should generally not cause + initialization - but need to bear in mind key-many-to-one + mappings. + + Indicates a problem completing post + + Essentially equivalent to constructor injection, but contracted + here via interface. + + + + + Create a new proxy + + The id value for the proxy to be generated. + The session to which the generated proxy will be associated. + The generated proxy. + Indicates problems generating requested proxy. + + + Lazy initializer for POCOs + + + + Adds all of the information into the SerializationInfo that is needed to + reconstruct the proxy during deserialization or to replace the proxy + with the instantiated target. + + + This will only be called if the Dynamic Proxy generator does not handle serialization + itself or delegates calls to the method GetObjectData to the LazyInitializer. + + + + + Invokes the method if this is something that the LazyInitializer can handle + without the underlying proxied object being instantiated. + + The name of the method/property to Invoke. + The arguments to pass the method/property. + The proxy object that the method is being invoked on. + + The result of the Invoke if the underlying proxied object is not needed. If the + underlying proxied object is needed then it returns the result + which indicates that the Proxy will need to forward to the real implementation. + + + + + Convenient common implementation for ProxyFactory + + + + + Proxeability validator. + + + + + Validates whether can be specified as the base class + (or an interface) for a dynamically-generated proxy. + + The type to validate. + + A collection of errors messages, if any, or if none were found. + + + When the configuration property "use_proxy_validator" is set to true(default), the result of this method + is used to throw a detailed exception about the proxeability of the given . + + + + + Validate if a single method can be intercepted by proxy. + + The given method to check. + if the method can be intercepted by proxy. + otherwise. + + + This method can be used internally by the and is used + by to log errors when + a property accessor can't be intercepted by proxy. + The validation of property accessors is fairly enough if you ecampsulate each property. + + + + + Validates whether can be specified as the base class + (or an interface) for a dynamically-generated proxy. + + The type to validate. + + A collection of errors messages, if any, or if none were found. + + + + + NHibernateProxyHelper provides convenience methods for working with + objects that might be instances of Classes or the Proxied version of + the Class. + + + + + Get the class of an instance or the underlying class of a proxy (without initializing the proxy!). + It is almost always better to use the entity name! + + The object to get the type of. + The Underlying Type for the object regardless of if it is a Proxy. + + + + Get the true, underlying class of a proxied persistent class. This operation + will NOT initialize the proxy and thus may return an incorrect result. + + a persistable object or proxy + guessed class of the instance + + This method is approximate match for Session.bestGuessEntityName in H3.2 + + + + + Aliases tables and fields for Sql Statements. + + + Several methods of this class take an additional + parameter, while their Java counterparts + do not. The dialect is used to correctly quote and unquote identifiers. + Java versions do the quoting and unquoting themselves and fail to + consider dialect-specific rules, such as escaping closing brackets in + identifiers on MS SQL 2000. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An ANSI SQL CASE expression. + case when ... then ... end as ... + + This class looks StringHelper.SqlParameter safe... + + + Abstract SQL case fragment renderer + + + + An ANSI-style Join. + + + + + Represents a SQL JOIN + + + + + + + + Sets the op + + The op to set + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An Oracle-style DECODE function. + + decode(pkvalue, key1, 1, key2, 2, ..., 0) + + + + + + + + Represents an SQL for update of ... nowait statement + + + + + An Informix-style (theta) Join + + + + + Represents an ... in (...) expression + + + + + Add a value to the value list. Value may be a string, + a , or one of special values + or . + + + + + + + + An Oracle-style (theta) Join + + + + + This method is a bit of a hack, and assumes + that the column on the "right" side of the + join appears on the "left" side of the + operator, which is extremely weird if this + was a normal join condition, but is natural + for a filter. + + + + + A placeholder for an ADO.NET parameter in an . + + + + + We need to know what the position of the parameter was in a query + before we rearranged the query. + This is the ADO parameter position that this SqlString parameter is + bound to. The SqlString can be safely rearranged once this is set. + + + + + Create a parameter with the specified position + + + + + Generates an array of parameters for the given SqlTypes. + + The number of parameters to generate. + An array of objects + + + + Determines whether this instance and the specified object + are of the same type and have the same values. + + An object to compare to this instance. + + if the object equals the current instance. + + + + + Gets a hash code for the parameter. + + + An value for the hash code. + + + + + Used to determine the parameter's name (p0,p1 etc.) + + + + + Unique identifier of a parameter to be tracked back by its generator. + + + We have various query-systems. Each one, at the end, give us a . + At the same time we have various bad-guys playing the game (hql function implementations, the dialect...). + A bad guy can rearrange a and the query-system can easly lost organization/sequence of parameters. + Using the the query-system can easily find where are its parameters. + + + + + Used as a placeholder when parsing HQL or SQL queries. + + + + + Summary description for QueryJoinFragment. + + + + + Summary description for QuerySelect. + + + + + Certain databases don't like spaces around these operators. + + + This needs to contain both a plain string and a + SqlString version of the operator because the portions in + the WHERE clause will come in as SqlStrings since there + might be parameters, other portions of the clause come in + as strings since there are no parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds a string containing a valid "order by" sql statement + to this QuerySelect + + The "order by" sql statement. + + + + + + + + + + + + + + + + + Represents part of an SQL SELECT clause + + + + + Equivalent to ToSqlStringFragment. + + + + In H3, it is called ToFragmentString(). It appears to be + functionally equivalent as ToSqlStringFragment() here. + + + + + The base class for all of the SqlBuilders. + + + + + Converts the ColumnNames and ColumnValues to a WhereFragment + + The names of the Columns to Add to the WhereFragment + A SqlString that contains the WhereFragment + This just calls the overloaded ToWhereFragment() with the operator as " = " and the tableAlias null. + + + + Converts the ColumnNames and ColumnValues to a WhereFragment + + The Alias for the Table. + The names of the Columns to Add to the WhereFragment + A SqlString that contains the WhereFragment + This defaults the op to " = " + + + + Converts the ColumnNames and ColumnValues to a WhereFragment + + The names of the Columns to Add to the WhereFragment + The operator to use between the names & values. For example " = " or "!=" + A SqlString that contains the WhereFragment + + + + Converts the ColumnNames and ColumnValues to a WhereFragment + + The Alias for the Table. + The names of the Columns to Add to the WhereFragment + The operator to use between the names & values. For example " = " or "!=" + A SqlString that contains the WhereFragment + + + + re-set the index of each parameter in the final command. + + The offset from where start the list of , in the given command, for the this . + + Suppose the final command is composed by two queries. The for the first query is zero. + If the first query command has 12 parameters (size of its SqlType array) the offset to bind all s, of the second query in the + command, is 12 (for the first query we are using from 0 to 11). + + This method should be called before call . + + + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The parameter-list of the whole query of the command. + The offset from where start the list of , in the given , for the this . + The session against which the current execution is occuring. + + Suppose the is composed by two queries. The for the first query is zero. + If the first query in has 12 parameters (size of its SqlType array) the offset to bind all s, of the second query in the + , is 12 (for the first query we are using from 0 to 11). + + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The session against which the current execution is occuring. + + Use this method when the contains just 'this' instance of . + Use the overload when the contains more instances of . + + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The parameter-list of the whole query of the command. + The offset from where start the list of , in the given , for the this . + The session against which the current execution is occuring. + + + + Bind the appropriate value into the given command. + + The command into which the value should be bound. + The session against which the current execution is occuring. + + Use this method when the contains just 'this' instance of . + Use the overload when the contains more instances of . + + + + + A class that builds an DELETE sql statement. + + + + + Sets the IdentityColumn for the DELETE sql to use. + + An array of the column names for the Property + The IType of the Identity Property. + The SqlDeleteBuilder. + + + + Sets the VersionColumn for the DELETE sql to use. + + An array of the column names for the Property + The IVersionType of the Version Property. + The SqlDeleteBuilder. + + + + Adds the columns for the Type to the WhereFragment + + The names of the columns to add. + The IType of the property. + The operator to put between the column name and value. + The SqlDeleteBuilder + + + + Adds a string to the WhereFragement + + A well formed sql statement with no parameters. + The SqlDeleteBuilder + + + + Builds a SELECT SQL statement. + + + + + Sets the text that should appear after the FROM + + The fromClause to set + The SqlSelectBuilder + + + + Sets the text that should appear after the FROM + + The name of the Table to get the data from + The Alias to use for the table name. + The SqlSelectBuilder + + + + Sets the text that should appear after the FROM + + The fromClause in a SqlString + The SqlSelectBuilder + + + + Sets the text that should appear after the ORDER BY. + + The orderByClause to set + The SqlSelectBuilder + + + + Sets the text that should appear after the GROUP BY. + + The groupByClause to set + The SqlSelectBuilder + + + + Sets the SqlString for the OUTER JOINs. + + + All of the Sql needs to be included in the SELECT. No OUTER JOINS will automatically be + added. + + The outerJoinsAfterFrom to set + The outerJoinsAfterWhere to set + The SqlSelectBuilder + + + + Sets the text for the SELECT + + The selectClause to set + The SqlSelectBuilder + + + + Sets the text for the SELECT + + The selectClause to set + The SqlSelectBuilder + + + + Sets the criteria to use for the WHERE. It joins all of the columnNames together with an AND. + + + The names of the columns + The Hibernate Type + The SqlSelectBuilder + + + + Sets the prebuilt SqlString to the Where clause + + The SqlString that contains the sql and parameters to add to the WHERE + This SqlSelectBuilder + + + + Sets the criteria to use for the WHERE. It joins all of the columnNames together with an AND. + + + The names of the columns + The Hibernate Type + The SqlSelectBuilder + + + + Sets the prebuilt SqlString to the Having clause + + The SqlString that contains the sql and parameters to add to the HAVING + This SqlSelectBuilder + + + + ToSqlString() is named ToStatementString() in H3 + + + + + + + + + Summary description for SqlSimpleSelectBuilder. + + + + + + + + + + + + Adds a columnName to the SELECT fragment. + + The name of the column to add. + The SqlSimpleSelectBuilder + + + + Adds a columnName and its Alias to the SELECT fragment. + + The name of the column to add. + The alias to use for the column + The SqlSimpleSelectBuilder + + + + Adds an array of columnNames to the SELECT fragment. + + The names of the columns to add. + The SqlSimpleSelectBuilder + + + + Adds an array of columnNames with their Aliases to the SELECT fragment. + + The names of the columns to add. + The aliases to use for the columns + The SqlSimpleSelectBuilder + + + + Gets the Alias that should be used for the column + + The name of the column to get the Alias for. + The Alias if one exists, null otherwise + + + + Sets the IdentityColumn for the SELECT sql to use. + + An array of the column names for the Property + The IType of the Identity Property. + The SqlSimpleSelectBuilder. + + + + Sets the VersionColumn for the SELECT sql to use. + + An array of the column names for the Property + The IVersionType of the Version Property. + The SqlSimpleSelectBuilder. + + + + Set the Order By fragment of the Select Command + + The OrderBy fragment. It should include the SQL "ORDER BY" + The SqlSimpleSelectBuilder + + + + Adds the columns for the Type to the WhereFragment + + The names of the columns to add. + The IType of the property. + The operator to put between the column name and value. + The SqlSimpleSelectBuilder + + + + + + + This is a non-modifiable SQL statement that is ready to be prepared + and sent to the Database for execution. + + + A represents a (potentially partial) SQL query string + that may or may not contain query parameter references. A + decomposes the underlying SQL query string into a list of parts. Each part is either + 1) a string part, which represents a fragment of the underlying SQL query string that + does not contain any parameter references, or 2) a parameter part, which represents + a single query parameter reference in the underlying SQL query string. + + The constructors ensure that the number of string parts + in a are kept to an absolute minimum (as compact as possible) + by concatenating any adjoining string parts into a single string part. + + + Substring operations on a (such as , + , ) return a that reuses the parts + list of the instance on which the operation was performed. + Besides a reference to this parts list, the resulting instance + also stores the character offset into the original underlying SQL string at which the + substring starts and the length of the substring. By avoiding the unnecessary rebuilding + of part lists these operations have O(1) behaviour rather than O(n) behaviour. + + + If you need to modify this object pass it to a and + get a new object back from it. + + + + + + Empty instance. + + + + + Immutable list of string and parameter parts that make up this . + This list may be shared by multiple instances that present + different fragments of a common underlying SQL query string. + + + + + List of SQL query parameter references that occur in this . + + + + + Cached index of first part in that contains (part of) + a SQL fragment that falls within the scope of this instance. + + + + + Cached index of last part in that contains (part of) + a SQL fragment that falls within the scope of this instance. + + + + + Index of first character of the underlying SQL query string that is within scope of + this instance. + + + + + Number of characters of the underlying SQL query string that are within scope of + this instance from onwards. + + + + + Creates copy of other . + + + + + + Creates substring of other . + + + + + + + + Creates consisting of single string part. + + A SQL fragment + + + + Creates consisting of single parameter part. + + A query parameter + + + + Creates consisting of multiple parts. + + Arbitrary number of parts, which must be + either , or + values. + The instance is automatically compacted. + + + + Parse SQL in and create a SqlString representing it. + + + Parameter marks in single quotes will be correctly skipped, but otherwise the + lexer is very simple and will not parse double quotes or escape sequences + correctly, for example. + + + + + Appends the SqlString parameter to the end of the current SqlString to create a + new SqlString object. + + The SqlString to append. + A new SqlString object. + + A SqlString object is immutable so this returns a new SqlString. If multiple Appends + are called it is better to use the SqlStringBuilder. + + + + + Appends the string parameter to the end of the current SqlString to create a + new SqlString object. + + The string to append. + A new SqlString object. + + A SqlString object is immutable so this returns a new SqlString. If multiple Appends + are called it is better to use the SqlStringBuilder. + + + + + Compacts the SqlString into the fewest parts possible. + + A new SqlString. + + Combines all SqlParts that are strings and next to each other into + one SqlPart. + + + + + Makes a copy of the SqlString, with new parameter references (Placeholders) + + + + + Determines whether the end of this instance matches the specified String. + + A string to seek at the end. + if the end of this instance matches value; otherwise, + + + + Returns the index of the first occurrence of , case-insensitive. + + Text to look for in the . Must be in lower + case. + + The text must be located entirely in a string part of the . + Searching for "a ? b" in an consisting of + "a ", Parameter, " b" will result in no matches. + + The index of the first occurrence of , or -1 + if not found. + + + + Returns the index of the first occurrence of , case-insensitive. + + Text to look for in the . Must be in lower + The zero-based index of the search starting position. + The number of character positions to examine. + One of the enumeration values that specifies the rules for the search. + + The text must be located entirely in a string part of the . + Searching for "a ? b" in an consisting of + "a ", Parameter, " b" will result in no matches. + + The index of the first occurrence of , or -1 + if not found. + + + + Returns the index of the first occurrence of , case-insensitive. + + Text to look for in the . Must be in lower + case. + + The text must be located entirely in a string part of the . + Searching for "a ? b" in an consisting of + "a ", Parameter, " b" will result in no matches. + + The index of the first occurrence of , or -1 + if not found. + + + + Returns the index of the first occurrence of , case-insensitive. + + Text to look for in the . Must be in lower case. + The zero-based index of the search starting position. + The number of character positions to examine. + One of the enumeration values that specifies the rules for the search. + + The text must be located entirely in a string part of the . + Searching for "a ? b" in an consisting of + "a ", Parameter, " b" will result in no matches. + + The index of the first occurrence of , or -1 + if not found. + + + + Replaces all occurrences of a specified in this instance, + with another specified . + + A String to be replaced. + A String to replace all occurrences of oldValue. + + A new SqlString with oldValue replaced by the newValue. The new SqlString is + in the compacted form. + + + + + Determines whether the beginning of this SqlString matches the specified System.String, + using case-insensitive comparison. + + The System.String to seek + true if the SqlString starts with the value. + + + + Retrieves a substring from this instance. The substring starts at a specified character position. + + The starting character position of a substring in this instance. + + A new SqlString to the substring that begins at startIndex in this instance. + + + If the startIndex is greater than the length of the SqlString then is returned. + + + + + Returns substring of this SqlString starting with the specified + . If the text is not found, returns an + empty, not-null SqlString. + + + The method performs case-insensitive comparison, so the + passed should be in lower case. + + + + + Removes all occurrences of white space characters from the beginning and end of this instance. + + + A new SqlString equivalent to this instance after white space characters + are removed from the beginning and end. + + + + + Locate the part that contains the requested character index, and return the + part's index. Return -1 if the character position isn't found. + + + + + It the pendingContent is non-empty, append it as a new part and reset the pendingContent + to empty. The new part will be given the sqlIndex. After return, the sqlIndex will have + been updated to the next available index. + + + + + + + Returns the SqlString in a string where it looks like + SELECT col1, col2 FROM table WHERE col1 = ? + + + The question mark is used as the indicator of a parameter because at + this point we are not using the specific provider so we don't know + how that provider wants our parameters formatted. + + A provider-neutral version of the CommandText + + + + Gets the number of SqlParts contained in this SqlString. + + The number of SqlParts contained in this SqlString. + + + + The SqlStringBuilder is used to construct a SqlString. + + + + The SqlString is a nonmutable class so it can't have sql parts added + to it. Instead this class should be used to generate a new SqlString. + The SqlStringBuilder is to SqlString what the StringBuilder is to + a String. + + + This is different from the original version of SqlString because this does not + hold the sql string in the form of "column1=@column1" instead it uses an array to + build the sql statement such that + object[0] = "column1=" + object[1] = ref to column1 parameter + + + What this allows us to do is to delay the generating of the parameter for the sql + until the very end - making testing dialect indifferent. Right now all of our test + to make sure the correct sql is getting built are specific to MsSql2000Dialect. + + + + + + Create an empty StringBuilder with the default capacity. + + + + + Create a StringBuilder with a specific capacity. + + The number of parts expected. + + + + Create a StringBuilder to modify the SqlString + + The SqlString to modify. + + + + Adds the preformatted sql to the SqlString that is being built. + + The string to add. + This SqlStringBuilder + + + + Adds the Parameter to the SqlString that is being built. + The correct operator should be added before the Add(Parameter) is called + because there will be no operator ( such as "=" ) placed between the last Add call + and this Add call. + + The Parameter to add. + This SqlStringBuilder + + + + Attempts to discover what type of object this is and calls the appropriate + method. + + The part to add when it is not known if it is a Parameter, String, or SqlString. + This SqlStringBuilder. + Thrown when the part is not a Parameter, String, or SqlString. + + + + Adds an existing SqlString to this SqlStringBuilder. It does NOT add any + prefix, postfix, operator, or wrap around this. It is equivalent to just + adding a string. + + The SqlString to add to this SqlStringBuilder + This SqlStringBuilder + This calls the overloaded Add(sqlString, null, null, null, false) + + + + Adds an existing SqlString to this SqlStringBuilder + + The SqlString to add to this SqlStringBuilder + String to put at the beginning of the combined SqlString. + How these Statements should be junctioned "AND" or "OR" + String to put at the end of the combined SqlString. + This SqlStringBuilder + + This calls the overloaded Add method with an array of SqlStrings and wrapStatment=false + so it will not be wrapped with a "(" and ")" + + + + + Adds existing SqlStrings to this SqlStringBuilder + + The SqlStrings to combine. + String to put at the beginning of the combined SqlString. + How these SqlStrings should be junctioned "AND" or "OR" + String to put at the end of the combined SqlStrings. + This SqlStringBuilder + This calls the overloaded Add method with wrapStatement=true + + + + Adds existing SqlStrings to this SqlStringBuilder + + The SqlStrings to combine. + String to put at the beginning of the combined SqlStrings. + How these SqlStrings should be junctioned "AND" or "OR" + String to put at the end of the combined SqlStrings. + Wrap each SqlStrings with "(" and ")" + This SqlStringBuilder + + + + Insert a string containing sql into the SqlStringBuilder at the specified index. + + The zero-based index at which the sql should be inserted. + The string containing sql to insert. + This SqlStringBuilder + + + + Insert a Parameter into the SqlStringBuilder at the specified index. + + The zero-based index at which the Parameter should be inserted. + The Parameter to insert. + This SqlStringBuilder + + + + Removes the string or Parameter at the specified index. + + The zero-based index of the item to remove. + This SqlStringBuilder + + + + Converts the mutable SqlStringBuilder into the immutable SqlString. + + The SqlString that was built. + + + + Gets the number of SqlParts in this SqlStringBuilder. + + + The number of SqlParts in this SqlStringBuilder. + + + + + Gets or Sets the element at the index + + Returns a string or Parameter. + + + + + A class that builds an UPDATE sql statement. + + + + + Add a column with a specific value to the UPDATE sql + + The name of the Column to add. + The value to set for the column. + The NHibernateType to use to convert the value to a sql string. + The SqlUpdateBuilder. + + + + Add a column with a specific value to the UPDATE sql + + The name of the Column to add. + A valid sql string to set as the value of the column. + The SqlUpdateBuilder. + + + + Adds columns with a specific value to the UPDATE sql + + The names of the Columns to add. + A valid sql string to set as the value of the column. This value is assigned to each column. + The SqlUpdateBuilder. + + + + Adds the Property's columns to the UPDATE sql + + An array of the column names for the Property + The IType of the property. + The SqlUpdateBuilder. + + + + Adds the Property's updatable columns to the UPDATE sql + + An array of the column names for the Property + An array of updatable column flags. If this array is null, all supplied columns are considered updatable. + The IType of the property. + The SqlUpdateBuilder. + + + + Sets the IdentityColumn for the UPDATE sql to use. + + An array of the column names for the Property + The IType of the Identity Property. + The SqlUpdateBuilder. + + + + Sets the VersionColumn for the UPDATE sql to use. + + An array of the column names for the Property + The IVersionType of the Version Property. + The SqlUpdateBuilder. + + + + Adds the columns for the Type to the WhereFragment + + The names of the columns to add. + The IType of the property. + The operator to put between the column name and value. + The SqlUpdateBuilder + + + + Adds a string to the WhereFragment + + A well formed sql string with no parameters. + The SqlUpdateBuilder + + + + + + + Given an SQL SELECT statement, parse it to extract clauses starting with + FROM, up to and not including ORDER BY (known collectively + as a subselect clause). + + + + + Contains the subselect clause as it is being built. + + + + + Initializes a new instance of the class. + + The to extract the subselect clause from. + + + + Looks for a FROM clause in the + and adds the clause to the result if found. + + A or a . + if the part contained a FROM clause, + otherwise. + + + + Returns the subselect clause of the statement + being processed. + + An containing + the subselect clause of the original SELECT + statement. + + + + Allows us to construct SQL WHERE fragments + + + + + Describes the details of a with the + information required to to generate an . + + + This can store the length of the string that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. + + + + + This is the base class that adds information to the + for the and + to use. + + +

+ The uses the SqlType to get enough + information to create an . +

+

+ The use the SqlType to convert the + to the appropriate sql type for SchemaExport. +

+
+
+ + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the string the should hold. + + + + Describes the details of a with the + information required to generate an . + + + This can store the length of the string that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the string the should hold. + + + + Describes the details of a that is stored in + a BLOB column with the information required to generate + an . + + +

+ This can store the length of the binary data that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. +

+

+ This is only needed by DataProviders (SqlClient) that need to specify a Size for the + IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a + BinarySqlType would work just fine. +

+
+
+ + + Describes the details of a with the + information required to to generate an . + + + This can store the binary data that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the binary data the should hold + + + + SqlTypeFactory provides Singleton access to the SqlTypes. + + + + + Describes the details of a that is stored in + a CLOB column with the information required to generate + an . + + +

+ This can store the length of the binary data that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. +

+

+ This is only needed by DataProviders (SqlClient) that need to specify a Size for the + IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a + StringSqlType would work just fine. +

+
+
+ + + Describes the details of a with the + information required to generate an . + + + This can store the length of the string that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the string the should hold. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the string the should hold. + + + + Describes the details of a with the + information required to to generate an . + + + This can store the length of the string that the can hold. + If no value is provided for the length then the Driver is responsible for + setting the properties on the correctly. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The length of the string the should hold. + + + + Statistics for a particular "category" (a named entity, + collection role, second level cache region or query). + + + + Collection related statistics + + + Entity related statistics + + + + Information about the first-level (session) cache for a particular session instance + + + + Get the number of entity instances associated with the session + + + Get the number of collection instances associated with the session + + + Get the set of all EntityKeys. + + + Get the set of all CollectionKeys. + + + + Statistics for a particular . + Beware of metrics, they are dependent of the precision: + + + + Reset all statistics + + + Find entity statistics per name + entity name + EntityStatistics object + + + Get collection statistics per role + collection role + CollectionStatistics + + + Second level cache statistics per region + region name + SecondLevelCacheStatistics + + + Query statistics from query string (HQL or SQL) + query string + QueryStatistics + + + log in info level the main statistics + + + Global number of entity deletes + + + Global number of entity inserts + + + Global number of entity loads + + + Global number of entity fetchs + + + Global number of entity updates + + + Global number of executed queries + + + The of the slowest query. + + + The query string for the slowest query. + + + The global number of cached queries successfully retrieved from cache + + + The global number of cached queries *not* found in cache + + + The global number of cacheable queries put in cache + + + Get the global number of flush executed by sessions (either implicit or explicit) + + + + Get the global number of connections asked by the sessions + (the actual number of connections used may be much smaller depending + whether you use a connection pool or not) + + + + Global number of cacheable entities/collections successfully retrieved from the cache + + + Global number of cacheable entities/collections not found in the cache and loaded from the database. + + + Global number of cacheable entities/collections put in the cache + + + Global number of sessions closed + + + Global number of sessions opened + + + Global number of collections loaded + + + Global number of collections fetched + + + Global number of collections updated + + + Global number of collections removed + + + Global number of collections recreated + + + Start time + + + Enable/Disable statistics logs (this is a dynamic parameter) + + + All executed query strings + + + The names of all entities + + + The names of all collection roles + + + Get all second-level cache region names + + + The number of transactions we know to have been successful + + + The number of transactions we know to have completed + + + The number of prepared statements that were acquired + + + The number of prepared statements that were released + + + The number of StaleObjectStateExceptions that occurred + + + + The OperationThreshold to a value greater than to enable logging of long running operations. + + Operations that exceed the level will be logged. + + + Statistics SPI for the NHibernate core + + + Query statistics (HQL and SQL) + Note that for a cached query, the cache miss is equals to the db count + + + Add statistics report of a DB query + rows count returned + time taken + + + Second level cache statistics of a specific region + + + + Not ported yet + + + + + Not ported yet + + + + + Not ported yet + + + + + Not ported yet + + + + + Contract for delegates responsible for managing connection used by the hbm2ddl tools. + + + + + Prepare the helper for use. + + + + + Release any resources held by this helper. + + + + + Get a reference to the connection we are using. + + + + + A implementation based on an internally + built and managed . + + + + + Generates ddl to export table schema for a configured Configuration to the database + + + This Class can be used directly or the command line wrapper NHibernate.Tool.hbm2ddl.exe can be + used when a dll can not be directly used. + + + + + Create a schema exported for a given Configuration + + The NHibernate Configuration to generate the schema from. + + + + Create a schema exporter for the given Configuration, with the given + database connection properties + + The NHibernate Configuration to generate the schema from. + The Properties to use when connecting to the Database. + + + + Set the output filename. The generated script will be written to this file + + The name of the file to output the ddl to. + The SchemaExport object. + + + + Set the end of statement delimiter + + The end of statement delimiter. + The SchemaExport object. + + + + Run the schema creation script + + if the ddl should be outputted in the Console. + if the ddl should be executed against the Database. + + This is a convenience method that calls and sets + the justDrop parameter to false. + + + + + Run the drop schema script + + if the ddl should be outputted in the Console. + if the ddl should be executed against the Database. + + This is a convenience method that calls and sets + the justDrop parameter to true. + + + + + Executes the Export of the Schema in the given connection + + if the ddl should be outputted in the Console. + if the ddl should be executed against the Database. + if only the ddl to drop the Database objects should be executed. + + The connection to use when executing the commands when export is . + Must be an opened connection. The method doesn't close the connection. + + The writer used to output the generated schema + + This method allows for both the drop and create ddl script to be executed. + This overload is provided mainly to enable use of in memory databases. + It does NOT close the given connection! + + + + + Executes the Export of the Schema. + + if the ddl should be outputted in the Console. + if the ddl should be executed against the Database. + if only the ddl to drop the Database objects should be executed. + + This method allows for both the drop and create ddl script to be executed. + + + + + Execute the schema updates + + + + + Execute the schema updates + + The action to write the each schema line. + Commit the script to DB + + + + Returns a List of all Exceptions which occured during the export. + + + + + Perform the validations. + + + + This acts as a template method. Specific Reader instances + override the component methods. + + + + + A implementation based on an explicitly supplied + connection. + + + + + A implementation based on a provided + . Essentially, ensures that the connection + gets cleaned up, but that the provider itself remains usable since it + was externally provided to us. + + + + + An abstract factory for instances. + Concrete implementations are specified by transaction.factory_class + configuration property. + + Implementors must be threadsafe and should declare a public default constructor. + + + + + + Configure from the given properties + + + + + + Create a new transaction and return it without starting it. + + + + + This is used as a marker interface for the different + transaction context required for each session + + + + + Wraps an ADO.NET to implement + the interface. + + + + + Allows the application to define units of work, while maintaining abstraction from the + underlying transaction implementation + + + A transaction is associated with a ISession and is usually instanciated by a call to + ISession.BeginTransaction(). A single session might span multiple transactions since + the notion of a session (a conversation between the application and the datastore) is of + coarser granularity than the notion of a transaction. However, it is intended that there be + at most one uncommitted ITransaction associated with a particular ISession + at a time. Implementors are not intended to be threadsafe. + + + + + Begin the transaction with the default isolation level. + + + + + Begin the transaction with the specified isolation level. + + Isolation level of the transaction + + + + Flush the associated ISession and end the unit of work. + + + This method will commit the underlying transaction if and only if the transaction + was initiated by this object. + + + + + Force the underlying transaction to roll back. + + + + + Enlist the in the current Transaction. + + The to enlist. + + It is okay for this to be a no op implementation. + + + + + Register a user synchronization callback for this transaction. + + The callback to register. + + + + Is the transaction in progress + + + + + Was the transaction rolled back or set to rollback only? + + + + + Was the transaction successfully committed? + + + This method could return even after successful invocation of Commit() + + + + + Initializes a new instance of the class. + + The the Transaction is for. + + + + Enlist the in the current . + + The to enlist in this Transaction. + + + This takes care of making sure the 's Transaction property + contains the correct or if there is no + Transaction for the ISession - ie BeginTransaction() not called. + + + This method may be called even when the transaction is disposed. + + + + + + Begins the on the + used by the . + + + Thrown if there is any problems encountered while trying to create + the . + + + + + Commits the by flushing the + and committing the . + + + Thrown if there is any exception while trying to call Commit() on + the underlying . + + + + + Rolls back the by calling the method Rollback + on the underlying . + + + Thrown if there is any exception while trying to call Rollback() on + the underlying . + + + + + A flag to indicate if Disose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this AdoTransaction is being Disposed of or Finalized. + + If this AdoTransaction is being Finalized (isDisposing==false) then make sure not + to call any methods that could potentially bring this AdoTransaction back to life. + + + + + Gets a indicating if the transaction was rolled back. + + + if the had Rollback called + without any exceptions. + + + + + Gets a indicating if the transaction was committed. + + + if the had Commit called + without any exceptions. + + + + + A mimic to the javax.transaction.Synchronization callback to enable + + + + + Result transformer that allows to transform a result to + a user specified class which will be populated via setter + methods or fields matching the alias names. + + + + IList resultWithAliasedBean = s.CreateCriteria(typeof(Enrollment)) + .CreateAlias("Student", "st") + .CreateAlias("Course", "co") + .SetProjection( Projections.ProjectionList() + .Add( Projections.Property("co.Description"), "CourseDescription" ) + ) + .SetResultTransformer( new AliasToBeanResultTransformer(typeof(StudentDTO)) ) + .List(); + + StudentDTO dto = (StudentDTO)resultWithAliasedBean[0]; + + + + + + Tranforms each result row from a tuple into a , such that what + you end up with is a of . + + + + + Each row of results is a map () from alias to values/entities + + + + Each row of results is a + + + + Creates a resulttransformer that will inject aliased values into instances + of via property methods or fields. + + + + Support for tuplizers relating to components. + + + + Defines further responsibilities regarding tuplization based on + a mapped components. + + + ComponentTuplizer implementations should have the following constructor signature: + (org.hibernate.mapping.Component) + + + + + A tuplizer defines the contract for things which know how to manage + a particular representation of a piece of data, given that + representation's (the entity-mode + essentially defining which representation). + + + If that given piece of data is thought of as a data structure, then a tuplizer + is the thing which knows how to: + + create such a data structure appropriately + extract values from and inject values into such a data structure + + + For example, a given piece of data might be represented as a POCO class. + Here, it's representation and entity-mode is POCO. Well a tuplizer for POCO + entity-modes would know how to: + + create the data structure by calling the POCO's constructor + extract and inject values through getters/setter, or by direct field access, etc + + + That same piece of data might also be represented as a DOM structure, using + the tuplizer associated with the XML entity-mode, which would generate instances + of as the data structure and know how to access the + values as either nested s or as s. + + + + + + + Extract the current values contained on the given entity. + + The entity from which to extract values. + The current property values. + HibernateException + + + Inject the given values into the given entity. + The entity. + The values to be injected. + + + Extract the value of a particular property from the given entity. + The entity from which to extract the property value. + The index of the property for which to extract the value. + The current value of the given property on the given entity. + + + Generate a new, empty entity. + The new, empty entity instance. + + + + Is the given object considered an instance of the the entity (acconting + for entity-mode) managed by this tuplizer. + + The object to be checked. + True if the object is considered as an instance of this entity within the given mode. + + + + Return the pojo class managed by this tuplizer. + + The persistent class. + + Need to determine how to best handle this for the Tuplizers for EntityModes + other than POCO. + + + + Retrieve the current value of the parent property. + + The component instance from which to extract the parent property value. + + The current value of the parent property. + + + Set the value of the parent property. + The component instance on which to set the parent. + The parent to be set on the component. + The current session factory. + + + Does the component managed by this tuuplizer contain a parent property? + True if the component does contain a parent property; false otherwise. + + + This method does not populate the component parent + + + + Handles mapping s to ComponentTuplizers. +

+ Most of the handling is really in the super class; here we just create + the tuplizers and add them to the superclass +

+
+ + Centralizes handling of to mappings. + + + Given a supposed instance of an entity/component, guess its entity mode. + The supposed instance of the entity/component. + The guessed entity mode. + + + + Locate the contained tuplizer responsible for the given entity-mode. If + no such tuplizer is defined on this mapping, then return null. + + The entity-mode for which the caller wants a tuplizer. + The tuplizer, or null if not found. + + + Locate the tuplizer contained within this mapping which is responsible + for the given entity-mode. If no such tuplizer is defined on this + mapping, then an exception is thrown. + + + The entity-mode for which the caller wants a tuplizer. + + The tuplizer. + + HibernateException Unable to locate the requested tuplizer. + + + Centralizes metamodel information about a component. + + + + A specific to the dynamic-map entity mode. + + + + + A specific to the POCO entity mode. + + + + Support for tuplizers relating to entities. + + + + Defines further responsibilities regarding tuplization based on a mapped entity. + + + EntityTuplizer implementations should have the following constructor signature: + (, ) + + + + Create an entity instance initialized with the given identifier. + The identifier value for the entity to be instantiated. + The instantiated entity. + + + Extract the identifier value from the given entity. + The entity from which to extract the identifier value. + The identifier value. + + + + Inject the identifier value into the given entity. + + The entity to inject with the identifier value. + The value to be injected as the identifier. + Has no effect if the entity does not define an identifier property + + + + Inject the given identifier and version into the entity, in order to + "roll back" to their original values. + + + The identifier value to inject into the entity. + The version value to inject into the entity. + + + Extract the value of the version property from the given entity. + The entity from which to extract the version value. + The value of the version property, or null if not versioned. + + + Inject the value of a particular property. + The entity into which to inject the value. + The property's index. + The property value to inject. + + + Inject the value of a particular property. + The entity into which to inject the value. + The name of the property. + The property value to inject. + + + Extract the values of the insertable properties of the entity (including backrefs) + The entity from which to extract. + a map of instances being merged to merged instances + The session in which the resuest is being made. + The insertable property values. + + + Extract the value of a particular property from the given entity. + The entity from which to extract the property value. + The name of the property for which to extract the value. + The current value of the given property on the given entity. + + + Called just after the entities properties have been initialized. + The entity being initialized. + Are defined lazy properties currently unfecthed + The session initializing this entity. + + + + Generates an appropriate proxy representation of this entity for this entity-mode. + + The id of the instance for which to generate a proxy. + The session to which the proxy should be bound. + The generate proxies. + + + Does the given entity instance have any currently uninitialized lazy properties? + The entity to be check for uninitialized lazy properties. + True if uninitialized lazy properties were found; false otherwise. + + + + Does the class managed by this tuplizer implement + the interface. + + True if the ILifecycle interface is implemented; false otherwise. + + + + Does the class managed by this tuplizer implement + the interface. + + True if the IValidatable interface is implemented; false otherwise. + + + Returns the java class to which generated proxies will be typed. + The .NET class to which generated proxies will be typed + + + Is it an instrumented POCO? + + + Does this entity, for this mode, present a possibility for proxying? + True if this tuplizer can generate proxies for this entity. + + + Constructs a new AbstractEntityTuplizer instance. + The "interpreted" information relating to the mapped entity. + The parsed "raw" mapping data relating to the given entity. + + + Build an appropriate Getter for the given property. + The property to be accessed via the built Getter. + The entity information regarding the mapped entity owning this property. + An appropriate Getter instance. + + + Build an appropriate Setter for the given property. + The property to be accessed via the built Setter. + The entity information regarding the mapped entity owning this property. + An appropriate Setter instance. + + + Build an appropriate Instantiator for the given mapped entity. + The mapping information regarding the mapped entity. + An appropriate Instantiator instance. + + + Build an appropriate ProxyFactory for the given mapped entity. + The mapping information regarding the mapped entity. + The constructed Getter relating to the entity's id property. + The constructed Setter relating to the entity's id property. + An appropriate ProxyFactory instance. + + + Extract a component property value. + The component property types. + The component instance itself. + The property path for the property to be extracted. + The property value extracted. + + + Return the entity-mode handled by this tuplizer instance. + + + Retrieves the defined entity-name for the tuplized entity. + + + + Retrieves the defined entity-names for any subclasses defined for this entity. + + + + + Handles mapping s to s. + + + Most of the handling is really in the super class; here we just create + the tuplizers and add them to the superclass + + + + + Instantiates a EntityEntityModeToTuplizerMapping based on the given + entity mapping and metamodel definitions. + + The entity mapping definition. + The entity metamodel definition. + + + An specific to the POCO entity mode. + + + Contract for implementors responsible for instantiating entity/component instances. + + + Perform the requested entity instantiation. + The id of the entity to be instantiated. + An appropriately instantiated entity. + This form is never called for component instantiation, only entity instantiation. + + + Perform the requested instantiation. + The instantiated data structure. + + + + Performs check to see if the given object is an instance of the entity + or component which this Instantiator instantiates. + + The object to be checked. + True is the object does represent an instance of the underlying entity/component. + + + + Represents a defined entity identifier property within the Hibernate + runtime-metamodel. + + + Author: Steve Ebersole + + + + + Defines the basic contract of a Property within the runtime metamodel. + + + + + Constructor for Property instances. + + The name by which the property can be referenced within its owner. + The node name to use for XML-based representation of this property. + The Hibernate Type of this property. + + + + Construct a non-virtual identifier property. + + The name of the property representing the identifier within + its owning entity. + The node name to use for XML-based representation of this + property. + The Hibernate Type for the identifier property. + Is this an embedded identifier. + The value which, if found as the value on the identifier + property, represents new (i.e., un-saved) instances of the owning entity. + The generator to use for id value generation. + + + + Construct a virtual IdentifierProperty. + + The Hibernate Type for the identifier property. + Is this an embedded identifier. + The value which, if found as the value on the identifier + property, represents new (i.e., un-saved) instances of the owning entity. + The generator to use for id value generation. + + + + Defines a POCO-based instantiator for use from the tuplizers. + + + + Responsible for generation of runtime metamodel representations. + Makes distinction between identifier, version, and other (standard) properties. + + + Author: Steve Ebersole + + + + + Generates an IdentifierProperty representation of the for a given entity mapping. + + The mapping definition of the entity. + The identifier value generator to use for this identifier. + The appropriate IdentifierProperty definition. + + + + Generates a VersionProperty representation for an entity mapping given its + version mapping Property. + + The version mapping Property. + Is property lazy loading currently available. + The appropriate VersionProperty definition. + + + + Generate a "standard" (i.e., non-identifier and non-version) based on the given + mapped property. + + The mapped property. + Is property lazy loading currently available. + The appropriate StandardProperty definition. + + + + Represents a basic property within the Hibernate runtime-metamodel. + + + Author: Steve Ebersole + + + + + Constructs StandardProperty instances. + + The name by which the property can be referenced within + its owner. + The node name to use for XML-based representation of this + property. + The Hibernate Type of this property. + Should this property be handled lazily? + Is this property an insertable value? + Is this property an updateable value? + Is this property generated in the database on insert? + Is this property generated in the database on update? + Is this property a nullable value? + Is this property a checkable value? + Is this property a versionable value? + The cascade style for this property's value. + Any fetch mode defined for this property + + + + Represents a version property within the Hibernate runtime-metamodel. + + + Author: Steve Ebersole + + + + + Constructs VersionProperty instances. + + The name by which the property can be referenced within + its owner. + The node name to use for XML-based representation of this + property. + The Hibernate Type of this property. + Should this property be handled lazily? + Is this property an insertable value? + Is this property an updateable value? + Is this property generated in the database on insert? + Is this property generated in the database on update? + Is this property a nullable value? + Is this property a checkable value? + Is this property a versionable value? + The cascade style for this property's value. + The value which, if found as the value of + this (i.e., the version) property, represents new (i.e., un-saved) + instances of the owning entity. + + + Logic to bind stream of byte into a VARBINARY + + + + Superclass for mutable nullable types. + + + + + Superclass of single-column nullable types. + + + Maps the Property to a single column that is capable of storing nulls in it. If a .net Struct is + used it will be created with its unitialized value and then on Update the uninitialized value of + the Struct will be written to the column - not . + + + + + The base implementation of the interface. + Mapping of the built in Type hierarchy. + + + + + Disassembles the object into a cacheable representation. + + The value to disassemble. + The is not used by this method. + optional parent entity object (needed for collections) + The disassembled, deep cloned state of the object + + This method calls DeepCopy if the value is not null. + + + + + Reconstructs the object from its cached "disassembled" state. + + The disassembled state from the cache + The is not used by this method. + The parent Entity object is not used by this method + The assembled object. + + This method calls DeepCopy if the value is not null. + + + + + Should the parent be considered dirty, given both the old and current + field or element value? + + The old value + The current value + The is not used by this method. + true if the field is dirty + This method uses IType.Equals(object, object) to determine the value of IsDirty. + + + + Retrives an instance of the mapped class, or the identifier of an entity + or collection from a . + + The that contains the values. + + The names of the columns in the that contain the + value to populate the IType with. + + the session + The parent Entity + An identifier or actual object mapped by this IType. + + This method uses the IType.NullSafeGet(IDataReader, string[], ISessionImplementor, object) method + to Hydrate this . + + + + + Maps identifiers to Entities or Collections. + + An identifier or value returned by Hydrate() + The is not used by this method. + The parent Entity is not used by this method. + The value. + + There is nothing done in this method other than return the value parameter passed in. + + + + + Says whether the value has been modified + + + + + When implemented by a class, returns a deep copy of the persistent + state, stopping at entities and at collections. + A Collection element or Entity fieldThe entityMode.The session factory.A deep copy of the object. + + + + When implemented by a class, returns the SqlTypes for the columns mapped by this IType. + The that uses this IType.An array of s. + + + + When implemented by a class, returns how many columns are used to persist this type. + The that uses this IType.The number of columns this IType spans.MappingException + + + + + + + + + + When implemented by a class, puts the value/values from the mapped + class into the . + The to put the values into.The object that contains the values.The index of the to start writing the values to.Indicates which columns are to be set. + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from . + + + + + When implemented by a class, puts the value/values from the mapped + class into the . + + The to put the values into. + The object that contains the values. + The index of the to start writing the values to. + + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from . + + + + + When implemented by a class, a representation of the value to be + embedded in an XML element + The object that contains the values.An Xml formatted string. + + + + Gets a value indicating if the is an . + + false - by default an is not an . + + + + Gets a value indicating if the is a . + + false - by default an is not a . + + + + Gets a value indicating if the is an . + + false - by default an is not an . + + + + Gets a value indicating if the is a . + + false - by default an is not a . + + + + Gets a value indicating if the implementation is an "object" type + + false - by default an is not a "object" type. + + + + When implemented by a class, gets the value indicating if the objects + of this IType are mutable. + true if the objects mapped by this IType are mutable. + With respect to the referencing object... + Entities and Collections are considered immutable because they manage their own internal state. + + + + + When implemented by a class, gets the abbreviated name of the type. + The NHibernate type name. + + + + When implemented by a class, gets the returned + by the NullSafeGet() methods. + + The from the .NET framework. + + This is used to establish the class of an array of this Itype + + + + + Initialize a new instance of the NullableType class using a + . + + The underlying . + This is used when the Property is mapped to a single column. + + + + When implemented by a class, put the value from the mapped + Property into to the . + + The to put the value into. + The object that contains the value. + The index of the to start writing the values to. + + Implementors do not need to handle possibility of null values because this will + only be called from after + it has checked for nulls. + + + + + When implemented by a class, gets the object in the + for the Property. + + The that contains the value. + The index of the field to get the value from. + An object with the value from the database. + + + + When implemented by a class, gets the object in the + for the Property. + + The that contains the value. + The name of the field to get the value from. + An object with the value from the database. + + Most implementors just call the + overload of this method. + + + + + A representation of the value to be embedded in an XML element + + The object that contains the values. + + An Xml formatted string. + + + + When implemented by a class, a representation of the value to be + embedded in an XML element + The object that contains the values.An Xml formatted string. + + + This implementation forwards the call to if the parameter + value is not null. + + + It has been "sealed" because the Types inheriting from + do not need and should not override this method. All of their implementation + should be in . + + + + + + Parse the XML representation of an instance + + XML string to parse, guaranteed to be non-empty + + + + + When implemented by a class, puts the value/values from the mapped + class into the . + + The to put the values into. + The object that contains the values. + The index of the to start writing the values to. + + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from . + + + + This implementation forwards the call to . + + + It has been "sealed" because the Types inheriting from + do not need to and should not override this method. All of their implementation + should be in . + + + + + + Puts the value from the mapped class into the . + + The to put the values into. + The object that contains the values. + The index of the to write the value to. + + + This method checks to see if value is null, if it is then the value of + is written to the . + + + If the value is not null, then the method + is called and that method is responsible for setting the value. + + + + + + When implemented by a class, gets an instance of the object mapped by + this IType from the . + The that contains the values + The names of the columns in the that contain the + value to populate the IType with. + The object mapped by this IType. + Implementors should handle possibility of null values. + + + This has been sealed because no other class should override it. This + method calls for a single value. + It only takes the first name from the string[] names parameter - that is a + safe thing to do because a Nullable Type only has one field. + + + + + Extracts the values of the fields from the DataReader + + The DataReader positioned on the correct record + An array of field names. + The value off the field from the DataReader + + In this class this just ends up passing the first name to the NullSafeGet method + that takes a string, not a string[]. + + I don't know why this method is in here - it doesn't look like anybody that inherits + from NullableType overrides this... + + TODO: determine if this is needed + + + + + Gets the value of the field from the . + + The positioned on the correct record. + The name of the field to get the value from. + The value of the field. + + + This method checks to see if value is null, if it is then the null is returned + from this method. + + + If the value is not null, then the method + is called and that method is responsible for retrieving the value. + + + + + + When implemented by a class, gets an instance of the object + mapped by this IType from the . + The that contains the valuesThe name of the column in the that contains the + value to populate the IType with.The object mapped by this IType. + Implementations should handle possibility of null values. + This method might be called if the IType is known to be a single-column type. + + + + This implementation forwards the call to . + + + It has been "sealed" because the Types inheriting from + do not need to and should not override this method. All of their implementation + should be in . + + + + + + When implemented by a class, returns the SqlTypes for the columns mapped by this IType. + The that uses this IType.An array of s. + + + This implementation forwards the call to . + + + It has been "sealed" because the Types inheriting from + do not need to and should not override this method because they map to a single + column. All of their implementation should be in . + + + + + + Returns the number of columns spanned by this + + A always returns 1. + + This has the hard coding of 1 in there because, by definition of this class, + a NullableType can only map to one column in a table. + + + + + Determines whether the specified is equal to this + . + + The to compare with this NullableType. + true if the SqlType and Name properties are the same. + + + + Serves as a hash function for the , + suitable for use in hashing algorithms and data structures like a hash table. + + + A hash code that is based on the 's + hash code and the 's hash code. + + + + Gets the underlying for + the column mapped by this . + + The underlying . + + This implementation should be suitable for all subclasses unless they need to + do some special things to get the value. There are no built in s + that override this Property. + + + + + Initialize a new instance of the MutableType class using a + . + + The underlying . + + + + Gets the value indicating if this IType is mutable. + + true - a is mutable. + + This has been "sealed" because any subclasses are expected to be mutable. If + the type is immutable then they should inherit from . + + + + + An that may be used to version data. + + + + + When implemented by a class, increments the version. + + The current version + The current session, if available. + an instance of the that has been incremented. + + + + When implemented by a class, gets an initial version. + + The current session, if available. + An instance of the type. + + + + Are the two version values considered equal? + + One value to check. + The other value to check. + true if the values are equal, false otherwise. + + + + Get a comparator for the version numbers + + + + Convert the byte[] into the expected object type + + + Convert the object into the internal byte[] representation + + + + Common base class for and . + + + + + Superclass of types. + + + + + Superclass of nullable immutable types. + + + + + Initialize a new instance of the ImmutableType class using a + . + + The underlying . + + + + Gets the value indicating if this IType is mutable. + + false - an is not mutable. + + This has been "sealed" because any subclasses are expected to be immutable. If + the type is mutable then they should inherit from . + + + + + An that may appear as an SQL literal + + + + + When implemented by a class, return a representation + of the value, suitable for embedding in an SQL statement + + The object to convert to a string for the SQL statement. + + A string that contains a well formed SQL Statement. + + + + Initialize a new instance of the PrimitiveType class using a . + + The underlying . + + + + When implemented by a class, return a representation + of the value, suitable for embedding in an SQL statement + + The object to convert to a string for the SQL statement. + + A string that containts a well formed SQL Statement. + + + + A representation of the value to be embedded in an XML element + + The object that contains the values. + + An Xml formatted string. + + This just calls so if there is + a possibility of this PrimitiveType having any characters + that need to be encoded then this method should be overridden. + + + + + An IType that may be used for a discriminator column. + + + This interface contains no new methods but does require that an + that will be used in a discriminator column must implement + both the and interfaces. + + + + + An that may be used as an identifier. + + + + + When implemented by a class, converts the xml string from the + mapping file to the .NET object. + + The value of discriminator-value or unsaved-value attribute. + The string converted to the object. + + This method needs to be able to handle any string. It should not just + call System.Type.Parse without verifying that it is a parsable value + for the System.Type. + + + + + Maps a Property to a column that + stores date & time down to the accuracy of a second. + + + This only stores down to a second, so if you are looking for the most accurate + date and time storage your provider can give you use the . + or the + + + + + + + + + + + Base class for enum types. + + + + + Maps a Property + to a DbType.AnsiStringFixedLength column. + + + + + Maps a Property + to a column. + + + + + + + + Handles "any" mappings and the old deprecated "object" type. + + + The identifierType is any NHibernate IType that can be serailized by default. + For example, you can specify the identifierType as an Int32 or a custom identifier + type that you built. The identifierType matches to one or many columns. + + The metaType maps to a single column. By default it stores the name of the Type + that the Identifier identifies. + + For example, we can store a link to any table. It will have the results + class_name id_col1 + ======================================== + Simple, AssemblyName 5 + DiffClass, AssemblyName 5 + Simple, AssemblyName 4 + + You can also provide you own type that might map the name of the class to a table + with a giant switch statemet or a good naming convention for your class->table. The + data stored might look like + class_name id_col1 + ======================================== + simple_table 5 + diff_table 5 + simple_table 4 + + + + + + Enables other Component-like types to hold collections and have cascades, etc. + + + + + Get the values of the component properties of + a component instance + + + + + Optional Operation + + + + + Optional operation + + + + Get the types of the component properties + + + Get the names of the component properties + + + + Optional operation + + nullability of component properties + + + + An that represents some kind of association between entities. + + + + + Get the "persister" for this association - a class or collection persister + + + + + + Get the entity name of the associated entity + + + + Get the "filtering" SQL fragment that is applied in the + SQL on clause, in addition to the usual join condition. + + + + + When implemented by a class, gets the type of foreign key directionality + of this association. + + The of this association. + + + + Is the primary key of the owning entity table + to be used in the join? + + + + + Get the name of the property in the owning entity + that provides the join key (null if the identifier) + + + + + The name of a unique property of the associated entity + that provides the join key (null if the identifier of + an entity, or key of a collection) + + + + + Do we dirty check this association, even when there are + no columns to be updated. + + + + + + + + + + + + + + + Not really relevant to AnyType, since it cannot be "joined" + + + + + An that maps an collection + to the database. + + + + + The base class for an that maps collections + to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + + Instantiate an uninitialized collection wrapper or holder. Callers MUST add the holder to the + persistence context! + + The session from which the request is originating. + The underlying collection persister (metadata) + The owner key. + The instantiated collection. + + + + Wrap the naked collection instance in a wrapper, or instantiate a + holder. Callers MUST add the holder to the persistence context! + + The session from which the request is originating. + The bare collection to be wrapped. + + A subclass of that wraps the non NHibernate collection. + + + + + Get the key value from the owning entity instance, usually the identifier, but might be some + other unique key, in the case of property-ref + + + + + Get the id value from the owning entity key, usually the same as the key, but might be some + other property, in the case of property-ref + + The collection owner key + The session from which the request is originating. + + The collection owner's id, if it can be obtained from the key; + otherwise, null is returned + + + + + Instantiate an empty instance of the "underlying" collection (not a wrapper), + but with the given anticipated size (i.e. accounting for initial capacity + and perhaps load factor). + + + The anticipated size of the instantiated collection after we are done populating it. + + A newly instantiated collection to be wrapped. + + + + Get an iterator over the element set of the collection, which may not yet be wrapped + + The collection to be iterated + The session from which the request is originating. + The iterator. + + + + Get an iterator over the element set of the collection in POCO mode + + The collection to be iterated + The iterator. + + + + We always need to dirty check the collection because we sometimes + need to increment version number of owner and also because of + how assemble/disassemble is implemented for uks + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The of the element contained in the array. + + + This creates a bag that is non-generic. + + + + + + + + + + + + + + Wraps a in a . + + The for the collection to be a part of. + The unwrapped array. + + An that wraps the non NHibernate . + + + + + The for the element. + + + + + + + + An that maps an collection + using bag semantics to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + Instantiates a new for the bag. + + The current for the bag. + + + A new . + + + + Wraps an in a NHibernate . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + + + + Maps a System.Byte[] Property to an column that can store a BLOB. + + + This is only needed by DataProviders (SqlClient) that need to specify a Size for the + IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a BinaryType + would work just fine. + + + + + BinaryType. + + + + + + + + Maps a Property + to a column. + + + + + Initialize a new instance of the BooleanType + + This is used when the Property is mapped to a native boolean type. + + + + Initialize a new instance of the BooleanType class using a + . + + The underlying . + + This is used when the Property is mapped to a string column + that stores true or false as a string. + + + + + Maps a property + to a column. + + + + + Maps a Property + to a column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property + to a DbType.StringFixedLength column. + + + + + ClassMetaType is a NH specific type to support "any" with meta-type="class" + + + It work like a MetaType where the key is the entity-name it self + + + + + + + + + + + + + + + + + + + + + This method does not populate the component parent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property + to a column. + + + CultureInfoType stores the culture name (not the Culture ID) of the + in the DB. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property + to a column. + + + + + A custom type for mapping user-written classes that implement + . + + + + + + + Adapts IUserType to the generic IType interface. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property to a + + + + + + + + Maps a Property to a + + + + + + + + Maps the Year, Month, and Day of a Property to a + column + + + + + Support for parameterizable types. A UserType or CustomUserType may be + made parameterizable by implementing this interface. Parameters for a + type may be set by using a nested type element for the property element + + + + + Gets called by Hibernate to pass the configured type parameters to + the implementation. + + + + + + + + + + An extension of which + maps to the database's current timestamp, rather than the vm's + current timestamp. + + + Note: May/may-not cause issues on dialects which do not properly support + a true notion of timestamp + + + + + This is almost the exact same type as the DateTime except it can be used + in the version column, stores it to the accuracy the database supports, + and will default to the value of DateTime.Now if the value is null. + + +

+ The value stored in the database depends on what your data provider is capable + of storing. So there is a possibility that the DateTime you save will not be + the same DateTime you get back when you check DateTime.Equals(DateTime) because + they will have their milliseconds off. +

+

+ For example - SQL Server 2000 is only accurate to 3.33 milliseconds. So if + NHibernate writes a value of 01/01/98 23:59:59.995 to the Prepared Command, MsSql + will store it as 1998-01-01 23:59:59.997. +

+

+ Please review the documentation of your Database server. +

+
+
+ + + Sets the value of this Type in the IDbCommand. + + The IDbCommand to add the Type's value to. + The value of the Type. + The index of the IDataParameter in the IDbCommand. + + No null values will be written to the IDbCommand for this Type. + + + + + Maps a Property + to a column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A reference to an entity class + + + + Constructs the requested entity type mapping. + The name of the associated entity. + + The property-ref name, or null if we + reference the PK of the associated entity. + + Is eager fetching enabled. + Should values of this mapping be embedded in XML modes? + + Is unwrapping of proxies allowed for this association; unwrapping + says to return the "implementation target" of lazy prooxies; typically only possible + with lazy="no-proxy". + + + + Two entities are considered the same when their instances are the same. + One entity instance + Another entity instance + The entity mode. + True if x == y; false otherwise. + + + + Get the identifier value of an instance or proxy. +

+ Intended only for loggin purposes!!! +

+ The object from which to extract the identifier. + The entity persister + The entity mode + The extracted identifier. +
+ + + Converts the id contained in the to an object. + + The that contains the query results. + A string array of column names that contain the id. + The this is occurring in. + The object that this Entity will be a part of. + + An instance of the object or if the identifer was null. + + + + Retrieves the {@link Joinable} defining the associated entity. + The session factory. + The associated joinable + + + + Determine the type of either (1) the identifier if we reference the + associated entity's PK or (2) the unique key to which we refer (i.e. + the property-ref). + + The mappings... + The appropriate type. + + + + The name of the property on the associated entity to which our FK refers + + The mappings... + The appropriate property name. + + + Convenience method to locate the identifier type of the associated entity. + The mappings... + The identifier type + + + Convenience method to locate the identifier type of the associated entity. + The originating session + The identifier type + + + + Resolves the identifier to the actual object. + + + + + Resolve an identifier or unique key value + + + + + + + + The name of the associated entity. + The session factory, for resolution. + The associated entity name. + + + The name of the associated entity. + The associated entity name. + + + + Load an instance by a unique key that is not the primary key. + + The name of the entity to load + The name of the property defining the uniqie key. + The unique key property value. + The originating session. + The loaded entity + + + Explicitly, an entity type is an entity type + True. + + + + This returns the wrong class for an entity with a proxy, or for a named + entity. Theoretically it should return the proxy class, but it doesn't. +

+ The problem here is that we do not necessarily have a ref to the associated + entity persister (nor to the session factory, to look it up) which is really + needed to "do the right thing" here... +

+
+ + + When implemented by a class, gets the type of foreign key directionality + of this association. + + The of this association. + + + + Is the foreign key the primary key of the table? + + + + + Converts the given enum instance into a basic type. + + + + + + + Maps a to a + DbType.String. + + + If your database should store the + using the named values in the enum instead of the underlying values + then subclass this . + + + All that needs to be done is to provide a default constructor that + NHibernate can use to create the specific type. For example, if + you had an enum defined as. + + + + public enum MyEnum + { + On, + Off, + Dimmed + } + + + + all that needs to be written for your enum string type is: + + + + public class MyEnumStringType : NHibernate.Type.EnumStringType + { + public MyEnumStringType() + : base( typeof( MyEnum ) ) + { + } + } + + + + The mapping would look like: + + + + ... + <property name="Status" type="MyEnumStringType, AssemblyContaining" /> + ... + + + + The TestFixture that shows the working code can be seen + in NHibernate.Test.TypesTest.EnumStringTypeFixture.cs + , NHibernate.Test.TypesTest.EnumStringClass.cs + , and NHibernate.Test.TypesTest.EnumStringClass.hbm.xml + + + + + + Hardcoding of 255 for the maximum length + of the Enum name that will be saved to the db. + + + 255 because that matches the default length that hbm2ddl will + use to create the column. + + + + + Initializes a new instance of . + + The of the Enum. + + + + Initializes a new instance of . + + The of the Enum. + The length of the string that can be written to the column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This appends enumstring - to the beginning of the underlying + enums name so that could still be stored + using the underlying value through the + also. + + + + + Represents directionality of the foreign key constraint + + + + + A foreign key from parent to child + + + + + A foreign key from child to parent + + + + + Should we cascade at this cascade point? + + + + + An that maps an collection + to the database using bag semantics. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + Instantiates a new for the bag. + + The current for the bag. + The current for the bag. + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + An that maps an collection + using bag semantics with an identifier to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + Instantiates a new for the identifier bag. + + The current for the identifier bag. + + + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + + + + An that maps an collection + to the database using list semantics. + + + + + An that maps an collection + using list semantics to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + Instantiates a new for the bag. + + The current for the bag. + + + A new . + + + + Wraps an exist in a NHibernate . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + Instantiates a new for the list. + + The current for the list. + The current for the list. + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + An that maps an collection + to the database. + + + + + An that maps an collection + to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + Instantiates a new for the map. + + The current for the map. + + + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + Instantiates a new for the map. + + The current for the map. + + Not used. + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the + non NHibernate . + + + + + An that maps a sorted collection + to the database. + + + + + An that maps an collection + to the database. + + + + + An that maps an collection + to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + + Instantiates a new for the set. + + The current for the set. + + + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + Instantiates a new for the set. + + The current for the set. + The current for the set. + + + + + Wraps an in a . + + The for the collection to be a part of. + The unwrapped . + + An that wraps the non NHibernate . + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + + + + An that maps a sorted collection + to the database. + + + + + Initializes a new instance of a class for + a specific role. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The to use to compare + set elements. + + + + Maps a Property + to a column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property + to a column. + + + + + + + + + + + Maps a Property + to a column. + + + + + + + + + + + Maps a Property + to a column. + + + + + + + + + + + A many-to-one association to an entity + + + + + Hydrates the Identifier from . + + The that contains the query results. + A string array of column names to read from. + The this is occurring in. + The object that this Entity will be a part of. + + An instantiated object that used as the identifier of the type. + + + + + A one-to-one association to an entity + + + + + We don't need to dirty check one-to-one because of how + assemble/disassemble is implemented and because a one-to-one + association is never dirty + + + + + A implemented using a collection that maintains + the order in which elements are inserted into it. + + + + + Initializes a new instance of a class. + + The role the persistent collection is in. + + + + + + A implemented using a collection that maintains + the order in which elements are inserted into it. + + + + + Initializes a new instance of a class + + The role the persistent collection is in. + + + + + + PersistentEnumType + + + + + Gets an instance of the Enum + + The underlying value of an item in the Enum. + + An instance of the Enum set to the code value. + + + + + Gets the correct value for the Enum. + + The value to convert (an enum instance). + A boxed version of the code, converted to the correct type. + + This handles situations where the DataProvider returns the value of the Enum + from the db in the wrong underlying type. It uses to + convert it to the correct type. + + + + + Maps a Property + to a column. + + + + + + + + + + + Maps an instance of a that has the + to a column. + + + + For performance reasons, the SerializableType should be used when you know that Bytes are + not going to be greater than 8,000. Implementing a custom type is recommended for larger + types. + + + The base class is because the data is stored in + a byte[]. The System.Array does not have a nice "equals" method so we must + do a custom implementation. + + + + + + + + + + + + + + + + + + + + + + + Thrown when a property cannot be serialized/deserialized + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Maps a Property to an + column. + + + Verify through your database's documentation if there is a column type that + matches up with the capabilities of + + + + + + + + + + + Extends the to provide sorting. + + + + + Initializes a new instance of a class for + a specific role using the to do the sorting. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The to use for the sorting. + + + + + Extends the to provide sorting. + + + + + Initializes a new instance of a class for + a specific role using the to do the sorting. + + The role the persistent collection is in. + The name of the property in the + owner object containing the collection ID, or if it is + the primary key. + The to use for the sorting. + + + + + A one-to-one association that maps to specific formula(s) + instead of the primary key column of the owning entity. + + + + + Maps a Property to an + column that can store a CLOB. + + + This is only needed by DataProviders (SqlClient) that need to specify a Size for the + IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a StringType + would work just fine. + + + + + Maps a to a column. + + + + + + + + + + + + + + + + + Maps a Property to an column + that stores the DateTime using the Ticks property. + + + This is the recommended way to "timestamp" a column. + The System.DateTime.Ticks is accurate to 100-nanosecond intervals. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property to an column + This is an extra way to map a . You already have + but mapping against a . + + + + + Maps a Property to an column + + + + + + + + + + + + + + + + + + + + + + + + + Maps a Property to an DateTime column that only stores the + Hours, Minutes, and Seconds of the DateTime as significant. + Also you have for handling, the NHibernate Type , + the which maps to a . + + + + This defaults the Date to "1753-01-01" - that should not matter because + using this Type indicates that you don't care about the Date portion of the DateTime. + + + A more appropriate choice to store the duration/time is the . + The underlying tends to be handled differently by different + DataProviders. + + + + + + Maps a to a 1 char column + that stores a 'T'/'F' to indicate true/false. + + + If you are using schema-export to generate your tables then you need + to set the column attributes: length=1 or sql-type="char(1)". + + This needs to be done because in Java's JDBC there is a type for CHAR and + in ADO.NET there is not one specifically for char, so you need to tell schema + export to create a char(1) column. + + + + + + + + + + + + + + + + + Used internally to obtain instances of IType. + + + Applications should use static methods and constants on NHibernate.NHibernateUtil if the default + IType is good enough. For example, the TypeFactory should only be used when the String needs + to have a length of 300 instead of 255. At this point NHibernateUtil.String does not get you the + correct IType. Instead use TypeFactory.GetString(300) and keep a local variable that holds + a reference to the IType. + + + + + + + + Register other Default .NET type + + + These type will be used, as default, even when the "type" attribute was NOT specified in the mapping + + + + + Register other NO Default .NET type + + + These type will be used only when the "type" attribute was is specified in the mapping. + These are in here because needed to NO override default CLR types and be available in mappings + + + + + Gets the classification of the Type based on the string. + + The name of the Type to get the classification for. + The Type of Classification + + This parses through the string and makes the assumption that no class + name and no assembly name will contain the "(". + + If it finds + the "(" and then finds a "," afterwards then it is a + TypeClassification.PrecisionScale. + + + If it finds the "(" + and doesn't find a "," afterwards, then it is a + TypeClassification.Length. + + + If it doesn't find the "(" then it assumes that it is a + TypeClassification.Plain. + + + + + + Given the name of a Hibernate type such as Decimal, Decimal(19,0) + , Int32, or even NHibernate.Type.DecimalType, NHibernate.Type.DecimalType(19,0), + NHibernate.Type.Int32Type, then return an instance of NHibernate.Type.IType + + The name of the type. + The instance of the IType that the string represents. + + This method will return null if the name is not found in the basicNameMap. + + + + + Uses heuristics to deduce a NHibernate type given a string naming the + type. + + + An instance of NHibernate.Type.IType + + When looking for the NHibernate type it will look in the cache of the Basic types first. + If it doesn't find it in the cache then it uses the typeName to get a reference to the + Class (Type in .NET). Once we get the reference to the .NET class we check to see if it + implements IType, ICompositeUserType, IUserType, ILifecycle (Association), or + IPersistentEnum. If none of those are implemented then we will serialize the Type to the + database using NHibernate.Type.SerializableType(typeName) + + + + + Uses heuristics to deduce a NHibernate type given a string naming the type. + + the type name + parameters for the type + An instance of NHibernate.Type.IType + + + + Uses heuristics to deduce a NHibernate type given a string naming the type. + + the type name + parameters for the type + optionally, the size of the type + + + + + Gets the BinaryType with the specified length. + + The length of the data to store in the database. + A BinaryType + + In addition to returning the BinaryType it will also ensure that it has + been added to the basicNameMap with the keys Byte[](length) and + NHibernate.Type.BinaryType(length). + + + + + Gets the SerializableType for the specified Type + + The Type that will be Serialized to the database. + A SerializableType + + + In addition to returning the SerializableType it will also ensure that it has + been added to the basicNameMap with the keys Type.FullName (the result + of IType.Name and Type.AssemblyQualifiedName. This is different + from the other items put in the basicNameMap because it is uses the AQN and the + FQN as opposed to the short name used in the maps and the FQN. + + + Since this method calls the method + GetSerializableType(System.Type, Int32) + with the default length, those keys will also be added. + + + + + + A one-to-one association type for the given class and cascade style. + + + + + A many-to-one association type for the given class and cascade style. + + + + + + + A many-to-one association type for the given class and cascade style. + + + + + A many-to-one association type for the given class and cascade style. + + + + + Collection of convenience methods relating to operations across arrays of types... + + + + Deep copy a series of values from one array to another + The values to copy (the source) + The value types + An array indicating which values to include in the copy + The array into which to copy the values + The originating session + + + Apply the operation across a series of values. + The values + The value types + The originating session + + + + Apply the operation across a series of values. + + The values + The value types + The originating session + The entity "owning" the values + + + + Apply the operation across a series of values. + The values + The value types + An array indicating which values to include in the disassembled state + The originating session + The entity "owning" the values + The disassembled state + + + + Apply the operation across a series of values. + + The source of the state + The target into which to replace the source values. + The value types + The originating session + The entity "owning" the values + Represent a cache of already replaced state + The replaced state + + + + Apply the + operation across a series of values. + + The source of the state + The target into which to replace the source values. + The value types + The originating session + The entity "owning" the values + A map representing a cache of already replaced state + FK directionality to be applied to the replacement + The replaced state + + + + Apply the + operation across a series of values, as long as the corresponding is an association. + + The source of the state + The target into which to replace the source values. + The value types + The originating session + The entity "owning" the values + A map representing a cache of already replaced state + FK directionality to be applied to the replacement + The replaced state + + If the corresponding type is a component type, then apply + across the component subtypes but do not replace the component value itself. + + + + + Determine if any of the given field values are dirty, returning an array containing + indices of the dirty fields. + If it is determined that no fields are dirty, null is returned. + + The property definitions + The current state of the entity + The baseline state of the entity + Columns to be included in the dirty checking, per property + Does the entity currently hold any uninitialized property values? + The session from which the dirty check request originated. + Array containing indices of the dirty properties, or null if no properties considered dirty. + + + + Determine if any of the given field values are modified, returning an array containing + indices of the modified fields. + If it is determined that no fields are dirty, null is returned. + + The property definitions + The current state of the entity + The baseline state of the entity + Columns to be included in the mod checking, per property + Does the entity currently hold any uninitialized property values? + The session from which the dirty check request originated. + Array containing indices of the modified properties, or null if no properties considered modified. + + + + Maps the Assembly Qualified Name of a to a + column. + + + + + + + + Initialize a new instance of the TypeType class using a + . + + The underlying . + + + + Gets the in the for the Property. + + The that contains the value. + The index of the field to get the value from. + The from the database. + + Thrown when the value in the database can not be loaded as a + + + + + Gets the in the for the Property. + + The that contains the value. + The name of the field to get the value from. + The from the database. + + This just calls gets the index of the name in the IDataReader + and calls the overloaded version + (IDataReader, Int32). + + + Thrown when the value in the database can not be loaded as a + + + + + Puts the Assembly Qualified Name of the + Property into to the . + + The to put the value into. + The that contains the value. + The index of the to start writing the value to. + + This uses the method of the + object to do the work. + + + + + A representation of the value to be embedded in an XML element + + The that contains the values. + + An Xml formatted string that contains the Assembly Qualified Name. + + + + Gets the that will be returned + by the NullSafeGet() methods. + + + A from the .NET framework. + + + + + + + + Maps a Property + to a column. + + + + + + + + + + + Maps a Property + to a column. + + + + + + + + + + + Maps a Property + to a column. + + + + + + + + Maps a to a 1 char column + that stores a 'Y'/'N' to indicate true/false. + + + If you are using schema-export to generate your tables then you need + to set the column attributes: length=1 or sql-type="char(1)". + + This needs to be done because in Java's JDBC there is a type for CHAR and + in ADO.NET there is not one specifically for char, so you need to tell schema + export to create a char(1) column. + + + + + + + + + + + + + + + + + A UserType that may be dereferenced in a query. + This interface allows a custom type to define "properties". + These need not necessarily correspond to physical .NET style properties. + + A ICompositeUserType may be used in almost every way + that a component may be used. It may even contain many-to-one + associations. + + Implementors must be immutable and must declare a public + default constructor. + + Unlike UserType, cacheability does not depend upon + serializability. Instead, Assemble() and + Disassemble() provide conversion to/from a cacheable + representation. + + + + + Get the value of a property + + an instance of class mapped by this "type" + + the property value + + + + Set the value of a property + + an instance of class mapped by this "type" + + the value to set + + + + Compare two instances of the class mapped by this type for persistence + "equality", ie. equality of persistent state. + + + + + + + + Get a hashcode for the instance, consistent with persistence "equality" + + + + + Retrieve an instance of the mapped class from a IDataReader. Implementors + should handle possibility of null values. + + IDataReader + the column names + + the containing entity + + + + + Write an instance of the mapped class to a prepared statement. + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from index. + If a property is not settable, skip it and don't increment the index. + + + + + + + + + + Return a deep copy of the persistent state, stopping at entities and at collections. + + generally a collection element or entity field + + + + + Transform the object into its cacheable representation. + At the very least this method should perform a deep copy. + That may not be enough for some implementations, method should perform a deep copy. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation) + + the object to be cached + + + + + + Reconstruct an object from the cacheable representation. + At the very least this method should perform a deep copy. (optional operation) + + the object to be cached + + + + + + + During merge, replace the existing (target) value in the entity we are merging to + with a new (original) value from the detached entity we are merging. For immutable + objects, or null values, it is safe to simply return the first parameter. For + mutable objects, it is safe to return a copy of the first parameter. However, since + composite user types often define component values, it might make sense to recursively + replace component values in the target object. + + + + + Get the "property names" that may be used in a query. + + + + + Get the corresponding "property types" + + + + + The class returned by NullSafeGet(). + + + + + Are objects of this type mutable? + + + + + A custom type that may function as an identifier or discriminator + type, or may be marshalled to and from an XML document. + + + + + The interface to be implemented by user-defined types. + + + + The interface abstracts user code from future changes to the interface, + simplifies the implementation of custom types and hides certain "internal interfaces from + user code. + + + Implementers must be immutable and must declare a public default constructor. + + + The actual class mapped by a IUserType may be just about anything. However, if it is to + be cacheble by a persistent cache, it must be serializable. + + + Alternatively, custom types could implement directly or extend one of the + abstract classes in NHibernate.Type. This approach risks future incompatible changes + to classes or interfaces in the package. + + + + + + Compare two instances of the class mapped by this type for persistent "equality" + ie. equality of persistent state + + + + + + + + Get a hashcode for the instance, consistent with persistence "equality" + + + + + Retrieve an instance of the mapped class from a JDBC resultset. + Implementors should handle possibility of null values. + + a IDataReader + column names + the containing entity + + HibernateException + + + + Write an instance of the mapped class to a prepared statement. + Implementors should handle possibility of null values. + A multi-column type should be written to parameters starting from index. + + a IDbCommand + the object to write + command parameter index + HibernateException + + + + Return a deep copy of the persistent state, stopping at entities and at collections. + + generally a collection element or entity field + a copy + + + + During merge, replace the existing () value in the entity + we are merging to with a new () value from the detached + entity we are merging. For immutable objects, or null values, it is safe to simply + return the first parameter. For mutable objects, it is safe to return a copy of the + first parameter. For objects with component values, it might make sense to + recursively replace component values. + + the value from the detached entity being merged + the value in the managed entity + the managed entity + the value to be merged + + + + Reconstruct an object from the cacheable representation. At the very least this + method should perform a deep copy if the type is mutable. (optional operation) + + the object to be cached + the owner of the cached object + a reconstructed object from the cachable representation + + + + Transform the object into its cacheable representation. At the very least this + method should perform a deep copy if the type is mutable. That may not be enough + for some implementations, however; for example, associations must be cached as + identifier values. (optional operation) + + the object to be cached + a cacheable representation of the object + + + + The SQL types for the columns mapped by this type. + + + + + The type returned by NullSafeGet() + + + + + Are objects of this type mutable? + + + + + Parse a string representation of this value, as it appears + in an XML document. + + + + + Return an SQL literal representation of the value + + + + + Return a string representation of this value, as it + should appear in an XML document + + + + + Marker interface for user types which want to perform custom + logging of their corresponding values + + + + Generate a loggable string representation of the collection (value). + The collection to be logged; guaranteed to be non-null and initialized. + The factory. + The loggable string representation. + + + + Instantiate an uninitialized instance of the collection wrapper + + + + + Wrap an instance of a collection + + + + + Return an over the elements of this collection - the passed collection + instance may or may not be a wrapper + + + + + Optional operation. Does the collection contain the entity instance? + + + + + Optional operation. Return the index of the entity in the collection. + + + + + Replace the elements of a collection with the elements of another collection + + + + + Instantiate an empty instance of the "underlying" collection (not a wrapper), + but with the given anticipated size (i.e. accounting for initial size + and perhaps load factor). + + + The anticipated size of the instantiated collection + after we are done populating it. Note, may be negative to indicate that + we not yet know anything about the anticipated size (i.e., when initializing + from a result set row by row). + + + + + A user type that may be used for a version property. + + + + + Generate an initial version. + + The session from which this request originates. May be + null; currently this only happens during startup when trying to determine + the "unsaved value" of entities. + an instance of the type + + + + Increment the version. + + The session from which this request originates. + the current version + an instance of the type + + + + Helper class that contains common array functions and + data structures used through out NHibernate. + + + + + Sets item at position to . + Expands the list by adding values, if needed. + + + + + Computes a hash code for . + + The hash code is computed as the sum of hash codes of + individual elements, so that the value is independent of the + collection iteration order. + + + + + Creates a that uses case-insensitive string comparison + associated with invariant culture. + + + This is different from the method in + in that the latter uses the current culture and is thus vulnerable to the "Turkish I" problem. + + + + + Creates a that uses case-insensitive string comparison + associated with invariant culture. + + + This is different from the method in + in that the latter uses the current culture and is thus vulnerable to the "Turkish I" problem. + + + + + Computes a hash code for . + + The hash code is computed as the sum of hash codes of + individual elements, so that the value is independent of the + collection iteration order. + + + + + A read-only dictionary that is always empty and permits lookup by key. + + + + + A read-only dictionary that is always empty and permits lookup by key. + + + + + Utility class implementing ToString for collections. All ToString + overloads call element.ToString(). + + + To print collections of entities or typed values, use + . + + + + + + + + Get only filters enabled for many-to-one association. + + All enabled filters + A new for filters enabled for many to one. + + + + An where keys are compared by object identity, rather than equals. + + All external users of this class need to have no knowledge of the IdentityKey - it is all + hidden by this class. + + + + Do NOT use a System.Value type as the key for this Hashtable - only classes. See + the google thread + about why using System.Value is a bad thing. + + + If I understand it correctly, the first call to get an object defined by a DateTime("2003-01-01") + would box the DateTime and return the identity key for the box. If you were to get that Key and + unbox it into a DateTime struct, then the next time you passed it in as the Key the IdentityMap + would box it again (into a different box) and it would have a different IdentityKey - so you would + not get the same value for the same DateTime value. + + + + + + Create a new instance of the IdentityMap that has no + iteration order. + + A new IdentityMap based on a Hashtable. + + + + Create a new instance of the IdentityMap that has an + iteration order of the order the objects were added + to the Map. + + A new IdentityMap based on ListDictionary. + + + + Return the Dictionary Entries (as instances of DictionaryEntry in a collection + that is safe from concurrent modification). Ie - we may safely add new instances + to the underlying IDictionary during enumeration of the Values. + + The IDictionary to get the enumeration safe list. + A Collection of DictionaryEntries + + + + Create the IdentityMap class with the correct class for the IDictionary. + Unsorted = Hashtable + Sorted = ListDictionary + + A class that implements the IDictionary for storing the objects. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Verifies that we are not using a System.ValueType as the Key in the Dictionary + + The object that will be the key. + An object that is safe to be a key. + Thrown when the obj is a System.ValueType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the Keys used in this IdentityMap + + + + + + + + + + + + + + + + Provides a snapshot VIEW in the form of a List of the contents of the IdentityMap. + You can safely iterate over this VIEW and modify the actual IdentityMap because the + VIEW is a copy of the contents, not a reference to the existing Map. + + Contains a copy (not that actual instance stored) of the DictionaryEntries in a List. + + + + + Set implementation that use == instead of equals() as its comparison mechanism + that base its implementation of IdentityMap + + + + + Combines multiple objects implementing into one. + + + + + Creates an IEnumerable object from multiple IEnumerables. + + The IEnumerables to join together. + + + + + + + + + + + + + A flag to indicate if Dispose() has been called. + + + + + Finalizer that ensures the object is correctly disposed of. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + + + + Takes care of freeing the managed and unmanaged resources that + this class is responsible for. + + Indicates if this JoinedEnumerable is being Disposed of or Finalized. + + The command is closed and the reader is disposed. This allows other ADO.NET + related actions to occur without needing to move all the way through the + EnumerableImpl. + + + + + + + + A map of objects whose mapping entries are sequenced based on the order in which they were + added. This data structure has fast O(1) search time, deletion time, and insertion time + + + This class is not thread safe. + This class is not a really replication of JDK LinkedHashMap{K, V}, + this class is an adaptation of SequencedHashMap with generics. + + + + + Initializes a new instance of the class that is empty, + has the default initial capacity, and uses the default equality comparer for the key type. + + + + + Initializes a new instance of the class that is empty, + has the specified initial capacity, and uses the default equality comparer for the key type. + + The initial number of elements that the can contain. + + + + Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified . + + The implementation to use when comparing keys, or null to use the default EqualityComparer for the type of the key. + + + + Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified . + + The initial number of elements that the can contain. + The implementation to use when comparing keys, or null to use the default EqualityComparer for the type of the key. + + + + An implementation of a Map which has a maximum size and uses a Least Recently Used + algorithm to remove items from the Map when the maximum size is reached and new items are added. + + + + + A map of objects whose mapping entries are sequenced based on the order in which they were + added. This data structure has fast O(1) search time, deletion time, and insertion time + + + This class is not thread safe. + + + + + Construct an empty sentinel used to hold the head (sentinel.next) and the tail (sentinal.prev) + of the list. The sentinal has a key and value + + + + + + Sentinel used to hold the head and tail of the list of entries + + + + + Map of keys to entries + + + + + Holds the number of modifications that have occurred to the map, excluding modifications + made through a collection view's iterator. + + + + + Construct a new sequenced hash map with default initial size and load factor + + + + + Construct a new sequenced hash map with the specified initial size and default load factor + + the initial size for the hash table + + + + Construct a new sequenced hash map with the specified initial size and load factor + + the initial size for the hashtable + the load factor for the hash table + + + + Construct a new sequenced hash map with the specified initial size, hash code provider + and comparer + + the initial size for the hashtable + + + + + Creates an empty Hashtable with the default initial capacity and using the default load factor, + the specified hash code provider and the specified comparer + + + + + + Creates an empty Hashtable with the default initial capacity and using the default load factor, + the specified hash code provider and the specified comparer + + the initial size for the hashtable + the load factor for the hash table + + + + + Removes an internal entry from the linked list. THis does not remove it from the underlying + map. + + + + + + Inserts a new internal entry to the tail of the linked list. This does not add the + entry to the underlying map. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove the Entry identified by the Key if it exists. + + The Key to remove. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Return only the Key of the DictionaryEntry + + + + + Return only the Value of the DictionaryEntry + + + + + Return the full DictionaryEntry + + + + + Summary description for ObjectUtils. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper class for Reflection related code. + + + + + Determine if the specified overrides the + implementation of Equals from + + The to reflect. + if any type in the hierarchy overrides Equals(object). + + + + Determine if the specified overrides the + implementation of GetHashCode from + + The to reflect. + if any type in the hierarchy overrides GetHashCode(). + + + + Finds the for the property in the . + + The to find the property in. + The name of the Property to find. + The name of the property access strategy. + The to get the value of the Property. + + This one takes a propertyAccessor name as we might know the correct strategy by now so we avoid Exceptions which are costly + + + + + Get the NHibernate for the named property of the . + + The to find the Property in. + The name of the property/field to find in the class. + The name of the property accessor for the property. + + The NHibernate for the named property. + + + + + Get the for the named property of a type. + + The to find the property in. + The name of the property/field to find in the class. + The name of the property accessor for the property. + The for the named property. + + + + Get the for the named property of a type. + + The FullName to find the property in. + The name of the property/field to find in the class. + The name of the property accessor for the property. + The for the named property. + + + + Returns a reference to the Type. + + The name of the class or a fully qualified name. + The Type for the Class. + + + + Load a System.Type given is't name. + + The class FullName or AssemblyQualifiedName + The System.Type + + If the don't represent an + the method try to find the System.Type scanning all Assemblies of the . + + If no System.Type was found for . + + + + Load a System.Type given is't name. + + The class FullName or AssemblyQualifiedName + The System.Type or null + + If the don't represent an + the method try to find the System.Type scanning all Assemblies of the . + + + + + Returns a from an already loaded Assembly or an + Assembly that is loaded with a partial name. + + An . + if an exception should be thrown + in case of an error, otherwise. + + A object that represents the specified type, + or if the type cannot be loaded. + + + Attempts to get a reference to the type from an already loaded assembly. If the + type cannot be found then the assembly is loaded using + . + + + + + Returns the value of the static field of . + + The . + The name of the field in the . + The value contained in the field, or if the type or the field does not exist. + + + + Gets the default no arg constructor for the . + + The to find the constructor for. + + The for the no argument constructor, or if the + type is an abstract class. + + + Thrown when there is a problem calling the method GetConstructor on . + + + + + Finds the constructor that takes the parameters. + + The to find the constructor in. + The objects to use to find the appropriate constructor. + + An that can be used to create the type with + the specified parameters. + + + Thrown when no constructor with the correct signature can be found. + + + + + Determines if the is a non creatable class. + + The to check. + if the is an Abstract Class or an Interface. + + + + Unwraps the supplied + and returns the inner exception preserving the stack trace. + + + The to unwrap. + + The unwrapped exception. + + + + Try to find a method in a given type. + + The given type. + The method info. + The found method or null. + + The , in general, become from another . + + + + + Try to find a property, that can be managed by NHibernate, from a given type. + + The given . + The name of the property to find. + true if the property exists; otherwise false. + + When the user defines a field.xxxxx access strategy should be because both the property and the field exists. + NHibernate can work even when the property does not exist but in this case the user should use the appropiate accessor. + + + + + Check if a method is declared in a given . + + The method to check. + The where the method is really declared. + True if the method is an implementation of the method declared in ; false otherwise. + + + + Used to ensure a collection filtering a given IEnumerable by a certain type. + + The type used like filter. + + + + Cache following a "Most Recently Used" (MRU) algorithm for maintaining a + bounded in-memory size; the "Least Recently Used" (LRU) entry is the first + available for removal from the cache. + + + This implementation uses a bounded MRU Map to limit the in-memory size of + the cache. Thus the size of this cache never grows beyond the stated size. + + + + + Cache following a "Most Recently Used" (MRY) algorithm for maintaining a + bounded in-memory size; the "Least Recently Used" (LRU) entry is the first + available for removal from the cache. + + + This implementation uses a "soft limit" to the in-memory size of the cache, + meaning that all cache entries are kept within a completely + {@link java.lang.ref.SoftReference}-based map with the most recently utilized + entries additionally kept in a hard-reference manner to prevent those cache + entries soft references from becoming enqueued by the garbage collector. + Thus the actual size of this cache impl can actually grow beyond the stated + max size bound as long as GC is not actively seeking soft references for + enqueuement. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Just a façade for calling string.Split() + We don't use our StringTokenizer because string.Split() is + more efficient (but it only works when we don't want to retrieve the delimiters) + + separators for the tokens of the list + the string that will be broken into tokens + + + + + Splits the String using the StringTokenizer. + + separators for the tokens of the list + the string that will be broken into tokens + true to include the separators in the tokens. + + + This is more powerful than Split because you have the option of including or + not including the separators in the tokens. + + + + + + + + + + + + + + + + + + + + Takes a fully qualified type name and returns the full name of the + Class - includes namespaces. + + + + + + + Takes a fully qualified type name (can include the assembly) and just returns + the name of the Class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts a in the format of "true", "t", "false", or "f" to + a . + + The string to convert. + + The value converted to a . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the unquoted instances of the character. + + + + + + + + + + + + + + + + Generate a nice alias for the given class name or collection role + name and unique integer. Subclasses do not have to use + aliases of this form. + + an alias of the form foo1_ + + + + Returns the interned string equal to if there is one, or + otherwise. + + A + A + + + + A StringTokenizer java like object + + + + + + + + + + + + + + + + + + + + + + + + + + Returns an unmodifiable view of the specified IDictionary. + This method allows modules to provide users with "read-only" access to internal dictionary. + Query operations on the returned dictionary "read through" to the specified dictionary, + and attempts to modify the returned dictionary, + whether direct or via its collection views, result in an . + + The type of keys in the dictionary. + The type of values in the dictionary. + + + + Initializes a new instance of the UnmodifiableDictionary class that contains elements wrapped + from the specified IDictionary. + + The whose elements are wrapped. + + + + Count of elements in the collection. Unreliable! + + + + + Indicates failure of an assertion: a possible bug in NHibernate + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Controls how the session interacts with the second-level + cache and query cache. + + + + + The session will never interact with the cache, except to invalidate + cache items when updates occur + + + + + The session will never read items from the cache, but will add items + to the cache as it reads them from the database. + + + + + The session may read items from the cache, but will not add items, + except to invalidate items when updates occur + + + + The session may read items from the cache, and add items to the cache + + + + The session will never read items from the cache, but will add items + to the cache as it reads them from the database. In this mode, the + effect of hibernate.cache.use_minimal_puts is bypassed, in + order to force a cache refresh + + + + + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Transforms Criteria queries + + + + + Returns a clone of the original criteria, which will return the count + of rows that are returned by the original criteria query. + + + + + Returns a clone of the original criteria, which will return the count + of rows that are returned by the original criteria query. + + + + + Creates an exact clone of the criteria + + + + + + Creates an exact clone of the criteria + + + + + + Initializes a new instance of the class. + + The message that describes the error. + The name of the duplicate object + The type of the duplicate object + + + + Initializes a new instance of the class. + + The name of the duplicate object + The type of the duplicate object + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + The type of the duplicated object + + + + + The name of the duplicated object + + + + + Allows user code to inspect and/or change property values before they are written and after they + are read from the database + + + + There might be a single instance of IInterceptor for a SessionFactory, or a new + instance might be specified for each ISession. Whichever approach is used, the interceptor + must be serializable if the ISession is to be serializable. This means that SessionFactory + -scoped interceptors should implement ReadResolve(). + + + The ISession may not be invoked from a callback (nor may a callback cause a collection or + proxy to be lazily initialized). + + + + + + Called just before an object is initialized + + + + + + + + The interceptor may change the state, which will be propagated to the persistent + object. Note that when this method is called, entity will be an empty + uninitialized instance of the class. + if the user modified the state in any way + + + + Called when an object is detected to be dirty, during a flush. + + + + + + + + + The interceptor may modify the detected currentState, which will be propagated to + both the database and the persistent object. Note that all flushes end in an actual + synchronization with the database, in which as the new currentState will be propagated + to the object, but not necessarily (immediately) to the database. It is strongly recommended + that the interceptor not modify the previousState. + + if the user modified the currentState in any way + + + + Called before an object is saved + + + + + + + + The interceptor may modify the state, which will be used for the SQL INSERT + and propagated to the persistent object + + if the user modified the state in any way + + + + Called before an object is deleted + + + + + + + + It is not recommended that the interceptor modify the state. + + + + Called before a collection is (re)created. + + + Called before a collection is deleted. + + + Called before a collection is updated. + + + + Called before a flush + + The entities + + + + Called after a flush that actually ends in execution of the SQL statements required to + synchronize in-memory state with the database. + + The entitites + + + + Called when a transient entity is passed to SaveOrUpdate. + + + The return value determines if the object is saved + + - the entity is passed to Save(), resulting in an INSERT + - the entity is passed to Update(), resulting in an UPDATE + - Hibernate uses the unsaved-value mapping to determine if the object is unsaved + + + A transient entity + Boolean or to choose default behaviour + + + + Called from Flush(). The return value determines whether the entity is updated + + + + an array of property indicies - the entity is dirty + an empty array - the entity is not dirty + - use Hibernate's default dirty-checking algorithm + + + A persistent entity + + + + + + An array of dirty property indicies or to choose default behavior + + + + Instantiate the entity class. Return to indicate that Hibernate should use the default + constructor of the class + + the name of the entity + The type of entity instance to be returned. + the identifier of the new instance + An instance of the class, or to choose default behaviour + + The identifier property of the returned instance + should be initialized with the given identifier. + + + + Get the entity name for a persistent or transient instance + an entity instance + the name of the entity + + + Get a fully loaded entity instance that is cached externally + the name of the entity + the instance identifier + a fully initialized entity + + + + Called when a NHibernate transaction is begun via the NHibernate + API. Will not be called if transactions are being controlled via some other mechanism. + + + + + Called before a transaction is committed (but not before rollback). + + + + + Called after a transaction is committed or rolled back. + + + + Called when sql string is being prepared. + sql to be prepared + original or modified sql + + + + Called when a session-scoped (and only session scoped) interceptor is attached + to a session + + + session-scoped-interceptor is an instance of the interceptor used only for one session. + The use of singleton-interceptor may cause problems in multi-thread scenario. + + + + + + Defines the representation modes available for entities. + + + + Represents a fetching strategy. + + + This is used together with the API to specify + runtime fetching strategies. + + For Hql queries, use the FETCH keyword instead. + + + + + + Default to the setting configured in the mapping file. + + + + + Fetch eagerly, using a separate select. Equivalent to + fetch="select" (and outer-join="false") + + + + + Fetch using an outer join. Equivalent to + fetch="join" (and outer-join="true") + + + + + Indicates that an expected getter or setter method could not be found on a class + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Represents a flushing strategy. + + + The flush process synchronizes database state with session state by detecting state + changes and executing SQL statements + + + + + Special value for unspecified flush mode (like in Java). + + + + + The ISession is never flushed unless Flush() is explicitly + called by the application. This mode is very efficient for read only + transactions + + + + + The ISession is flushed when Transaction.Commit() is called + + + + + The ISession is sometimes flushed before query execution in order to + ensure that queries never return stale state. This is the default flush mode. + + + + + The is flushed before every query. This is + almost always unnecessary and inefficient. + + + + + Provides XML marshalling for classes registered with a SessionFactory + + + + Hibernate defines a generic XML format that may be used to represent any class + (hibernate-generic.dtd). The user configures an XSLT stylesheet for marshalling + data from this generic format to an application and/or user readable format. By default, + Hibernate will use hibernate-default.xslt which maps data to a useful human- + readable format. + + + The property xml.output_stylesheet specifies a user-written stylesheet. + Hibernate will attempt to load the stylesheet from the classpath first and if not found, + will attempt to load it as a file + + + It is not intended that implementors be threadsafe + + + + + + Add an object to the output document. + + A transient or persistent instance + Databinder + + + + Add a collection of objects to the output document + + A collection of transient or persistent instance + Databinder + + + + Output the generic XML representation of the bound objects + + Generic Xml representation + + + + Output the generic XML Representation of the bound objects + to a XmlDocument + + A generic Xml tree + + + + Output the custom XML representation of the bound objects + + Custom Xml representation + + + + Output the custom XML representation of the bound objects as + an XmlDocument + + A custom Xml Tree + + + + Controls whether bound objects (and their associated objects) that are lazily instanciated + are explicityl initialized or left as they are + + True to explicitly initilize lazy objects, false to leave them in the state they are in + + + + Performs a null safe comparison using "==" instead of Object.Equals() + + First object to compare. + Second object to compare. + + true if x is the same instance as y or if both are null references; otherwise, false. + + + This is Lazy collection safe since it uses , + unlike Object.Equals() which currently causes NHibernate to load up the collection. + This behaivior of Collections is likely to change because Java's collections override Equals() and + .net's collections don't. So in .net there is no need to override Equals() and + GetHashCode() on the NHibernate Collection implementations. + + + + + Thrown if Hibernate can't instantiate an entity or component class at runtime. + + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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. + + The that NHibernate was trying to instantiate. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Gets the that NHibernate was trying to instantiate. + + + + + Gets a message that describes the current . + + + The error message that explains the reason for this exception and the Type that + was trying to be instantiated. + + + + + Thrown when an invalid type is specified as a proxy for a class. + The exception is also thrown when a class is specified as lazy, + but cannot be used as a proxy for itself. + + + + + A problem occurred trying to lazily initialize a collection or proxy (for example the session + was closed) or iterate query results. + + + + + Initializes a new instance of the class. + + The name of the entity where the exception was thrown + The id of the entity where the exception was thrown + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + + 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. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Instances represent a lock mode for a row of a relational database table. + + + It is not intended that users spend much time worrying about locking since Hibernate + usually obtains exactly the right lock level automatically. Some "advanced" users may + wish to explicitly specify lock levels. + + + + + + + + + + + + + + + Is this lock mode more restrictive than the given lock mode? + + + + + + Is this lock mode less restrictive than the given lock mode? + + + + + + No lock required. + + + If an object is requested with this lock mode, a Read lock + might be obtained if necessary. + + + + + A shared lock. + + + Objects are loaded in Read mode by default + + + + + An upgrade lock. + + + Objects loaded in this lock mode are materialized using an + SQL SELECT ... FOR UPDATE + + + + + Attempt to obtain an upgrade lock, using an Oracle-style + SELECT ... FOR UPGRADE NOWAIT. + + + The semantics of this lock mode, once obtained, are the same as Upgrade + + + + + A Write lock is obtained when an object is updated or inserted. + + + This is not a valid mode for Load() or Lock(). + + + + + Similar to except that, for versioned entities, + it results in a forced version increment. + + + + + Provides access to the full range of NHibernate built-in types. + IType instances may be used to bind values to query parameters. + Also a factory for new Blobs and Clobs. + + + + + Guesses the IType of this object + + The obj. + + + + + Guesses the IType by the type + + The type. + + + + + NHibernate Ansi String type + + + + + NHibernate binary type + + + + + NHibernate binary blob type + + + + + NHibernate boolean type + + + + + NHibernate byte type + + + + + NHibernate character type + + + + + NHibernate Culture Info type + + + + + NHibernate date type + + + + + NHibernate date type + + + + + NHibernate local date type + + + + + NHibernate utc date type + + + + + NHibernate date type + + + + + NHibernate date type + + + + + NHibernate decimal type + + + + + NHibernate double type + + + + + NHibernate Currency type (System.Decimal - DbType.Currency) + + + + + NHibernate Guid type. + + + + + NHibernate System.Int16 (short in C#) type + + + + + NHibernate System.Int32 (int in C#) type + + + + + NHibernate System.Int64 (long in C#) type + + + + + NHibernate System.SByte type + + + + + NHibernate System.UInt16 (ushort in C#) type + + + + + NHibernate System.UInt32 (uint in C#) type + + + + + NHibernate System.UInt64 (ulong in C#) type + + + + + NHibernate System.Single (float in C#) Type + + + + + NHibernate String type + + + + + NHibernate string clob type + + + + + NHibernate Time type + + + + + NHibernate Ticks type + + + + + NHibernate Ticks type + + + + + NHibernate Ticks type + + + + + NHibernate Timestamp type + + + + + NHibernate TrueFalse type + + + + + NHibernate YesNo type + + + + + NHibernate class type + + + + + NHibernate class meta type for association of kind any. + + + + + + NHibernate serializable type + + + + + NHibernate System.Object type + + + + + A NHibernate persistent enum type + + + + + + + A NHibernate serializable type + + + + + + + A NHibernate serializable type + + a type mapping to a single column + the entity identifier type + + + + + A NHibernate persistent object (entity) type + + a mapped entity class + + + + A Hibernate persistent object (entity) type. + a mapped entity class + + + + A NHibernate custom type + + a class that implements UserType + + + + + Force initialization of a proxy or persistent collection. + + a persistable object, proxy, persistent collection or null + if we can't initialize the proxy at this time, eg. the Session was closed + + + + Is the proxy or persistent collection initialized? + + a persistable object, proxy, persistent collection or null + true if the argument is already initialized, or is not a proxy or collection + + + + Get the true, underlying class of a proxied persistent class. This operation + will initialize a proxy by side-effect. + + a persistable object or proxy + the true class of the instance + + + + Close an obtained from an + returned by NHibernate immediately, instead of waiting until the session is + closed or disconnected. + + + + + Close an returned by NHibernate immediately, + instead of waiting until the session is closed or disconnected. + + + + + Check if the property is initialized. If the named property does not exist + or is not persistent, this method always returns true. + + The potential proxy + the name of a persistent attribute of the object + + true if the named property of the object is not listed as uninitialized; + false if the object is an uninitialized proxy, or the named property is uninitialized + + + + + This exception is thrown when an operation would + break session-scoped identity. This occurs if the + user tries to associate two different instances of + the same class with a particular identifier, + in the scope of a single . + + + + + Initializes a new instance of the class. + + The message that describes the error. + The identifier of the object that caused the exception. + The EntityName of the object attempted to be loaded. + + + + Initializes a new instance of the class. + + The identifier of the object that caused the exception. + The EntityName of the object attempted to be loaded. + + + + Initializes a new instance of the class. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Thrown when the application calls IQuery.UniqueResult() + and the query returned more than one result. Unlike all other NHibernate + exceptions, this one is recoverable! + + + + + Initializes a new instance of the class. + + The number of items in the result. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Thrown when the user tries to pass a deleted object to the ISession. + + + + + Thrown when Hibernate could not resolve an object by id, especially when + loading an association. + + + + + Initializes a new instance of the class. + + The identifier of the object that caused the exception. + The of the object attempted to be loaded. + + + + Initializes a new instance of the class. + + The message that describes the error. + The identifier of the object that caused the exception. + The of the object attempted to be loaded. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Thrown when ISession.Load() fails to select a row with + the given primary key (identifier value). This exception might not + be thrown when Load() is called, even if there was no + row on the database, because Load() returns a proxy if + possible. Applications should use ISession.Get() to test if + a row exists in the database. + + + + + Initializes a new instance of the class. + + The identifier of the object that was attempting to be loaded. + The that NHibernate was trying to find a row for in the database. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Thrown when the user passes a persistent instance to a ISession method that expects a + transient instance + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + A problem occurred accessing a property of an instance of a persistent class by reflection + + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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. + + A indicating if this was a "setter" operation. + The that NHibernate was trying find the Property or Field in. + The mapped property name that was trying to be accessed. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Gets the that NHibernate was trying find the Property or Field in. + + + + + Gets a message that describes the current . + + + The error message that explains the reason for this exception and + information about the mapped property and its usage. + + + + + Indicates that an expected getter or setter method could not be found on a class + + + + + Initializes a new instance of the class, + used when a property get/set accessor is missing. + + The that is missing the property + The name of the missing property + The type of the missing accessor + ("getter" or "setter") + + + + Initializes a new instance of the class, + used when a field is missing. + + The that is missing the field + The name of the missing property + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Initializes a new instance of the class. + + The message that describes the error. + The that NHibernate was trying to access. + The name of the Property that was being get/set. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Represents a replication strategy. + + + + + + Throw an exception when a row already exists + + + + + Ignore replicated entities when a row already exists + + + + + When a row already exists, choose the latest version + + + + + Overwrite existing rows when a row already exists + + + + + Thrown when a version number check failed, indicating that the + contained stale data (when using long transactions with + versioning). + + + + + Initializes a new instance of the class. + + The EntityName that NHibernate was trying to update in the database. + The identifier of the object that is stale. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Gets the EntityName that NHibernate was trying to update in the database. + + + + + Gets the identifier of the object that is stale. + + + + + Gets a message that describes the current . + + The error message that explains the reason for this exception. + + + + Indicated that a transaction could not be begun, committed, or rolled back + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class. + + The message that describes the error. + + 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 serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Throw when the user passes a transient instance to a ISession method that expects + a persistent instance + + + + + Initializes a new instance of the class. + + The message that describes the error. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Used when a user provided type does not match the expected one + + + + + Thrown when ISession.Load() selects a row with the given primary key (identifier value) + but the row's discriminator value specifies a different subclass from the one requested + + + + + Initializes a new instance of the class. + + The message that describes the error. + The identifier of the object that was being loaded. + The name of entity that NHibernate was told to load. + + + + Initializes a new instance of the class + with serialized data. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Sets the serialization info for after + getting the info from the base Exception. + + + The that holds the serialized object + data about the exception being thrown. + + + The that contains contextual information about the source or destination. + + + + + Gets the identifier of the object that was being loaded. + + + + + Gets the name of entity that NHibernate was told to load. + + + + + Gets a message that describes the current . + + The error message that explains the reason for this exception. + + + diff --git a/packages/NHibernate.3.3.3.4001/nhibernate-configuration.xsd b/packages/NHibernate.3.3.3.4001/nhibernate-configuration.xsd new file mode 100644 index 000000000..4703b962d --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/nhibernate-configuration.xsd @@ -0,0 +1,226 @@ + + + + -- This schema was automatically generated by Syntext Dtd2Schema and changed for NH use -- + -- conversion tool (from file: hibernate-configuration-3.0.dtd) -- + -- Copyright (C) 2002, 2003 Syntext Inc. See http://www.syntext.com for updates. -- + + + + + + + + + + There are 3 default short-cut values + - lcg : default for .NET2.0 and higher. + - codedom : CodeDOM-based bytecode provider (mostly for .NET1.1). + - null : Disable the reflection optimization completely. + In addition you can specify the AssemblyQualifiedName of your custom bytecode-provider (implementation of IBytecodeProvider). + Note: the bytecode-provider will be tooks in account only when specified in the app.config or web.config. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + There are 3 possible combinations of mapping attributes + 1 - resource & assembly: NHibernate will read the mapping resource from the specified assembly + 2 - file only: NHibernate will read the mapping from the file. + 3 - assembly only: NHibernate will find all the resources ending in hbm.xml from the assembly. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NHibernate.3.3.3.4001/nhibernate-mapping.xsd b/packages/NHibernate.3.3.3.4001/nhibernate-mapping.xsd new file mode 100644 index 000000000..396c19053 --- /dev/null +++ b/packages/NHibernate.3.3.3.4001/nhibernate-mapping.xsd @@ -0,0 +1,1699 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A composite key may be modelled by a .NET class with a property for each key column. The class must be Serializable and override equals() and hashCode() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Namespace used to find not-Fully Qualified Type Names + + + + + Assembly used to find not-Fully Qualified Type Names + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + undefined|any|none|null|0|-1|... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The concrete collection should use a generic version or an object-based version. + + + + + + + + + + + + + + Types of polymorphism + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nupkg b/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nupkg new file mode 100644 index 000000000..45bfbc27a Binary files /dev/null and b/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nupkg differ diff --git a/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nuspec b/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nuspec new file mode 100644 index 000000000..b1ba142d5 --- /dev/null +++ b/packages/System.Data.SQLite.1.0.90.0/System.Data.SQLite.1.0.90.0.nuspec @@ -0,0 +1,19 @@ + + + + System.Data.SQLite + 1.0.90.0 + System.Data.SQLite (x86/x64) + SQLite Development Team + SQLite Development Team + http://www.sqlite.org/copyright.html + http://system.data.sqlite.org/ + http://system.data.sqlite.org/images/sqlite32.png + false + The official SQLite database engine for both x86 and x64 along with the ADO.NET provider. + + Public Domain + en-US + sqlite database ado.net provider interop + + \ No newline at end of file diff --git a/packages/System.Data.SQLite.1.0.90.0/content/net40/x64/SQLite.Interop.dll b/packages/System.Data.SQLite.1.0.90.0/content/net40/x64/SQLite.Interop.dll new file mode 100644 index 000000000..30e752000 Binary files /dev/null and b/packages/System.Data.SQLite.1.0.90.0/content/net40/x64/SQLite.Interop.dll differ diff --git a/packages/System.Data.SQLite.1.0.90.0/content/net40/x86/SQLite.Interop.dll b/packages/System.Data.SQLite.1.0.90.0/content/net40/x86/SQLite.Interop.dll new file mode 100644 index 000000000..092ed077a Binary files /dev/null and b/packages/System.Data.SQLite.1.0.90.0/content/net40/x86/SQLite.Interop.dll differ diff --git a/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.Linq.dll b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.Linq.dll new file mode 100644 index 000000000..d9e101d57 Binary files /dev/null and b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.Linq.dll differ diff --git a/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.dll b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.dll new file mode 100644 index 000000000..833b8b283 Binary files /dev/null and b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.dll differ diff --git a/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.xml b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.xml new file mode 100644 index 000000000..149e17c83 --- /dev/null +++ b/packages/System.Data.SQLite.1.0.90.0/lib/net40/System.Data.SQLite.xml @@ -0,0 +1,12758 @@ + + + + System.Data.SQLite + + + + + Defines a source code identifier custom attribute for an assembly + manifest. + + + + + Constructs an instance of this attribute class using the specified + source code identifier value. + + + The source code identifier value to use. + + + + + Gets the source code identifier value. + + + + + Defines a source code time-stamp custom attribute for an assembly + manifest. + + + + + Constructs an instance of this attribute class using the specified + source code time-stamp value. + + + The source code time-stamp value to use. + + + + + Gets the source code time-stamp value. + + + + + This is the method signature for the SQLite core library logging callback + function for use with sqlite3_log() and the SQLITE_CONFIG_LOG. + + WARNING: This delegate is used more-or-less directly by native code, do + not modify its type signature. + + + The extra data associated with this message, if any. + + + The error code associated with this message. + + + The message string to be logged. + + + + + This class implements SQLiteBase completely, and is the guts of the code that interop's SQLite with .NET + + + + + This internal class provides the foundation of SQLite support. It defines all the abstract members needed to implement + a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. + + + + + This base class provides datatype conversion services for the SQLite provider. + + + + + The format string for DateTime values when using the InvariantCulture or CurrentCulture formats. + + + + + The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC). + + + + + The value of the OLE Automation epoch represented as a Julian day. + + + + + An array of ISO-8601 DateTime formats that we support parsing. + + + + + The internal default format for UTC DateTime values when converting + to a string. + + + + + The internal default format for local DateTime values when converting + to a string. + + + + + An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 + + + + + The default DateTime format for this instance. + + + + + The default DateTimeKind for this instance. + + + + + The default DateTime format string for this instance. + + + + + Initializes the conversion class + + The default date/time format to use for this instance + The DateTimeKind to use. + The DateTime format string to use. + + + + Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character. + + The string to convert to UTF-8 + A byte array containing the converted string plus an extra 0 terminating byte at the end of the array. + + + + Convert a DateTime to a UTF-8 encoded, zero-terminated byte array. + + + This function is a convenience function, which first calls ToString() on the DateTime, and then calls ToUTF8() with the + string result. + + The DateTime to convert. + The UTF-8 encoded string, including a 0 terminating byte at the end of the array. + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, + and DateTimeFormatString specified for the connection when it was opened. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats -OR- + the DateTimeFormatString if one was provided, an exception will + be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + A DateTime value + + + + Converts a string into a DateTime, using the specified DateTimeFormat, + DateTimeKind and DateTimeFormatString. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats -OR- + the DateTimeFormatString if one was provided, an exception will + be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + The SQLiteDateFormats to use. + The DateTimeKind to use. + The DateTime format string to use. + A DateTime value + + + + Converts a julianday value into a DateTime + + The value to convert + A .NET DateTime + + + + Converts a julianday value into a DateTime + + The value to convert + The DateTimeKind to use. + A .NET DateTime + + + + Converts the specified number of seconds from the Unix epoch into a + value. + + + The number of whole seconds since the Unix epoch. + + + Either Utc or Local time. + + + The new value. + + + + + Converts the specified number of ticks since the epoch into a + value. + + + The number of whole ticks since the epoch. + + + Either Utc or Local time. + + + The new value. + + + + + Converts a DateTime struct to a JulianDay double + + The DateTime to convert + The JulianDay value the Datetime represents + + + + Converts a DateTime struct to the whole number of seconds since the + Unix epoch. + + The DateTime to convert + The whole number of seconds since the Unix epoch + + + + Returns the DateTime format string to use for the specified DateTimeKind. + If is not null, it will be returned verbatim. + + The DateTimeKind to use. + The DateTime format string to use. + + The DateTime format string to use for the specified DateTimeKind. + + + + + Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, + and DateTimeFormatString specified for the connection when it was opened. + + The DateTime value to convert + Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a + Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time + string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. + + + + Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. + + + This is a convenience function, which first calls ToString() on the IntPtr to convert it to a string, then calls + ToDateTime() on the string to return a DateTime. + + A pointer to the UTF-8 encoded string + The length in bytes of the string + The parsed DateTime value + + + + Smart method of splitting a string. Skips quoted elements, removes the quotes. + + + This split function works somewhat like the String.Split() function in that it breaks apart a string into + pieces and returns the pieces as an array. The primary differences are: + + Only one character can be provided as a separator character + Quoted text inside the string is skipped over when searching for the separator, and the quotes are removed. + + Thus, if splitting the following string looking for a comma:
+ One,Two, "Three, Four", Five
+
+ The resulting array would contain
+ [0] One
+ [1] Two
+ [2] Three, Four
+ [3] Five
+
+ Note that the leading and trailing spaces were removed from each item during the split. +
+ Source string to split apart + Separator character + A string array of the split up elements +
+ + + Splits the specified string into multiple strings based on a separator + and returns the result as an array of strings. + + + The string to split into pieces based on the separator character. If + this string is null, null will always be returned. If this string is + empty, an array of zero strings will always be returned. + + + The character used to divide the original string into sub-strings. + This character cannot be a backslash or a double-quote; otherwise, no + work will be performed and null will be returned. + + + If this parameter is non-zero, all double-quote characters will be + retained in the returned list of strings; otherwise, they will be + dropped. + + + Upon failure, this parameter will be modified to contain an appropriate + error message. + + + The new array of strings or null if the input string is null -OR- the + separator character is a backslash or a double-quote -OR- the string + contains an unbalanced backslash or double-quote character. + + + + + Convert a value to true or false. + + A string or number representing true or false + + + + + Convert a string to true or false. + + A string representing true or false + + + "yes", "no", "y", "n", "0", "1", "on", "off" as well as Boolean.FalseString and Boolean.TrueString will all be + converted to a proper boolean value. + + + + + Converts a SQLiteType to a .NET Type object + + The SQLiteType to convert + Returns a .NET Type object + + + + For a given intrinsic type, return a DbType + + The native type to convert + The corresponding (closest match) DbType + + + + Returns the ColumnSize for the given DbType + + The DbType to get the size of + + + + + Determines the type name for the given database value type. + + The database value type. + The flags associated with the parent connection object. + The type name or an empty string if it cannot be determined. + + + + Convert a DbType to a Type + + The DbType to convert from + The closest-match .NET type + + + + For a given type, return the closest-match SQLite TypeAffinity, which only understands a very limited subset of types. + + The type to evaluate + The SQLite type affinity for that type. + + + + Builds and returns a map containing the database column types + recognized by this provider. + + + A map containing the database column types recognized by this + provider. + + + + + For a given type name, return a closest-match .NET type + + The name of the type to match + The flags associated with the parent connection object. + The .NET DBType the text evaluates to. + + + + The error code used for logging exceptions caught in user-provided + code. + + + + + Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. + If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is + global to the process. + + Non-zero to enable memory usage tracking, zero otherwise. + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Attempts to free as much heap memory as possible for the database connection. + + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Shutdown the SQLite engine so that it can be restarted with different config options. + We depend on auto initialization to recover. + + + + + Determines if the associated native connection handle is open. + + + Non-zero if a database connection is open. + + + + + Opens a database. + + + Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection + to bind all attributed user-defined functions and collating sequences to the new connection. + + The filename of the database to open. SQLite automatically creates it if it doesn't exist. + The flags associated with the parent connection object + The open flags to use when creating the connection + The maximum size of the pool for the given filename + If true, the connection can be pulled from the connection pool + + + + Closes the currently-open database. + + + After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated + memory associated with the user-defined functions and collating sequences tied to the closed connection. + + Non-zero if the operation is allowed to throw exceptions, zero otherwise. + + + + Sets the busy timeout on the connection. SQLiteCommand will call this before executing any command. + + The number of milliseconds to wait before returning SQLITE_BUSY + + + + Returns the text of the last error issued by SQLite + + + + + + Returns the text of the last error issued by SQLite -OR- the specified default error text if + none is available from the SQLite core library. + + + The error text to return in the event that one is not available from the SQLite core library. + + + The error text. + + + + + When pooling is enabled, force this connection to be disposed rather than returned to the pool + + + + + When pooling is enabled, returns the number of pool entries matching the current file name. + + The number of pool entries matching the current file name. + + + + Prepares a SQL statement for execution. + + The source connection preparing the command. Can be null for any caller except LINQ + The SQL command text to prepare + The previous statement in a multi-statement command, or null if no previous statement exists + The timeout to wait before aborting the prepare + The remainder of the statement that was not processed. Each call to prepare parses the + SQL up to to either the end of the text or to the first semi-colon delimiter. The remaining text is returned + here for a subsequent call to Prepare() until all the text has been processed. + Returns an initialized SQLiteStatement. + + + + Steps through a prepared statement. + + The SQLiteStatement to step through + True if a row was returned, False if not. + + + + Resets a prepared statement so it can be executed again. If the error returned is SQLITE_SCHEMA, + transparently attempt to rebuild the SQL statement and throw an error if that was not possible. + + The statement to reset + Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock + + + + Attempts to interrupt the query currently executing on the associated + native database connection. + + + + + This function binds a user-defined functions to the connection. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + The flags associated with the parent connection object. + + + + + Calls the native SQLite core library in order to create a disposable + module containing the implementation of a virtual table. + + + The module object to be used when creating the native disposable module. + + + The flags for the associated object instance. + + + + + Calls the native SQLite core library in order to cleanup the resources + associated with a module containing the implementation of a virtual table. + + + The module object previously passed to the + method. + + + The flags for the associated object instance. + + + + + Calls the native SQLite core library in order to declare a virtual table + in response to a call into the + or virtual table methods. + + + The virtual table module that is to be responsible for the virtual table + being declared. + + + The string containing the SQL statement describing the virtual table to + be declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. + + + A standard SQLite return code. + + + + + Calls the native SQLite core library in order to declare a virtual table + function in response to a call into the + or virtual table methods. + + + The virtual table module that is to be responsible for the virtual table + function being declared. + + + The number of arguments to the function being declared. + + + The name of the function being declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. + + + A standard SQLite return code. + + + + + Enables or disabled extension loading by SQLite. + + + True to enable loading of extensions, false to disable. + + + + + Loads a SQLite extension library from the named file. + + + The name of the dynamic link library file containing the extension. + + + The name of the exported function used to initialize the extension. + If null, the default "sqlite3_extension_init" will be used. + + + + + Enables or disabled extened result codes returned by SQLite + + true to enable extended result codes, false to disable. + + + + + Returns the numeric result code for the most recent failed SQLite API call + associated with the database connection. + + Result code + + + + Returns the extended numeric result code for the most recent failed SQLite API call + associated with the database connection. + + Extended result code + + + + Add a log message via the SQLite sqlite3_log interface. + + Error code to be logged with the message. + String to be logged. Unlike the SQLite sqlite3_log() + interface, this should be pre-formatted. Consider using the + String.Format() function. + + + + + Checks if the SQLite core library has been initialized in the current process. + + + Non-zero if the SQLite core library has been initialized in the current process, + zero otherwise. + + + + + Creates a new SQLite backup object based on the provided destination + database connection. The source database connection is the one + associated with this object. The source and destination database + connections cannot be the same. + + The destination database connection. + The destination database name. + The source database name. + The newly created backup object. + + + + Copies up to N pages from the source database to the destination + database associated with the specified backup object. + + The backup object to use. + + The number of pages to copy or negative to copy all remaining pages. + + + Set to true if the operation needs to be retried due to database + locking issues. + + + True if there are more pages to be copied, false otherwise. + + + + + Returns the number of pages remaining to be copied from the source + database to the destination database associated with the specified + backup object. + + The backup object to check. + The number of pages remaining to be copied. + + + + Returns the total number of pages in the source database associated + with the specified backup object. + + The backup object to check. + The total number of pages in the source database. + + + + Destroys the backup object, rolling back any backup that may be in + progess. + + The backup object to destroy. + + + + Returns the error message for the specified SQLite return code using + the internal static lookup table. + + The SQLite return code. + The error message or null if it cannot be found. + + + + Returns the error message for the specified SQLite return code using + the sqlite3_errstr() function, falling back to the internal lookup + table if necessary. + + The SQLite return code. + The error message or null if it cannot be found. + + + + Returns a string representing the active version of SQLite + + + + + Returns an integer representing the active version of SQLite + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + Returns the number of changes the last executing insert/update caused. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. This is not really a per-connection + value, it is global to the process. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + This is not really a per-connection value, it is global to the process. + + + + + Returns non-zero if the underlying native connection handle is owned by this instance. + + + + + Returns non-zero if the given database connection is in autocommit mode. + Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN + statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + + + + + The opaque pointer returned to us by the sqlite provider + + + + + The user-defined functions registered on this connection + + + + + The modules created using this connection. + + + + + Constructs the object used to interact with the SQLite core library + using the UTF-8 text encoding. + + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. + + + The to be used when creating DateTime + values. + + + The format string to be used when parsing and formatting DateTime + values. + + + The native handle to be associated with the database connection. + + + The fully qualified file name associated with . + + + Non-zero if the newly created object instance will need to dispose + of when it is no longer needed. + + + + + This method attempts to dispose of all the derived + object instances currently associated with the native database connection. + + + + + Attempts to interrupt the query currently executing on the associated + native database connection. + + + + + This function binds a user-defined function to the connection. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + The flags associated with the parent connection object. + + + + + Attempts to free as much heap memory as possible for the database connection. + + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Attempts to free N bytes of heap memory by deallocating non-essential memory + allocations held by the database library. Memory used to cache database pages + to improve performance is an example of non-essential memory. This is a no-op + returning zero if the SQLite core library was not compiled with the compile-time + option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or + compact the Win32 native heap, if applicable. + + + The requested number of bytes to free. + + + Non-zero to attempt a heap reset. + + + Non-zero to attempt heap compaction. + + + The number of bytes actually freed. This value may be zero. + + + This value will be non-zero if the heap reset was successful. + + + The size of the largest committed free block in the heap, in bytes. + This value will be zero unless heap compaction is enabled. + + + A standard SQLite return code (i.e. zero for success and non-zero + for failure). + + + + + Shutdown the SQLite engine so that it can be restarted with different + configuration options. We depend on auto initialization to recover. + + Returns a standard SQLite result code. + + + + Shutdown the SQLite engine so that it can be restarted with different + configuration options. We depend on auto initialization to recover. + + + Non-zero to reset the database and temporary directories to their + default values, which should be null for both. This parameter has no + effect on non-Windows operating systems. + + Returns a standard SQLite result code. + + + + Determines if the associated native connection handle is open. + + + Non-zero if the associated native connection handle is open. + + + + + Calls the native SQLite core library in order to create a disposable + module containing the implementation of a virtual table. + + + The module object to be used when creating the native disposable module. + + + The flags for the associated object instance. + + + + + Calls the native SQLite core library in order to cleanup the resources + associated with a module containing the implementation of a virtual table. + + + The module object previously passed to the + method. + + + The flags for the associated object instance. + + + + + Calls the native SQLite core library in order to declare a virtual table + in response to a call into the + or virtual table methods. + + + The virtual table module that is to be responsible for the virtual table + being declared. + + + The string containing the SQL statement describing the virtual table to + be declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. + + + A standard SQLite return code. + + + + + Calls the native SQLite core library in order to declare a virtual table + function in response to a call into the + or virtual table methods. + + + The virtual table module that is to be responsible for the virtual table + function being declared. + + + The number of arguments to the function being declared. + + + The name of the function being declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. + + + A standard SQLite return code. + + + + + Enables or disabled extension loading by SQLite. + + + True to enable loading of extensions, false to disable. + + + + + Loads a SQLite extension library from the named file. + + + The name of the dynamic link library file containing the extension. + + + The name of the exported function used to initialize the extension. + If null, the default "sqlite3_extension_init" will be used. + + + + Enables or disabled extended result codes returned by SQLite + + + Gets the last SQLite error code + + + Gets the last SQLite extended error code + + + Add a log message via the SQLite sqlite3_log interface. + + + Add a log message via the SQLite sqlite3_log interface. + + + + Allows the setting of a logging callback invoked by SQLite when a + log event occurs. Only one callback may be set. If NULL is passed, + the logging callback is unregistered. + + The callback function to invoke. + Returns a result code + + + + Creates a new SQLite backup object based on the provided destination + database connection. The source database connection is the one + associated with this object. The source and destination database + connections cannot be the same. + + The destination database connection. + The destination database name. + The source database name. + The newly created backup object. + + + + Copies up to N pages from the source database to the destination + database associated with the specified backup object. + + The backup object to use. + + The number of pages to copy, negative to copy all remaining pages. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. + + + True if there are more pages to be copied, false otherwise. + + + + + Returns the number of pages remaining to be copied from the source + database to the destination database associated with the specified + backup object. + + The backup object to check. + The number of pages remaining to be copied. + + + + Returns the total number of pages in the source database associated + with the specified backup object. + + The backup object to check. + The total number of pages in the source database. + + + + Destroys the backup object, rolling back any backup that may be in + progess. + + The backup object to destroy. + + + + Determines if the SQLite core library has been initialized for the + current process. + + + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. + + + + + Determines if the SQLite core library has been initialized for the + current process. + + + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. + + + + + Helper function to retrieve a column of data from an active statement. + + The statement being step()'d through + The flags associated with the connection. + The column index to retrieve + The type of data contained in the column. If Uninitialized, this function will retrieve the datatype information. + Returns the data in the column + + + + Returns non-zero if the underlying native connection handle is owned + by this instance. + + + + + Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) + + + + + Constructs the object used to interact with the SQLite core library + using the UTF-8 text encoding. + + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. + + + The to be used when creating DateTime + values. + + + The format string to be used when parsing and formatting DateTime + values. + + + The native handle to be associated with the database connection. + + + The fully qualified file name associated with . + + + Non-zero if the newly created object instance will need to dispose + of when it is no longer needed. + + + + + Overrides SQLiteConvert.ToString() to marshal UTF-16 strings instead of UTF-8 + + A pointer to a UTF-16 string + The length (IN BYTES) of the string + A .NET string + + + + Represents a single SQL backup in SQLite. + + + + + The underlying SQLite object this backup is bound to. + + + + + The actual backup handle. + + + + + The destination database for the backup. + + + + + The destination database name for the backup. + + + + + The source database for the backup. + + + + + The source database name for the backup. + + + + + The last result from the StepBackup method of the SQLite3 class. + This is used to determine if the call to the FinishBackup method of + the SQLite3 class should throw an exception when it receives a non-Ok + return code from the core SQLite library. + + + + + Initializes the backup. + + The base SQLite object. + The backup handle. + The destination database for the backup. + The destination database name for the backup. + The source database for the backup. + The source database name for the backup. + + + + Disposes and finalizes the backup. + + + + + The extra behavioral flags that can be applied to a connection. + + + + + No extra flags. + + + + + Enable logging of all SQL statements to be prepared. + + + + + Enable logging of all bound parameter types and raw values. + + + + + Enable logging of all bound parameter strongly typed values. + + + + + Enable logging of all exceptions caught from user-provided + managed code called from native code via delegates. + + + + + Enable logging of backup API errors. + + + + + Skip adding the extension functions provided by the native + interop assembly. + + + + + When binding parameter values with the + type, use the interop method that accepts an + value. + + + + + When binding parameter values, always bind them as though they were + plain text (i.e. no numeric, date/time, or other conversions should + be attempted). + + + + + When returning column values, always return them as though they were + plain text (i.e. no numeric, date/time, or other conversions should + be attempted). + + + + + Prevent this object instance from + loading extensions. + + + + + Prevent this object instance from + creating virtual table modules. + + + + + Skip binding any functions provided by other managed assemblies when + opening the connection. + + + + + Skip setting the logging related properties of the + object instance that was passed to + the method. + + + + + Enable logging of all virtual table module errors seen by the + method. + + + + + Enable logging of certain virtual table module exceptions that cannot + be easily discovered via other means. + + + + + Enable tracing of potentially important [non-fatal] error conditions + that cannot be easily reported through other means. + + + + + When binding and returning column values, always treat them as though + they were plain text (i.e. no numeric, date/time, or other conversions + should be attempted). + + + + + Enable all logging. + + + + + The default extra flags for new connections. + + + + + SQLite implementation of DbCommand. + + + + + The default connection string to be used when creating a temporary + connection to execute a command via the static + or + + methods. + + + + + The command text this command is based on + + + + + The connection the command is associated with + + + + + The version of the connection the command is associated with + + + + + Indicates whether or not a DataReader is active on the command. + + + + + The timeout for the command, kludged because SQLite doesn't support per-command timeout values + + + + + Designer support + + + + + Used by DbDataAdapter to determine updating behavior + + + + + The collection of parameters for the command + + + + + The SQL command text, broken into individual SQL statements as they are executed + + + + + Unprocessed SQL text that has not been executed + + + + + Transaction associated with this command + + + + + Constructs a new SQLiteCommand + + + Default constructor + + + + + Initializes the command with the given command text + + The SQL command text + + + + Initializes the command with the given SQL command text and attach the command to the specified + connection. + + The SQL command text + The connection to associate with the command + + + + Initializes the command and associates it with the specified connection. + + The connection to associate with the command + + + + Initializes a command with the given SQL, connection and transaction + + The SQL command text + The connection to associate with the command + The transaction the command should be associated with + + + + Disposes of the command and clears all member variables + + Whether or not the class is being explicitly or implicitly disposed + + + + This method attempts to query the flags associated with the database + connection in use. If the database connection is disposed, the default + flags will be returned. + + + The command containing the databse connection to query the flags from. + + + The connection flags value. + + + + + Clears and destroys all statements currently prepared + + + + + Builds an array of prepared statements for each complete SQL statement in the command text + + + + + Not implemented + + + + + Forwards to the local CreateParameter() function + + + + + + Create a new parameter + + + + + + This function ensures there are no active readers, that we have a valid connection, + that the connection is open, that all statements are prepared and all parameters are assigned + in preparation for allocating a data reader. + + + + + Creates a new SQLiteDataReader to execute/iterate the array of SQLite prepared statements + + The behavior the data reader should adopt + Returns a SQLiteDataReader object + + + + This method creates a new connection, executes the query using the given + execution type, closes the connection, and returns the results. If the + connection string is null, a temporary in-memory database connection will + be used. + + + The text of the command to be executed. + + + The execution type for the command. This is used to determine which method + of the command object to call, which then determines the type of results + returned, if any. + + + The connection string to the database to be opened, used, and closed. If + this parameter is null, a temporary in-memory databse will be used. + + + The SQL parameter values to be used when building the command object to be + executed, if any. + + + The results of the query -OR- null if no results were produced from the + given execution type. + + + + + This method creates a new connection, executes the query using the given + execution type and command behavior, closes the connection, and returns + the results. If the connection string is null, a temporary in-memory + database connection will be used. + + + The text of the command to be executed. + + + The execution type for the command. This is used to determine which method + of the command object to call, which then determines the type of results + returned, if any. + + + The command behavior flags for the command. + + + The connection string to the database to be opened, used, and closed. If + this parameter is null, a temporary in-memory databse will be used. + + + The SQL parameter values to be used when building the command object to be + executed, if any. + + + The results of the query -OR- null if no results were produced from the + given execution type. + + + + + Overrides the default behavior to return a SQLiteDataReader specialization class + + The flags to be associated with the reader. + A SQLiteDataReader + + + + Overrides the default behavior of DbDataReader to return a specialized SQLiteDataReader class + + A SQLiteDataReader + + + + Called by the SQLiteDataReader when the data reader is closed. + + + + + Execute the command and return the number of rows inserted/updated affected by it. + + The number of rows inserted/updated affected by it. + + + + Execute the command and return the number of rows inserted/updated affected by it. + + The flags to be associated with the reader. + The number of rows inserted/updated affected by it. + + + + Execute the command and return the first column of the first row of the resultset + (if present), or null if no resultset was returned. + + The first column of the first row of the first resultset from the query. + + + + Execute the command and return the first column of the first row of the resultset + (if present), or null if no resultset was returned. + + The flags to be associated with the reader. + The first column of the first row of the first resultset from the query. + + + + Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards. + + + + + Clones a command, including all its parameters + + A new SQLiteCommand with the same commandtext, connection and parameters + + + + The SQL command text associated with the command + + + + + The amount of time to wait for the connection to become available before erroring out + + + + + The type of the command. SQLite only supports CommandType.Text + + + + + The connection associated with this command + + + + + Forwards to the local Connection property + + + + + Returns the SQLiteParameterCollection for the given command + + + + + Forwards to the local Parameters property + + + + + The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the + command's underlying connection. + + + + + Forwards to the local Transaction property + + + + + Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable. + + + + + Determines if the command is visible at design time. Defaults to True. + + + + + SQLite implementation of DbCommandBuilder. + + + + + Default constructor + + + + + Initializes the command builder and associates it with the specified data adapter. + + + + + + Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema + + The parameter to use in applying custom behaviors to a row + The row to apply the parameter to + The type of statement + Whether the application of the parameter is part of a WHERE clause + + + + Returns a valid named parameter + + The name of the parameter + Error + + + + Returns a named parameter for the given ordinal + + The i of the parameter + Error + + + + Returns a placeholder character for the specified parameter i. + + The index of the parameter to provide a placeholder for + Returns a named parameter + + + + Sets the handler for receiving row updating events. Used by the DbCommandBuilder to autogenerate SQL + statements that may not have previously been generated. + + A data adapter to receive events on. + + + + Returns the automatically-generated SQLite command to delete rows from the database + + + + + + Returns the automatically-generated SQLite command to delete rows from the database + + + + + + + Returns the automatically-generated SQLite command to update rows in the database + + + + + + Returns the automatically-generated SQLite command to update rows in the database + + + + + + + Returns the automatically-generated SQLite command to insert rows into the database + + + + + + Returns the automatically-generated SQLite command to insert rows into the database + + + + + + + Places brackets around an identifier + + The identifier to quote + The bracketed identifier + + + + Removes brackets around an identifier + + The quoted (bracketed) identifier + The undecorated identifier + + + + Override helper, which can help the base command builder choose the right keys for the given query + + + + + + + Gets/sets the DataAdapter for this CommandBuilder + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Event data for connection event handlers. + + + + + The type of event being raised. + + + + + The associated with this event, if any. + + + + + The transaction associated with this event, if any. + + + + + The command associated with this event, if any. + + + + + The data reader associated with this event, if any. + + + + + The critical handle associated with this event, if any. + + + + + Command or message text associated with this event, if any. + + + + + Extra data associated with this event, if any. + + + + + Constructs the object. + + The type of event being raised. + The base associated + with this event, if any. + The transaction associated with this event, if any. + The command associated with this event, if any. + The data reader associated with this event, if any. + The critical handle associated with this event, if any. + The command or message text, if any. + The extra data, if any. + + + + Raised when an event pertaining to a connection occurs. + + The connection involved. + Extra information about the event. + + + + SQLite implentation of DbConnection. + + + The property can contain the following parameter(s), delimited with a semi-colon: + + + Parameter + Values + Required + Default + + + Data Source + + This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). + Starting with release 1.0.86.0, in order to use more than one consecutive backslash (e.g. for a + UNC path), each of the adjoining backslash characters must be doubled (e.g. "\\Network\Share\test.db" + would become "\\\\Network\Share\test.db"). + + Y + + + + Version + 3 + N + 3 + + + UseUTF16Encoding + True
False
+ N + False +
+ + DateTimeFormat + + Ticks - Use the value of DateTime.Ticks.
+ ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC + DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
+ JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC.
+ UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970).
+ InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
+ CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
+ N + ISO8601 +
+ + DateTimeKind + Unspecified - Not specified as either UTC or local time.
Utc - The time represented is UTC.
Local - The time represented is local time.
+ N + Unspecified +
+ + DateTimeFormatString + The exact DateTime format string to use for all formatting and parsing of all DateTime + values for this connection. + N + null + + + BaseSchemaName + Some base data classes in the framework (e.g. those that build SQL queries dynamically) + assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting + alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used + as a placeholder and removed prior to preparing any SQL statements that may contain it. + N + sqlite_default_schema + + + BinaryGUID + True - Store GUID columns in binary form
False - Store GUID columns as text
+ N + True +
+ + Cache Size + {size in bytes} + N + 2000 + + + Synchronous + Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
+ N + Full +
+ + Page Size + {size in bytes} + N + 1024 + + + Password + {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. + N + + + + HexPassword + {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. + N + + + + Enlist + Y - Automatically enlist in distributed transactions
N - No automatic enlistment
+ N + Y +
+ + Pooling + + True - Use connection pooling.
+ False - Do not use connection pooling.

+ WARNING: When using the default connection pool implementation, + setting this property to True should be avoided by applications that make + use of COM (either directly or indirectly) due to possible deadlocks that + can occur during the finalization of some COM objects. +
+ N + False +
+ + FailIfMissing + True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
+ N + False +
+ + Max Page Count + {size in pages} - Limits the maximum number of pages (limits the size) of the database + N + 0 + + + Legacy Format + True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
+ N + False +
+ + Default Timeout + {time in seconds}
The default command timeout
+ N + 30 +
+ + Journal Mode + Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
+ N + Delete +
+ + Read Only + True - Open the database for read only access
False - Open the database for normal read/write access
+ N + False +
+ + Max Pool Size + The maximum number of connections for the given connection string that can be in the connection pool + N + 100 + + + Default IsolationLevel + The default transaciton isolation level + N + Serializable + + + Foreign Keys + Enable foreign key constraints + N + False + + + Flags + Extra behavioral flags for the connection. See the enumeration for possible values. + N + Default + + + SetDefaults + + True - Apply the default connection settings to the opened database.
+ False - Skip applying the default connection settings to the opened database. +
+ N + True +
+ + ToFullPath + + True - Attempt to expand the data source file name to a fully qualified path before opening.
+ False - Skip attempting to expand the data source file name to a fully qualified path before opening. +
+ N + True +
+
+
+
+ + + The default "stub" (i.e. placeholder) base schema name to use when + returning column schema information. Used as the initial value of + the BaseSchemaName property. This should start with "sqlite_*" + because those names are reserved for use by SQLite (i.e. they cannot + be confused with the names of user objects). + + + + + The managed assembly containing this type. + + + + + Object used to synchronize access to the static instance data + for this class. + + + + + State of the current connection + + + + + The connection string + + + + + Nesting level of the transactions open on the connection + + + + + If set, then the connection is currently being disposed. + + + + + The default isolation level for new transactions + + + + + Whether or not the connection is enlisted in a distrubuted transaction + + + + + The base SQLite object to interop with + + + + + The database filename minus path and extension + + + + + Temporary password storage, emptied after the database has been opened + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. + + + + + The extra behavioral flags for this connection, if any. See the + enumeration for a list of + possible values. + + + + + Default command timeout + + + + + Non-zero if the built-in (i.e. framework provided) connection string + parser should be used when opening the connection. + + + + + Constructs a new SQLiteConnection object + + + Default constructor + + + + + Initializes the connection with the specified connection string. + + The connection string to use. + + + + Initializes the connection with a pre-existing native connection handle. + This constructor overload is intended to be used only by the private + method. + + + The native connection handle to use. + + + The file name corresponding to the native connection handle. + + + Non-zero if this instance owns the native connection handle and + should dispose of it when it is no longer needed. + + + + + Initializes the connection with the specified connection string. + + + The connection string to use. + + + Non-zero to parse the connection string using the built-in (i.e. + framework provided) parser when opening the connection. + + + + + Clones the settings and connection string from an existing connection. If the existing connection is already open, this + function will open its own connection, enumerate any attached databases of the original connection, and automatically + attach to them. + + The connection to copy the settings from. + + + + Raises the event. + + + The connection associated with this event. If this parameter is not + null and the specified connection cannot raise events, then the + registered event handlers will not be invoked. + + + A that contains the event data. + + + + + Creates and returns a new managed database connection handle. This + method is intended to be used by implementations of the + interface only. In theory, it + could be used by other classes; however, that usage is not supported. + + + This must be a native database connection handle returned by the + SQLite core library and it must remain valid and open during the + entire duration of the calling method. + + + The new managed database connection handle or null if it cannot be + created. + + + + + Backs up the database, using the specified database connection as the + destination. + + The destination database connection. + The destination database name. + The source database name. + + The number of pages to copy or negative to copy all remaining pages. + + + The method to invoke between each step of the backup process. This + parameter may be null (i.e. no callbacks will be performed). + + + The number of milliseconds to sleep after encountering a locking error + during the backup process. A value less than zero means that no sleep + should be performed. + + + + + Attempts to bind the specified object + instance to this connection. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + + + Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection + will also be opened. + + + + + + Creates a database file. This just creates a zero-byte file which SQLite + will turn into a database when the file is opened properly. + + The file to create + + + + Raises the state change event when the state of the connection changes + + The new connection state. If this is different + from the previous state, the event is + raised. + The event data created for the raised event, if + it was actually raised. + + + + Determines and returns the fallback default isolation level when one cannot be + obtained from an existing connection instance. + + + The fallback default isolation level for this connection instance -OR- + if it cannot be determined. + + + + + Determines and returns the default isolation level for this connection instance. + + + The default isolation level for this connection instance -OR- + if it cannot be determined. + + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + This parameter is ignored. + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + Creates a new if one isn't already active on the connection. + + Supported isolation levels are Serializable, ReadCommitted and Unspecified. + + Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the + connection string, Serializable is used. + Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads + may begin a transaction. Other threads may read from the database, but not write. + With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start + a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread + has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. + + Returns a SQLiteTransaction object. + + + + Creates a new if one isn't already + active on the connection. + + Returns the new transaction object. + + + + Forwards to the local function + + Supported isolation levels are Unspecified, Serializable, and ReadCommitted + + + + + This method is not implemented; however, the + event will still be raised. + + + + + + When the database connection is closed, all commands linked to this connection are automatically reset. + + + + + Clears the connection pool associated with the connection. Any other active connections using the same database file + will be discarded instead of returned to the pool when they are closed. + + + + + + Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed. + + + + + Create a new and associate it with this connection. + + Returns a new command object already assigned to this connection. + + + + Forwards to the local function. + + + + + + Parses the connection string into component parts using the custom + connection string parser. + + The connection string to parse + An array of key-value pairs representing each parameter of the connection string + + + + Parses a connection string using the built-in (i.e. framework provided) + connection string parser class and returns the key/value pairs. An + exception may be thrown if the connection string is invalid or cannot be + parsed. When compiled for the .NET Compact Framework, the custom + connection string parser is always used instead because the framework + provided one is unavailable there. + + + The connection string to parse. + + + Non-zero to throw an exception if any connection string values are not of + the type. + + The list of key/value pairs. + + + + Manual distributed transaction enlistment support + + The distributed transaction to enlist in + + + + Looks for a key in the array of key/values of the parameter string. If not found, return the specified default value + + The list to look in + The key to find + The default value to return if the key is not found + The value corresponding to the specified key, or the default value if not found. + + + + Attempts to convert the string value to an enumerated value of the specified type. + + The enumerated type to convert the string value to. + The string value to be converted. + Non-zero to make the conversion case-insensitive. + The enumerated value upon success or null upon error. + + + + Attempts to convert an input string into a byte value. + + + The string value to be converted. + + + The number styles to use for the conversion. + + + Upon sucess, this will contain the parsed byte value. + Upon failure, the value of this parameter is undefined. + + + Non-zero upon success; zero on failure. + + + + + Enables or disabled extension loading. + + + True to enable loading of extensions, false to disable. + + + + + Loads a SQLite extension library from the named dynamic link library file. + + + The name of the dynamic link library file containing the extension. + + + + + Loads a SQLite extension library from the named dynamic link library file. + + + The name of the dynamic link library file containing the extension. + + + The name of the exported function used to initialize the extension. + If null, the default "sqlite3_extension_init" will be used. + + + + + Creates a disposable module containing the implementation of a virtual + table. + + + The module object to be used when creating the disposable module. + + + + + Parses a string containing a sequence of zero or more hexadecimal + encoded byte values and returns the resulting byte array. The + "0x" prefix is not allowed on the input string. + + + The input string containing zero or more hexadecimal encoded byte + values. + + + A byte array containing the parsed byte values or null if an error + was encountered. + + + + + Creates and returns a string containing the hexadecimal encoded byte + values from the input array. + + + The input array of bytes. + + + The resulting string or null upon failure. + + + + + Parses a string containing a sequence of zero or more hexadecimal + encoded byte values and returns the resulting byte array. The + "0x" prefix is not allowed on the input string. + + + The input string containing zero or more hexadecimal encoded byte + values. + + + Upon failure, this will contain an appropriate error message. + + + A byte array containing the parsed byte values or null if an error + was encountered. + + + + + Opens the connection using the parameters found in the . + + + + + Opens the connection using the parameters found in the and then returns it. + + The current connection object. + + + + This method causes any pending database operation to abort and return at + its earliest opportunity. This routine is typically called in response + to a user action such as pressing "Cancel" or Ctrl-C where the user wants + a long query operation to halt immediately. It is safe to call this + routine from any thread. However, it is not safe to call this routine + with a database connection that is closed or might close before this method + returns. + + + + + Returns various global memory statistics for the SQLite core library via + a dictionary of key/value pairs. Currently, only the "MemoryUsed" and + "MemoryHighwater" keys are returned and they have values that correspond + to the values that could be obtained via the + and connection properties. + + + This dictionary will be populated with the global memory statistics. It + will be created if necessary. + + + + + Attempts to free as much heap memory as possible for this database connection. + + + + + Attempts to free N bytes of heap memory by deallocating non-essential memory + allocations held by the database library. Memory used to cache database pages + to improve performance is an example of non-essential memory. This is a no-op + returning zero if the SQLite core library was not compiled with the compile-time + option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or + compact the Win32 native heap, if applicable. + + + The requested number of bytes to free. + + + Non-zero to attempt a heap reset. + + + Non-zero to attempt heap compaction. + + + The number of bytes actually freed. This value may be zero. + + + This value will be non-zero if the heap reset was successful. + + + The size of the largest committed free block in the heap, in bytes. + This value will be zero unless heap compaction is enabled. + + + A standard SQLite return code (i.e. zero for success and non-zero + for failure). + + + + + Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. + If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is + global to the process. + + Non-zero to enable memory usage tracking, zero otherwise. + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Passes a shutdown request to the SQLite core library. Does not throw + an exception if the shutdown request fails. + + + A standard SQLite return code (i.e. zero for success and non-zero for + failure). + + + + + Passes a shutdown request to the SQLite core library. Throws an + exception if the shutdown request fails and the no-throw parameter + is non-zero. + + + Non-zero to reset the database and temporary directories to their + default values, which should be null for both. + + + When non-zero, throw an exception if the shutdown request fails. + + + + Enables or disabled extended result codes returned by SQLite + + + Enables or disabled extended result codes returned by SQLite + + + Enables or disabled extended result codes returned by SQLite + + + Add a log message via the SQLite sqlite3_log interface. + + + Add a log message via the SQLite sqlite3_log interface. + + + + Change the password (or assign a password) to an open database. + + + No readers or writers may be active for this process. The database must already be open + and if it already was password protected, the existing password must already have been supplied. + + The new password to assign to the database + + + + Change the password (or assign a password) to an open database. + + + No readers or writers may be active for this process. The database must already be open + and if it already was password protected, the existing password must already have been supplied. + + The new password to assign to the database + + + + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. + + The password for the database + + + + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. + + The password for the database + + + + Queries or modifies the number of retries or the retry interval (in milliseconds) for + certain I/O operations that may fail due to anti-virus software. + + The number of times to retry the I/O operation. A negative value + will cause the current count to be queried and replace that negative value. + The number of milliseconds to wait before retrying the I/O + operation. This number is multiplied by the number of retry attempts so far to come + up with the final number of milliseconds to wait. A negative value will cause the + current interval to be queried and replace that negative value. + Zero for success, non-zero for error. + + + + Removes one set of surrounding single -OR- double quotes from the string + value and returns the resulting string value. If the string is null, empty, + or contains quotes that are not balanced, nothing is done and the original + string value will be returned. + + The string value to process. + + The string value, modified to remove one set of surrounding single -OR- + double quotes, if applicable. + + + + + Expand the filename of the data source, resolving the |DataDirectory| + macro as appropriate. + + The database filename to expand + + Non-zero if the returned file name should be converted to a full path + (except when using the .NET Compact Framework). + + The expanded path and filename of the filename + + + + The following commands are used to extract schema information out of the database. Valid schema types are: + + + MetaDataCollections + + + DataSourceInformation + + + Catalogs + + + Columns + + + ForeignKeys + + + Indexes + + + IndexColumns + + + Tables + + + Views + + + ViewColumns + + + + + Returns the MetaDataCollections schema + + A DataTable of the MetaDataCollections schema + + + + Returns schema information of the specified collection + + The schema collection to retrieve + A DataTable of the specified collection + + + + Retrieves schema information using the specified constraint(s) for the specified collection + + The collection to retrieve + The restrictions to impose + A DataTable of the specified collection + + + + Builds a MetaDataCollections schema datatable + + DataTable + + + + Builds a DataSourceInformation datatable + + DataTable + + + + Build a Columns schema + + The catalog (attached database) to query, can be null + The table to retrieve schema information for, must not be null + The column to retrieve schema information for, can be null + DataTable + + + + Returns index information for the given database and catalog + + The catalog (attached database) to query, can be null + The name of the index to retrieve information for, can be null + The table to retrieve index information for, can be null + DataTable + + + + Retrieves table schema information for the database and catalog + + The catalog (attached database) to retrieve tables on + The table to retrieve, can be null + The table type, can be null + DataTable + + + + Retrieves view schema information for the database + + The catalog (attached database) to retrieve views on + The view name, can be null + DataTable + + + + Retrieves catalog (attached databases) schema information for the database + + The catalog to retrieve, can be null + DataTable + + + + Returns the base column information for indexes in a database + + The catalog to retrieve indexes for (can be null) + The table to restrict index information by (can be null) + The index to restrict index information by (can be null) + The source column to restrict index information by (can be null) + A DataTable containing the results + + + + Returns detailed column information for a specified view + + The catalog to retrieve columns for (can be null) + The view to restrict column information by (can be null) + The source column to restrict column information by (can be null) + A DataTable containing the results + + + + Retrieves foreign key information from the specified set of filters + + An optional catalog to restrict results on + An optional table to restrict results on + An optional foreign key name to restrict results on + A DataTable with the results of the query + + + + Static variable to store the connection event handlers to call. + + + + + This event is raised whenever the database is opened or closed. + + + + + This event is raised when events related to the lifecycle of a + SQLiteConnection object occur. + + + + + This property is used to obtain or set the custom connection pool + implementation to use, if any. Setting this property to null will + cause the default connection pool implementation to be used. + + + + + Returns the number of pool entries for the file name associated with this connection. + + + + + The connection string containing the parameters for the connection + + + + + Parameter + Values + Required + Default + + + Data Source + + This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). + Starting with release 1.0.86.0, in order to use more than one consecutive backslash (e.g. for a + UNC path), each of the adjoining backslash characters must be doubled (e.g. "\\Network\Share\test.db" + would become "\\\\Network\Share\test.db"). + + Y + + + + Version + 3 + N + 3 + + + UseUTF16Encoding + True
False
+ N + False +
+ + DateTimeFormat + + Ticks - Use the value of DateTime.Ticks.
+ ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC + DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
+ JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC.
+ UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970).
+ InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
+ CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
+ N + ISO8601 +
+ + DateTimeKind + Unspecified - Not specified as either UTC or local time.
Utc - The time represented is UTC.
Local - The time represented is local time.
+ N + Unspecified +
+ + DateTimeFormatString + The exact DateTime format string to use for all formatting and parsing of all DateTime + values for this connection. + N + null + + + BaseSchemaName + Some base data classes in the framework (e.g. those that build SQL queries dynamically) + assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting + alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used + as a placeholder and removed prior to preparing any SQL statements that may contain it. + N + sqlite_default_schema + + + BinaryGUID + True - Store GUID columns in binary form
False - Store GUID columns as text
+ N + True +
+ + Cache Size + {size in bytes} + N + 2000 + + + Synchronous + Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
+ N + Full +
+ + Page Size + {size in bytes} + N + 1024 + + + Password + {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. + N + + + + HexPassword + {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. + N + + + + Enlist + Y - Automatically enlist in distributed transactions
N - No automatic enlistment
+ N + Y +
+ + Pooling + + True - Use connection pooling.
+ False - Do not use connection pooling.

+ WARNING: When using the default connection pool implementation, + setting this property to True should be avoided by applications that + make use of COM (either directly or indirectly) due to possible + deadlocks that can occur during the finalization of some COM objects. +
+ N + False +
+ + FailIfMissing + True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
+ N + False +
+ + Max Page Count + {size in pages} - Limits the maximum number of pages (limits the size) of the database + N + 0 + + + Legacy Format + True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
+ N + False +
+ + Default Timeout + {time in seconds}
The default command timeout
+ N + 30 +
+ + Journal Mode + Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
+ N + Delete +
+ + Read Only + True - Open the database for read only access
False - Open the database for normal read/write access
+ N + False +
+ + Max Pool Size + The maximum number of connections for the given connection string that can be in the connection pool + N + 100 + + + Default IsolationLevel + The default transaciton isolation level + N + Serializable + + + Foreign Keys + Enable foreign key constraints + N + False + + + Flags + Extra behavioral flags for the connection. See the enumeration for possible values. + N + Default + + + SetDefaults + + True - Apply the default connection settings to the opened database.
+ False - Skip applying the default connection settings to the opened database. +
+ N + True +
+ + ToFullPath + + True - Attempt to expand the data source file name to a fully qualified path before opening.
+ False - Skip attempting to expand the data source file name to a fully qualified path before opening. +
+ N + True +
+
+
+
+ + + Returns the data source file name without extension or path. + + + + + Returns the string "main". + + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + This can also be set in the ConnectionString with "Default Timeout" + + + + + Non-zero if the built-in (i.e. framework provided) connection string + parser should be used when opening the connection. + + + + + Gets/sets the extra behavioral flags for this connection. See the + enumeration for a list of + possible values. + + + + + Returns non-zero if the underlying native connection handle is + owned by this instance. + + + + + Returns the version of the underlying SQLite database engine + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on + this connection. + + + + + Returns non-zero if the given database connection is in autocommit mode. + Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN + statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + + + + + Returns a string containing the define constants (i.e. compile-time + options) used to compile the core managed assembly, delimited with + spaces. + + + + + Returns the version of the underlying SQLite core library. + + + + + This method returns the string whose value is the same as the + SQLITE_SOURCE_ID C preprocessor macro used when compiling the + SQLite core library. + + + + + This method returns the version of the interop SQLite assembly + used. If the SQLite interop assembly is not in use or the + necessary information cannot be obtained for any reason, a null + value may be returned. + + + + + This method returns the string whose value contains the unique + identifier for the source checkout used to build the interop + assembly. If the SQLite interop assembly is not in use or the + necessary information cannot be obtained for any reason, a null + value may be returned. + + + + + This method returns the version of the managed components used + to interact with the SQLite core library. If the necessary + information cannot be obtained for any reason, a null value may + be returned. + + + + + This method returns the string whose value contains the unique + identifier for the source checkout used to build the managed + components currently executing. If the necessary information + cannot be obtained for any reason, a null value may be returned. + + + + + Returns the state of the connection. + + + + + This event is raised whenever SQLite encounters an action covered by the + authorizer during query preparation. Changing the value of the + property will determine if + the specific action will be allowed, ignored, or denied. For the entire + duration of the event, the associated connection and statement objects + must not be modified, either directly or indirectly, by the called code. + + + + + This event is raised whenever SQLite makes an update/delete/insert into the database on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is committing a transaction. + Return non-zero to trigger a rollback. + + + + + This event is raised whenever SQLite statement first begins executing on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is rolling back a transaction. + + + + + Returns the instance. + + + + + The I/O file cache flushing behavior for the connection + + + + + Normal file flushing at critical sections of the code + + + + + Full file flushing after every write operation + + + + + Use the default operating system's file flushing, SQLite does not explicitly flush the file buffers after writing + + + + + Raised when authorization is required to perform an action contained + within a SQL query. + + The connection performing the action. + A that contains the + event data. + + + + Raised when a transaction is about to be committed. To roll back a transaction, set the + rollbackTrans boolean value to true. + + The connection committing the transaction + Event arguments on the transaction + + + + Raised when data is inserted, updated and deleted on a given connection + + The connection committing the transaction + The event parameters which triggered the event + + + + Raised when a statement first begins executing on a given connection + + The connection executing the statement + Event arguments of the trace + + + + Raised between each backup step. + + + The source database connection. + + + The source database name. + + + The destination database connection. + + + The destination database name. + + + The number of pages copied with each step. + + + The number of pages remaining to be copied. + + + The total number of pages in the source database. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. + + + True to continue with the backup process or false to halt the backup + process, rolling back any changes that have been made so far. + + + + + The data associated with a call into the authorizer. + + + + + The user-defined native data associated with this event. Currently, + this will always contain the value of . + + + + + The action code responsible for the current call into the authorizer. + + + + + The first string argument for the current call into the authorizer. + The exact value will vary based on the action code, see the + enumeration for possible + values. + + + + + The second string argument for the current call into the authorizer. + The exact value will vary based on the action code, see the + enumeration for possible + values. + + + + + The database name for the current call into the authorizer, if + applicable. + + + + + The name of the inner-most trigger or view that is responsible for + the access attempt or a null value if this access attempt is directly + from top-level SQL code. + + + + + The return code for the current call into the authorizer. + + + + + Constructs an instance of this class with default property values. + + + + + Constructs an instance of this class with specific property values. + + + The user-defined native data associated with this event. + + + The authorizer action code. + + + The first authorizer argument. + + + The second authorizer argument. + + + The database name, if applicable. + + + The name of the inner-most trigger or view that is responsible for + the access attempt or a null value if this access attempt is directly + from top-level SQL code. + + + The authorizer return code. + + + + + Whenever an update event is triggered on a connection, this enum will indicate + exactly what type of operation is being performed. + + + + + A row is being deleted from the given database and table + + + + + A row is being inserted into the table. + + + + + A row is being updated in the table. + + + + + Passed during an Update callback, these event arguments detail the type of update operation being performed + on the given connection. + + + + + The name of the database being updated (usually "main" but can be any attached or temporary database) + + + + + The name of the table being updated + + + + + The type of update being performed (insert/update/delete) + + + + + The RowId affected by this update. + + + + + Event arguments raised when a transaction is being committed + + + + + Set to true to abort the transaction and trigger a rollback + + + + + Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text + + + + + SQL statement text as the statement first begins executing + + + + + This interface represents a custom connection pool implementation + usable by System.Data.SQLite. + + + + + Counts the number of pool entries matching the specified file name. + + + The file name to match or null to match all files. + + + The pool entry counts for each matching file. + + + The total number of connections successfully opened from any pool. + + + The total number of connections successfully closed from any pool. + + + The total number of pool entries for all matching files. + + + + + Disposes of all pooled connections associated with the specified + database file name. + + + The database file name. + + + + + Disposes of all pooled connections. + + + + + Adds a connection to the pool of those associated with the + specified database file name. + + + The database file name. + + + The database connection handle. + + + The connection pool version at the point the database connection + handle was received from the connection pool. This is also the + connection pool version that the database connection handle was + created under. + + + + + Removes a connection from the pool of those associated with the + specified database file name with the intent of using it to + interact with the database. + + + The database file name. + + + The new maximum size of the connection pool for the specified + database file name. + + + The connection pool version associated with the returned database + connection handle, if any. + + + The database connection handle associated with the specified + database file name or null if it cannot be obtained. + + + + + This default method implementations in this class should not be used by + applications that make use of COM (either directly or indirectly) due + to possible deadlocks that can occur during finalization of some COM + objects. + + + + + This field is used to synchronize access to the private static data + in this class. + + + + + When this field is non-null, it will be used to provide the + implementation of all the connection pool methods; otherwise, + the default method implementations will be used. + + + + + The dictionary of connection pools, based on the normalized file + name of the SQLite database. + + + + + The default version number new pools will get. + + + + + The number of connections successfully opened from any pool. + This value is incremented by the Remove method. + + + + + The number of connections successfully closed from any pool. + This value is incremented by the Add method. + + + + + Counts the number of pool entries matching the specified file name. + + + The file name to match or null to match all files. + + + The pool entry counts for each matching file. + + + The total number of connections successfully opened from any pool. + + + The total number of connections successfully closed from any pool. + + + The total number of pool entries for all matching files. + + + + + Disposes of all pooled connections associated with the specified + database file name. + + + The database file name. + + + + + Disposes of all pooled connections. + + + + + Adds a connection to the pool of those associated with the + specified database file name. + + + The database file name. + + + The database connection handle. + + + The connection pool version at the point the database connection + handle was received from the connection pool. This is also the + connection pool version that the database connection handle was + created under. + + + + + Removes a connection from the pool of those associated with the + specified database file name with the intent of using it to + interact with the database. + + + The database file name. + + + The new maximum size of the connection pool for the specified + database file name. + + + The connection pool version associated with the returned database + connection handle, if any. + + + The database connection handle associated with the specified + database file name or null if it cannot be obtained. + + + + + This method is used to obtain a reference to the custom connection + pool implementation currently in use, if any. + + + The custom connection pool implementation or null if the default + connection pool implementation should be used. + + + + + This method is used to set the reference to the custom connection + pool implementation to use, if any. + + + The custom connection pool implementation to use or null if the + default connection pool implementation should be used. + + + + + We do not have to thread-lock anything in this function, because it + is only called by other functions above which already take the lock. + + + The pool queue to resize. + + + If a function intends to add to the pool, this is true, which + forces the resize to take one more than it needs from the pool. + + + + + Keeps track of connections made on a specified file. The PoolVersion + dictates whether old objects get returned to the pool or discarded + when no longer in use. + + + + + The queue of weak references to the actual database connection + handles. + + + + + This pool version associated with the database connection + handles in this pool queue. + + + + + The maximum size of this pool queue. + + + + + Constructs a connection pool queue using the specified version + and maximum size. Normally, all the database connection + handles in this pool are associated with a single database file + name. + + + The initial pool version for this connection pool queue. + + + The initial maximum size for this connection pool queue. + + + + + SQLite implementation of DbConnectionStringBuilder. + + + + + Properties of this class + + + + + Constructs a new instance of the class + + + Default constructor + + + + + Constructs a new instance of the class using the specified connection string. + + The connection string to parse + + + + Private initializer, which assigns the connection string and resets the builder + + The connection string to assign + + + + Helper function for retrieving values from the connectionstring + + The keyword to retrieve settings for + The resulting parameter value + Returns true if the value was found and returned + + + + Fallback method for MONO, which doesn't implement DbConnectionStringBuilder.GetProperties() + + The hashtable to fill with property descriptors + + + + Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library. + + + + + Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal". + + + + + Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding. + + + + + Gets/Sets whether or not to use connection pooling. The default is "False" + + + + + Gets/Sets whethor not to store GUID's in binary format. The default is True + which saves space in the database. + + + + + Gets/Sets the filename to open on the connection string. + + + + + An alternate to the data source property + + + + + An alternate to the data source property that uses the SQLite URI syntax. + + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + + + + + Determines whether or not the connection will automatically participate + in the current distributed transaction (if one exists) + + + + + If set to true, will throw an exception if the database specified in the connection + string does not exist. If false, the database will be created automatically. + + + + + If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger + database sizes. + + + + + When enabled, the database will be opened for read-only access and writing will be disabled. + + + + + Gets/sets the database encryption password + + + + + Gets/sets the database encryption hexadecimal password + + + + + Gets/Sets the page size for the connection. + + + + + Gets/Sets the maximum number of pages the database may hold + + + + + Gets/Sets the cache size for the connection. + + + + + Gets/Sets the DateTime format for the connection. + + + + + Gets/Sets the DateTime kind for the connection. + + + + + Gets/sets the DateTime format string used for formatting + and parsing purposes. + + + + + Gets/Sets the placeholder base schema name used for + .NET Framework compatibility purposes. + + + + + Determines how SQLite handles the transaction journal file. + + + + + Sets the default isolation level for transactions on the connection. + + + + + If enabled, use foreign key constraints + + + + + Gets/Sets the extra behavioral flags. + + + + + If enabled, apply the default connection settings to opened databases. + + + + + If enabled, attempt to resolve the provided data source file name to a + full path before opening. + + + + + SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite + understands. The DateTime extension to the spec is for internal use only. + + + + + Not used + + + + + All integers in SQLite default to Int64 + + + + + All floating point numbers in SQLite default to double + + + + + The default data type of SQLite is text + + + + + Typically blob types are only seen when returned from a function + + + + + Null types can be returned from functions + + + + + Used internally by this provider + + + + + Used internally by this provider + + + + + These are the event types associated with the + + delegate (and its corresponding event) and the + class. + + + + + Not used. + + + + + Not used. + + + + + The connection is being opened. + + + + + The connection string has been parsed. + + + + + The connection was opened. + + + + + The method was called on the + connection. + + + + + A transaction was created using the connection. + + + + + The connection was enlisted into a transaction. + + + + + A command was created using the connection. + + + + + A data reader was created using the connection. + + + + + An instance of a derived class has + been created to wrap a native resource. + + + + + The connection is being closed. + + + + + The connection was closed. + + + + + This implementation of SQLite for ADO.NET can process date/time fields in + databases in one of six formats. + + + ISO8601 format is more compatible, readable, fully-processable, but less + accurate as it does not provide time down to fractions of a second. + JulianDay is the numeric format the SQLite uses internally and is arguably + the most compatible with 3rd party tools. It is not readable as text + without post-processing. Ticks less compatible with 3rd party tools that + query the database, and renders the DateTime field unreadable as text + without post-processing. UnixEpoch is more compatible with Unix systems. + InvariantCulture allows the configured format for the invariant culture + format to be used and is human readable. CurrentCulture allows the + configured format for the current culture to be used and is also human + readable. + + The preferred order of choosing a DateTime format is JulianDay, ISO8601, + and then Ticks. Ticks is mainly present for legacy code support. + + + + + Use the value of DateTime.Ticks. This value is not recommended and is not well supported with LINQ. + + + + + Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and + "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values). + + + + + The interval of time in days and fractions of a day since January 1, 4713 BC. + + + + + The whole number of seconds since the Unix epoch (January 1, 1970). + + + + + Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. + + + + + Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. + + + + + The default format for this provider. + + + + + This enum determines how SQLite treats its journal file. + + + By default SQLite will create and delete the journal file when needed during a transaction. + However, for some computers running certain filesystem monitoring tools, the rapid + creation and deletion of the journal file can cause those programs to fail, or to interfere with SQLite. + + If a program or virus scanner is interfering with SQLite's journal file, you may receive errors like "unable to open database file" + when starting a transaction. If this is happening, you may want to change the default journal mode to Persist. + + + + + The default mode, this causes SQLite to use the existing journaling mode for the database. + + + + + SQLite will create and destroy the journal file as-needed. + + + + + When this is set, SQLite will keep the journal file even after a transaction has completed. It's contents will be erased, + and the journal re-used as often as needed. If it is deleted, it will be recreated the next time it is needed. + + + + + This option disables the rollback journal entirely. Interrupted transactions or a program crash can cause database + corruption in this mode! + + + + + SQLite will truncate the journal file to zero-length instead of deleting it. + + + + + SQLite will store the journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. + If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the + database file will very likely go corrupt. + + + + + SQLite uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; + after being set it stays in effect across multiple database connections and after closing and reopening the database. A database + in WAL journaling mode can only be accessed by SQLite version 3.7.0 or later. + + + + + Possible values for the "synchronous" database setting. This setting determines + how often the database engine calls the xSync method of the VFS. + + + + + Use the default "synchronous" database setting. Currently, this should be + the same as using the FULL mode. + + + + + The database engine continues without syncing as soon as it has handed + data off to the operating system. If the application running SQLite + crashes, the data will be safe, but the database might become corrupted + if the operating system crashes or the computer loses power before that + data has been written to the disk surface. + + + + + The database engine will still sync at the most critical moments, but + less often than in FULL mode. There is a very small (though non-zero) + chance that a power failure at just the wrong time could corrupt the + database in NORMAL mode. + + + + + The database engine will use the xSync method of the VFS to ensure that + all content is safely written to the disk surface prior to continuing. + This ensures that an operating system crash or power failure will not + corrupt the database. FULL synchronous is very safe, but it is also + slower. + + + + + The requested command execution type. This controls which method of the + object will be called. + + + + + Do nothing. No method will be called. + + + + + The command is not expected to return a result -OR- the result is not + needed. The or + method + will be called. + + + + + The command is expected to return a scalar result -OR- the result should + be limited to a scalar result. The + or method will + be called. + + + + + The command is expected to return result. + The or + method will + be called. + + + + + Use the default command execution type. Using this value is the same + as using the value. + + + + + The action code responsible for the current call into the authorizer. + + + + + No action is being performed. This value should not be used from + external code. + + + + + No longer used. + + + + + An index will be created. The action-specific arguments are the + index name and the table name. + + + + + + A table will be created. The action-specific arguments are the + table name and a null value. + + + + + A temporary index will be created. The action-specific arguments + are the index name and the table name. + + + + + A temporary table will be created. The action-specific arguments + are the table name and a null value. + + + + + A temporary trigger will be created. The action-specific arguments + are the trigger name and the table name. + + + + + A temporary view will be created. The action-specific arguments are + the view name and a null value. + + + + + A trigger will be created. The action-specific arguments are the + trigger name and the table name. + + + + + A view will be created. The action-specific arguments are the view + name and a null value. + + + + + A DELETE statement will be executed. The action-specific arguments + are the table name and a null value. + + + + + An index will be dropped. The action-specific arguments are the + index name and the table name. + + + + + A table will be dropped. The action-specific arguments are the tables + name and a null value. + + + + + A temporary index will be dropped. The action-specific arguments are + the index name and the table name. + + + + + A temporary table will be dropped. The action-specific arguments are + the table name and a null value. + + + + + A temporary trigger will be dropped. The action-specific arguments + are the trigger name and the table name. + + + + + A temporary view will be dropped. The action-specific arguments are + the view name and a null value. + + + + + A trigger will be dropped. The action-specific arguments are the + trigger name and the table name. + + + + + A view will be dropped. The action-specific arguments are the view + name and a null value. + + + + + An INSERT statement will be executed. The action-specific arguments + are the table name and a null value. + + + + + A PRAGMA statement will be executed. The action-specific arguments + are the name of the PRAGMA and the new value or a null value. + + + + + A table column will be read. The action-specific arguments are the + table name and the column name. + + + + + A SELECT statement will be executed. The action-specific arguments + are both null values. + + + + + A transaction will be started, committed, or rolled back. The + action-specific arguments are the name of the operation (BEGIN, + COMMIT, or ROLLBACK) and a null value. + + + + + An UPDATE statement will be executed. The action-specific arguments + are the table name and the column name. + + + + + A database will be attached to the connection. The action-specific + arguments are the database file name and a null value. + + + + + A database will be detached from the connection. The action-specific + arguments are the database name and a null value. + + + + + The schema of a table will be altered. The action-specific arguments + are the database name and the table name. + + + + + An index will be deleted and then recreated. The action-specific + arguments are the index name and a null value. + + + + + A table will be analyzed to gathers statistics about it. The + action-specific arguments are the table name and a null value. + + + + + A virtual table will be created. The action-specific arguments are + the table name and the module name. + + + + + A virtual table will be dropped. The action-specific arguments are + the table name and the module name. + + + + + A SQL function will be called. The action-specific arguments are a + null value and the function name. + + + + + A savepoint will be created, released, or rolled back. The + action-specific arguments are the name of the operation (BEGIN, + RELEASE, or ROLLBACK) and the savepoint name. + + + + + The return code for the current call into the authorizer. + + + + + The action will be allowed. + + + + + The overall action will be disallowed and an error message will be + returned from the query preparation method. + + + + + The specific action will be disallowed; however, the overall action + will continue. The exact effects of this return code vary depending + on the specific action, please refer to the SQLite core library + documentation for futher details. + + + + + Class used internally to determine the datatype of a column in a resultset + + + + + The DbType of the column, or DbType.Object if it cannot be determined + + + + + The affinity of a column, used for expressions or when Type is DbType.Object + + + + + SQLite implementation of DbDataAdapter. + + + + + This class is just a shell around the DbDataAdapter. Nothing from + DbDataAdapter is overridden here, just a few constructors are defined. + + + Default constructor. + + + + + Constructs a data adapter using the specified select command. + + + The select command to associate with the adapter. + + + + + Constructs a data adapter with the supplied select command text and + associated with the specified connection. + + + The select command text to associate with the data adapter. + + + The connection to associate with the select command. + + + + + Constructs a data adapter with the specified select command text, + and using the specified database connection string. + + + The select command text to use to construct a select command. + + + A connection string suitable for passing to a new SQLiteConnection, + which is associated with the select command. + + + + + Constructs a data adapter with the specified select command text, + and using the specified database connection string. + + + The select command text to use to construct a select command. + + + A connection string suitable for passing to a new SQLiteConnection, + which is associated with the select command. + + + Non-zero to parse the connection string using the built-in (i.e. + framework provided) parser when opening the connection. + + + + + Raised by the underlying DbDataAdapter when a row is being updated + + The event's specifics + + + + Raised by DbDataAdapter after a row is updated + + The event's specifics + + + + Row updating event handler + + + + + Row updated event handler + + + + + Gets/sets the select command for this DataAdapter + + + + + Gets/sets the insert command for this DataAdapter + + + + + Gets/sets the update command for this DataAdapter + + + + + Gets/sets the delete command for this DataAdapter + + + + + SQLite implementation of DbDataReader. + + + + + Underlying command this reader is attached to + + + + + Index of the current statement in the command being processed + + + + + Current statement being Read() + + + + + State of the current statement being processed. + -1 = First Step() executed, so the first Read() will be ignored + 0 = Actively reading + 1 = Finished reading + 2 = Non-row-returning statement, no records + + + + + Number of records affected by the insert/update statements executed on the command + + + + + Count of fields (columns) in the row-returning statement currently being processed + + + + + Maps the field (column) names to their corresponding indexes within the results. + + + + + Datatypes of active fields (columns) in the current statement, used for type-restricting data + + + + + The behavior of the datareader + + + + + If set, then dispose of the command object when the reader is finished + + + + + If set, then raise an exception when the object is accessed after being disposed. + + + + + An array of rowid's for the active statement if CommandBehavior.KeyInfo is specified + + + + + Matches the version of the connection. + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. Matches the base schema name used by the + associated connection. + + + + + Internal constructor, initializes the datareader and sets up to begin executing statements + + The SQLiteCommand this data reader is for + The expected behavior of the data reader + + + + Dispose of all resources used by this datareader. + + + + + + Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified. + + + + + Throw an error if the datareader is closed + + + + + Throw an error if a row is not loaded + + + + + Enumerator support + + Returns a DbEnumerator object. + + + + SQLite is inherently un-typed. All datatypes in SQLite are natively strings. The definition of the columns of a table + and the affinity of returned types are all we have to go on to type-restrict data in the reader. + + This function attempts to verify that the type of data being requested of a column matches the datatype of the column. In + the case of columns that are not backed into a table definition, we attempt to match up the affinity of a column (int, double, string or blob) + to a set of known types that closely match that affinity. It's not an exact science, but its the best we can do. + + + This function throws an InvalidTypeCast() exception if the requested type doesn't match the column's definition or affinity. + + The index of the column to type-check + The type we want to get out of the column + + + + Retrieves the column as a boolean value + + The index of the column to retrieve + bool + + + + Retrieves the column as a single byte value + + The index of the column to retrieve + byte + + + + Retrieves a column as an array of bytes (blob) + + The index of the column to retrieve + The zero-based index of where to begin reading the data + The buffer to write the bytes into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of bytes written into the array + + To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. + + + + + Returns the column as a single character + + The index of the column to retrieve + char + + + + Retrieves a column as an array of chars (blob) + + The index of the column to retrieve + The zero-based index of where to begin reading the data + The buffer to write the characters into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of characters written into the array + + To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. + + + + + Retrieves the name of the back-end datatype of the column + + The index of the column to retrieve + string + + + + Retrieve the column as a date/time value + + The index of the column to retrieve + DateTime + + + + Retrieve the column as a decimal value + + The index of the column to retrieve + decimal + + + + Returns the column as a double + + The index of the column to retrieve + double + + + + Returns the .NET type of a given column + + The index of the column to retrieve + Type + + + + Returns a column as a float value + + The index of the column to retrieve + float + + + + Returns the column as a Guid + + The index of the column to retrieve + Guid + + + + Returns the column as a short + + The index of the column to retrieve + Int16 + + + + Retrieves the column as an int + + The index of the column to retrieve + Int32 + + + + Retrieves the column as a long + + The index of the column to retrieve + Int64 + + + + Retrieves the name of the column + + The index of the column to retrieve + string + + + + Retrieves the i of a column, given its name + + The name of the column to retrieve + The int i of the column + + + + Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done + to gather the necessary information so it can be represented in an ADO.NET manner. + + Returns a DataTable containing the schema information for the active SELECT statement being processed. + + + + Retrieves the column as a string + + The index of the column to retrieve + string + + + + Retrieves the column as an object corresponding to the underlying datatype of the column + + The index of the column to retrieve + object + + + + Retreives the values of multiple columns, up to the size of the supplied array + + The array to fill with values from the columns in the current resultset + The number of columns retrieved + + + + Returns a collection containing all the column names and values for the + current row of data in the current resultset, if any. If there is no + current row or no current resultset, an exception may be thrown. + + + The collection containing the column name and value information for the + current row of data in the current resultset or null if this information + cannot be obtained. + + + + + Returns True if the specified column is null + + The index of the column to retrieve + True or False + + + + Moves to the next resultset in multiple row-returning SQL command. + + True if the command was successful and a new resultset is available, False otherwise. + + + + This method attempts to query the flags associated with the database + connection in use. If the database connection is disposed, the default + flags will be returned. + + + The data reader containing the databse connection to query the flags from. + + + The connection flags value. + + + + + Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls. + + The index of the column to retrieve + A SQLiteType structure + + + + Reads the next row from the resultset + + True if a new row was successfully loaded and is ready for processing + + + + Not implemented. Returns 0 + + + + + Returns the number of columns in the current resultset + + + + + Returns the number of visible fields in the current resultset + + + + + Returns True if the resultset has rows that can be fetched + + + + + Returns True if the data reader is closed + + + + + Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed! + + + + + Indexer to retrieve data from a column given its name + + The name of the column to retrieve data for + The value contained in the column + + + + Indexer to retrieve data from a column given its i + + The index of the column to retrieve + The value contained in the column + + + + SQLite exception class. + + + + + Private constructor for use with serialization. + + + Holds the serialized object data about the exception being thrown. + + + Contains contextual information about the source or destination. + + + + + Public constructor for generating a SQLite exception given the error + code and message. + + + The SQLite return code to report. + + + Message text to go along with the return code message text. + + + + + Public constructor that uses the base class constructor for the error + message. + + Error message text. + + + + Public constructor that uses the default base class constructor. + + + + + Public constructor that uses the base class constructor for the error + message and inner exception. + + Error message text. + The original (inner) exception. + + + + Adds extra information to the serialized object data specific to this + class type. This is only used for serialization. + + + Holds the serialized object data about the exception being thrown. + + + Contains contextual information about the source or destination. + + + + + Returns the error message for the specified SQLite return code. + + The SQLite return code. + The error message or null if it cannot be found. + + + + Returns the composite error message based on the SQLite return code + and the optional detailed error message. + + The SQLite return code. + Optional detailed error message. + Error message text for the return code. + + + + Gets the associated SQLite result code for this exception as a + . This property returns the same + underlying value as the property. + + + + + Gets the associated SQLite return code for this exception as an + . For desktop versions of the .NET Framework, + this property overrides the property of the same name within the + + class. This property returns the same underlying value as the + property. + + + + + SQLite error codes. Actually, this enumeration represents a return code, + which may also indicate success in one of several ways (e.g. SQLITE_OK, + SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is + something of a misnomer. + + + + + The error code is unknown. This error code + is only used by the managed wrapper itself. + + + + + Successful result + + + + + SQL error or missing database + + + + + Internal logic error in SQLite + + + + + Access permission denied + + + + + Callback routine requested an abort + + + + + The database file is locked + + + + + A table in the database is locked + + + + + A malloc() failed + + + + + Attempt to write a readonly database + + + + + Operation terminated by sqlite3_interrupt() + + + + + Some kind of disk I/O error occurred + + + + + The database disk image is malformed + + + + + Unknown opcode in sqlite3_file_control() + + + + + Insertion failed because database is full + + + + + Unable to open the database file + + + + + Database lock protocol error + + + + + Database is empty + + + + + The database schema changed + + + + + String or BLOB exceeds size limit + + + + + Abort due to constraint violation + + + + + Data type mismatch + + + + + Library used incorrectly + + + + + Uses OS features not supported on host + + + + + Authorization denied + + + + + Auxiliary database format error + + + + + 2nd parameter to sqlite3_bind out of range + + + + + File opened that is not a database file + + + + + Notifications from sqlite3_log() + + + + + Warnings from sqlite3_log() + + + + + sqlite3_step() has another row ready + + + + + sqlite3_step() has finished executing + + + + + Used to mask off extended result codes + + + + + SQLite implementation of . + + + SQLite implementation of . + + + + + Constructs a new instance. + + + + + Static instance member which returns an instanced class. + + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Will provide a object in .NET 3.5. + + The class or interface type to query for. + + + + + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. This event is provided for backward compatibility only. + New code should use the class instead. + + + + + This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each + connection to the database. + + + Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access + to the underlying connection. This is necessary to deter implementers from thinking it would be a good idea to make database + calls during processing. + + It is important to distinguish between a per-connection instance, and a per-SQL statement context. One instance of this class + services all SQL statements being stepped through on that connection, and there can be many. One should never store per-statement + information in member variables of user-defined function classes. + + For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step. This data will + be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes. + + + + + The base connection this function is attached to + + + + + Internal array used to keep track of aggregate function context data + + + + + The connection flags associated with this object (this should be the + same value as the flags associated with the parent connection object). + + + + + Holds a reference to the callback function for user functions + + + + + Holds a reference to the callbakc function for stepping in an aggregate function + + + + + Holds a reference to the callback function for finalizing an aggregate function + + + + + Holds a reference to the callback function for collation sequences + + + + + Current context of the current callback. Only valid during a callback + + + + + This static list contains all the user-defined functions declared using the proper attributes. + + + + + Internal constructor, initializes the function's internal variables. + + + + + Constructs an instance of this class using the specified data-type + conversion parameters. + + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. + + + The to be used when creating DateTime + values. + + + The format string to be used when parsing and formatting DateTime + values. + + + Non-zero to create a UTF-16 data-type conversion context; otherwise, + a UTF-8 data-type conversion context will be created. + + + + + Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if + someone closes the connection while a DataReader is open. + + + + + Placeholder for a user-defined disposal routine + + True if the object is being disposed explicitly + + + + Scalar functions override this method to do their magic. + + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The arguments for the command to process + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! + + + + Aggregate functions override this method to do their magic. + + + Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible. + + The arguments for the command to process + The 1-based step number. This is incrememted each time the step method is called. + A placeholder for implementers to store contextual data pertaining to the current context. + + + + Aggregate functions override this method to finish their aggregate processing. + + + If you implemented your aggregate function properly, + you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have + all the information you need in there to figure out what to return. + NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will + be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value + if that is the case. + + Your own assigned contextData, provided for you so you can return your final results. + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! + + + + + User-defined collation sequences override this method to provide a custom string sorting algorithm. + + The first string to compare + The second strnig to compare + 1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2 + + + + Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to. + + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The number of arguments + A pointer to the array of arguments + An object array of the arguments once they've been converted to .NET values + + + + Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context. + + The context the return value applies to + The parameter to return to SQLite + + + + Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. + WARNING: Must not throw exceptions. + + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments + + + + Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. + + + + Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. + + + + The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. + WARNING: Must not throw exceptions. + + + This function takes care of doing the lookups and getting the important information put together to call the Step() function. + That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so + binary searches can be done to find the data. + + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments + + + + An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. + WARNING: Must not throw exceptions. + + A raw context pointer + + + + Using reflection, enumerate all assemblies in the current appdomain looking for classes that + have a SQLiteFunctionAttribute attribute, and registering them accordingly. + + + + + Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work + properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported. + + The type of the function to register + + + + Called by SQLiteBase derived classes, this function binds all user-defined functions to a connection. + It is done this way so that all user-defined functions will access the database using the same encoding scheme + as the connection (UTF-8 or UTF-16). + + + The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to + all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. + + The base object on which the functions are to bind + The flags associated with the parent connection object + Returns a logical list of functions which the connection should retain until it is closed. + + + + This function binds a user-defined functions to a connection. + + + The object instance associated with the + that the function should be bound to. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + The flags associated with the parent connection object. + + + + + Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert + strings and DateTime's into the current connection's encoding schema. + + + + + Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call. + + + User-defined functions can call the GetCollationSequence() method in this class and use it to compare strings and char arrays. + + + + + Obtains the collating sequence in effect for the given function. + + + + + + The type of user-defined function to declare + + + + + Scalar functions are designed to be called and return a result immediately. Examples include ABS(), Upper(), Lower(), etc. + + + + + Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data. + Examples include SUM(), COUNT(), AVG(), etc. + + + + + Collation sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause. Typically text in an ORDER BY is + sorted using a straight case-insensitive comparison function. Custom collating sequences can be used to alter the behavior of text sorting + in a user-defined manner. + + + + + An internal callback delegate declaration. + + Raw native context pointer for the user function. + Total number of arguments to the user function. + Raw native pointer to the array of raw native argument pointers. + + + + An internal final callback delegate declaration. + + Raw context pointer for the user function + + + + Internal callback delegate for implementing collation sequences + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. + + + + The type of collating sequence + + + + + The built-in BINARY collating sequence + + + + + The built-in NOCASE collating sequence + + + + + The built-in REVERSE collating sequence + + + + + A custom user-defined collating sequence + + + + + The encoding type the collation sequence uses + + + + + The collation sequence is UTF8 + + + + + The collation sequence is UTF16 little-endian + + + + + The collation sequence is UTF16 big-endian + + + + + A struct describing the collating sequence a function is executing in + + + + + The name of the collating sequence + + + + + The type of collating sequence + + + + + The text encoding of the collation sequence + + + + + Context of the function that requested the collating sequence + + + + + Calls the base collating sequence to compare two strings + + The first string to compare + The second string to compare + -1 if s1 is less than s2, 0 if s1 is equal to s2, and 1 if s1 is greater than s2 + + + + Calls the base collating sequence to compare two character arrays + + The first array to compare + The second array to compare + -1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2 + + + + A simple custom attribute to enable us to easily find user-defined functions in + the loaded assemblies and initialize them in SQLite as connections are made. + + + + + Default constructor, initializes the internal variables for the function. + + + + + Constructs an instance of this class. + + + The name of the function, as seen by the SQLite core library. + + + The number of arguments that the function will accept. + + + The type of function being declared. This will either be Scalar, + Aggregate, or Collation. + + + + + The function's name as it will be used in SQLite command text. + + + + + The number of arguments this function expects. -1 if the number of arguments is variable. + + + + + The type of function this implementation will be. + + + + + The object instance that describes the class + containing the implementation for the associated function. + + + + + This class provides key info for a given SQLite statement. + + Providing key information for a given statement is non-trivial :( + + + + + + This function does all the nasty work at determining what keys need to be returned for + a given statement. + + + + + + + + Make sure all the subqueries are open and ready and sync'd with the current rowid + of the table they're supporting + + + + + Release any readers on any subqueries + + + + + Append all the columns we've added to the original query to the schema + + + + + + How many additional columns of keyinfo we're holding + + + + + Used to support CommandBehavior.KeyInfo + + + + + A single sub-query for a given table/database. + + + + + Event data for logging event handlers. + + + + + The error code. The type of this object value should be + or . + + + + + SQL statement text as the statement first begins executing + + + + + Extra data associated with this event, if any. + + + + + Constructs the object. + + Should be null. + + The error code. The type of this object value should be + or . + + The error message, if any. + The extra data, if any. + + + + Raised when a log event occurs. + + The current connection + Event arguments of the trace + + + + Manages the SQLite custom logging functionality and the associated + callback for the whole process. + + + + + Object used to synchronize access to the static instance data + for this class. + + + + + Member variable to store the AppDomain.DomainUnload event handler. + + + + + The default log event handler. + + + + + The log callback passed to native SQLite engine. This must live + as long as the SQLite library has a pointer to it. + + + + + The base SQLite object to interop with. + + + + + This will be non-zero if logging is currently enabled. + + + + + Initializes the SQLite logging facilities. + + + + + Handles the AppDomain being unloaded. + + Should be null. + The data associated with this event. + + + + Log a message to all the registered log event handlers without going + through the SQLite library. + + The message to be logged. + + + + Log a message to all the registered log event handlers without going + through the SQLite library. + + The SQLite error code. + The message to be logged. + + + + Log a message to all the registered log event handlers without going + through the SQLite library. + + The integer error code. + The message to be logged. + + + + Log a message to all the registered log event handlers without going + through the SQLite library. + + + The error code. The type of this object value should be + System.Int32 or SQLiteErrorCode. + + The message to be logged. + + + + Creates and initializes the default log event handler. + + + + + Adds the default log event handler to the list of handlers. + + + + + Removes the default log event handler from the list of handlers. + + + + + Internal proxy function that calls any registered application log + event handlers. + + WARNING: This method is used more-or-less directly by native code, + do not modify its type signature. + + + The extra data associated with this message, if any. + + + The error code associated with this message. + + + The message string to be logged. + + + + + Default logger. Currently, uses the Trace class (i.e. sends events + to the current trace listeners, if any). + + Should be null. + The data associated with this event. + + + + Member variable to store the application log handler to call. + + + + + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. + + + + + If this property is true, logging is enabled; otherwise, logging is + disabled. When logging is disabled, no logging events will fire. + + + + + MetaDataCollections specific to SQLite + + + + + Returns a list of databases attached to the connection + + + + + Returns column information for the specified table + + + + + Returns index information for the optionally-specified table + + + + + Returns base columns for the given index + + + + + Returns the tables in the given catalog + + + + + Returns user-defined views in the given catalog + + + + + Returns underlying column information on the given view + + + + + Returns foreign key information for the given catalog + + + + + Returns the triggers on the database + + + + + SQLite implementation of DbParameter. + + + + + The data type of the parameter + + + + + The version information for mapping the parameter + + + + + The value of the data in the parameter + + + + + The source column for the parameter + + + + + The column name + + + + + The data size, unused by SQLite + + + + + Default constructor + + + + + Constructs a named parameter given the specified parameter name + + The parameter name + + + + Constructs a named parameter given the specified parameter name and initial value + + The parameter name + The initial value of the parameter + + + + Constructs a named parameter of the specified type + + The parameter name + The datatype of the parameter + + + + Constructs a named parameter of the specified type and source column reference + + The parameter name + The data type + The source column + + + + Constructs a named parameter of the specified type, source column and row version + + The parameter name + The data type + The source column + The row version information + + + + Constructs an unnamed parameter of the specified data type + + The datatype of the parameter + + + + Constructs an unnamed parameter of the specified data type and sets the initial value + + The datatype of the parameter + The initial value of the parameter + + + + Constructs an unnamed parameter of the specified data type and source column + + The datatype of the parameter + The source column + + + + Constructs an unnamed parameter of the specified data type, source column and row version + + The data type + The source column + The row version information + + + + Constructs a named parameter of the specified type and size + + The parameter name + The data type + The size of the parameter + + + + Constructs a named parameter of the specified type, size and source column + + The name of the parameter + The data type + The size of the parameter + The source column + + + + Constructs a named parameter of the specified type, size, source column and row version + + The name of the parameter + The data type + The size of the parameter + The source column + The row version information + + + + Constructs a named parameter of the specified type, size, source column and row version + + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + Ignored + The source column + The row version information + The initial value to assign the parameter + + + + Constructs a named parameter, yet another flavor + + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + The source column + The row version information + Whether or not this parameter is for comparing NULL's + The intial value to assign the parameter + + + + Constructs an unnamed parameter of the specified type and size + + The data type + The size of the parameter + + + + Constructs an unnamed parameter of the specified type, size, and source column + + The data type + The size of the parameter + The source column + + + + Constructs an unnamed parameter of the specified type, size, source column and row version + + The data type + The size of the parameter + The source column + The row version information + + + + Resets the DbType of the parameter so it can be inferred from the value + + + + + Clones a parameter + + A new, unassociated SQLiteParameter + + + + Whether or not the parameter can contain a null value + + + + + Returns the datatype of the parameter + + + + + Supports only input parameters + + + + + Returns the parameter name + + + + + Returns the size of the parameter + + + + + Gets/sets the source column + + + + + Used by DbCommandBuilder to determine the mapping for nullable fields + + + + + Gets and sets the row version + + + + + Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given. + + + + + SQLite implementation of DbParameterCollection. + + + + + The underlying command to which this collection belongs + + + + + The internal array of parameters in this collection + + + + + Determines whether or not all parameters have been bound to their statement(s) + + + + + Initializes the collection + + The command to which the collection belongs + + + + Retrieves an enumerator for the collection + + An enumerator for the underlying array + + + + Adds a parameter to the collection + + The parameter name + The data type + The size of the value + The source column + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter name + The data type + The size of the value + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter name + The data type + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter to add + A zero-based index of where the parameter is located in the array + + + + Adds a parameter to the collection + + The parameter to add + A zero-based index of where the parameter is located in the array + + + + Adds a named/unnamed parameter and its value to the parameter collection. + + Name of the parameter, or null to indicate an unnamed parameter + The initial value of the parameter + Returns the SQLiteParameter object created during the call. + + + + Adds an array of parameters to the collection + + The array of parameters to add + + + + Adds an array of parameters to the collection + + The array of parameters to add + + + + Clears the array and resets the collection + + + + + Determines if the named parameter exists in the collection + + The name of the parameter to check + True if the parameter is in the collection + + + + Determines if the parameter exists in the collection + + The SQLiteParameter to check + True if the parameter is in the collection + + + + Not implemented + + + + + + + Retrieve a parameter by name from the collection + + The name of the parameter to fetch + A DbParameter object + + + + Retrieves a parameter by its index in the collection + + The index of the parameter to retrieve + A DbParameter object + + + + Returns the index of a parameter given its name + + The name of the parameter to find + -1 if not found, otherwise a zero-based index of the parameter + + + + Returns the index of a parameter + + The parameter to find + -1 if not found, otherwise a zero-based index of the parameter + + + + Inserts a parameter into the array at the specified location + + The zero-based index to insert the parameter at + The parameter to insert + + + + Removes a parameter from the collection + + The parameter to remove + + + + Removes a parameter from the collection given its name + + The name of the parameter to remove + + + + Removes a parameter from the collection given its index + + The zero-based parameter index to remove + + + + Re-assign the named parameter to a new parameter object + + The name of the parameter to replace + The new parameter + + + + Re-assign a parameter at the specified index + + The zero-based index of the parameter to replace + The new parameter + + + + Un-binds all parameters from their statements + + + + + This function attempts to map all parameters in the collection to all statements in a Command. + Since named parameters may span multiple statements, this function makes sure all statements are bound + to the same named parameter. Unnamed parameters are bound in sequence. + + + + + Returns false + + + + + Returns false + + + + + Returns false + + + + + Returns null + + + + + Returns a count of parameters in the collection + + + + + Overloaded to specialize the return value of the default indexer + + Name of the parameter to get/set + The specified named SQLite parameter + + + + Overloaded to specialize the return value of the default indexer + + The index of the parameter to get/set + The specified SQLite parameter + + + + Represents a single SQL statement in SQLite. + + + + + The underlying SQLite object this statement is bound to + + + + + The command text of this SQL statement + + + + + The actual statement pointer + + + + + An index from which unnamed parameters begin + + + + + Names of the parameters as SQLite understands them to be + + + + + Parameters for this statement + + + + + Command this statement belongs to (if any) + + + + + The flags associated with the parent connection object. + + + + + Initializes the statement and attempts to get all information about parameters in the statement + + The base SQLite object + The flags associated with the parent connection object + The statement + The command text for this statement + The previous command in a multi-statement command + + + + Disposes and finalizes the statement + + + + + If the underlying database connection is open, fetches the number of changed rows + resulting from the most recent query; otherwise, does nothing. + + + The number of changes when true is returned. + Undefined if false is returned. + + Non-zero if the number of changed rows was fetched. + + + + Called by SQLiteParameterCollection, this function determines if the specified parameter name belongs to + this statement, and if so, keeps a reference to the parameter so it can be bound later. + + The parameter name to map + The parameter to assign it + + + + Bind all parameters, making sure the caller didn't miss any + + + + + Attempts to convert an arbitrary object to the Boolean data type. + Null object values are converted to false. Throws a SQLiteException + upon failure. + + The object value to convert. + The format provider to use. + The converted boolean value. + + + + Perform the bind operation for an individual parameter + + The index of the parameter to bind + The parameter we're binding + + + + SQLite implementation of DbTransaction. + + + + + The connection to which this transaction is bound + + + + + Constructs the transaction object, binding it to the supplied connection + + The connection to open a transaction on + TRUE to defer the writelock, or FALSE to lock immediately + + + + Disposes the transaction. If it is currently active, any changes are rolled back. + + + + + Commits the current transaction. + + + + + Rolls back the active transaction. + + + + + Returns the underlying connection to which this transaction applies. + + + + + Forwards to the local Connection property + + + + + Gets the isolation level of the transaction. SQLite only supports Serializable transactions. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to <?xml version="1.0" standalone="yes"?> + <DocumentElement> + <DataTypes> + <TypeName>smallint</TypeName> + <ProviderDbType>10</ProviderDbType> + <ColumnSize>5</ColumnSize> + <DataType>System.Int16</DataType> + <CreateFormat>smallint</CreateFormat> + <IsAutoIncrementable>false</IsAutoIncrementable> + <IsCaseSensitive>false</IsCaseSensitive> + <IsFixedLength>true</IsFixedLength> + <IsFixedPrecisionScale>true</IsFixedPrecisionScale> + <IsLong>false</IsLong> + <IsNullable>true</ [rest of string was truncated]";. + + + + + Looks up a localized string similar to ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE. + + + + + Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + <DocumentElement> + <MetaDataCollections> + <CollectionName>MetaDataCollections</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataCollections> + <CollectionName>DataSourceInformation</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataC [rest of string was truncated]";. + + + + + The name of the environment variable containing the processor + architecture of the current process. + + + + + This is the P/Invoke method that wraps the native Win32 LoadLibrary + function. See the MSDN documentation for full details on what it + does. + + + The name of the executable library. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + + + + + This lock is used to protect the static _SQLiteModule and + processorArchitecturePlatforms fields, below. + + + + + Stores the mappings between processor architecture names and platform + names. + + + + + The native module handle for the native SQLite library or the value + IntPtr.Zero. + + + + + For now, this method simply calls the Initialize method. + + + + + Attempts to initialize this class by pre-loading the native SQLite + library for the processor architecture of the current process. + + + + + Queries and returns the base directory of the current application + domain. + + + The base directory for the current application domain -OR- null if it + cannot be determined. + + + + + Determines if the dynamic link library file name requires a suffix + and adds it if necessary. + + + The original dynamic link library file name to inspect. + + + The dynamic link library file name, possibly modified to include an + extension. + + + + + Queries and returns the processor architecture of the current + process. + + + The processor architecture of the current process -OR- null if it + cannot be determined. + + + + + Given the processor architecture, returns the name of the platform. + + + The processor architecture to be translated to a platform name. + + + The platform name for the specified processor architecture -OR- null + if it cannot be determined. + + + + + Attempts to load the native SQLite library based on the specified + directory and processor architecture. + + + The base directory to use, null for default (the base directory of + the current application domain). This directory should contain the + processor architecture specific sub-directories. + + + The requested processor architecture, null for default (the + processor architecture of the current process). This caller should + almost always specify null for this parameter. + + + The native module handle as returned by LoadLibrary -OR- IntPtr.Zero + if the loading fails for any reason. + + + + + This class represents a context from the SQLite core library that can + be passed to the sqlite3_result_*() and associated functions. + + + + + This interface represents a native handle provided by the SQLite core + library. + + + + + The native handle value. + + + + + The native context handle. + + + + + Constructs an instance of this class using the specified native + context handle. + + + The native context handle to use. + + + + + Sets the context result to NULL. + + + + + Sets the context result to the specified + value. + + + The value to use. + + + + + Sets the context result to the specified + value. + + + The value to use. + + + + + Sets the context result to the specified + value. + + + The value to use. + + + + + Sets the context result to the specified + value. + + + The value to use. This value will be + converted to the UTF-8 encoding prior to being used. + + + + + Sets the context result to the specified + value containing an error message. + + + The value containing the error message text. + This value will be converted to the UTF-8 encoding prior to being + used. + + + + + Sets the context result to the specified + value. + + + The value to use. + + + + + Sets the context result to contain the error code SQLITE_TOOBIG. + + + + + Sets the context result to contain the error code SQLITE_NOMEM. + + + + + Sets the context result to the specified array + value. + + + The array value to use. + + + + + Sets the context result to a BLOB of zeros of the specified size. + + + The number of zero bytes to use for the BLOB context result. + + + + + Sets the context result to the specified . + + + The to use. + + + + + Returns the underlying SQLite native handle associated with this + object instance. + + + + + This class represents a value from the SQLite core library that can be + passed to the sqlite3_value_*() and associated functions. + + + + + The native value handle. + + + + + Constructs an instance of this class using the specified native + value handle. + + + The native value handle to use. + + + + + Invalidates the native value handle, thereby preventing further + access to it from this object instance. + + + + + Converts a logical array of native pointers to native sqlite3_value + structures into a managed array of + object instances. + + + The number of elements in the logical array of native sqlite3_value + structures. + + + The native pointer to the logical array of native sqlite3_value + structures to convert. + + + The managed array of object instances or + null upon failure. + + + + + Gets and returns the type affinity associated with this value. + + + The type affinity associated with this value. + + + + + Gets and returns the number of bytes associated with this value, if + it refers to a UTF-8 encoded string. + + + The number of bytes associated with this value. The returned value + may be zero. + + + + + Gets and returns the associated with this + value. + + + The associated with this value. + + + + + Gets and returns the associated with + this value. + + + The associated with this value. + + + + + Gets and returns the associated with this + value. + + + The associated with this value. + + + + + Gets and returns the associated with this + value. + + + The associated with this value. The value is + converted from the UTF-8 encoding prior to being returned. + + + + + Gets and returns the array associated with this + value. + + + The array associated with this value. + + + + + Uses the native value handle to obtain and store the managed value + for this object instance, thus saving it for later use. The type + of the managed value is determined by the type affinity of the + native value. If the type affinity is not recognized by this + method, no work is done and false is returned. + + + Non-zero if the native value was persisted successfully. + + + + + Returns the underlying SQLite native handle associated with this + object instance. + + + + + Returns non-zero if the native SQLite value has been successfully + persisted as a managed value within this object instance (i.e. the + property may then be read successfully). + + + + + If the managed value for this object instance is available (i.e. it + has been previously persisted via the ) method, + that value is returned; otherwise, an exception is thrown. The + returned value may be null. + + + + + These are the allowed values for the operators that are part of a + constraint term in the WHERE clause of a query that uses a virtual + table. + + + + + This value represents the equality operator. + + + + + This value represents the greater than operator. + + + + + This value represents the less than or equal to operator. + + + + + This value represents the less than operator. + + + + + This value represents the greater than or equal to operator. + + + + + This value represents the MATCH operator. + + + + + This class represents the native sqlite3_index_constraint structure + from the SQLite core library. + + + + + Constructs an instance of this class using the specified native + sqlite3_index_constraint structure. + + + The native sqlite3_index_constraint structure to use. + + + + + Constructs an instance of this class using the specified field + values. + + + Column on left-hand side of constraint. + + + Constraint operator (). + + + True if this constraint is usable. + + + Used internally - + should ignore. + + + + + Column on left-hand side of constraint. + + + + + Constraint operator (). + + + + + True if this constraint is usable. + + + + + Used internally - + should ignore. + + + + + This class represents the native sqlite3_index_orderby structure from + the SQLite core library. + + + + + Constructs an instance of this class using the specified native + sqlite3_index_orderby structure. + + + The native sqlite3_index_orderby structure to use. + + + + + Constructs an instance of this class using the specified field + values. + + + Column number. + + + True for DESC. False for ASC. + + + + + Column number. + + + + + True for DESC. False for ASC. + + + + + This class represents the native sqlite3_index_constraint_usage + structure from the SQLite core library. + + + + + Constructs an instance of this class using the specified native + sqlite3_index_constraint_usage structure. + + + The native sqlite3_index_constraint_usage structure to use. + + + + + Constructs an instance of this class using the specified field + values. + + + If greater than 0, constraint is part of argv to xFilter. + + + Do not code a test for this constraint. + + + + + If greater than 0, constraint is part of argv to xFilter. + + + + + Do not code a test for this constraint. + + + + + This class represents the various inputs provided by the SQLite core + library to the method. + + + + + Constructs an instance of this class. + + + The number of instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. + + + + + An array of object instances, + each containing information supplied by the SQLite core library. + + + + + An array of object instances, + each containing information supplied by the SQLite core library. + + + + + This class represents the various outputs provided to the SQLite core + library by the method. + + + + + Constructs an instance of this class. + + + The number of instances + to pre-allocate space for. + + + + + Determines if the native estimatedRows field can be used, based on + the available version of the SQLite core library. + + + Non-zero if the property is supported + by the SQLite core library. + + + + + An array of object + instances, each containing information to be supplied to the SQLite + core library. + + + + + Number used to help identify the selected index. This value will + later be provided to the + method. + + + + + String used to help identify the selected index. This value will + later be provided to the + method. + + + + + Non-zero if the index string must be freed by the SQLite core + library. + + + + + True if output is already ordered. + + + + + Estimated cost of using this index. Using a null value here + indicates that a default estimated cost value should be used. + + + + + Estimated number of rows returned. Using a null value here + indicates that a default estimated rows value should be used. + + + + + This class represents the various inputs and outputs used with the + method. + + + + + Constructs an instance of this class. + + + The number of (and + ) instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. + + + + + Converts a native pointer to a native sqlite3_index_info structure + into a new object instance. + + + The native pointer to the native sqlite3_index_info structure to + convert. + + + Upon success, this parameter will be modified to contain the newly + created object instance. + + + + + Populates the outputs of a pre-allocated native sqlite3_index_info + structure using an existing object + instance. + + + The existing object instance containing + the output data to use. + + + The native pointer to the pre-allocated native sqlite3_index_info + structure. + + + + + The object instance containing + the inputs to the + method. + + + + + The object instance containing + the outputs from the + method. + + + + + This class represents a managed virtual table implementation. It is + not sealed and should be used as the base class for any user-defined + virtual table classes implemented in managed code. + + + + + The index within the array of strings provided to the + and + methods containing the + name of the module implementing this virtual table. + + + + + The index within the array of strings provided to the + and + methods containing the + name of the database containing this virtual table. + + + + + The index within the array of strings provided to the + and + methods containing the + name of the virtual table. + + + + + Constructs an instance of this class. + + + The original array of strings provided to the + and + methods. + + + + + This method should normally be used by the + method in order to + perform index selection based on the constraints provided by the + SQLite core library. + + + The object instance containing all the + data for the inputs and outputs relating to index selection. + + + Non-zero upon success. + + + + + Attempts to record the renaming of the virtual table associated + with this object instance. + + + The new name for the virtual table. + + + Non-zero upon success. + + + + + Disposes of this object instance. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is being called + from the finalizer. + + + + + Finalizes this object instance. + + + + + The original array of strings provided to the + and + methods. + + + + + The name of the module implementing this virtual table. + + + + + The name of the database containing this virtual table. + + + + + The name of the virtual table. + + + + + The object instance containing all the + data for the inputs and outputs relating to the most recent index + selection. + + + + + Returns the underlying SQLite native handle associated with this + object instance. + + + + + This class represents a managed virtual table cursor implementation. + It is not sealed and should be used as the base class for any + user-defined virtual table cursor classes implemented in managed code. + + + + + This value represents an invalid integer row sequence number. + + + + + The field holds the integer row sequence number for the current row + pointed to by this cursor object instance. + + + + + Constructs an instance of this class. + + + The object instance associated + with this object instance. + + + + + Constructs an instance of this class. + + + + + Attempts to persist the specified object + instances in order to make them available after the + method returns. + + + The array of object instances to be + persisted. + + + The number of object instances that were + successfully persisted. + + + + + This method should normally be used by the + method in order to + perform filtering of the result rows and/or to record the filtering + criteria provided by the SQLite core library. + + + Number used to help identify the selected index. + + + String used to help identify the selected index. + + + The values corresponding to each column in the selected index. + + + + + Determines the integer row sequence number for the current row. + + + The integer row sequence number for the current row -OR- zero if + it cannot be determined. + + + + + Adjusts the integer row sequence number so that it refers to the + next row. + + + + + Disposes of this object instance. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is being called + from the finalizer. + + + + + Finalizes this object instance. + + + + + The object instance associated + with this object instance. + + + + + Number used to help identify the selected index. This value will + be set via the method. + + + + + String used to help identify the selected index. This value will + be set via the method. + + + + + The values used to filter the rows returned via this cursor object + instance. This value will be set via the + method. + + + + + Returns the underlying SQLite native handle associated with this + object instance. + + + + + This interface represents a virtual table implementation written in + native code. + + + + + + This method is called to create a new instance of a virtual table + in response to a CREATE VIRTUAL TABLE statement. The db parameter + is a pointer to the SQLite database connection that is executing + the CREATE VIRTUAL TABLE statement. The pAux argument is the copy + of the client data pointer that was the fourth argument to the + sqlite3_create_module() or sqlite3_create_module_v2() call that + registered the virtual table module. The argv parameter is an + array of argc pointers to null terminated strings. The first + string, argv[0], is the name of the module being invoked. The + module name is the name provided as the second argument to + sqlite3_create_module() and as the argument to the USING clause of + the CREATE VIRTUAL TABLE statement that is running. The second, + argv[1], is the name of the database in which the new virtual table + is being created. The database name is "main" for the primary + database, or "temp" for TEMP database, or the name given at the + end of the ATTACH statement for attached databases. The third + element of the array, argv[2], is the name of the new virtual + table, as specified following the TABLE keyword in the CREATE + VIRTUAL TABLE statement. If present, the fourth and subsequent + strings in the argv[] array report the arguments to the module name + in the CREATE VIRTUAL TABLE statement. + + + The job of this method is to construct the new virtual table object + (an sqlite3_vtab object) and return a pointer to it in *ppVTab. + + + As part of the task of creating a new sqlite3_vtab structure, this + method must invoke sqlite3_declare_vtab() to tell the SQLite core + about the columns and datatypes in the virtual table. The + sqlite3_declare_vtab() API has the following prototype: + + + + int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable) + + + + The first argument to sqlite3_declare_vtab() must be the same + database connection pointer as the first parameter to this method. + The second argument to sqlite3_declare_vtab() must a + zero-terminated UTF-8 string that contains a well-formed CREATE + TABLE statement that defines the columns in the virtual table and + their data types. The name of the table in this CREATE TABLE + statement is ignored, as are all constraints. Only the column names + and datatypes matter. The CREATE TABLE statement string need not to + be held in persistent memory. The string can be deallocated and/or + reused as soon as the sqlite3_declare_vtab() routine returns. + + + + The native database connection handle. + + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. + + + The number of arguments from the CREATE VIRTUAL TABLE statement. + + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + + + + + + The xConnect method is very similar to xCreate. It has the same + parameters and constructs a new sqlite3_vtab structure just like + xCreate. And it must also call sqlite3_declare_vtab() like xCreate. + + + The difference is that xConnect is called to establish a new + connection to an existing virtual table whereas xCreate is called + to create a new virtual table from scratch. + + + The xCreate and xConnect methods are only different when the + virtual table has some kind of backing store that must be + initialized the first time the virtual table is created. The + xCreate method creates and initializes the backing store. The + xConnect method just connects to an existing backing store. + + + As an example, consider a virtual table implementation that + provides read-only access to existing comma-separated-value (CSV) + files on disk. There is no backing store that needs to be created + or initialized for such a virtual table (since the CSV files + already exist on disk) so the xCreate and xConnect methods will be + identical for that module. + + + Another example is a virtual table that implements a full-text + index. The xCreate method must create and initialize data + structures to hold the dictionary and posting lists for that index. + The xConnect method, on the other hand, only has to locate and use + an existing dictionary and posting lists that were created by a + prior xCreate call. + + + The xConnect method must return SQLITE_OK if it is successful in + creating the new virtual table, or SQLITE_ERROR if it is not + successful. If not successful, the sqlite3_vtab structure must not + be allocated. An error message may optionally be returned in *pzErr + if unsuccessful. Space to hold the error message string must be + allocated using an SQLite memory allocation function like + sqlite3_malloc() or sqlite3_mprintf() as the SQLite core will + attempt to free the space using sqlite3_free() after the error has + been reported up to the application. + + + The xConnect method is required for every virtual table + implementation, though the xCreate and xConnect pointers of the + sqlite3_module object may point to the same function the virtual + table does not need to initialize backing store. + + + + The native database connection handle. + + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. + + + The number of arguments from the CREATE VIRTUAL TABLE statement. + + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + + + + + + SQLite uses the xBestIndex method of a virtual table module to + determine the best way to access the virtual table. The xBestIndex + method has a prototype like this: + + + int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + + + The SQLite core communicates with the xBestIndex method by filling + in certain fields of the sqlite3_index_info structure and passing a + pointer to that structure into xBestIndex as the second parameter. + The xBestIndex method fills out other fields of this structure + which forms the reply. The sqlite3_index_info structure looks like + this: + + + struct sqlite3_index_info { + /* Inputs */ + const int nConstraint; /* Number of entries in aConstraint */ + const struct sqlite3_index_constraint { + int iColumn; /* Column on left-hand side of + * constraint */ + unsigned char op; /* Constraint operator */ + unsigned char usable; /* True if this constraint is usable */ + int iTermOffset; /* Used internally - xBestIndex should + * ignore */ + } *const aConstraint; /* Table of WHERE clause constraints */ + const int nOrderBy; /* Number of terms in the ORDER BY + * clause */ + const struct sqlite3_index_orderby { + int iColumn; /* Column number */ + unsigned char desc; /* True for DESC. False for ASC. */ + } *const aOrderBy; /* The ORDER BY clause */ + /* Outputs */ + struct sqlite3_index_constraint_usage { + int argvIndex; /* if greater than zero, constraint is + * part of argv to xFilter */ + unsigned char omit; /* Do not code a test for this + * constraint */ + } *const aConstraintUsage; + int idxNum; /* Number used to identify the index */ + char *idxStr; /* String, possibly obtained from + * sqlite3_malloc() */ + int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if + * true */ + int orderByConsumed; /* True if output is already ordered */ + double estimatedCost; /* Estimated cost of using this index */ + }; + + + In addition, there are some defined constants: + + + #define SQLITE_INDEX_CONSTRAINT_EQ 2 + #define SQLITE_INDEX_CONSTRAINT_GT 4 + #define SQLITE_INDEX_CONSTRAINT_LE 8 + #define SQLITE_INDEX_CONSTRAINT_LT 16 + #define SQLITE_INDEX_CONSTRAINT_GE 32 + #define SQLITE_INDEX_CONSTRAINT_MATCH 64 + + + The SQLite core calls the xBestIndex method when it is compiling a + query that involves a virtual table. In other words, SQLite calls + this method when it is running sqlite3_prepare() or the equivalent. + By calling this method, the SQLite core is saying to the virtual + table that it needs to access some subset of the rows in the + virtual table and it wants to know the most efficient way to do + that access. The xBestIndex method replies with information that + the SQLite core can then use to conduct an efficient search of the + virtual table. + + + While compiling a single SQL query, the SQLite core might call + xBestIndex multiple times with different settings in + sqlite3_index_info. The SQLite core will then select the + combination that appears to give the best performance. + + + Before calling this method, the SQLite core initializes an instance + of the sqlite3_index_info structure with information about the + query that it is currently trying to process. This information + derives mainly from the WHERE clause and ORDER BY or GROUP BY + clauses of the query, but also from any ON or USING clauses if the + query is a join. The information that the SQLite core provides to + the xBestIndex method is held in the part of the structure that is + marked as "Inputs". The "Outputs" section is initialized to zero. + + + The information in the sqlite3_index_info structure is ephemeral + and may be overwritten or deallocated as soon as the xBestIndex + method returns. If the xBestIndex method needs to remember any part + of the sqlite3_index_info structure, it should make a copy. Care + must be take to store the copy in a place where it will be + deallocated, such as in the idxStr field with needToFreeIdxStr set + to 1. + + + Note that xBestIndex will always be called before xFilter, since + the idxNum and idxStr outputs from xBestIndex are required inputs + to xFilter. However, there is no guarantee that xFilter will be + called following a successful xBestIndex. + + + The xBestIndex method is required for every virtual table + implementation. + + + 2.3.1 Inputs + + + The main thing that the SQLite core is trying to communicate to the + virtual table is the constraints that are available to limit the + number of rows that need to be searched. The aConstraint[] array + contains one entry for each constraint. There will be exactly + nConstraint entries in that array. + + + Each constraint will correspond to a term in the WHERE clause or in + a USING or ON clause that is of the form + + + column OP EXPR + + + Where "column" is a column in the virtual table, OP is an operator + like "=" or "<", and EXPR is an arbitrary expression. So, for + example, if the WHERE clause contained a term like this: + + + a = 5 + + + Then one of the constraints would be on the "a" column with + operator "=" and an expression of "5". Constraints need not have a + literal representation of the WHERE clause. The query optimizer + might make transformations to the WHERE clause in order to extract + as many constraints as it can. So, for example, if the WHERE clause + contained something like this: + + + x BETWEEN 10 AND 100 AND 999>y + + + The query optimizer might translate this into three separate + constraints: + + + x >= 10 + x <= 100 + y < 999 + + + For each constraint, the aConstraint[].iColumn field indicates + which column appears on the left-hand side of the constraint. The + first column of the virtual table is column 0. The rowid of the + virtual table is column -1. The aConstraint[].op field indicates + which operator is used. The SQLITE_INDEX_CONSTRAINT_* constants map + integer constants into operator values. Columns occur in the order + they were defined by the call to sqlite3_declare_vtab() in the + xCreate or xConnect method. Hidden columns are counted when + determining the column index. + + + The aConstraint[] array contains information about all constraints + that apply to the virtual table. But some of the constraints might + not be usable because of the way tables are ordered in a join. The + xBestIndex method must therefore only consider constraints that + have an aConstraint[].usable flag which is true. + + + In addition to WHERE clause constraints, the SQLite core also tells + the xBestIndex method about the ORDER BY clause. (In an aggregate + query, the SQLite core might put in GROUP BY clause information in + place of the ORDER BY clause information, but this fact should not + make any difference to the xBestIndex method.) If all terms of the + ORDER BY clause are columns in the virtual table, then nOrderBy + will be the number of terms in the ORDER BY clause and the + aOrderBy[] array will identify the column for each term in the + order by clause and whether or not that column is ASC or DESC. + + + 2.3.2 Outputs + + + Given all of the information above, the job of the xBestIndex + method it to figure out the best way to search the virtual table. + + + The xBestIndex method fills the idxNum and idxStr fields with + information that communicates an indexing strategy to the xFilter + method. The information in idxNum and idxStr is arbitrary as far as + the SQLite core is concerned. The SQLite core just copies the + information through to the xFilter method. Any desired meaning can + be assigned to idxNum and idxStr as long as xBestIndex and xFilter + agree on what that meaning is. + + + The idxStr value may be a string obtained from an SQLite memory + allocation function such as sqlite3_mprintf(). If this is the case, + then the needToFreeIdxStr flag must be set to true so that the + SQLite core will know to call sqlite3_free() on that string when it + has finished with it, and thus avoid a memory leak. + + + If the virtual table will output rows in the order specified by the + ORDER BY clause, then the orderByConsumed flag may be set to true. + If the output is not automatically in the correct order then + orderByConsumed must be left in its default false setting. This + will indicate to the SQLite core that it will need to do a separate + sorting pass over the data after it comes out of the virtual table. + + + The estimatedCost field should be set to the estimated number of + disk access operations required to execute this query against the + virtual table. The SQLite core will often call xBestIndex multiple + times with different constraints, obtain multiple cost estimates, + then choose the query plan that gives the lowest estimate. + + + The aConstraintUsage[] array contains one element for each of the + nConstraint constraints in the inputs section of the + sqlite3_index_info structure. The aConstraintUsage[] array is used + by xBestIndex to tell the core how it is using the constraints. + + + The xBestIndex method may set aConstraintUsage[].argvIndex entries + to values greater than one. Exactly one entry should be set to 1, + another to 2, another to 3, and so forth up to as many or as few as + the xBestIndex method wants. The EXPR of the corresponding + constraints will then be passed in as the argv[] parameters to + xFilter. + + + For example, if the aConstraint[3].argvIndex is set to 1, then when + xFilter is called, the argv[0] passed to xFilter will have the EXPR + value of the aConstraint[3] constraint. + + + By default, the SQLite core double checks all constraints on each + row of the virtual table that it receives. If such a check is + redundant, the xBestFilter method can suppress that double-check by + setting aConstraintUsage[].omit. + + + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the sqlite3_index_info structure. + + + A standard SQLite return code. + + + + + + This method releases a connection to a virtual table. Only the + sqlite3_vtab object is destroyed. The virtual table is not + destroyed and any backing store associated with the virtual table + persists. This method undoes the work of xConnect. + + + This method is a destructor for a connection to the virtual table. + Contrast this method with xDestroy. The xDestroy is a destructor + for the entire virtual table. + + + The xDisconnect method is required for every virtual table + implementation, though it is acceptable for the xDisconnect and + xDestroy methods to be the same function if that makes sense for + the particular virtual table. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + This method releases a connection to a virtual table, just like the + xDisconnect method, and it also destroys the underlying table + implementation. This method undoes the work of xCreate. + + + The xDisconnect method is called whenever a database connection + that uses a virtual table is closed. The xDestroy method is only + called when a DROP TABLE statement is executed against the virtual + table. + + + The xDestroy method is required for every virtual table + implementation, though it is acceptable for the xDisconnect and + xDestroy methods to be the same function if that makes sense for + the particular virtual table. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + The xOpen method creates a new cursor used for accessing (read + and/or writing) a virtual table. A successful invocation of this + method will allocate the memory for the sqlite3_vtab_cursor (or a + subclass), initialize the new object, and make *ppCursor point to + the new object. The successful call then returns SQLITE_OK. + + + For every successful call to this method, the SQLite core will + later invoke the xClose method to destroy the allocated cursor. + + + The xOpen method need not initialize the pVtab field of the + sqlite3_vtab_cursor structure. The SQLite core will take care of + that chore automatically. + + + A virtual table implementation must be able to support an arbitrary + number of simultaneously open cursors. + + + When initially opened, the cursor is in an undefined state. The + SQLite core will invoke the xFilter method on the cursor prior to + any attempt to position or read from the cursor. + + + The xOpen method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab derived structure. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + + + + + + The xClose method closes a cursor previously opened by xOpen. The + SQLite core will always call xClose once for each cursor opened + using xOpen. + + + This method must release all resources allocated by the + corresponding xOpen call. The routine will not be called again even + if it returns an error. The SQLite core will not use the + sqlite3_vtab_cursor again after it has been closed. + + + The xClose method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + + + + + + This method begins a search of a virtual table. The first argument + is a cursor opened by xOpen. The next two argument define a + particular search index previously chosen by xBestIndex. The + specific meanings of idxNum and idxStr are unimportant as long as + xFilter and xBestIndex agree on what that meaning is. + + + The xBestIndex function may have requested the values of certain + expressions using the aConstraintUsage[].argvIndex values of the + sqlite3_index_info structure. Those values are passed to xFilter + using the argc and argv parameters. + + + If the virtual table contains one or more rows that match the + search criteria, then the cursor must be left point at the first + row. Subsequent calls to xEof must return false (zero). If there + are no rows match, then the cursor must be left in a state that + will cause the xEof to return true (non-zero). The SQLite engine + will use the xColumn and xRowid methods to access that row content. + The xNext method will be used to advance to the next row. + + + This method must return SQLITE_OK if successful, or an sqlite error + code if an error occurs. + + + The xFilter method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Number used to help identify the selected index. + + + The native pointer to the UTF-8 encoded string containing the + string used to help identify the selected index. + + + The number of native pointers to sqlite3_value structures specified + in . + + + An array of native pointers to sqlite3_value structures containing + filtering criteria for the selected index. + + + A standard SQLite return code. + + + + + + The xNext method advances a virtual table cursor to the next row of + a result set initiated by xFilter. If the cursor is already + pointing at the last row when this routine is called, then the + cursor no longer points to valid data and a subsequent call to the + xEof method must return true (non-zero). If the cursor is + successfully advanced to another row of content, then subsequent + calls to xEof must return false (zero). + + + This method must return SQLITE_OK if successful, or an sqlite error + code if an error occurs. + + + The xNext method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + + + + + + The xEof method must return false (zero) if the specified cursor + currently points to a valid row of data, or true (non-zero) + otherwise. This method is called by the SQL engine immediately + after each xFilter and xNext invocation. + + + The xEof method is required for every virtual table implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Non-zero if no more rows are available; zero otherwise. + + + + + + The SQLite core invokes this method in order to find the value for + the N-th column of the current row. N is zero-based so the first + column is numbered 0. The xColumn method may return its result back + to SQLite using one of the following interface: + + + sqlite3_result_blob() + sqlite3_result_double() + sqlite3_result_int() + sqlite3_result_int64() + sqlite3_result_null() + sqlite3_result_text() + sqlite3_result_text16() + sqlite3_result_text16le() + sqlite3_result_text16be() + sqlite3_result_zeroblob() + + + If the xColumn method implementation calls none of the functions + above, then the value of the column defaults to an SQL NULL. + + + To raise an error, the xColumn method should use one of the + result_text() methods to set the error message text, then return an + appropriate error code. The xColumn method must return SQLITE_OK on + success. + + + The xColumn method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + The native pointer to the sqlite3_context structure to be used + for returning the specified column value to the SQLite core + library. + + + The zero-based index corresponding to the column containing the + value to be returned. + + + A standard SQLite return code. + + + + + + A successful invocation of this method will cause *pRowid to be + filled with the rowid of row that the virtual table cursor pCur is + currently pointing at. This method returns SQLITE_OK on success. It + returns an appropriate error code on failure. + + + The xRowid method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the current row for the specified cursor. + + + A standard SQLite return code. + + + + + + All changes to a virtual table are made using the xUpdate method. + This one method can be used to insert, delete, or update. + + + The argc parameter specifies the number of entries in the argv + array. The value of argc will be 1 for a pure delete operation or + N+2 for an insert or replace or update where N is the number of + columns in the table. In the previous sentence, N includes any + hidden columns. + + + Every argv entry will have a non-NULL value in C but may contain + the SQL value NULL. In other words, it is always true that + argv[i]!=0 for i between 0 and argc-1. However, it might be the + case that sqlite3_value_type(argv[i])==SQLITE_NULL. + + + The argv[0] parameter is the rowid of a row in the virtual table + to be deleted. If argv[0] is an SQL NULL, then no deletion occurs. + + + The argv[1] parameter is the rowid of a new row to be inserted into + the virtual table. If argv[1] is an SQL NULL, then the + implementation must choose a rowid for the newly inserted row. + Subsequent argv[] entries contain values of the columns of the + virtual table, in the order that the columns were declared. The + number of columns will match the table declaration that the + xConnect or xCreate method made using the sqlite3_declare_vtab() + call. All hidden columns are included. + + + When doing an insert without a rowid (argc>1, argv[1] is an SQL + NULL), the implementation must set *pRowid to the rowid of the + newly inserted row; this will become the value returned by the + sqlite3_last_insert_rowid() function. Setting this value in all the + other cases is a harmless no-op; the SQLite engine ignores the + *pRowid return value if argc==1 or argv[1] is not an SQL NULL. + + + Each call to xUpdate will fall into one of cases shown below. Note + that references to argv[i] mean the SQL value held within the + argv[i] object, not the argv[i] object itself. + + + argc = 1 + + + The single row with rowid equal to argv[0] is deleted. No + insert occurs. + + + argc > 1 + argv[0] = NULL + + + A new row is inserted with a rowid argv[1] and column + values in argv[2] and following. If argv[1] is an SQL NULL, + the a new unique rowid is generated automatically. + + + argc > 1 + argv[0] ? NULL + argv[0] = argv[1] + + + The row with rowid argv[0] is updated with new values in + argv[2] and following parameters. + + + argc > 1 + argv[0] ? NULL + argv[0] ? argv[1] + + + The row with rowid argv[0] is updated with rowid argv[1] + and new values in argv[2] and following parameters. This + will occur when an SQL statement updates a rowid, as in + the statement: + + + UPDATE table SET rowid=rowid+1 WHERE ...; + + + The xUpdate method must return SQLITE_OK if and only if it is + successful. If a failure occurs, the xUpdate must return an + appropriate error code. On a failure, the pVTab->zErrMsg element + may optionally be replaced with error message text stored in memory + allocated from SQLite using functions such as sqlite3_mprintf() or + sqlite3_malloc(). + + + If the xUpdate method violates some constraint of the virtual table + (including, but not limited to, attempting to store a value of the + wrong datatype, attempting to store a value that is too large or + too small, or attempting to change a read-only value) then the + xUpdate must fail with an appropriate error code. + + + There might be one or more sqlite3_vtab_cursor objects open and in + use on the virtual table instance and perhaps even on the row of + the virtual table when the xUpdate method is invoked. The + implementation of xUpdate must be prepared for attempts to delete + or modify rows of the table out from other existing cursors. If the + virtual table cannot accommodate such changes, the xUpdate method + must return an error code. + + + The xUpdate method is optional. If the xUpdate pointer in the + sqlite3_module for a virtual table is a NULL pointer, then the + virtual table is read-only. + + + + The native pointer to the sqlite3_vtab derived structure. + + + The number of new or modified column values contained in + . + + + The array of native pointers to sqlite3_value structures containing + the new or modified column values, if any. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the row that was inserted, if any. + + + A standard SQLite return code. + + + + + + This method begins a transaction on a virtual table. This is method + is optional. The xBegin pointer of sqlite3_module may be NULL. + + + This method is always followed by one call to either the xCommit or + xRollback method. Virtual table transactions do not nest, so the + xBegin method will not be invoked more than once on a single + virtual table without an intervening call to either xCommit or + xRollback. Multiple calls to other methods can and likely will + occur in between the xBegin and the corresponding xCommit or + xRollback. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + This method signals the start of a two-phase commit on a virtual + table. This is method is optional. The xSync pointer of + sqlite3_module may be NULL. + + + This method is only invoked after call to the xBegin method and + prior to an xCommit or xRollback. In order to implement two-phase + commit, the xSync method on all virtual tables is invoked prior to + invoking the xCommit method on any virtual table. If any of the + xSync methods fail, the entire transaction is rolled back. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + This method causes a virtual table transaction to commit. This is + method is optional. The xCommit pointer of sqlite3_module may be + NULL. + + + A call to this method always follows a prior call to xBegin and + xSync. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + This method causes a virtual table transaction to rollback. This is + method is optional. The xRollback pointer of sqlite3_module may be + NULL. + + + A call to this method always follows a prior call to xBegin. + + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + + This method provides notification that the virtual table + implementation that the virtual table will be given a new name. If + this method returns SQLITE_OK then SQLite renames the table. If + this method returns an error code then the renaming is prevented. + + + The xRename method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab derived structure. + + + The number of arguments to the function being sought. + + + The name of the function being sought. + + + Upon success, this parameter must be modified to contain the + delegate responsible for implementing the specified function. + + + Upon success, this parameter must be modified to contain the + native user-data pointer associated with + . + + + Non-zero if the specified function was found; zero otherwise. + + + + + + This method provides notification that the virtual table + implementation that the virtual table will be given a new name. If + this method returns SQLITE_OK then SQLite renames the table. If + this method returns an error code then the renaming is prevented. + + + The xRename method is required for every virtual table + implementation. + + + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the UTF-8 encoded string containing the new + name for the virtual table. + + + A standard SQLite return code. + + + + + + These methods provide the virtual table implementation an + opportunity to implement nested transactions. They are always + optional and will only be called in SQLite version 3.7.7 and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual + table X that it should save its current state as savepoint N. A + subsequent call to xRollbackTo(X,R) means that the state of the + virtual table should return to what it was when xSavepoint(X,R) was + last called. The call to xRollbackTo(X,R) will invalidate all + savepoints with N>R; none of the invalided savepoints will be + rolled back or released without first being reinitialized by a call + to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints + where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will + ever be called except in between calls to xBegin() and either + xCommit() or xRollback(). + + + + The native pointer to the sqlite3_vtab derived structure. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + + + + + + These methods provide the virtual table implementation an + opportunity to implement nested transactions. They are always + optional and will only be called in SQLite version 3.7.7 and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual + table X that it should save its current state as savepoint N. A + subsequent call to xRollbackTo(X,R) means that the state of the + virtual table should return to what it was when xSavepoint(X,R) was + last called. The call to xRollbackTo(X,R) will invalidate all + savepoints with N>R; none of the invalided savepoints will be + rolled back or released without first being reinitialized by a call + to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints + where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will + ever be called except in between calls to xBegin() and either + xCommit() or xRollback(). + + + + The native pointer to the sqlite3_vtab derived structure. + + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + + + A standard SQLite return code. + + + + + + These methods provide the virtual table implementation an + opportunity to implement nested transactions. They are always + optional and will only be called in SQLite version 3.7.7 and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual + table X that it should save its current state as savepoint N. A + subsequent call to xRollbackTo(X,R) means that the state of the + virtual table should return to what it was when xSavepoint(X,R) was + last called. The call to xRollbackTo(X,R) will invalidate all + savepoints with N>R; none of the invalided savepoints will be + rolled back or released without first being reinitialized by a call + to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints + where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will + ever be called except in between calls to xBegin() and either + xCommit() or xRollback(). + + + + The native pointer to the sqlite3_vtab derived structure. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + + + + + This interface represents a virtual table implementation written in + managed code. + + + + + This method is called in response to the + method. + + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The object instance containing all the + data for the inputs and outputs relating to index selection. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + Upon success, this parameter must be modified to contain the + object instance associated + with the newly opened virtual table cursor. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Number used to help identify the selected index. + + + String used to help identify the selected index. + + + The values corresponding to each column in the selected index. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Non-zero if no more rows are available; zero otherwise. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + The object instance to be used for + returning the specified column value to the SQLite core library. + + + The zero-based index corresponding to the column containing the + value to be returned. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the current row for the specified cursor. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The array of object instances containing + the new or modified column values, if any. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the row that was inserted, if any. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The number of arguments to the function being sought. + + + The name of the function being sought. + + + Upon success, this parameter must be modified to contain the + object instance responsible for + implementing the specified function. + + + Upon success, this parameter must be modified to contain the + native user-data pointer associated with + . + + + Non-zero if the specified function was found; zero otherwise. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The new name for the virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + + + + + Returns non-zero if the schema for the virtual table has been + declared. + + + + + Returns the name of the module as it was registered with the SQLite + core library. + + + + + This class contains static methods that are used to allocate, + manipulate, and free native memory provided by the SQLite core library. + + + + + Allocates at least the specified number of bytes of native memory + via the SQLite core library sqlite3_malloc() function and returns + the resulting native pointer. + + + The number of bytes to allocate. + + + The native pointer that points to a block of memory of at least the + specified size -OR- if the memory could + not be allocated. + + + + + Gets and returns the actual size of the specified memory block that + was previously obtained from the method. + + + The native pointer to the memory block previously obtained from the + method. + + + The actual size, in bytes, of the memory block specified via the + native pointer. + + + + + Frees a memory block previously obtained from the + method. + + + The native pointer to the memory block previously obtained from the + method. + + + + + This class contains static methods that are used to deal with native + UTF-8 string pointers to be used with the SQLite core library. + + + + + This is the maximum possible length for the native UTF-8 encoded + strings used with the SQLite core library. + + + + + This is the object instance used to handle + conversions from/to UTF-8. + + + + + Converts the specified managed string into the UTF-8 encoding and + returns the array of bytes containing its representation in that + encoding. + + + The managed string to convert. + + + The array of bytes containing the representation of the managed + string in the UTF-8 encoding or null upon failure. + + + + + Converts the specified array of bytes representing a string in the + UTF-8 encoding and returns a managed string. + + + The array of bytes to convert. + + + The managed string or null upon failure. + + + + + Probes a native pointer to a string in the UTF-8 encoding for its + terminating NUL character, within the specified length limit. + + + The native NUL-terminated string pointer. + + + The maximum length of the native string, in bytes. + + + The length of the native string, in bytes -OR- zero if the length + could not be determined. + + + + + Converts the specified native NUL-terminated UTF-8 string pointer + into a managed string. + + + The native NUL-terminated UTF-8 string pointer. + + + The managed string or null upon failure. + + + + + Converts the specified native UTF-8 string pointer of the specified + length into a managed string. + + + The native UTF-8 string pointer. + + + The length of the native string, in bytes. + + + The managed string or null upon failure. + + + + + Converts the specified managed string into a native NUL-terminated + UTF-8 string pointer using memory obtained from the SQLite core + library. + + + The managed string to convert. + + + The native NUL-terminated UTF-8 string pointer or + upon failure. + + + + + Converts a logical array of native NUL-terminated UTF-8 string + pointers into an array of managed strings. + + + The number of elements in the logical array of native + NUL-terminated UTF-8 string pointers. + + + The native pointer to the logical array of native NUL-terminated + UTF-8 string pointers to convert. + + + The array of managed strings or null upon failure. + + + + + Converts an array of managed strings into an array of native + NUL-terminated UTF-8 string pointers. + + + The array of managed strings to convert. + + + The array of native NUL-terminated UTF-8 string pointers or null + upon failure. + + + + + This class contains static methods that are used to deal with native + pointers to memory blocks that logically contain arrays of bytes to be + used with the SQLite core library. + + + + + Converts a native pointer to a logical array of bytes of the + specified length into a managed byte array. + + + The native pointer to the logical array of bytes to convert. + + + The length, in bytes, of the logical array of bytes to convert. + + + The managed byte array or null upon failure. + + + + + Converts a managed byte array into a native pointer to a logical + array of bytes. + + + The managed byte array to convert. + + + The native pointer to a logical byte array or null upon failure. + + + + + This class contains static methods that are used to perform several + low-level data marshalling tasks between native and managed code. + + + + + Returns a new object instance based on the + specified object instance and an integer + offset. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location that the new + object instance should point to. + + + The new object instance. + + + + + Rounds up an integer size to the next multiple of the alignment. + + + The size, in bytes, to be rounded up. + + + The required alignment for the return value. + + + The size, in bytes, rounded up to the next multiple of the + alignment. This value may end up being the same as the original + size. + + + + + Determines the offset, in bytes, of the next structure member. + + + The offset, in bytes, of the current structure member. + + + The size, in bytes, of the current structure member. + + + The alignment, in bytes, of the next structure member. + + + The offset, in bytes, of the next structure member. + + + + + Reads a value from the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be read is located. + + + The value at the specified memory location. + + + + + Reads a value from the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + to be read is located. + + + The value at the specified memory location. + + + + + Reads an value from the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be read is located. + + + The value at the specified memory location. + + + + + Writes an value to the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + + + + + Writes an value to the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + + + + + Writes a value to the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + + + + + Writes a value to the specified memory + location. + + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + + + + + This class represents a managed virtual table module implementation. + It is not sealed and must be used as the base class for any + user-defined virtual table module classes implemented in managed code. + + + + + The default version of the native sqlite3_module structure in use. + + + + + This field is used to store the native sqlite3_module structure + associated with this object instance. + + + + + This field is used to store the destructor delegate to be passed to + the SQLite core library via the sqlite3_create_disposable_module() + function. + + + + + This field is used to store a pointer to the native sqlite3_module + structure returned by the sqlite3_create_disposable_module + function. + + + + + This field is used to store the virtual table instances associated + with this module. The native pointer to the sqlite3_vtab derived + structure is used to key into this collection. + + + + + This field is used to store the virtual table cursor instances + associated with this module. The native pointer to the + sqlite3_vtab_cursor derived structure is used to key into this + collection. + + + + + This field is used to store the virtual table function instances + associated with this module. The case-insensitive function name + and the number of arguments (with -1 meaning "any") are used to + construct the string that is used to key into this collection. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + + + Calls the native SQLite core library in order to create a new + disposable module containing the implementation of a virtual table. + + + The native database connection pointer to use. + + + Non-zero upon success. + + + + + This method is called by the SQLite core library when the native + module associated with this object instance is being destroyed due + to its parent connection being closed. It may also be called by + the "vtshim" module if/when the sqlite3_dispose_module() function + is called. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + + + Creates and returns the native sqlite_module structure using the + configured (or default) + interface implementation. + + + The native sqlite_module structure using the configured (or + default) interface + implementation. + + + + + Creates and returns the native sqlite_module structure using the + specified interface + implementation. + + + The interface implementation to + use. + + + The native sqlite_module structure using the specified + interface implementation. + + + + + Creates a copy of the specified + object instance, + using default implementations for the contained delegates when + necessary. + + + The object + instance to copy. + + + The new object + instance. + + + + + Calls one of the virtual table initialization methods. + + + Non-zero to call the + method; otherwise, the + method will be called. + + + The native database connection handle. + + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. + + + The number of arguments from the CREATE VIRTUAL TABLE statement. + + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + + + + + Calls one of the virtual table finalization methods. + + + Non-zero to call the + method; otherwise, the + method will be + called. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance to be used. + + + The native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + The error message. + + + Non-zero upon success. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance to be used. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + The error message. + + + Non-zero upon success. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance to be used. + + + The native pointer to the sqlite3_vtab_cursor derived structure + used to get the native pointer to the sqlite3_vtab derived + structure. + + + Non-zero if this error message should also be logged using the + class. + + + The error message. + + + Non-zero upon success. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance to be used. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + The error message. + + + Non-zero upon success. + + + + + Gets and returns the interface + implementation to be used when creating the native sqlite3_module + structure. Derived classes may override this method to supply an + alternate implementation for the + interface. + + + The interface implementation to + be used when populating the native sqlite3_module structure. If + the returned value is null, the private methods provided by the + class and relating to the + interface will be used to + create the necessary delegates. + + + + + Creates and returns the + interface implementation corresponding to the current + object instance. + + + The interface implementation + corresponding to the current object + instance. + + + + + Allocates a native sqlite3_vtab derived structure and returns a + native pointer to it. + + + A native pointer to a native sqlite3_vtab derived structure. + + + + + Zeros out the fields of a native sqlite3_vtab derived structure. + + + The native pointer to the native sqlite3_vtab derived structure to + zero. + + + + + Frees a native sqlite3_vtab structure using the provided native + pointer to it. + + + A native pointer to a native sqlite3_vtab derived structure. + + + + + Allocates a native sqlite3_vtab_cursor derived structure and + returns a native pointer to it. + + + A native pointer to a native sqlite3_vtab_cursor derived structure. + + + + + Frees a native sqlite3_vtab_cursor structure using the provided + native pointer to it. + + + A native pointer to a native sqlite3_vtab_cursor derived structure. + + + + + Reads and returns the native pointer to the sqlite3_vtab derived + structure based on the native pointer to the sqlite3_vtab_cursor + derived structure. + + + The object instance to be used. + + + The native pointer to the sqlite3_vtab_cursor derived structure + from which to read the native pointer to the sqlite3_vtab derived + structure. + + + The native pointer to the sqlite3_vtab derived structure -OR- + if it cannot be determined. + + + + + Reads and returns the native pointer to the sqlite3_vtab derived + structure based on the native pointer to the sqlite3_vtab_cursor + derived structure. + + + The native pointer to the sqlite3_vtab_cursor derived structure + from which to read the native pointer to the sqlite3_vtab derived + structure. + + + The native pointer to the sqlite3_vtab derived structure -OR- + if it cannot be determined. + + + + + Looks up and returns the object + instance based on the native pointer to the sqlite3_vtab derived + structure. + + + The native pointer to the sqlite3_vtab derived structure. + + + The object instance or null if + the corresponding one cannot be found. + + + + + Allocates and returns a native pointer to a sqlite3_vtab derived + structure and creates an association between it and the specified + object instance. + + + The object instance to be used + when creating the association. + + + The native pointer to a sqlite3_vtab derived structure or + if the method fails for any reason. + + + + + Looks up and returns the + object instance based on the native pointer to the + sqlite3_vtab_cursor derived structure. + + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + The object instance or null + if the corresponding one cannot be found. + + + + + Allocates and returns a native pointer to a sqlite3_vtab_cursor + derived structure and creates an association between it and the + specified object instance. + + + The object instance to be + used when creating the association. + + + The native pointer to a sqlite3_vtab_cursor derived structure or + if the method fails for any reason. + + + + + Deterimines the key that should be used to identify and store the + object instance for the virtual table + (i.e. to be returned via the + method). + + + The number of arguments to the virtual table function. + + + The name of the virtual table function. + + + The object instance associated with + this virtual table function. + + + The string that should be used to identify and store the virtual + table function instance. This method cannot return null. If null + is returned from this method, the behavior is undefined. + + + + + Attempts to declare the schema for the virtual table using the + specified database connection. + + + The object instance to use when + declaring the schema of the virtual table. This parameter may not + be null. + + + The string containing the CREATE TABLE statement that completely + describes the schema for the virtual table. This parameter may not + be null. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + + + + + Calls the native SQLite core library in order to declare a virtual + table function in response to a call into the + + or virtual table + methods. + + + The object instance to use when + declaring the schema of the virtual table. + + + The number of arguments to the function being declared. + + + The name of the function being declared. + + + Upon success, the contents of this parameter are undefined. Upon + failure, it should contain an appropriate error message. + + + A standard SQLite return code. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + + + + + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + + + + + Modifies the specified object instance + to contain the specified estimated cost. + + + The object instance to modify. + + + The estimated cost value to use. Using a null value means that the + default value provided by the SQLite core library should be used. + + + Non-zero upon success. + + + + + Modifies the specified object instance + to contain the default estimated cost. + + + The object instance to modify. + + + Non-zero upon success. + + + + + Modifies the specified object instance + to contain the specified estimated rows. + + + The object instance to modify. + + + The estimated rows value to use. Using a null value means that the + default value provided by the SQLite core library should be used. + + + Non-zero upon success. + + + + + Modifies the specified object instance + to contain the default estimated rows. + + + The object instance to modify. + + + Non-zero upon success. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + This method is called in response to the + method. + + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The object instance containing all the + data for the inputs and outputs relating to index selection. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + Upon success, this parameter must be modified to contain the + object instance associated + with the newly opened virtual table cursor. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Number used to help identify the selected index. + + + String used to help identify the selected index. + + + The values corresponding to each column in the selected index. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Non-zero if no more rows are available; zero otherwise. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + The object instance to be used for + returning the specified column value to the SQLite core library. + + + The zero-based index corresponding to the column containing the + value to be returned. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the current row for the specified cursor. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The array of object instances containing + the new or modified column values, if any. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the row that was inserted, if any. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The number of arguments to the function being sought. + + + The name of the function being sought. + + + Upon success, this parameter must be modified to contain the + object instance responsible for + implementing the specified function. + + + Upon success, this parameter must be modified to contain the + native user-data pointer associated with + . + + + Non-zero if the specified function was found; zero otherwise. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The new name for the virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + + + + + Disposes of this object instance. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is being + called from the finalizer. + + + + + Finalizes this object instance. + + + + + Returns or sets a boolean value indicating whether virtual table + errors should be logged using the class. + + + + + Returns or sets a boolean value indicating whether exceptions + caught in the + method, + method, and the + method should be logged using the + class. + + + + + Returns or sets a boolean value indicating whether virtual table + errors should be logged using the class. + + + + + Returns or sets a boolean value indicating whether exceptions + caught in the + method, + method, and the + method should be logged using the + class. + + + + + Returns non-zero if the schema for the virtual table has been + declared. + + + + + Returns the name of the module as it was registered with the SQLite + core library. + + + + + This class implements the + interface by forwarding those method calls to the + object instance it contains. If the + contained object instance is null, all + the methods simply generate an + error. + + + + + This is the value that is always used for the "logErrors" + parameter to the various static error handling methods provided + by the class. + + + + + This is the error message text used when the contained + object instance is not available + for any reason. + + + + + The object instance used to provide + an implementation of the + interface. + + + + + Constructs an instance of this class. + + + The object instance used to provide + an implementation of the + interface. + + + + + Sets the table error message to one that indicates the native + module implementation is not available. + + + The native pointer to the sqlite3_vtab derived structure. + + + The value of . + + + + + Sets the table error message to one that indicates the native + module implementation is not available. + + + The native pointer to the sqlite3_vtab_cursor derived + structure. + + + The value of . + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + Disposes of this object instance. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is being + called from the finalizer. + + + + + Finalizes this object instance. + + + + + This class represents a virtual table cursor to be used with the + class. It is not sealed and may + be used as the base class for any user-defined virtual table cursor + class that wraps an object instance. + + + + + The instance provided when this cursor + was created. + + + + + This value will be non-zero if false has been returned from the + method. + + + + + Constructs an instance of this class. + + + The object instance associated + with this object instance. + + + The instance to expose as a virtual + table cursor. + + + + + Advances to the next row of the virtual table cursor using the + method of the + object instance. + + + Non-zero if the current row is valid; zero otherwise. If zero is + returned, no further rows are available. + + + + + Resets the virtual table cursor position, also invalidating the + current row, using the method of + the object instance. + + + + + Closes the virtual table cursor. This method must not throw any + exceptions. + + + + + Throws an if the virtual + table cursor has been closed. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + + + + Returns the value for the current row of the virtual table cursor + using the property of the + object instance. + + + + + Returns non-zero if the end of the virtual table cursor has been + seen (i.e. no more rows are available, including the current one). + + + + + Returns non-zero if the virtual table cursor is open. + + + + + This class implements a virtual table module that exposes an + object instance as a read-only virtual + table. It is not sealed and may be used as the base class for any + user-defined virtual table class that wraps an + object instance. The following short + example shows it being used to treat an array of strings as a table + data source: + + public static class Sample + { + public static void Main() + { + using (SQLiteConnection connection = new SQLiteConnection( + "Data Source=:memory:;")) + { + connection.Open(); + + connection.CreateModule(new SQLiteModuleEnumerable( + "sampleModule", new string[] { "one", "two", "three" })); + + using (SQLiteCommand command = connection.CreateCommand()) + { + command.CommandText = + "CREATE VIRTUAL TABLE t1 USING sampleModule;"; + + command.ExecuteNonQuery(); + } + + using (SQLiteCommand command = connection.CreateCommand()) + { + command.CommandText = "SELECT * FROM t1;"; + + using (SQLiteDataReader dataReader = command.ExecuteReader()) + { + while (dataReader.Read()) + Console.WriteLine(dataReader[0].ToString()); + } + } + + connection.Close(); + } + } + } + + + + + + This class implements a virtual table module that does nothing by + providing "empty" implementations for all of the + interface methods. The result + codes returned by these "empty" method implementations may be + controlled on a per-method basis by using and/or overriding the + , + , + , + , and + methods from within derived classes. + + + + + This field is used to store the + values to return, on a per-method basis, for all methods that are + part of the interface. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + + + Determines the default value to be + returned by methods of the + interface that lack an overridden implementation in all classes + derived from the class. + + + The value that should be returned + by all interface methods unless + a more specific result code has been set for that interface method. + + + + + Converts a value into a boolean + return value for use with the + method. + + + The value to convert. + + + The value. + + + + + Converts a value into a boolean + return value for use with the + method. + + + The value to convert. + + + The value. + + + + + Determines the value that should be + returned by the specified + interface method if it lack an overridden implementation. If no + specific value is available (or set) + for the specified method, the value + returned by the method will be + returned instead. + + + The name of the method. Currently, this method must be part of + the interface. + + + The value that should be returned + by the interface method. + + + + + Sets the value that should be + returned by the specified + interface method if it lack an overridden implementation. + + + The name of the method. Currently, this method must be part of + the interface. + + + The value that should be returned + by the interface method. + + + Non-zero upon success. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + + + + The CREATE TABLE statement used to declare the schema for the + virtual table. + + + + + The instance containing the backing data + for the virtual table. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + The instance to expose as a virtual + table. This parameter cannot be null. + + + + + Determines the SQL statement used to declare the virtual table. + This method should be overridden in derived classes if they require + a custom virtual table schema. + + + The SQL statement used to declare the virtual table -OR- null if it + cannot be determined. + + + + + Sets the table error message to one that indicates the virtual + table cursor is of the wrong type. + + + The object instance. + + + The value of . + + + + + Sets the table error message to one that indicates the virtual + table cursor has no current row. + + + The object instance. + + + The value of . + + + + + Determines the string to return as the column value for the object + instance value. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + The object instance to return a string representation for. + + + The string representation of the specified object instance or null + upon failure. + + + + + Constructs an unique row identifier from two + values. The first value + must contain the row sequence number for the current row and the + second value must contain the hash code of the enumerator value + for the current row. + + + The integer row sequence number for the current row. + + + The hash code of the enumerator value for the current row. + + + The unique row identifier or zero upon failure. + + + + + Determines the unique row identifier for the current row. + + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + The object instance to return a unique row identifier for. + + + The unique row identifier or zero upon failure. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + + + + This class represents a virtual table cursor to be used with the + class. It is not sealed and may + be used as the base class for any user-defined virtual table cursor + class that wraps an object instance. + + + + + The instance provided when this + cursor was created. + + + + + Constructs an instance of this class. + + + The object instance associated + with this object instance. + + + The instance to expose as a virtual + table cursor. + + + + + Closes the virtual table cursor. This method must not throw any + exceptions. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + + + + Returns the value for the current row of the virtual table cursor + using the property of the + object instance. + + + + + This class implements a virtual table module that exposes an + object instance as a read-only virtual + table. It is not sealed and may be used as the base class for any + user-defined virtual table class that wraps an + object instance. + + + + + The instance containing the backing + data for the virtual table. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + The instance to expose as a virtual + table. This parameter cannot be null. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + +
+
diff --git a/packages/System.Data.SQLite.1.0.90.0/tools/install.ps1 b/packages/System.Data.SQLite.1.0.90.0/tools/install.ps1 new file mode 100644 index 000000000..a4293924a --- /dev/null +++ b/packages/System.Data.SQLite.1.0.90.0/tools/install.ps1 @@ -0,0 +1,36 @@ +############################################################################### +# +# install.ps1 -- +# +# Written by Joe Mistachkin. +# Released to the public domain, use at your own risk! +# +############################################################################### + +param($installPath, $toolsPath, $package, $project) + +$platformNames = "x86", "x64" +$fileName = "SQLite.Interop.dll" +$propertyName = "CopyToOutputDirectory" + +foreach($platformName in $platformNames) { + $folder = $project.ProjectItems.Item($platformName) + + if ($folder -eq $null) { + continue + } + + $item = $folder.ProjectItems.Item($fileName) + + if ($item -eq $null) { + continue + } + + $property = $item.Properties.Item($propertyName) + + if ($property -eq $null) { + continue + } + + $property.Value = 1 +} diff --git a/packages/log4net.2.0.2/lib/net40-full/log4net.dll b/packages/log4net.2.0.2/lib/net40-full/log4net.dll new file mode 100644 index 000000000..ad3e89561 Binary files /dev/null and b/packages/log4net.2.0.2/lib/net40-full/log4net.dll differ diff --git a/packages/log4net.2.0.2/lib/net40-full/log4net.xml b/packages/log4net.2.0.2/lib/net40-full/log4net.xml new file mode 100644 index 000000000..e71d34d4e --- /dev/null +++ b/packages/log4net.2.0.2/lib/net40-full/log4net.xml @@ -0,0 +1,31809 @@ + + + + log4net + + + + + Appender that logs to a database. + + + + appends logging events to a table within a + database. The appender can be configured to specify the connection + string by setting the property. + The connection type (provider) can be specified by setting the + property. For more information on database connection strings for + your specific database see http://www.connectionstrings.com/. + + + Records are written into the database either using a prepared + statement or a stored procedure. The property + is set to (System.Data.CommandType.Text) to specify a prepared statement + or to (System.Data.CommandType.StoredProcedure) to specify a stored + procedure. + + + The prepared statement text or the name of the stored procedure + must be set in the property. + + + The prepared statement or stored procedure can take a number + of parameters. Parameters are added using the + method. This adds a single to the + ordered list of parameters. The + type may be subclassed if required to provide database specific + functionality. The specifies + the parameter name, database type, size, and how the value should + be generated using a . + + + + An example of a SQL Server table that could be logged to: + + CREATE TABLE [dbo].[Log] ( + [ID] [int] IDENTITY (1, 1) NOT NULL , + [Date] [datetime] NOT NULL , + [Thread] [varchar] (255) NOT NULL , + [Level] [varchar] (20) NOT NULL , + [Logger] [varchar] (255) NOT NULL , + [Message] [varchar] (4000) NOT NULL + ) ON [PRIMARY] + + + + An example configuration to log to the above table: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Julian Biddle + Nicko Cadell + Gert Driesen + Lance Nehring + + + + Abstract base class implementation of that + buffers events in a fixed size buffer. + + + + This base class should be used by appenders that need to buffer a + number of events before logging them. For example the + buffers events and then submits the entire contents of the buffer to + the underlying database in one go. + + + Subclasses should override the + method to deliver the buffered events. + + The BufferingAppenderSkeleton maintains a fixed size cyclic + buffer of events. The size of the buffer is set using + the property. + + A is used to inspect + each event as it arrives in the appender. If the + triggers, then the current buffer is sent immediately + (see ). Otherwise the event + is stored in the buffer. For example, an evaluator can be used to + deliver the events immediately when an ERROR event arrives. + + + The buffering appender can be configured in a mode. + By default the appender is NOT lossy. When the buffer is full all + the buffered events are sent with . + If the property is set to true then the + buffer will not be sent when it is full, and new events arriving + in the appender will overwrite the oldest event in the buffer. + In lossy mode the buffer will only be sent when the + triggers. This can be useful behavior when you need to know about + ERROR events but not about events with a lower level, configure an + evaluator that will trigger when an ERROR event arrives, the whole + buffer will be sent which gives a history of events leading up to + the ERROR event. + + + Nicko Cadell + Gert Driesen + + + + Abstract base class implementation of . + + + + This class provides the code for common functionality, such + as support for threshold filtering and support for general filters. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface for your own strategies for printing log statements. + + + + Implementors should consider extending the + class which provides a default implementation of this interface. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Log the logging event in Appender specific way. + + The event to log + + + This method is called to log a message into this appender. + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + The name uniquely identifies the appender. + + + + + Interface for appenders that support bulk logging. + + + + This interface extends the interface to + support bulk logging of objects. Appenders + should only implement this interface if they can bulk log efficiently. + + + Nicko Cadell + + + + Log the array of logging events in Appender specific way. + + The events to log + + + This method is called to log an array of events into this appender. + + + + + + Interface used to delay activate a configured object. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then the method + must be called by the container after its all the configured properties have been set + and before the component can be used. + + + Nicko Cadell + + + + Activate the options that were previously set with calls to properties. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then this method must be called + after its properties have been set before the component can be used. + + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Default constructor + + + Empty default constructor + + + + + Finalizes this appender by calling the implementation's + method. + + + + If this appender has not been closed then the Finalize method + will call . + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Closes the appender and release resources. + + + + Release any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + This method cannot be overridden by subclasses. This method + delegates the closing of the appender to the + method which must be overridden in the subclass. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The event to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the abstract method. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The array of events to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the method. + + + + + + Test if the logging event should we output by this appender + + the event to test + true if the event should be output, false if the event should be ignored + + + This method checks the logging event against the threshold level set + on this appender and also against the filters specified on this + appender. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + + + + + Adds a filter to the end of the filter chain. + + the filter to add to this appender + + + The Filters are organized in a linked list. + + + Setting this property causes the new filter to be pushed onto the + back of the filter chain. + + + + + + Clears the filter list for this appender. + + + + Clears the filter list for this appender. + + + + + + Checks if the message level is below this appender's threshold. + + to test against. + + + If there is no threshold set, then the return value is always true. + + + + true if the meets the + requirements of this appender. + + + + + Is called when the appender is closed. Derived classes should override + this method if resources need to be released. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Subclasses of should implement this method + to perform actual logging. + + The event to append. + + + A subclass must implement this method to perform + logging of the . + + This method will be called by + if all the conditions listed for that method are met. + + + To restrict the logging of events in the appender + override the method. + + + + + + Append a bulk array of logging events. + + the array of logging events + + + This base class implementation calls the + method for each element in the bulk array. + + + A sub class that can better process a bulk array of events should + override this method in addition to . + + + + + + Called before as a precondition. + + + + This method is called by + before the call to the abstract method. + + + This method can be overridden in a subclass to extend the checks + made before the event is passed to the method. + + + A subclass should ensure that they delegate this call to + this base class if it is overridden. + + + true if the call to should proceed. + + + + Renders the to a string. + + The event to render. + The event rendered as a string. + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Where possible use the alternative version of this method + . + That method streams the rendering onto an existing Writer + which can give better performance if the caller already has + a open and ready for writing. + + + + + + Renders the to a string. + + The event to render. + The TextWriter to write the formatted event to + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Use this method in preference to + where possible. If, however, the caller needs to render the event + to a string then does + provide an efficient mechanism for doing so. + + + + + + The layout of this appender. + + + See for more information. + + + + + The name of this appender. + + + See for more information. + + + + + The level threshold of this appender. + + + + There is no level threshold filtering by default. + + + See for more information. + + + + + + It is assumed and enforced that errorHandler is never null. + + + + It is assumed and enforced that errorHandler is never null. + + + See for more information. + + + + + + The first filter in the filter chain. + + + + Set to null initially. + + + See for more information. + + + + + + The last filter in the filter chain. + + + See for more information. + + + + + Flag indicating if this appender is closed. + + + See for more information. + + + + + The guard prevents an appender from repeatedly calling its own DoAppend method + + + + + StringWriter used to render events + + + + + The fully qualified type of the AppenderSkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the threshold of this appender. + + + The threshold of the appender. + + + + All log events with lower level than the threshold level are ignored + by the appender. + + + In configuration files this option is specified by setting the + value of the option to a level + string, such as "DEBUG", "INFO" and so on. + + + + + + Gets or sets the for this appender. + + The of the appender + + + The provides a default + implementation for the property. + + + + + + The filter chain. + + The head of the filter chain filter chain. + + + Returns the head Filter. The Filters are organized in a linked list + and so all Filters on this Appender are available through the result. + + + + + + Gets or sets the for this appender. + + The layout of the appender. + + + See for more information. + + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + + The name uniquely identifies the appender. + + + + + + Tests if this appender requires a to be set. + + + + In the rather exceptional case, where the appender + implementation admits a layout but can also work without it, + then the appender should return true. + + + This default implementation always returns false. + + + + true if the appender requires a layout object, otherwise false. + + + + + The default buffer size. + + + The default size of the cyclic buffer used to store events. + This is set to 512 by default. + + + + + Initializes a new instance of the class. + + + + Protected default constructor to allow subclassing. + + + + + + Initializes a new instance of the class. + + the events passed through this appender must be + fixed by the time that they arrive in the derived class' SendBuffer method. + + + Protected constructor to allow subclassing. + + + The should be set if the subclass + expects the events delivered to be fixed even if the + is set to zero, i.e. when no buffering occurs. + + + + + + Flush the currently buffered events + + + + Flushes any events that have been buffered. + + + If the appender is buffering in mode then the contents + of the buffer will NOT be flushed to the appender. + + + + + + Flush the currently buffered events + + set to true to flush the buffer of lossy events + + + Flushes events that have been buffered. If is + false then events will only be flushed if this buffer is non-lossy mode. + + + If the appender is buffering in mode then the contents + of the buffer will only be flushed if is true. + In this case the contents of the buffer will be tested against the + and if triggering will be output. All other buffered + events will be discarded. + + + If is true then the buffer will always + be emptied by calling this method. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Close this appender instance. + + + + Close this appender instance. If this appender is marked + as not then the remaining events in + the buffer must be sent when the appender is closed. + + + + + + This method is called by the method. + + the event to log + + + Stores the in the cyclic buffer. + + + The buffer will be sent (i.e. passed to the + method) if one of the following conditions is met: + + + + The cyclic buffer is full and this appender is + marked as not lossy (see ) + + + An is set and + it is triggered for the + specified. + + + + Before the event is stored in the buffer it is fixed + (see ) to ensure that + any data referenced by the event will be valid when the buffer + is processed. + + + + + + Sends the contents of the buffer. + + The first logging event. + The buffer containing the events that need to be send. + + + The subclass must override . + + + + + + Sends the events. + + The events that need to be send. + + + The subclass must override this method to process the buffered events. + + + + + + The size of the cyclic buffer used to hold the logging events. + + + Set to by default. + + + + + The cyclic buffer used to store the logging events. + + + + + The triggering event evaluator that causes the buffer to be sent immediately. + + + The object that is used to determine if an event causes the entire + buffer to be sent immediately. This field can be null, which + indicates that event triggering is not to be done. The evaluator + can be set using the property. If this appender + has the ( property) set to + true then an must be set. + + + + + Indicates if the appender should overwrite events in the cyclic buffer + when it becomes full, or if the buffer should be flushed when the + buffer is full. + + + If this field is set to true then an must + be set. + + + + + The triggering event evaluator filters discarded events. + + + The object that is used to determine if an event that is discarded should + really be discarded or if it should be sent to the appenders. + This field can be null, which indicates that all discarded events will + be discarded. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + The events delivered to the subclass must be fixed. + + + + + Gets or sets a value that indicates whether the appender is lossy. + + + true if the appender is lossy, otherwise false. The default is false. + + + + This appender uses a buffer to store logging events before + delivering them. A triggering event causes the whole buffer + to be send to the remote sink. If the buffer overruns before + a triggering event then logging events could be lost. Set + to false to prevent logging events + from being lost. + + If is set to true then an + must be specified. + + + + + Gets or sets the size of the cyclic buffer used to hold the + logging events. + + + The size of the cyclic buffer used to hold the logging events. + + + + The option takes a positive integer + representing the maximum number of logging events to collect in + a cyclic buffer. When the is reached, + oldest events are deleted as new events are added to the + buffer. By default the size of the cyclic buffer is 512 events. + + + If the is set to a value less than + or equal to 1 then no buffering will occur. The logging event + will be delivered synchronously (depending on the + and properties). Otherwise the event will + be buffered. + + + + + + Gets or sets the that causes the + buffer to be sent immediately. + + + The that causes the buffer to be + sent immediately. + + + + The evaluator will be called for each event that is appended to this + appender. If the evaluator triggers then the current buffer will + immediately be sent (see ). + + If is set to true then an + must be specified. + + + + + Gets or sets the value of the to use. + + + The value of the to use. + + + + The evaluator will be called for each event that is discarded from this + appender. If the evaluator triggers then the current buffer will immediately + be sent (see ). + + + + + + Gets or sets a value indicating if only part of the logging event data + should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the + event data to be fixed and serialized. This will improve performance. + + + See for more information. + + + + + + Gets or sets a the fields that will be fixed in the event + + + The event fields that will be fixed before the event is buffered + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + + Initializes a new instance of the class. + + + Public default constructor to initialize a new instance of this class. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Override the parent method to close the database + + + + Closes the database command and database connection. + + + + + + Inserts the events into the database. + + The events to insert into the database. + + + Insert all the events specified in the + array into the database. + + + + + + Adds a parameter to the command. + + The parameter to add to the command. + + + Adds a parameter to the ordered list of command parameters. + + + + + + Writes the events to the database using the transaction specified. + + The transaction that the events will be executed under. + The array of events to insert into the database. + + + The transaction argument can be null if the appender has been + configured not to use transactions. See + property for more information. + + + + + + Formats the log message into database statement text. + + The event being logged. + + This method can be overridden by subclasses to provide + more control over the format of the database statement. + + + Text that can be passed to a . + + + + + Creates an instance used to connect to the database. + + + This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). + + The of the object. + The connectionString output from the ResolveConnectionString method. + An instance with a valid connection string. + + + + Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey + property. + + + ConnectiongStringName is only supported on .NET 2.0 and higher. + + Additional information describing the connection string. + A connection string used to connect to the database. + + + + Retrieves the class type of the ADO.NET provider. + + + + Gets the Type of the ADO.NET provider to use to connect to the + database. This method resolves the type specified in the + property. + + + Subclasses can override this method to return a different type + if necessary. + + + The of the ADO.NET provider + + + + Prepares the database command and initialize the parameters. + + + + + Connects to the database. + + + + + Cleanup the existing command. + + + If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. + + + + + Cleanup the existing connection. + + + Calls the IDbConnection's method. + + + + + Flag to indicate if we are using a command object + + + + Set to true when the appender is to use a prepared + statement or stored procedure to insert into the database. + + + + + + The list of objects. + + + + The list of objects. + + + + + + The security context to use for privileged calls + + + + + The that will be used + to insert logging events into a database. + + + + + The database command. + + + + + Database connection string. + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + + + String type name of the type name. + + + + + The text of the command. + + + + + The command type. + + + + + Indicates whether to use transactions when writing to the database. + + + + + Indicates whether to use transactions when writing to the database. + + + + + The fully qualified type of the AdoNetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the database connection string that is used to connect to + the database. + + + The database connection string used to connect to the database. + + + + The connections string is specific to the connection type. + See for more information. + + + Connection string for MS Access via ODBC: + "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" + + Another connection string for MS Access via ODBC: + "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" + + Connection string for MS Access via OLE DB: + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + This property requires at least .NET 2.0. + + + + + Gets or sets the type name of the connection + that should be created. + + + The type name of the connection. + + + + The type name of the ADO.NET provider to use. + + + The default is to use the OLE DB provider. + + + Use the OLE DB Provider. This is the default value. + System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the MS SQL Server Provider. + System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the ODBC Provider. + Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for ODBC .NET Data Provider. + + Use the Oracle Provider. + System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for .NET Managed Provider for Oracle. + + + + + Gets or sets the command text that is used to insert logging events + into the database. + + + The command text used to insert logging events into the database. + + + + Either the text of the prepared statement or the + name of the stored procedure to execute to write into + the database. + + + The property determines if + this text is a prepared statement or a stored procedure. + + + + + + Gets or sets the command type to execute. + + + The command type to execute. + + + + This value may be either (System.Data.CommandType.Text) to specify + that the is a prepared statement to execute, + or (System.Data.CommandType.StoredProcedure) to specify that the + property is the name of a stored procedure + to execute. + + + The default value is (System.Data.CommandType.Text). + + + + + + Should transactions be used to insert logging events in the database. + + + true if transactions should be used to insert logging events in + the database, otherwise false. The default value is true. + + + + Gets or sets a value that indicates whether transactions should be used + to insert logging events in the database. + + + When set a single transaction will be used to insert the buffered events + into the database. Otherwise each event will be inserted without using + an explicit transaction. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Should this appender try to reconnect to the database on error. + + + true if the appender should try to reconnect to the database after an + error has occurred, otherwise false. The default value is false, + i.e. not to try to reconnect. + + + + The default behaviour is for the appender not to try to reconnect to the + database if an error occurs. Subsequent logging events are discarded. + + + To force the appender to attempt to reconnect to the database set this + property to true. + + + When the appender attempts to connect to the database there may be a + delay of up to the connection timeout specified in the connection string. + This delay will block the calling application's thread. + Until the connection can be reestablished this potential delay may occur multiple times. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to insert + logging events into a database. Classes deriving from + can use this property to get or set this . Use the + underlying returned from if + you require access beyond that which provides. + + + + + Parameter type used by the . + + + + This class provides the basic database parameter properties + as defined by the interface. + + This type can be subclassed to provide database specific + functionality. The two methods that are called externally are + and . + + + + + + Initializes a new instance of the class. + + + Default constructor for the AdoNetAppenderParameter class. + + + + + Prepare the specified database command object. + + The command to prepare. + + + Prepares the database command object by adding + this parameter to its collection of parameters. + + + + + + Renders the logging event and set the parameter value in the command. + + The command containing the parameter. + The event to be rendered. + + + Renders the logging event using this parameters layout + object. Sets the value of the parameter on the command object. + + + + + + The name of this parameter. + + + + + The database type for this parameter. + + + + + Flag to infer type rather than use the DbType + + + + + The precision for this parameter. + + + + + The scale for this parameter. + + + + + The size for this parameter. + + + + + The to use to render the + logging event into an object for this parameter. + + + + + Gets or sets the name of this parameter. + + + The name of this parameter. + + + + The name of this parameter. The parameter name + must match up to a named parameter to the SQL stored procedure + or prepared statement. + + + + + + Gets or sets the database type for this parameter. + + + The database type for this parameter. + + + + The database type for this parameter. This property should + be set to the database type from the + enumeration. See . + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the type from the value. + + + + + + + Gets or sets the precision for this parameter. + + + The precision for this parameter. + + + + The maximum number of digits used to represent the Value. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the precision from the value. + + + + + + + Gets or sets the scale for this parameter. + + + The scale for this parameter. + + + + The number of decimal places to which Value is resolved. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the scale from the value. + + + + + + + Gets or sets the size for this parameter. + + + The size for this parameter. + + + + The maximum size, in bytes, of the data within the column. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the size from the value. + + + For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. + + + + + + + Gets or sets the to use to + render the logging event into an object for this + parameter. + + + The used to render the + logging event into an object for this parameter. + + + + The that renders the value for this + parameter. + + + The can be used to adapt + any into a + for use in the property. + + + + + + Appends logging events to the terminal using ANSI color escape sequences. + + + + AnsiColorTerminalAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific level of message to be set. + + + This appender expects the terminal to understand the VT100 control set + in order to interpret the color codes. If the terminal or console does not + understand the control codes the behavior is not defined. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + When configuring the ANSI colored terminal appender, a mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + + These color values cannot be combined together to make new colors. + + + The attributes can be any combination of the following: + + Brightforeground is brighter + Dimforeground is dimmer + Underscoremessage is underlined + Blinkforeground is blinking (does not work on all terminals) + Reverseforeground and background are reversed + Hiddenoutput is hidden + Strikethroughmessage has a line through it + + While any of these attributes may be combined together not all combinations + work well together, for example setting both Bright and Dim attributes makes + no sense. + + + Patrick Wagstrom + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Ansi code to reset terminal + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colours + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible display attributes + + + + The following flags can be combined together to + form the ANSI color attributes. + + + + + + + text is bright + + + + + text is dim + + + + + text is underlined + + + + + text is blinking + + + Not all terminals support this attribute + + + + + text and background colors are reversed + + + + + text is hidden + + + + + text is displayed with a strikethrough + + + + + text color is light + + + + + The enum of possible foreground or background color values for + use with the color mapping method + + + + The output can be in one for the following ANSI colors. + + + + + + + color is black + + + + + color is red + + + + + color is green + + + + + color is yellow + + + + + color is blue + + + + + color is magenta + + + + + color is cyan + + + + + color is white + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + An entry in the + + + + This is an abstract base class for types that are stored in the + object. + + + Nicko Cadell + + + + Default protected constructor + + + + Default protected constructor + + + + + + Initialize any options defined on this entry + + + + Should be overridden by any classes that need to initialise based on their options + + + + + + The level that is the key for this mapping + + + The that is the key for this mapping + + + + Get or set the that is the key for this + mapping subclass. + + + + + + Initialize the options for the object + + + + Combine the and together + and append the attributes. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level + + + + + + The color attributes for the specified level + + + + Required property. + The color attributes for the specified level + + + + + + The combined , and + suitable for setting the ansi terminal color. + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a AppenderCollection instance. + + list to create a readonly wrapper arround + + An AppenderCollection wrapper that is read-only. + + + + + An empty readonly static AppenderCollection + + + + + Initializes a new instance of the AppenderCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the AppenderCollection class + that has the specified initial capacity. + + + The number of elements that the new AppenderCollection is initially capable of storing. + + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified AppenderCollection. + + The AppenderCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire AppenderCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire AppenderCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the AppenderCollection. + + The to be added to the end of the AppenderCollection. + The index at which the value has been added. + + + + Removes all elements from the AppenderCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the AppenderCollection. + + The to check for. + true if is found in the AppenderCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the AppenderCollection. + + The to locate in the AppenderCollection. + + The zero-based index of the first occurrence of + in the entire AppenderCollection, if found; otherwise, -1. + + + + + Inserts an element into the AppenderCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the AppenderCollection. + + The to remove from the AppenderCollection. + + The specified was not found in the AppenderCollection. + + + + + Removes the element at the specified index of the AppenderCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the AppenderCollection. + + An for the entire AppenderCollection. + + + + Adds the elements of another AppenderCollection to the current AppenderCollection. + + The AppenderCollection whose elements should be added to the end of the current AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a array to the current AppenderCollection. + + The array whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a collection to the current AppenderCollection. + + The collection whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Sets the capacity to the actual number of elements. + + + + + Return the collection elements as an array + + the array + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the AppenderCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the AppenderCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + + + + + Appends log events to the ASP.NET system. + + + + + Diagnostic information and tracing messages that you specify are appended to the output + of the page that is sent to the requesting browser. Optionally, you can view this information + from a separate trace viewer (Trace.axd) that displays trace information for every page in a + given application. + + + Trace statements are processed and displayed only when tracing is enabled. You can control + whether tracing is displayed to a page, to the trace viewer, or both. + + + The logging event is passed to the or + method depending on the level of the logging event. + The event's logger name is the default value for the category parameter of the Write/Warn method. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the ASP.NET trace + + the event to log + + + Write the logging event to the ASP.NET trace + HttpContext.Current.Trace + (). + + + + + + Defaults to %logger + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + Buffers events and then forwards them to attached appenders. + + + + The events are buffered in this appender until conditions are + met to allow the appender to deliver the events to the attached + appenders. See for the + conditions that cause the buffer to be sent. + + The forwarding appender can be used to specify different + thresholds and filters for the same appender at different locations + within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Interface for attaching appenders to objects. + + + + Interface for attaching, removing and retrieving appenders. + + + Nicko Cadell + Gert Driesen + + + + Attaches an appender. + + The appender to add. + + + Add the specified appender. The implementation may + choose to allow or deny duplicate appenders. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Returns an attached appender with the specified. + If no appender with the specified name is found null will be + returned. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Gets all attached appenders. + + + A collection of attached appenders. + + + + Gets a collection of attached appenders. + If there are no attached appenders the + implementation should return an empty + collection rather than null. + + + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Send the events. + + The events that need to be send. + + + Forwards the events to the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this buffering appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Appends logging events to the console. + + + + ColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes directly to the application's attached console + not to the System.Console.Out or System.Console.Error TextWriter. + The System.Console.Out and System.Console.Error streams can be + programmatically redirected (for example NUnit does this to capture program output). + This appender will ignore these redirections because it needs to use Win32 + API calls to colorize the output. To respect these redirections the + must be used. + + + When configuring the colored console appender, mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + combination of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + HighIntensity + + + + Rick Hobbs + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + The console output stream writer to write to + + + + This writer is not thread safe. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible color values for use with the color mapping method + + + + The following flags can be combined together to + form the colors. + + + + + + + color is blue + + + + + color is green + + + + + color is red + + + + + color is white + + + + + color is yellow + + + + + color is purple + + + + + color is cyan + + + + + color is intensified + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + Initialize the options for the object + + + + Combine the and together. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + The combined and suitable for + setting the console color. + + + + + Appends logging events to the console. + + + + ConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + Nicko Cadell + Gert Driesen + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + debug system. + + + Events are written using the + method. The event's logger name is passed as the value for the category name to the Write method. + + + Nicko Cadell + + + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + If is true then the + is called. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Writes events to the system event log. + + + + The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. + See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog + + + The EventID of the event log entry can be + set using the EventID property () + on the . + + + The Category of the event log entry can be + set using the Category property () + on the . + + + There is a limit of 32K characters for an event log message + + + When configuring the EventLogAppender a mapping can be + specified to map a logging level to an event log entry type. For example: + + + <mapping> + <level value="ERROR" /> + <eventLogEntryType value="Error" /> + </mapping> + <mapping> + <level value="DEBUG" /> + <eventLogEntryType value="Information" /> + </mapping> + + + The Level is the standard log4net logging level and eventLogEntryType can be any value + from the enum, i.e.: + + Erroran error event + Warninga warning event + Informationan informational event + + + + Aspi Havewala + Douglas de la Torre + Nicko Cadell + Gert Driesen + Thomas Voss + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class + with the specified . + + The to use with this appender. + + + Obsolete constructor. + + + + + + Add a mapping of level to - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the event log entry type for a level. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create an event log source + + + Uses different API calls under NET_2_0 + + + + + This method is called by the + method. + + the event to log + + Writes the event to the system event log using the + . + + If the event has an EventID property (see ) + set then this integer will be used as the event log event id. + + + There is a limit of 32K characters for an event log message + + + + + + Get the equivalent for a + + the Level to convert to an EventLogEntryType + The equivalent for a + + Because there are fewer applicable + values to use in logging levels than there are in the + this is a one way mapping. There is + a loss of information during the conversion. + + + + + The log name is the section in the event logs where the messages + are stored. + + + + + Name of the application to use when logging. This appears in the + application column of the event log named by . + + + + + The name of the machine which holds the event log. This is + currently only allowed to be '.' i.e. the current machine. + + + + + Mapping from level object to EventLogEntryType + + + + + The security context to use for privileged calls + + + + + The event ID to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The event category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The fully qualified type of the EventLogAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The maximum size supported by default. + + + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx + The 32766 documented max size is two bytes shy of 32K (I'm assuming 32766 + may leave space for a two byte null terminator of #0#0). The 32766 max + length is what the .NET 4.0 source code checks for, but this is WRONG! + Strings with a length > 31839 on Windows Vista or higher can CORRUPT + the event log! See: System.Diagnostics.EventLogInternal.InternalWriteEvent() + for the use of the 32766 max size. + + + + + The maximum size supported by a windows operating system that is vista + or newer. + + + See ReportEvent API: + http://msdn.microsoft.com/en-us/library/aa363679(VS.85).aspx + ReportEvent's lpStrings parameter: + "A pointer to a buffer containing an array of + null-terminated strings that are merged into the message before Event Viewer + displays the string to the user. This parameter must be a valid pointer + (or NULL), even if wNumStrings is zero. Each string is limited to 31,839 characters." + + Going beyond the size of 31839 will (at some point) corrupt the event log on Windows + Vista or higher! It may succeed for a while...but you will eventually run into the + error: "System.ComponentModel.Win32Exception : A device attached to the system is + not functioning", and the event log will then be corrupt (I was able to corrupt + an event log using a length of 31877 on Windows 7). + + The max size for Windows Vista or higher is documented here: + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx. + Going over this size may succeed a few times but the buffer will overrun and + eventually corrupt the log (based on testing). + + The maxEventMsgSize size is based on the max buffer size of the lpStrings parameter of the ReportEvent API. + The documented max size for EventLog.WriteEntry for Windows Vista and higher is 31839, but I'm leaving room for a + terminator of #0#0, as we cannot see the source of ReportEvent (though we could use an API monitor to examine the + buffer, given enough time). + + + + + The maximum size that the operating system supports for + a event log message. + + + Used to determine the maximum string length that can be written + to the operating system event log and eventually truncate a string + that exceeds the limits. + + + + + This method determines the maximum event log message size allowed for + the current environment. + + + + + + The name of the log where messages will be stored. + + + The string name of the log where messages will be stored. + + + This is the name of the log as it appears in the Event Viewer + tree. The default value is to log into the Application + log, this is where most applications write their events. However + if you need a separate log for your application (or applications) + then you should set the appropriately. + This should not be used to distinguish your event log messages + from those of other applications, the + property should be used to distinguish events. This property should be + used to group together events into a single log. + + + + + + Property used to set the Application name. This appears in the + event logs when logging. + + + The string used to distinguish events from different sources. + + + Sets the event log source property. + + + + + This property is used to return the name of the computer to use + when accessing the event logs. Currently, this is the current + computer, denoted by a dot "." + + + The string name of the machine holding the event log that + will be logged into. + + + This property cannot be changed. It is currently set to '.' + i.e. the local machine. This may be changed in future. + + + + + Gets or sets the used to write to the EventLog. + + + The used to write to the EventLog. + + + + The system security context used to write to the EventLog. + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The EventID of the event log entry will normally be + set using the EventID property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The Category of the event log entry will normally be + set using the Category property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and its event log entry type. + + + + + + The for this entry + + + + Required property. + The for this entry + + + + + + Appends logging events to a file. + + + + Logging events are sent to the file specified by + the property. + + + The file can be opened in either append or overwrite mode + by specifying the property. + If the file path is relative it is taken as relative from + the application base directory. The file encoding can be + specified by setting the property. + + + The layout's and + values will be written each time the file is opened and closed + respectively. If the property is + then the file may contain multiple copies of the header and footer. + + + This appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + The supports pluggable file locking models via + the property. + The default behavior, implemented by + is to obtain an exclusive write lock on the file until this appender is closed. + The alternative models only hold a + write lock while the appender is writing a logging event () + or synchronize by using a named system wide Mutex (). + + + All locking strategies have issues and you should seriously consider using a different strategy that + avoids having multiple processes logging to the same file. + + + Nicko Cadell + Gert Driesen + Rodrigo B. de Oliveira + Douglas de la Torre + Niall Daley + + + + Sends logging events to a . + + + + An Appender that writes to a . + + + This appender may be used stand alone if initialized with an appropriate + writer, however it is typically used as a base class for an appender that + can open a to write to. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class and + sets the output destination to a new initialized + with the specified . + + The layout to use with this appender. + The to output to. + + + Obsolete constructor. + + + + + + Initializes a new instance of the class and sets + the output destination to the specified . + + The layout to use with this appender + The to output to + + The must have been previously opened. + + + + Obsolete constructor. + + + + + + This method determines if there is a sense in attempting to append. + + + + This method checks if an output target has been set and if a + layout has been set. + + + false if any of the preconditions fail. + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + This method writes all the bulk logged events to the output writer + before flushing the stream. + + + + + + Close this appender instance. The underlying stream or writer is also closed. + + + Closed appenders cannot be reused. + + + + + Writes the footer and closes the underlying . + + + + Writes the footer and closes the underlying . + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Clears internal references to the underlying + and other variables. + + + + Subclasses can override this method for an alternate closing behavior. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Called to allow a subclass to lazily initialize the writer + + + + This method is called when an event is logged and the or + have not been set. This allows a subclass to + attempt to initialize the writer multiple times. + + + + + + This is the where logging events + will be written to. + + + + + Immediate flush means that the underlying + or output stream will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logging events are not actually persisted if and when the application + crashes. + + + The default value is true. + + + + + + The fully qualified type of the TextWriterAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or set whether the appender will flush at the end + of each append operation. + + + + The default behavior is to flush at the end of each + append operation. + + + If this option is set to false, then the underlying + stream can defer persisting the logging event to a later + time. + + + + Avoiding the flush operation at the end of each append results in + a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + Sets the where the log output will go. + + + + The specified must be open and writable. + + + The will be closed when the appender + instance is closed. + + + Note: Logging to an unopened will fail. + + + + + + Gets or set the and the underlying + , if any, for this appender. + + + The for this appender. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Gets or sets the where logging events + will be written to. + + + The where logging events are written. + + + + This is the where logging events + will be written to. + + + + + + Default constructor + + + + Default constructor + + + + + + Construct a new appender using the layout, file and append mode. + + the layout to use with this appender + the full path to the file to write to + flag to indicate if the file should be appended to + + + Obsolete constructor. + + + + + + Construct a new appender using the layout and file specified. + The file will be appended to. + + the layout to use with this appender + the full path to the file to write to + + + Obsolete constructor. + + + + + + Activate the options on the file appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This will cause the file to be opened. + + + + + + Closes any previously opened file and calls the parent's . + + + + Resets the filename and the file stream. + + + + + + Called to initialize the file writer + + + + Will be called for each logged message until the file is + successfully opened. + + + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + Acquires the output file locks once before writing all the events to + the stream. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Closes the previously opened file. + + + + Writes the to the file and then + closes the file. + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + Calls but guarantees not to throw an exception. + Errors are passed to the . + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + If there was already an opened file, then the previous file + is closed first. + + + This method will ensure that the directory structure + for the specified exists. + + + + + + Sets the quiet writer used for file output + + the file stream that has been opened for writing + + + This implementation of creates a + over the and passes it to the + method. + + + This method can be overridden by sub classes that want to wrap the + in some way, for example to encrypt the output + data using a System.Security.Cryptography.CryptoStream. + + + + + + Sets the quiet writer being used. + + the writer over the file stream that has been opened for writing + + + This method can be overridden by sub classes that want to + wrap the in some way. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + Flag to indicate if we should append to the file + or overwrite the file. The default is to append. + + + + + The name of the log file. + + + + + The encoding to use for the file stream. + + + + + The security context to use for privileged calls + + + + + The stream to log to. Has added locking semantics + + + + + The locking model to use + + + + + The fully qualified type of the FileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the path to the file that logging will be written to. + + + The path to the file that logging will be written to. + + + + If the path is relative it is taken as relative from + the application base directory. + + + + + + Gets or sets a flag that indicates whether the file should be + appended to or overwritten. + + + Indicates whether the file should be appended to or overwritten. + + + + If the value is set to false then the file will be overwritten, if + it is set to true then the file will be appended to. + + The default value is true. + + + + + Gets or sets used to write to the file. + + + The used to write to the file. + + + + The default encoding set is + which is the encoding for the system's current ANSI code page. + + + + + + Gets or sets the used to write to the file. + + + The used to write to the file. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the used to handle locking of the file. + + + The used to lock the file. + + + + Gets or sets the used to handle locking of the file. + + + There are three built in locking models, , and . + The first locks the file from the start of logging to the end, the + second locks only for the minimal amount of time when logging each message + and the last synchronizes processes using a named system wide Mutex. + + + The default locking model is the . + + + + + + Write only that uses the + to manage access to an underlying resource. + + + + + True asynchronous writes are not supported, the implementation forces a synchronous write. + + + + + Exception base type for log4net. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class with + the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Locking model base class + + + + Base class for the locking models available to the derived loggers. + + + + + + Open the output file + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Helper method that creates a FileStream under CurrentAppender's SecurityContext. + + + + Typically called during OpenFile or AcquireLock. + + + If the directory portion of the does not exist, it is created + via Directory.CreateDirecctory. + + + + + + + + + + Helper method to close under CurrentAppender's SecurityContext. + + + Does not set to null. + + + + + + Gets or sets the for this LockingModel + + + The for this LockingModel + + + + The file appender this locking model is attached to and working on + behalf of. + + + The file appender is used to locate the security context and the error handler to use. + + + The value of this property will be set before is + called. + + + + + + Hold an exclusive lock on the output file + + + + Open the file once for writing and hold it open until is called. + Maintains an exclusive lock on the file during this time. + + + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + Release the lock on the file + + + + Does nothing. The lock will be released when the file is closed. + + + + + + Acquires the file lock for each write + + + + Opens the file once for each / cycle, + thus holding the lock for the minimal amount of time. This method of locking + is considerably slower than but allows + other processes to move/delete the log file whilst logging continues. + + + + + + Prepares to open the file when the first message is logged. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Provides cross-process file locking. + + Ron Grabowski + Steve Wranovsky + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + - and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + + + + + + This appender forwards logging events to attached appenders. + + + + The forwarding appender can be used to specify different thresholds + and filters for the same appender at different locations within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Forward the logging event to the attached appenders + + The event to log. + + + Delivers the logging event to all the attached appenders. + + + + + + Forward the logging events to the attached appenders + + The array of events to log. + + + Delivers the logging events to all the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Logs events to a local syslog service. + + + + This appender uses the POSIX libc library functions openlog, syslog, and closelog. + If these functions are not available on the local system then this appender will not work! + + + The functions openlog, syslog, and closelog are specified in SUSv2 and + POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. + + + This appender talks to a local syslog service. If you need to log to a remote syslog + daemon and you cannot configure your local syslog service to do this you may be + able to use the to log via UDP. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a local syslog service. + + + + + Add a mapping of level to severity + + The mapping to add + + + Adds a to this appender. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Close the syslog when the appender is closed + + + + Close the syslog when the appender is closed + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + + The facility. The default facility is . + + + + + The message identity + + + + + Marshaled handle to the identity string. We have to hold on to the + string as the openlog and syslog APIs just hold the + pointer to the ident and dereference it for each log message. + + + + + Mapping from level object to syslog severity + + + + + Open connection to system logger. + + + + + Generate a log message. + + + + The libc syslog method takes a format string and a variable argument list similar + to the classic printf function. As this type of vararg list is not supported + by C# we need to specify the arguments explicitly. Here we have specified the + format string with a single message argument. The caller must set the format + string to "%s". + + + + + + Close descriptor used to write to system logger. + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + syslog severities + + + + The log4net Level maps to a syslog severity using the + method and the + class. The severity is set on . + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facility defines which subsystem the logging comes from. + This is set on the property. + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Appends colorful logging events to the console, using the .NET 2 + built-in capabilities. + + + + ManagedColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + When configuring the colored console appender, mappings should be + specified to map logging levels to colors. For example: + + + + + + + + + + + + + + + + + + + + + + The Level is the standard log4net logging level while + ForeColor and BackColor are the values of + enumeration. + + + Based on the ColoredConsoleAppender + + + Rick Hobbs + Nicko Cadell + Pavlos Touboulidis + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + Stores logging events in an array. + + + + The memory appender stores all the logging events + that are appended in an in-memory array. + + + Use the method to get + the current list of events that have been appended. + + + Use the method to clear the + current list of events. + + + Julian Biddle + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Gets the events that have been logged. + + The events that have been logged + + + Gets the events that have been logged. + + + + + + This method is called by the method. + + the event to log + + Stores the in the events list. + + + + + Clear the list of events + + + Clear the list of events + + + + + The list of events that have been appended. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + Gets or sets a value indicating whether only part of the logging event + data should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the event + data to be fixed and stored in the appender, hereby improving performance. + + + See for more information. + + + + + + Gets or sets the fields that will be fixed in the event + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + Logs entries by sending network messages using the + native function. + + + + You can send messages only to names that are active + on the network. If you send the message to a user name, + that user must be logged on and running the Messenger + service to receive the message. + + + The receiver will get a top most window displaying the + messages one at a time, therefore this appender should + not be used to deliver a high volume of messages. + + + The following table lists some possible uses for this appender : + + + + + Action + Property Value(s) + + + Send a message to a user account on the local machine + + + = <name of the local machine> + + + = <user name> + + + + + Send a message to a user account on a remote machine + + + = <name of the remote machine> + + + = <user name> + + + + + Send a message to a domain user account + + + = <name of a domain controller | uninitialized> + + + = <user name> + + + + + Send a message to all the names in a workgroup or domain + + + = <workgroup name | domain name>* + + + + + Send a message from the local machine to a remote machine + + + = <name of the local machine | uninitialized> + + + = <name of the remote machine> + + + + + + + Note : security restrictions apply for sending + network messages, see + for more information. + + + + + An example configuration section to log information + using this appender from the local machine, named + LOCAL_PC, to machine OPERATOR_PC : + + + + + + + + + + Nicko Cadell + Gert Driesen + + + + The DNS or NetBIOS name of the server on which the function is to execute. + + + + + The sender of the network message. + + + + + The message alias to which the message should be sent. + + + + + The security context to use for privileged calls + + + + + Initializes the appender. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified. + + + The required property was not specified. + + + + This method is called by the method. + + The event to log. + + + Sends the event using a network message. + + + + + + Sends a buffer of information to a registered message alias. + + The DNS or NetBIOS name of the server on which the function is to execute. + The message alias to which the message buffer should be sent + The originator of the message. + The message text. + The length, in bytes, of the message text. + + + The following restrictions apply for sending network messages: + + + + + Platform + Requirements + + + Windows NT + + + No special group membership is required to send a network message. + + + Admin, Accounts, Print, or Server Operator group membership is required to + successfully send a network message on a remote server. + + + + + Windows 2000 or later + + + If you send a message on a domain controller that is running Active Directory, + access is allowed or denied based on the access control list (ACL) for the securable + object. The default ACL permits only Domain Admins and Account Operators to send a network message. + + + On a member server or workstation, only Administrators and Server Operators can send a network message. + + + + + + + For more information see Security Requirements for the Network Management Functions. + + + + + If the function succeeds, the return value is zero. + + + + + + Gets or sets the sender of the message. + + + The sender of the message. + + + If this property is not specified, the message is sent from the local computer. + + + + + Gets or sets the message alias to which the message should be sent. + + + The recipient of the message. + + + This property should always be specified in order to send a message. + + + + + Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. + + + DNS or NetBIOS name of the remote server on which the function is to execute. + + + + For Windows NT 4.0 and earlier, the string should begin with \\. + + + If this property is not specified, the local computer is used. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the OutputDebugString system. + + + + OutputDebugStringAppender appends log events to the + OutputDebugString system. + + + The string is passed to the native OutputDebugString + function. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the output debug string API + + the event to log + + + Write the logging event to the output debug string API + + + + + + Stub for OutputDebugString native method + + the string to output + + + Stub for OutputDebugString native method + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Logs events to a remote syslog daemon. + + + + The BSD syslog protocol is used to remotely log to + a syslog daemon. The syslogd listens for for messages + on UDP port 514. + + + The syslog UDP protocol is not authenticated. Most syslog daemons + do not accept remote log messages because of the security implications. + You may be able to use the LocalSyslogAppender to talk to a local + syslog service. + + + There is an RFC 3164 that claims to document the BSD Syslog Protocol. + This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. + This appender generates what the RFC calls an "Original Device Message", + i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation + this format of message will be accepted by all current syslog daemon + implementations. The daemon will attach the current time and the source + hostname or IP address to any messages received. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Sends logging events as connectionless UDP datagrams to a remote host or a + multicast group using an . + + + + UDP guarantees neither that messages arrive, nor that they arrive in the correct order. + + + To view the logging results, a custom application can be developed that listens for logging + events. + + + When decoding events send via this appender remember to use the same encoding + to decode the events as was used to send the events. See the + property to specify the encoding to use. + + + + This example shows how to log receive logging events that are sent + on IP address 244.0.0.1 and port 8080 to the console. The event is + encoded in the packet as a unicode string and it is decoded as such. + + IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); + UdpClient udpClient; + byte[] buffer; + string loggingEvent; + + try + { + udpClient = new UdpClient(8080); + + while(true) + { + buffer = udpClient.Receive(ref remoteEndPoint); + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); + Console.WriteLine(loggingEvent); + } + } + catch(Exception e) + { + Console.WriteLine(e.ToString()); + } + + + Dim remoteEndPoint as IPEndPoint + Dim udpClient as UdpClient + Dim buffer as Byte() + Dim loggingEvent as String + + Try + remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) + udpClient = new UdpClient(8080) + + While True + buffer = udpClient.Receive(ByRef remoteEndPoint) + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) + Console.WriteLine(loggingEvent) + Wend + Catch e As Exception + Console.WriteLine(e.ToString()) + End Try + + + An example configuration section to log information using this appender to the + IP 224.0.0.1 on port 8080: + + + + + + + + + + Gert Driesen + Nicko Cadell + + + + Initializes a new instance of the class. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified or + an invalid remote or local TCP port number was specified. + + + The required property was not specified. + The TCP port number assigned to or is less than or greater than . + + + + This method is called by the method. + + The event to log. + + + Sends the event using an UDP datagram. + + + Exceptions are passed to the . + + + + + + Closes the UDP connection and releases all resources associated with + this instance. + + + + Disables the underlying and releases all managed + and unmanaged resources associated with the . + + + + + + Initializes the underlying connection. + + + + The underlying is initialized and binds to the + port number from which you intend to communicate. + + + Exceptions are passed to the . + + + + + + The IP address of the remote host or multicast group to which + the logging event will be sent. + + + + + The TCP port number of the remote host or multicast group to + which the logging event will be sent. + + + + + The cached remote endpoint to which the logging events will be sent. + + + + + The TCP port number from which the will communicate. + + + + + The instance that will be used for sending the + logging events. + + + + + The encoding to use for the packet. + + + + + Gets or sets the IP address of the remote host or multicast group to which + the underlying should sent the logging event. + + + The IP address of the remote host or multicast group to which the logging event + will be sent. + + + + Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to + 239.255.255.255). Multicast packets can pass across different networks through routers, so + it is possible to use multicasts in an Internet scenario as long as your network provider + supports multicasting. + + + Hosts that want to receive particular multicast messages must register their interest by joining + the multicast group. Multicast messages are not sent to networks where no host has joined + the multicast group. Class D IP addresses are used for multicast groups, to differentiate + them from normal host addresses, allowing nodes to easily detect if a message is of interest. + + + Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: + + + + + IP Address + Description + + + 224.0.0.1 + + + Sends a message to all system on the subnet. + + + + + 224.0.0.2 + + + Sends a message to all routers on the subnet. + + + + + 224.0.0.12 + + + The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. + + + + + + + A complete list of actually reserved multicast addresses and their owners in the ranges + defined by RFC 3171 can be found at the IANA web site. + + + The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative + addresses. These addresses can be reused with other local groups. Routers are typically + configured with filters to prevent multicast traffic in this range from flowing outside + of the local network. + + + + + + Gets or sets the TCP port number of the remote host or multicast group to which + the underlying should sent the logging event. + + + An integer value in the range to + indicating the TCP port number of the remote host or multicast group to which the logging event + will be sent. + + + The underlying will send messages to this TCP port number + on the remote host or multicast group. + + The value specified is less than or greater than . + + + + Gets or sets the TCP port number from which the underlying will communicate. + + + An integer value in the range to + indicating the TCP port number from which the underlying will communicate. + + + + The underlying will bind to this port for sending messages. + + + Setting the value to 0 (the default) will cause the udp client not to bind to + a local port. + + + The value specified is less than or greater than . + + + + Gets or sets used to write the packets. + + + The used to write the packets. + + + + The used to write the packets. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to send logging events + over a network. Classes deriving from can use this + property to get or set this . Use the underlying + returned from if you require access beyond that which + provides. + + + + + Gets or sets the cached remote endpoint to which the logging events should be sent. + + + The cached remote endpoint to which the logging events will be sent. + + + The method will initialize the remote endpoint + with the values of the and + properties. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Syslog port 514 + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a remote syslog daemon. + + + + + Add a mapping of level to severity + + The mapping to add + + + Add a mapping to this appender. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to syslog severity mappings set on this appender. + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + Generate a syslog priority. + + + + + + The facility. The default facility is . + + + + + The message identity + + + + + Mapping from level object to syslog severity + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + syslog severities + + + + The syslog severities. + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facilities + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Delivers logging events to a remote logging sink. + + + + This Appender is designed to deliver events to a remote sink. + That is any object that implements the + interface. It delivers the events using .NET remoting. The + object to deliver events to is specified by setting the + appenders property. + + The RemotingAppender buffers events before sending them. This allows it to + make more efficient use of the remoting infrastructure. + + Once the buffer is full the events are still not sent immediately. + They are scheduled to be sent using a pool thread. The effect is that + the send occurs asynchronously. This is very important for a + number of non obvious reasons. The remoting infrastructure will + flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + Because the events are sent asynchronously using pool threads it is possible to close + this appender before all the queued events have been sent. + When closing the appender attempts to wait until all the queued events have been sent, but + this will timeout after 30 seconds regardless. + + If this appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. If the runtime terminates the threads before + the queued events have been sent then they will be lost. To ensure that all events + are sent the appender must be closed before the application exits. See + for details on how to shutdown + log4net programmatically. + + + Nicko Cadell + Gert Driesen + Daniel Cazzulino + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Send the contents of the buffer to the remote sink. + + + The events are not sent immediately. They are scheduled to be sent + using a pool thread. The effect is that the send occurs asynchronously. + This is very important for a number of non obvious reasons. The remoting + infrastructure will flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + The events to send. + + + + Override base class close. + + + + This method waits while there are queued work items. The events are + sent asynchronously using work items. These items + will be sent once a thread pool thread is available to send them, therefore + it is possible to close the appender before all the queued events have been + sent. + + This method attempts to wait until all the queued events have been sent, but this + method will timeout after 30 seconds regardless. + + If the appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. + + + + + A work item is being queued into the thread pool + + + + + A work item from the thread pool has completed + + + + + Send the contents of the buffer to the remote sink. + + + This method is designed to be used with the . + This method expects to be passed an array of + objects in the state param. + + the logging events to send + + + + The URL of the remote sink. + + + + + The local proxy (.NET remoting) for the remote logging sink. + + + + + The number of queued callbacks currently waiting or executing + + + + + Event used to signal when there are no queued work items + + + This event is set when there are no queued work items. In this + state it is safe to close the appender. + + + + + Gets or sets the URL of the well-known object that will accept + the logging events. + + + The well-known URL of the remote sink. + + + + The URL of the remoting sink that will accept logging events. + The sink must implement the + interface. + + + + + + Interface used to deliver objects to a remote sink. + + + This interface must be implemented by a remoting sink + if the is to be used + to deliver logging events to the sink. + + + + + Delivers logging events to the remote sink + + Array of events to log. + + + Delivers logging events to the remote sink + + + + + + Appender that rolls log files based on size or date or both. + + + + RollingFileAppender can roll log files based on size or date or both + depending on the setting of the property. + When set to the log file will be rolled + once its size exceeds the . + When set to the log file will be rolled + once the date boundary specified in the property + is crossed. + When set to the log file will be + rolled once the date boundary specified in the property + is crossed, but within a date boundary the file will also be rolled + once its size exceeds the . + When set to the log file will be rolled when + the appender is configured. This effectively means that the log file can be + rolled once per program execution. + + + A of few additional optional features have been added: + + Attach date pattern for current log file + Backup number increments for newer files + Infinite number of backups by file size + + + + + + For large or infinite numbers of backup files a + greater than zero is highly recommended, otherwise all the backup files need + to be renamed each time a new backup is created. + + + When Date/Time based rolling is used setting + to will reduce the number of file renamings to few or none. + + + + + + Changing or without clearing + the log file directory of backup files will cause unexpected and unwanted side effects. + + + + + If Date/Time based rolling is enabled this appender will attempt to roll existing files + in the directory without a Date/Time tag based on the last write date of the base log file. + The appender only rolls the log file when a message is logged. If Date/Time based rolling + is enabled then the appender will not roll the log file at the Date/Time boundary but + at the point when the next message is logged after the boundary has been crossed. + + + + The extends the and + has the same behavior when opening the log file. + The appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + When rolling a backup file necessitates deleting an older backup file the + file to be deleted is moved to a temporary name before being deleted. + + + + + A maximum number of backup files when rolling on date/time boundaries is not supported. + + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + Edward Smit + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + The fully qualified type of the RollingFileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Sets the quiet writer being used. + + + This method can be overridden by sub classes. + + the writer to set + + + + Write out a logging event. + + the event to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Write out an array of logging events. + + the events to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Performs any required rolling before outputting the next event + + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Creates and opens the file for logging. If + is false then the fully qualified name is determined and used. + + the name of the file to open + true to append to existing file + + This method will ensure that the directory structure + for the specified exists. + + + + + Get the current output file name + + the base file name + the output file name + + The output file name is based on the base fileName specified. + If is set then the output + file name is the same as the base file passed in. Otherwise + the output file depends on the date pattern, on the count + direction or both. + + + + + Determines curSizeRollBackups (only within the current roll point) + + + + + Generates a wildcard pattern that can be used to find all files + that are similar to the base file name. + + + + + + + Builds a list of filenames for all files matching the base filename plus a file + pattern. + + + + + + + Initiates a roll over if needed for crossing a date boundary since the last run. + + + + + Initializes based on existing conditions at time of . + + + + Initializes based on existing conditions at time of . + The following is done + + determine curSizeRollBackups (only within the current roll point) + initiates a roll over if needed for crossing a date boundary since the last run. + + + + + + + Does the work of bumping the 'current' file counter higher + to the highest count when an incremental file name is seen. + The highest count is either the first file (when count direction + is greater than 0) or the last file (when count direction less than 0). + In either case, we want to know the highest count that is present. + + + + + + + Attempts to extract a number from the end of the file name that indicates + the number of the times the file has been rolled over. + + + Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + + + + + + Takes a list of files and a base file name, and looks for + 'incremented' versions of the base file. Bumps the max + count up to the highest count seen. + + + + + + + Calculates the RollPoint for the datePattern supplied. + + the date pattern to calculate the check period for + The RollPoint that is most accurate for the date pattern supplied + + Essentially the date pattern is examined to determine what the + most suitable roll point is. The roll point chosen is the roll point + with the smallest period that can be detected using the date pattern + supplied. i.e. if the date pattern only outputs the year, month, day + and hour then the smallest roll point that can be detected would be + and hourly roll point as minutes could not be detected. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Sets initial conditions including date/time roll over information, first check, + scheduledFilename, and calls to initialize + the current number of backups. + + + + + + + + + .1, .2, .3, etc. + + + + + Rollover the file(s) to date/time tagged file(s). + + set to true if the file to be rolled is currently open + + + Rollover the file(s) to date/time tagged file(s). + Resets curSizeRollBackups. + If fileIsOpen is set then the new file is opened (through SafeOpenFile). + + + + + + Renames file to file . + + Name of existing file to roll. + New name for file. + + + Renames file to file . It + also checks for existence of target file and deletes if it does. + + + + + + Test if a file exists at a specified path + + the path to the file + true if the file exists + + + Test if a file exists at a specified path + + + + + + Deletes the specified file if it exists. + + The file to delete. + + + Delete a file if is exists. + The file is first moved to a new filename then deleted. + This allows the file to be removed even when it cannot + be deleted, but it still can be moved. + + + + + + Implements file roll base on file size. + + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. Moreover, File is + renamed File.1 and closed. + + + A new file is created to receive further log output. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + + + + Implements file roll. + + the base name to rename + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + This is called by to rename the files. + + + + + + Get the start time of the next window for the current rollpoint + + the current date + the type of roll point we are working with + the start time for the next roll point an interval after the currentDateTime date + + + Returns the date of the next roll point after the currentDateTime date passed to the method. + + + The basic strategy is to subtract the time parts that are less significant + than the rollpoint from the current time. This should roll the time back to + the start of the time window for the current rollpoint. Then we add 1 window + worth of time and get the start time of the next window for the rollpoint. + + + + + + This object supplies the current date/time. Allows test code to plug in + a method to control this class when testing date/time based rolling. The default + implementation uses the underlying value of DateTime.Now. + + + + + The date pattern. By default, the pattern is set to ".yyyy-MM-dd" + meaning daily rollover. + + + + + The actual formatted filename that is currently being written to + or will be the file transferred to on roll over + (based on staticLogFileName). + + + + + The timestamp when we shall next recompute the filename. + + + + + Holds date of last roll over + + + + + The type of rolling done + + + + + The default maximum file size is 10MB + + + + + There is zero backup files by default + + + + + How many sized based backups have been made so far + + + + + The rolling file count direction. + + + + + The rolling mode used in this appender. + + + + + Cache flag set if we are rolling by date. + + + + + Cache flag set if we are rolling by size. + + + + + Value indicating whether to always log to the same file. + + + + + Value indicating whether to preserve the file name extension when rolling. + + + + + FileName provided in configuration. Used for rolling properly + + + + + The 1st of January 1970 in UTC + + + + + Gets or sets the strategy for determining the current date and time. The default + implementation is to use LocalDateTime which internally calls through to DateTime.Now. + DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying + . + + + An implementation of the interface which returns the current date and time. + + + + Gets or sets the used to return the current date and time. + + + There are two built strategies for determining the current date and time, + + and . + + + The default strategy is . + + + + + + Gets or sets the date pattern to be used for generating file names + when rolling over on date. + + + The date pattern to be used for generating file names when rolling + over on date. + + + + Takes a string in the same format as expected by + . + + + This property determines the rollover schedule when rolling over + on date. + + + + + + Gets or sets the maximum number of backup files that are kept before + the oldest is erased. + + + The maximum number of backup files that are kept before the oldest is + erased. + + + + If set to zero, then there will be no backup files and the log file + will be truncated when it reaches . + + + If a negative number is supplied then no deletions will be made. Note + that this could result in very slow performance as a large number of + files are rolled over unless is used. + + + The maximum applies to each time based group of files and + not the total. + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size in bytes that the output file is allowed to reach before being + rolled over to backup files. + + + + This property is equivalent to except + that it is required for differentiating the setter taking a + argument from the setter taking a + argument. + + + The default maximum file size is 10MB (10*1024*1024). + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size that the output file is allowed to reach before being + rolled over to backup files. + + + + This property allows you to specify the maximum size with the + suffixes "KB", "MB" or "GB" so that the size is interpreted being + expressed respectively in kilobytes, megabytes or gigabytes. + + + For example, the value "10KB" will be interpreted as 10240 bytes. + + + The default maximum file size is 10MB. + + + If you have the option to set the maximum file size programmatically + consider using the property instead as this + allows you to set the size in bytes as a . + + + + + + Gets or sets the rolling file count direction. + + + The rolling file count direction. + + + + Indicates if the current file is the lowest numbered file or the + highest numbered file. + + + By default newer files have lower numbers ( < 0), + i.e. log.1 is most recent, log.5 is the 5th backup, etc... + + + >= 0 does the opposite i.e. + log.1 is the first backup made, log.5 is the 5th backup made, etc. + For infinite backups use >= 0 to reduce + rollover costs. + + The default file count direction is -1. + + + + + Gets or sets the rolling style. + + The rolling style. + + + The default rolling style is . + + + When set to this appender's + property is set to false, otherwise + the appender would append to a single file rather than rolling + the file each time it is opened. + + + + + + Gets or sets a value indicating whether to preserve the file name extension when rolling. + + + true if the file name extension should be preserved. + + + + By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. + However, under Windows the new file name will loose any program associations as the + extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or + file.curSizeRollBackup.log to maintain any program associations. + + + + + + Gets or sets a value indicating whether to always log to + the same file. + + + true if always should be logged to the same file, otherwise false. + + + + By default file.log is always the current file. Optionally + file.log.yyyy-mm-dd for current formatted datePattern can by the currently + logging file (or file.log.curSizeRollBackup or even + file.log.yyyy-mm-dd.curSizeRollBackup). + + + This will make time based rollovers with a large number of backups + much faster as the appender it won't have to rename all the backups! + + + + + + Style of rolling to use + + + + Style of rolling to use + + + + + + Roll files once per program execution + + + + Roll files once per program execution. + Well really once each time this appender is + configured. + + + Setting this option also sets AppendToFile to + false on the RollingFileAppender, otherwise + this appender would just be a normal file appender. + + + + + + Roll files based only on the size of the file + + + + + Roll files based only on the date + + + + + Roll files based on both the size and date of the file + + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + + + Roll the log not based on the date + + + + + Roll the log for each minute + + + + + Roll the log for each hour + + + + + Roll the log twice a day (midday and midnight) + + + + + Roll the log each day (midnight) + + + + + Roll the log each week + + + + + Roll the log each month + + + + + This interface is used to supply Date/Time information to the . + + + This interface is used to supply Date/Time information to the . + Used primarily to allow test classes to plug themselves in so they can + supply test date/times. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Default implementation of that returns the current time. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Implementation of that returns the current time as the coordinated universal time (UTC). + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Send an e-mail when a specific logging event occurs, typically on errors + or fatal errors. + + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. + For these features to be enabled you need to ensure that you are using a version of + the log4net assembly that is built against the MS .NET 1.1 framework and that you are + running the your application on the MS .NET 1.1 runtime. On all other platforms only sending + unauthenticated messages to a server listening on port 25 (the default) is supported. + + + Authentication is supported by setting the property to + either or . + If using authentication then the + and properties must also be set. + + + To set the SMTP server port use the property. The default port is 25. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + + Send the email message + + the body text to include in the mail + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses + that will be carbon copied (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses + that will be blind carbon copied. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of recipient e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the name of the SMTP relay mail server to use to send + the e-mail messages. + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + + + Obsolete + + + Use the BufferingAppenderSkeleton Fix methods instead + + + + Obsolete property. + + + + + + The mode to use to authentication with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + Valid Authentication mode values are: , + , and . + The default value is . When using + you must specify the + and to use to authenticate. + When using the Windows credentials for the current + thread, if impersonating, or the process will be used to authenticate. + + + + + + The username to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the username will be ignored. + + + + + + The password to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the password will be ignored. + + + + + + The port on which the SMTP server is listening + + + Server Port is only available on the MS .NET 1.1 runtime. + + The port on which the SMTP server is listening. The default + port is 25. The Port can only be changed when running on + the MS .NET 1.1 runtime. + + + + + + Gets or sets the priority of the e-mail message + + + One of the values. + + + + Sets the priority of the e-mails generated by this + appender. The default priority is . + + + If you are using this appender to report errors then + you may want to set the priority to . + + + + + + Enable or disable use of SSL when sending e-mail message + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the reply-to e-mail address. + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the subject encoding to be used. + + + The default encoding is the operating system's current ANSI codepage. + + + + + Gets or sets the body encoding to be used. + + + The default encoding is the operating system's current ANSI codepage. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Values for the property. + + + + SMTP authentication modes. + + + + + + No authentication + + + + + Basic authentication. + + + Requires a username and password to be supplied + + + + + Integrated authentication + + + Uses the Windows credentials from the current thread or process to authenticate. + + + + + Send an email when a specific logging event occurs, typically on errors + or fatal errors. Rather than sending via smtp it writes a file into the + directory specified by . This allows services such + as the IIS SMTP agent to manage sending the messages. + + + + The configuration for this appender is identical to that of the SMTPAppender, + except that instead of specifying the SMTPAppender.SMTPHost you specify + . + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Niall Daley + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + Sends the contents of the cyclic buffer as an e-mail message. + + + + + + Activate the options on this appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + The security context to use for privileged calls + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the path to write the messages to. + + + + Gets or sets the path to write the messages to. This should be the same + as that used by the agent sending the messages. + + + + + + Gets or sets the used to write to the pickup directory. + + + The used to write to the pickup directory. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appender that allows clients to connect via Telnet to receive log messages + + + + The TelnetAppender accepts socket connections and streams logging messages + back to the client. + The output is provided in a telnet-friendly way so that a log can be monitored + over a TCP/IP socket. + This allows simple remote monitoring of application logging. + + + The default is 23 (the telnet port). + + + Keith Long + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + The fully qualified type of the TelnetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Overrides the parent method to close the socket handler + + + + Closes all the outstanding connections. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Create the socket handler and wait for connections + + + + + + Writes the logging event to each connected client. + + The event to log. + + + Writes the logging event to each connected client. + + + + + + Gets or sets the TCP port number on which this will listen for connections. + + + An integer value in the range to + indicating the TCP port number on which this will listen for connections. + + + + The default value is 23 (the telnet port). + + + The value specified is less than + or greater than . + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Helper class to manage connected clients + + + + The SocketHandler class is used to accept connections from + clients. It is threaded so that clients can connect/disconnect + asynchronously. + + + + + + Opens a new server port on + + the local port to listen on for connections + + + Creates a socket handler on the specified local server port. + + + + + + Sends a string message to each of the connected clients + + the text to send + + + Sends a string message to each of the connected clients + + + + + + Add a client to the internal clients list + + client to add + + + + Remove a client from the internal clients list + + client to remove + + + + Callback used to accept a connection on the server socket + + The result of the asynchronous operation + + + On connection adds to the list of connections + if there are two many open connections you will be disconnected + + + + + + Close all network connections + + + + Make sure we close all network connections + + + + + + Test if this handler has active connections + + + true if this handler has active connections + + + + This property will be true while this handler has + active connections, that is at least one connection that + the handler will attempt to send a message to. + + + + + + Class that represents a client connected to this handler + + + + Class that represents a client connected to this handler + + + + + + Create this for the specified + + the client's socket + + + Opens a stream writer on the socket. + + + + + + Write a string to the client + + string to send + + + Write a string to the client + + + + + + Cleanup the clients connection + + + + Close the socket connection. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + trace system. + + + Events are written using the System.Diagnostics.Trace.Write(string,string) + method. The event's logger name is the default value for the category parameter + of the Write method. + + + Compact Framework
+ The Compact Framework does not support the + class for any operation except Assert. When using the Compact Framework this + appender will write to the system rather than + the Trace system. This appender will therefore behave like the . +
+
+ Douglas de la Torre + Nicko Cadell + Gert Driesen + Ron Grabowski +
+ + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Defaults to %logger + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Assembly level attribute that specifies a domain to alias to this assembly's repository. + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's domain to its repository by + specifying this attribute with the name of the target domain. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required domains. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies a repository to alias to this assembly's repository. + + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's repository to its repository by + specifying this attribute with the name of the target repository. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required repositories. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + The repository to alias to this assemby's repository. + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + + + + + Gets or sets the repository to alias to this assemby's repository. + + + The repository to alias to this assemby's repository. + + + + The name of the repository to alias to this assemby's repository. + + + + + + Initializes a new instance of the class with + the specified domain to alias to this assembly's repository. + + The domain to alias to this assemby's repository. + + + Obsolete. Use instead of . + + + + + + Use this class to quickly configure a . + + + + Allows very simple programmatic configuration of log4net. + + + Only one appender can be configured using this configurator. + The appender is set at the root of the hierarchy and all logging + events will be delivered to that appender. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + The fully qualified type of the BasicConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Initializes the log4net system with a default configuration. + + + + Initializes the log4net logging system using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the log4net system using the specified appender. + + The appender to use to log all logging events. + + + Initializes the log4net system using the specified appender. + + + + + + Initializes the log4net system using the specified appenders. + + The appenders to use to log all logging events. + + + Initializes the log4net system using the specified appenders. + + + + + + Initializes the with a default configuration. + + The repository to configure. + + + Initializes the specified repository using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the using the specified appender. + + The repository to configure. + The appender to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Initializes the using the specified appenders. + + The repository to configure. + The appenders to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Base class for all log4net configuration attributes. + + + This is an abstract class that must be extended by + specific configurators. This attribute allows the + configurator to be parameterized by an assembly level + attribute. + + Nicko Cadell + Gert Driesen + + + + Constructor used by subclasses. + + the ordering priority for this configurator + + + The is used to order the configurator + attributes before they are invoked. Higher priority configurators are executed + before lower priority ones. + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Abstract method implemented by a subclass. When this method is called + the subclass should configure the . + + + + + + Compare this instance to another ConfiguratorAttribute + + the object to compare to + see + + + Compares the priorities of the two instances. + Sorts by priority in descending order. Objects with the same priority are + randomly ordered. + + + + + + Assembly level attribute that specifies the logging domain for the assembly. + + + + DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + Assemblies are mapped to logging domains. Each domain has its own + logging repository. This attribute specified on the assembly controls + the configuration of the domain. The property specifies the name + of the domain that this assembly is a part of. The + specifies the type of the repository objects to create for the domain. If + this attribute is not specified and a is not specified + then the assembly will be part of the default shared logging domain. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies the logging repository for the assembly. + + + + Assemblies are mapped to logging repository. This attribute specified + on the assembly controls + the configuration of the repository. The property specifies the name + of the repository that this assembly is a part of. The + specifies the type of the object + to create for the assembly. If this attribute is not specified or a + is not specified then the assembly will be part of the default shared logging repository. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize a new instance of the class + with the name of the repository. + + The name of the repository. + + + Initialize the attribute with the name for the assembly's repository. + + + + + + Gets or sets the name of the logging repository. + + + The string name to use as the name of the repository associated with this + assembly. + + + + This value does not have to be unique. Several assemblies can share the + same repository. They will share the logging configuration of the repository. + + + + + + Gets or sets the type of repository to create for this assembly. + + + The type of repository to create for this assembly. + + + + The type of the repository to create for the assembly. + The type must implement the + interface. + + + This will be the type of repository created when + the repository is created. If multiple assemblies reference the + same repository then the repository is only created once using the + of the first assembly to call into the + repository. + + + + + + Initializes a new instance of the class. + + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Initialize a new instance of the class + with the name of the domain. + + The name of the domain. + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + The repository to configure. + + + + Configures log4net using a log4net element + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The element to parse. + + + + Configures the using the specified XML + element. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration file. + + A stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Assembly level attribute to configure the . + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + If neither of the or + properties are set the configuration is loaded from the application's .config file. + If set the property takes priority over the + property. The property + specifies a path to a file to load the config from. The path is relative to the + application's base directory; . + The property is used as a postfix to the assembly file name. + The config file must be located in the application's base directory; . + For example in a console application setting the to + config has the same effect as not specifying the or + properties. + + + The property can be set to cause the + to watch the configuration file for changes. + + + + Log4net will only look for assembly level configuration attributes once. + When using the log4net assembly level attributes to control the configuration + of log4net you must ensure that the first call to any of the + methods is made from the assembly with the configuration + attributes. + + + If you cannot guarantee the order in which log4net calls will be made from + different assemblies you must use programmatic configuration instead, i.e. + call the method directly. + + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Configure the repository using the . + The specified must extend the + class otherwise the will not be able to + configure it. + + + The does not extend . + + + + Attempt to load configuration from the local file system + + The assembly that this attribute was defined on. + The repository to configure. + + + + Configure the specified repository using a + + The repository to configure. + the FileInfo pointing to the config file + + + + Attempt to load configuration from a URI + + The assembly that this attribute was defined on. + The repository to configure. + + + + The fully qualified type of the XmlConfiguratorAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the filename of the configuration file. + + + The filename of the configuration file. + + + + If specified, this is the name of the configuration file to use with + the . This file path is relative to the + application base directory (). + + + The takes priority over the . + + + + + + Gets or sets the extension of the configuration file. + + + The extension of the configuration file. + + + + If specified this is the extension for the configuration file. + The path to the config file is built by using the application + base directory (), + the assembly file name and the config file extension. + + + If the is set to MyExt then + possible config file names would be: MyConsoleApp.exe.MyExt or + MyClassLibrary.dll.MyExt. + + + The takes priority over the . + + + + + + Gets or sets a value indicating whether to watch the configuration file. + + + true if the configuration should be watched, false otherwise. + + + + If this flag is specified and set to true then the framework + will watch the configuration file and will reload the config each time + the file is modified. + + + The config file can only be watched if it is loaded from local disk. + In a No-Touch (Smart Client) deployment where the application is downloaded + from a web server the config file may not reside on the local disk + and therefore it may not be able to watch it. + + + Watching configuration is not supported on the SSCLI. + + + + + + Class to register for the log4net section of the configuration file + + + The log4net section of the configuration file needs to have a section + handler registered. This is the section handler used. It simply returns + the XML element that is the root of the section. + + + Example of registering the log4net section handler : + + + +
+ + + log4net configuration XML goes here + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Parses the configuration section. + + The configuration settings in a corresponding parent configuration section. + The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. + The for the log4net section. + The for the log4net section. + + + Returns the containing the configuration data, + + + + + + Assembly level attribute that specifies a plugin to attach to + the repository. + + + + Specifies the type of a plugin to create and attach to the + assembly's repository. The plugin type must implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Interface used to create plugins. + + + + Interface used to create a plugin. + + + Nicko Cadell + Gert Driesen + + + + Creates the plugin object. + + the new plugin instance + + + Create and return a new plugin instance. + + + + + + Initializes a new instance of the class + with the specified type. + + The type name of plugin to create. + + + Create the attribute with the plugin type specified. + + + Where possible use the constructor that takes a . + + + + + + Initializes a new instance of the class + with the specified type. + + The type of plugin to create. + + + Create the attribute with the plugin type specified. + + + + + + Creates the plugin object defined by this attribute. + + + + Creates the instance of the object as + specified by this attribute. + + + The plugin object. + + + + Returns a representation of the properties of this object. + + + + Overrides base class method to + return a representation of the properties of this object. + + + A representation of the properties of this object + + + + Gets or sets the type for the plugin. + + + The type for the plugin. + + + + The type for the plugin. + + + + + + Gets or sets the type name for the plugin. + + + The type name for the plugin. + + + + The type name for the plugin. + + + Where possible use the property instead. + + + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + + + + Construct provider attribute with type specified + + the type of the provider to use + + + The provider specified must subclass the + class. + + + + + + Configures the SecurityContextProvider + + The assembly that this attribute was defined on. + The repository to configure. + + + Creates a provider instance from the specified. + Sets this as the default security context provider . + + + + + + The fully qualified type of the SecurityContextProviderAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the type of the provider to use. + + + the type of the provider to use. + + + + The provider specified must subclass the + class. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + The repository to configure. + + + + Configures log4net using a log4net element + + + + Loads the log4net configuration from the XML element + supplied as . + + + The element to parse. + + + + Configures the using the specified XML + element. + + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration URI. + + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The must support the URI scheme specified. + + + + + + Configures log4net using the specified configuration data stream. + + A stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + URI. + + The repository to configure. + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The must support the URI scheme specified. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the specified repository using a log4net element. + + The hierarchy to configure. + The element to parse. + + + Loads the log4net configuration from the XML element + supplied as . + + + This method is ultimately called by one of the Configure methods + to load the configuration from an . + + + + + + Maps repository names to ConfigAndWatchHandler instances to allow a particular + ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is + reconfigured. + + + + + The fully qualified type of the XmlConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Class used to watch config files. + + + + Uses the to monitor + changes to a specified file. Because multiple change notifications + may be raised when the file is modified, a timer is used to + compress the notifications into a single event. The timer + waits for time before delivering + the event notification. If any further + change notifications arrive while the timer is waiting it + is reset and waits again for to + elapse. + + + + + + The default amount of time to wait after receiving notification + before reloading the config file. + + + + + Holds the FileInfo used to configure the XmlConfigurator + + + + + Holds the repository being configured. + + + + + The timer used to compress the notification events. + + + + + Watches file for changes. This object should be disposed when no longer + needed to free system handles on the watched resources. + + + + + Initializes a new instance of the class to + watch a specified config file used to configure a repository. + + The repository to configure. + The configuration file to watch. + + + Initializes a new instance of the class. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Called by the timer when the configuration has been updated. + + null + + + + Release the handles held by the watcher and timer. + + + + + The implementation of the interface suitable + for use with the compact framework + + + + This implementation is a simple + mapping between repository name and + object. + + + The .NET Compact Framework 1.0 does not support retrieving assembly + level attributes therefore unlike the DefaultRepositorySelector + this selector does not examine the calling assembly for attributes. + + + Nicko Cadell + + + + Interface used by the to select the . + + + + The uses a + to specify the policy for selecting the correct + to return to the caller. + + + Nicko Cadell + Gert Driesen + + + + Gets the for the specified assembly. + + The assembly to use to lookup to the + The for the assembly. + + + Gets the for the specified assembly. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. The results of this method must be repeatable, i.e. + when called again with the same arguments the result must be the + save value. + + + + + + Gets the named . + + The name to use to lookup to the . + The named + + Lookup a named . This is the repository created by + calling . + + + + + Creates a new repository for the assembly specified. + + The assembly to use to create the domain to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the domain + specified such that a call to with the + same assembly specified will return the same repository instance. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. + + + + + + Creates a new repository with the name specified. + + The name to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the name + specified such that a call to with the + same name will return the same repository instance. + + + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets an array of all currently defined repositories. + + + An array of the instances created by + this . + + + Gets an array of all of the repositories created by this selector. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Create a new repository selector + + the type of the repositories to create, must implement + + + Create an new compact repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + throw if is null + throw if does not implement + + + + Get the for the specified assembly + + not used + The default + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Get the named + + the name of the repository to lookup + The named + + + Get the named . The default + repository is log4net-default-repository. Other repositories + must be created using the . + If the named repository does not exist an exception is thrown. + + + throw if is null + throw if the does not exist + + + + Create a new repository for the assembly specified + + not used + the type of repository to create, must implement + the repository created + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + If the is null then the + default repository type specified to the constructor is used. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Create a new repository for the repository specified + + the repository to associate with the + the type of repository to create, must implement . + If this param is null then the default repository type is used. + the repository created + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + If the named repository already exists an exception will be thrown. + + + If is null then the default + repository type specified to the constructor is used. + + + throw if is null + throw if the already exists + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + The fully qualified type of the CompactRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Notify the registered listeners that the repository has been created + + The repository that has been created + + + Raises the LoggerRepositoryCreatedEvent + event. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + The default implementation of the interface. + + + + Uses attributes defined on the calling assembly to determine how to + configure the hierarchy for the repository. + + + Nicko Cadell + Gert Driesen + + + + Creates a new repository selector. + + The type of the repositories to create, must implement + + + Create an new repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + is . + does not implement . + + + + Gets the for the specified assembly. + + The assembly use to lookup the . + + + The type of the created and the repository + to create can be overridden by specifying the + attribute on the . + + + The default values are to use the + implementation of the interface and to use the + as the name of the repository. + + + The created will be automatically configured using + any attributes defined on + the . + + + The for the assembly + is . + + + + Gets the for the specified repository. + + The repository to use to lookup the . + The for the specified repository. + + + Returns the named repository. If is null + a is thrown. If the repository + does not exist a is thrown. + + + Use to create a repository. + + + is . + does not exist. + + + + Create a new repository for the assembly specified + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the assembly specified. + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The name to assign to the created repository + Set to true to read and apply the assembly attributes + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the specified repository. + + The repository to associate with the . + The type of repository to create, must implement . + If this param is then the default repository type is used. + The new repository. + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + is . + already exists. + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + Aliases a repository to an existing repository. + + The repository to alias. + The repository that the repository is aliased to. + + + The repository specified will be aliased to the repository when created. + The repository must not already exist. + + + When the repository is created it must utilize the same repository type as + the repository it is aliased to, otherwise the aliasing will fail. + + + + is . + -or- + is . + + + + + Notifies the registered listeners that the repository has been created. + + The repository that has been created. + + + Raises the event. + + + + + + Gets the repository name and repository type for the specified assembly. + + The assembly that has a . + in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. + in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. + is . + + + + Configures the repository using information from the assembly. + + The assembly containing + attributes which define the configuration for the repository. + The repository to configure. + + is . + -or- + is . + + + + + Loads the attribute defined plugins on the assembly. + + The assembly that contains the attributes. + The repository to add the plugins to. + + is . + -or- + is . + + + + + Loads the attribute defined aliases on the assembly. + + The assembly that contains the attributes. + The repository to alias to. + + is . + -or- + is . + + + + + The fully qualified type of the DefaultRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Defined error codes that can be passed to the method. + + + + Values passed to the method. + + + Nicko Cadell + + + + A general error + + + + + Error while writing output + + + + + Failed to flush file + + + + + Failed to close file + + + + + Unable to open output file + + + + + No layout specified + + + + + Failed to parse address + + + + + An evaluator that triggers on an Exception type + + + + This evaluator will trigger if the type of the Exception + passed to + is equal to a Type in . /// + + + Drew Schaeffer + + + + Test if an triggers an action + + + + Implementations of this interface allow certain appenders to decide + when to perform an appender specific action. + + + The action or behavior triggered is defined by the implementation. + + + Nicko Cadell + + + + Test if this event triggers the action + + The event to check + true if this event triggers the action, otherwise false + + + Return true if this event triggers the action + + + + + + The type that causes the trigger to fire. + + + + + Causes subclasses of to cause the trigger to fire. + + + + + Default ctor to allow dynamic creation through a configurator. + + + + + Constructs an evaluator and initializes to trigger on + + the type that triggers this evaluator. + If true, this evaluator will trigger on subclasses of . + + + + Is this the triggering event? + + The event to check + This method returns true, if the logging event Exception + Type is . + Otherwise it returns false + + + This evaluator will trigger if the Exception Type of the event + passed to + is . + + + + + + The type that triggers this evaluator. + + + + + If true, this evaluator will trigger on subclasses of . + + + + + Appenders may delegate their error handling to an . + + + + Error handling is a particularly tedious to get right because by + definition errors are hard to predict and to reproduce. + + + Nicko Cadell + Gert Driesen + + + + Handles the error and information about the error condition is passed as + a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + The error code associated with the error. + + + Handles the error and information about the error condition is passed as + a parameter. + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + + + See . + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + + + See . + + + + + + Interface for objects that require fixing. + + + + Interface that indicates that the object requires fixing before it + can be taken outside the context of the appender's + method. + + + When objects that implement this interface are stored + in the context properties maps + and + are fixed + (see ) the + method will be called. + + + Nicko Cadell + + + + Get a portable version of this object + + the portable instance of this object + + + Get a portable instance object that represents the current + state of this object. The portable object can be stored + and logged from any thread with identical results. + + + + + + Interface that all loggers implement + + + + This interface supports logging events and testing if a level + is enabled for logging. + + + These methods will not throw exceptions. Note to implementor, ensure + that the implementation of these methods cannot allow an exception + to be thrown to the caller. + + + Nicko Cadell + Gert Driesen + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + the exception to log, including its stack trace. Pass null to not log an exception. + + + Generates a logging event for the specified using + the and . + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + + + + Gets the name of the logger. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Base interface for all wrappers + + + + Base interface for all wrappers. + + + All wrappers must implement this interface. + + + Nicko Cadell + + + + Get the implementation behind this wrapper object. + + + The object that in implementing this object. + + + + The object that in implementing this + object. The Logger object may not + be the same object as this object because of logger decorators. + This gets the actual underlying objects that is used to process + the log events. + + + + + + Delegate used to handle logger repository creation event notifications + + The which created the repository. + The event args + that holds the instance that has been created. + + + Delegate used to handle logger repository creation event notifications. + + + + + + Provides data for the event. + + + + A + event is raised every time a is created. + + + + + + The created + + + + + Construct instance using specified + + the that has been created + + + Construct instance using specified + + + + + + The that has been created + + + The that has been created + + + + The that has been created + + + + + + Defines the default set of levels recognized by the system. + + + + Each has an associated . + + + Levels have a numeric that defines the relative + ordering between levels. Two Levels with the same + are deemed to be equivalent. + + + The levels that are recognized by log4net are set for each + and each repository can have different levels defined. The levels are stored + in the on the repository. Levels are + looked up by name from the . + + + When logging at level INFO the actual level used is not but + the value of LoggerRepository.LevelMap["INFO"]. The default value for this is + , but this can be changed by reconfiguring the level map. + + + Each level has a in addition to its . The + is the string that is written into the output log. By default + the display name is the same as the level name, but this can be used to alias levels + or to localize the log output. + + + Some of the predefined levels recognized by the system are: + + + + . + + + . + + + . + + + . + + + . + + + . + + + . + + + + Nicko Cadell + Gert Driesen + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + The display name for this level. This may be localized or otherwise different from the name + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Returns the representation of the current + . + + + A representation of the current . + + + + Returns the level . + + + + + + Compares levels. + + The object to compare against. + true if the objects are equal. + + + Compares the levels of instances, and + defers to base class if the target object is not a + instance. + + + + + + Returns a hash code + + A hash code for the current . + + + Returns a hash code suitable for use in hashing algorithms and data + structures like a hash table. + + + Returns the hash code of the level . + + + + + + Compares this instance to a specified object and returns an + indication of their relative values. + + A instance or to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the + values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + This instance is less than . + + + Zero + This instance is equal to . + + + Greater than zero + + This instance is greater than . + -or- + is . + + + + + + + must be an instance of + or ; otherwise, an exception is thrown. + + + is not a . + + + + Returns a value indicating whether a specified + is greater than another specified . + + A + A + + true if is greater than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than another specified . + + A + A + + true if is less than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is greater than or equal to another specified . + + A + A + + true if is greater than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than or equal to another specified . + + A + A + + true if is less than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have the same value. + + A or . + A or . + + true if the value of is the same as the + value of ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have different values. + + A or . + A or . + + true if the value of is different from + the value of ; otherwise, false. + + + + Compares two levels. + + + + + + Compares two specified instances. + + The first to compare. + The second to compare. + + A 32-bit signed integer that indicates the relative order of the + two values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + is less than . + + + Zero + is equal to . + + + Greater than zero + is greater than . + + + + + + Compares two levels. + + + + + + The level designates a higher level than all the rest. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events + that will presumably lead the application to abort. + + + + + The level designates very severe error events. + Take immediate action, alerts. + + + + + The level designates very severe error events. + Critical condition, critical. + + + + + The level designates very severe error events. + + + + + The level designates error events that might + still allow the application to continue running. + + + + + The level designates potentially harmful + situations. + + + + + The level designates informational messages + that highlight the progress of the application at the highest level. + + + + + The level designates informational messages that + highlight the progress of the application at coarse-grained level. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates the lowest level possible. + + + + + Gets the name of this level. + + + The name of this level. + + + + Gets the name of this level. + + + + + + Gets the value of this level. + + + The value of this level. + + + + Gets the value of this level. + + + + + + Gets the display name of this level. + + + The display name of this level. + + + + Gets the display name of this level. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a LevelCollection instance. + + list to create a readonly wrapper arround + + A LevelCollection wrapper that is read-only. + + + + + Initializes a new instance of the LevelCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the LevelCollection class + that has the specified initial capacity. + + + The number of elements that the new LevelCollection is initially capable of storing. + + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified LevelCollection. + + The LevelCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + Copies the entire LevelCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire LevelCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the LevelCollection. + + The to be added to the end of the LevelCollection. + The index at which the value has been added. + + + + Removes all elements from the LevelCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the LevelCollection. + + The to check for. + true if is found in the LevelCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the LevelCollection. + + The to locate in the LevelCollection. + + The zero-based index of the first occurrence of + in the entire LevelCollection, if found; otherwise, -1. + + + + + Inserts an element into the LevelCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the LevelCollection. + + The to remove from the LevelCollection. + + The specified was not found in the LevelCollection. + + + + + Removes the element at the specified index of the LevelCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the LevelCollection. + + An for the entire LevelCollection. + + + + Adds the elements of another LevelCollection to the current LevelCollection. + + The LevelCollection whose elements should be added to the end of the current LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a array to the current LevelCollection. + + The array whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a collection to the current LevelCollection. + + The collection whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the LevelCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the LevelCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + A value + + + + + Supports simple iteration over a . + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + An evaluator that triggers at a threshold level + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + Nicko Cadell + + + + The threshold for triggering + + + + + Create a new evaluator using the threshold. + + + + Create a new evaluator using the threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Create a new evaluator using the specified threshold. + + the threshold to trigger at + + + Create a new evaluator using the specified threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the event level + is equal or higher than the . + Otherwise it returns false + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + the threshold to trigger at + + + The that will cause this evaluator to trigger + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Mapping between string name and Level object + + + + Mapping between string name and object. + This mapping is held separately for each . + The level name is case insensitive. + + + Nicko Cadell + + + + Mapping from level name to Level object. The + level name is case insensitive + + + + + Construct the level map + + + + Construct the level map. + + + + + + Clear the internal maps of all levels + + + + Clear the internal maps of all levels + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + + + Create a new Level and add it to the map + + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + the display name to give to the Level + + + Create a new Level and add it to the map + + + + + + Add a Level to the map + + the Level to add + + + Add a Level to the map + + + + + + Lookup a named level from the map + + the name of the level to lookup is taken from this level. + If the level is not set on the map then this level is added + the level in the map with the name specified + + + Lookup a named level from the map. The name of the level to lookup is taken + from the property of the + argument. + + + If no level with the specified name is found then the + argument is added to the level map + and returned. + + + + + + Lookup a by name + + The name of the Level to lookup + a Level from the map with the name specified + + + Returns the from the + map with the name specified. If the no level is + found then null is returned. + + + + + + Return all possible levels as a list of Level objects. + + all possible levels as a list of Level objects + + + Return all possible levels as a list of Level objects. + + + + + + The internal representation of caller location information. + + + + This class uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. + + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + Nicko Cadell + Gert Driesen + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + Constructor + + The declaring type of the method that is + the stack boundary into the logging system for this call. + + + Initializes a new instance of the + class based on the current thread. + + + + + + Constructor + + The fully qualified class name. + The method name. + The file name. + The line number of the method within the file. + + + Initializes a new instance of the + class with the specified data. + + + + + + The fully qualified type of the LocationInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + Gets the stack frames from the stack trace of the caller making the log request + + + + + Static manager that controls the creation of repositories + + + + Static manager that controls the creation of repositories + + + This class is used by the wrapper managers (e.g. ) + to provide access to the objects. + + + This manager also holds the that is used to + lookup and create repositories. The selector can be set either programmatically using + the property, or by setting the log4net.RepositorySelector + AppSetting in the applications config file to the fully qualified type name of the + selector to use. + + + Nicko Cadell + Gert Driesen + + + + Private constructor to prevent instances. Only static methods should be used. + + + + Private constructor to prevent instances. Only static methods should be used. + + + + + + Hook the shutdown event + + + + On the full .NET runtime, the static constructor hooks up the + AppDomain.ProcessExit and AppDomain.DomainUnload> events. + These are used to shutdown the log4net system as the application exits. + + + + + + Register for ProcessExit and DomainUnload events on the AppDomain + + + + This needs to be in a separate method because the events make + a LinkDemand for the ControlAppDomain SecurityPermission. Because + this is a LinkDemand it is demanded at JIT time. Therefore we cannot + catch the exception in the method itself, we have to catch it in the + caller. + + + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + Returns the default instance. + + + + + + Returns the named logger if it exists. + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified repository. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns the named logger if it exists. + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified assembly's repository. + + + + If the named logger exists (in the specified assembly's repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Retrieves or creates a named logger. + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Retrieves or creates a named logger. + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Shorthand for . + + The repository to lookup in. + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shorthand for . + + the assembly to use to lookup the repository + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The repository to shutdown. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The assembly to use to lookup the repository. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Resets all values contained in this repository instance to their defaults. + + The repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + The assembly to use to lookup the repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Gets an array of all currently defined repositories. + + An array of all the known objects. + + + Gets an array of all currently defined repositories. + + + + + + Internal method to get pertinent version info. + + A string of version info. + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + The fully qualified type of the LoggerManager class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initialize the default repository selector + + + + + Gets or sets the repository selector used by the . + + + The repository selector used by the . + + + + The repository selector () is used by + the to create and select repositories + (). + + + The caller to supplies either a string name + or an assembly (if not supplied the assembly is inferred using + ). + + + This context is used by the selector to lookup a specific repository. + + + For the full .NET Framework, the default repository is DefaultRepositorySelector; + for the .NET Compact Framework CompactRepositorySelector is the default + repository. + + + + + + Implementation of the interface. + + + + This class should be used as the base for all wrapper implementations. + + + Nicko Cadell + Gert Driesen + + + + Constructs a new wrapper for the specified logger. + + The logger to wrap. + + + Constructs a new wrapper for the specified logger. + + + + + + The logger that this object is wrapping + + + + + Gets the implementation behind this wrapper object. + + + The object that this object is implementing. + + + + The Logger object may not be the same object as this object + because of logger decorators. + + + This gets the actual underlying objects that is used to process + the log events. + + + + + + Portable data structure used by + + + + Portable data structure used by + + + Nicko Cadell + + + + The logger name. + + + + The logger name. + + + + + + Level of logging event. + + + + Level of logging event. Level cannot be Serializable + because it is a flyweight. Due to its special serialization it + cannot be declared final either. + + + + + + The application supplied message. + + + + The application supplied message of logging event. + + + + + + The name of thread + + + + The name of thread in which this logging event was generated + + + + + + The time the event was logged + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Location information for the caller. + + + + Location information for the caller. + + + + + + String representation of the user + + + + String representation of the user's windows name, + like DOMAIN\username + + + + + + String representation of the identity. + + + + String representation of the current thread's principal identity. + + + + + + The string representation of the exception + + + + The string representation of the exception + + + + + + String representation of the AppDomain. + + + + String representation of the AppDomain. + + + + + + Additional event specific properties + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + + + + Flags passed to the property + + + + Flags passed to the property + + + Nicko Cadell + + + + Fix the MDC + + + + + Fix the NDC + + + + + Fix the rendered message + + + + + Fix the thread name + + + + + Fix the callers location information + + + CAUTION: Very slow to generate + + + + + Fix the callers windows user name + + + CAUTION: Slow to generate + + + + + Fix the domain friendly name + + + + + Fix the callers principal name + + + CAUTION: May be slow to generate + + + + + Fix the exception text + + + + + Fix the event properties. Active properties must implement in order to be eligible for fixing. + + + + + No fields fixed + + + + + All fields fixed + + + + + Partial fields fixed + + + + This set of partial fields gives good performance. The following fields are fixed: + + + + + + + + + + + + + The internal representation of logging events. + + + + When an affirmative decision is made to log then a + instance is created. This instance + is passed around to the different log4net components. + + + This class is of concern to those wishing to extend log4net. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino + + + + The key into the Properties map for the host name value. + + + + + The key into the Properties map for the thread identity value. + + + + + The key into the Properties map for the user name value. + + + + + Initializes a new instance of the class + from the supplied parameters. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + The name of the logger of this event. + The level of this event. + The message of this event. + The exception for this event. + + + Except , and , + all fields of LoggingEvent are filled when actually needed. Call + to cache all data locally + to prevent inconsistencies. + + This method is called by the log4net framework + to create a logging event. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + The fields in the struct that have already been fixed. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + The parameter should be used to specify which fields in the + struct have been preset. Fields not specified in the + will be captured from the environment if requested or fixed. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Initializes a new instance of the class + using specific data. + + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Serialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Ensure that the repository is set. + + the value for the repository + + + + Write the rendered message to a TextWriter + + the writer to write the message to + + + Unlike the property this method + does store the message data in the internal cache. Therefore + if called only once this method should be faster than the + property, however if the message is + to be accessed multiple times then the property will be more efficient. + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + The data in this event must be fixed before it can be serialized. + + + The method must be called during the + method call if this event + is to be used outside that method. + + + + + + Gets the portable data for this . + + The for this event. + + + A new can be constructed using a + instance. + + + Does a fix of the data + in the logging event before returning the event data. + + + + + + Gets the portable data for this . + + The set of data to ensure is fixed in the LoggingEventData + The for this event. + + + A new can be constructed using a + instance. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Obsolete. Use instead. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Returns this event's exception's rendered using the + . + + + + + + Fix instance fields that hold volatile data. + + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + incurred by calling but it + is essential to maintaining data consistency. + + + Calling is equivalent to + calling passing the parameter + false. + + + See for more + information. + + + + + + Fixes instance fields that hold volatile data. + + Set to true to not fix data that takes a long time to fix. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + The param controls the data that + is fixed. Some of the data that can be fixed takes a long time to + generate, therefore if you do not require those settings to be fixed + they can be ignored by setting the param + to true. This setting will ignore the + and settings. + + + Set to false to ensure that all + settings are fixed. + + + + + + Fix the fields specified by the parameter + + the fields to fix + + + Only fields specified in the will be fixed. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Lookup a composite property in this event + + the key for the property to lookup + the value for the property + + + This event has composite properties that combine together properties from + several different contexts in the following order: + + + this events properties + + This event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + + Get all the composite properties in this event + + the containing all the properties + + + See for details of the composite properties + stored by the event. + + + This method returns a single containing all the + properties defined for this event. + + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The fully qualified Type of the calling + logger class in the stack frame (i.e. the declaring type of the method). + + + + + The application supplied message of logging event. + + + + + The exception that was thrown. + + + This is not serialized. The string representation + is serialized instead. + + + + + The repository that generated the logging event + + + This is not serialized. + + + + + The fix state for this event + + + These flags indicate which fields have been fixed. + Not serialized. + + + + + Indicated that the internal cache is updateable (ie not fixed) + + + This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler + changes in the caching strategy. + + + + + Gets the time when the current process started. + + + This is the time when this process started. + + + + The TimeStamp is stored in the local time zone for this computer. + + + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. + + + + + + Gets the of the logging event. + + + The of the logging event. + + + + Gets the of the logging event. + + + + + + Gets the time of the logging event. + + + The time of the logging event. + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Gets the name of the logger that logged the event. + + + The name of the logger that logged the event. + + + + Gets the name of the logger that logged the event. + + + + + + Gets the location information for this logging event. + + + The location information for this logging event. + + + + The collected information is cached for future use. + + + See the class for more information on + supported frameworks and the different behavior in Debug and + Release builds. + + + + + + Gets the message object used to initialize this event. + + + The message object used to initialize this event. + + + + Gets the message object used to initialize this event. + Note that this event may not have a valid message object. + If the event is serialized the message object will not + be transferred. To get the text of the message the + property must be used + not this property. + + + If there is no defined message object for this event then + null will be returned. + + + + + + Gets the exception object used to initialize this event. + + + The exception object used to initialize this event. + + + + Gets the exception object used to initialize this event. + Note that this event may not have a valid exception object. + If the event is serialized the exception object will not + be transferred. To get the text of the exception the + method must be used + not this property. + + + If there is no defined exception object for this event then + null will be returned. + + + + + + The that this event was created in. + + + + The that this event was created in. + + + + + + Gets the message, rendered through the . + + + The message rendered through the . + + + + The collected information is cached for future use. + + + + + + Gets the name of the current thread. + + + The name of the current thread, or the thread ID when + the name is not available. + + + + The collected information is cached for future use. + + + + + + Gets the name of the current user. + + + The name of the current user, or NOT AVAILABLE when the + underlying runtime has no support for retrieving the name of the + current user. + + + + Calls WindowsIdentity.GetCurrent().Name to get the name of + the current windows user. + + + To improve performance, we could cache the string representation of + the name, and reuse that as long as the identity stayed constant. + Once the identity changed, we would need to re-assign and re-render + the string. + + + However, the WindowsIdentity.GetCurrent() call seems to + return different objects every time, so the current implementation + doesn't do this type of caching. + + + Timing for these operations: + + + + Method + Results + + + WindowsIdentity.GetCurrent() + 10000 loops, 00:00:00.2031250 seconds + + + WindowsIdentity.GetCurrent().Name + 10000 loops, 00:00:08.0468750 seconds + + + + This means we could speed things up almost 40 times by caching the + value of the WindowsIdentity.GetCurrent().Name property, since + this takes (8.04-0.20) = 7.84375 seconds. + + + + + + Gets the identity of the current thread principal. + + + The string name of the identity of the current thread principal. + + + + Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get + the name of the current thread principal. + + + + + + Gets the AppDomain friendly name. + + + The AppDomain friendly name. + + + + Gets the AppDomain friendly name. + + + + + + Additional event specific properties. + + + Additional event specific properties. + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + This property is for events that have been added directly to + this event. The aggregate properties (which include these + event properties) can be retrieved using + and . + + + Once the properties have been fixed this property + returns the combined cached properties. This ensures that updates to + this property are always reflected in the underlying storage. When + returning the combined properties there may be more keys in the + Dictionary than expected. + + + + + + The fixed fields in this event + + + The set of fields that are fixed in this event + + + + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Implementation of wrapper interface. + + + + This implementation of the interface + forwards to the held by the base class. + + + This logger has methods to allow the caller to log at the following + levels: + + + + DEBUG + + The and methods log messages + at the DEBUG level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + INFO + + The and methods log messages + at the INFO level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + WARN + + The and methods log messages + at the WARN level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + ERROR + + The and methods log messages + at the ERROR level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + FATAL + + The and methods log messages + at the FATAL level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + + The values for these levels and their semantic meanings can be changed by + configuring the for the repository. + + + Nicko Cadell + Gert Driesen + + + + The ILog interface is use by application to log messages into + the log4net framework. + + + + Use the to obtain logger instances + that implement this interface. The + static method is used to get logger instances. + + + This class contains methods for logging at different levels and also + has properties for determining if those logging levels are + enabled in the current configuration. + + + This interface can be implemented in different ways. This documentation + specifies reasonable behavior that a caller can expect from the actual + implementation, however different implementations reserve the right to + do things differently. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + Log a message object with the level. + + Log a message object with the level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Logs a message object with the INFO level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + For some ILog interface log, when you write: + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, string construction and concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed (who isn't), then you should write: + + + if (log.IsDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in and once in + the . This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. This is the preferred style of logging. + + Alternatively if your logger is available statically then the is debug + enabled state can be stored in a static variable like this: + + + private static readonly bool isDebugEnabled = log.IsDebugEnabled; + + + Then when you come to log you can write: + + + if (isDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way the debug enabled state is only queried once + when the class is loaded. Using a private static readonly + variable is the most efficient because it is a run time constant + and can be heavily optimized by the JIT compiler. + + + Of course if you use a static readonly variable to + hold the enabled state of the logger then you cannot + change the enabled state at runtime to vary the logging + that is produced. You have to decide if you need absolute + speed or runtime flexibility. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Construct a new wrapper for the specified logger. + + The logger to wrap. + + + Construct a new wrapper for the specified logger. + + + + + + Virtual method called when the configuration of the repository changes + + the repository holding the levels + + + Virtual method called when the configuration of the repository changes + + + + + + Logs a message object with the DEBUG level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + DEBUG level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the DEBUG level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the DEBUG level including + the stack trace of the passed + as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + INFO level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the INFO level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the WARN level. + + the message object to log + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + WARN level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the WARN level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the WARN level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the ERROR level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + ERROR level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the ERROR level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the ERROR level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the FATAL level. + + The message object to log. + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + FATAL level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the FATAL level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the FATAL level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Event handler for the event + + the repository + Empty + + + + The fully qualified name of this declaring type not the type of any subclass. + + + + + Checks if this logger is enabled for the DEBUG + level. + + + true if this logger is enabled for DEBUG events, + false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + + For some log Logger object, when you write: + + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed, then you should write: + + + if (log.IsDebugEnabled()) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in IsDebugEnabled and once in + the Debug. This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. + + + + + + Checks if this logger is enabled for the INFO level. + + + true if this logger is enabled for INFO events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the WARN level. + + + true if this logger is enabled for WARN events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the ERROR level. + + + true if this logger is enabled for ERROR events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + Checks if this logger is enabled for the FATAL level. + + + true if this logger is enabled for FATAL events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + provides method information without actually referencing a System.Reflection.MethodBase + as that would require that the containing assembly is loaded. + + + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + constructs a method item for an unknown method. + + + + + constructs a method item from the name of the method. + + + + + + constructs a method item from the name of the method and its parameters. + + + + + + + constructs a method item from a method base by determining the method name and its parameters. + + + + + + The fully qualified type of the StackFrameItem class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the method name of the caller making the logging + request. + + + The method name of the caller making the logging + request. + + + + Gets the method name of the caller making the logging + request. + + + + + + Gets the method parameters of the caller making + the logging request. + + + The method parameters of the caller making + the logging request + + + + Gets the method parameters of the caller making + the logging request. + + + + + + A SecurityContext used by log4net when interacting with protected resources + + + + A SecurityContext used by log4net when interacting with protected resources + for example with operating system services. This can be used to impersonate + a principal that has been granted privileges on the system resources. + + + Nicko Cadell + + + + Impersonate this SecurityContext + + State supplied by the caller + An instance that will + revoke the impersonation of this SecurityContext, or null + + + Impersonate this security context. Further calls on the current + thread should now be made in the security context provided + by this object. When the result + method is called the security + context of the thread should be reverted to the state it was in + before was called. + + + + + + The providers default instances. + + + + A configured component that interacts with potentially protected system + resources uses a to provide the elevated + privileges required. If the object has + been not been explicitly provided to the component then the component + will request one from this . + + + By default the is + an instance of which returns only + objects. This is a reasonable default + where the privileges required are not know by the system. + + + This default behavior can be overridden by subclassing the + and overriding the method to return + the desired objects. The default provider + can be replaced by programmatically setting the value of the + property. + + + An alternative is to use the log4net.Config.SecurityContextProviderAttribute + This attribute can be applied to an assembly in the same way as the + log4net.Config.XmlConfiguratorAttribute". The attribute takes + the type to use as the as an argument. + + + Nicko Cadell + + + + The default provider + + + + + Protected default constructor to allow subclassing + + + + Protected default constructor to allow subclassing + + + + + + Create a SecurityContext for a consumer + + The consumer requesting the SecurityContext + An impersonation context + + + The default implementation is to return a . + + + Subclasses should override this method to provide their own + behavior. + + + + + + Gets or sets the default SecurityContextProvider + + + The default SecurityContextProvider + + + + The default provider is used by configured components that + require a and have not had one + given to them. + + + By default this is an instance of + that returns objects. + + + The default provider can be set programmatically by setting + the value of this property to a sub class of + that has the desired behavior. + + + + + + provides stack frame information without actually referencing a System.Diagnostics.StackFrame + as that would require that the containing assembly is loaded. + + + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + returns a stack frame item from a stack frame. This + + + + + + + The fully qualified type of the StackFrameItem class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + An evaluator that triggers after specified number of seconds. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + Robert Sevcik + + + + The default time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time of last check. This gets updated when the object is created and when the evaluator triggers. + + + + + Create a new evaluator using the time threshold in seconds. + + + + Create a new evaluator using the time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Create a new evaluator using the specified time threshold in seconds. + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + Create a new evaluator using the specified time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the specified time period + has passed since last check.. + Otherwise it returns false + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + The time threshold in seconds to trigger after + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Delegate used to handle creation of new wrappers. + + The logger to wrap in a wrapper. + + + Delegate used to handle creation of new wrappers. This delegate + is called from the + method to construct the wrapper for the specified logger. + + + The delegate to use is supplied to the + constructor. + + + + + + Maps between logger objects and wrapper objects. + + + + This class maintains a mapping between objects and + objects. Use the method to + lookup the for the specified . + + + New wrapper instances are created by the + method. The default behavior is for this method to delegate construction + of the wrapper to the delegate supplied + to the constructor. This allows specialization of the behavior without + requiring subclassing of this type. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the + + The handler to use to create the wrapper objects. + + + Initializes a new instance of the class with + the specified handler to create the wrapper objects. + + + + + + Gets the wrapper object for the specified logger. + + The wrapper object for the specified logger + + + If the logger is null then the corresponding wrapper is null. + + + Looks up the wrapper it it has previously been requested and + returns it. If the wrapper has never been requested before then + the virtual method is + called. + + + + + + Creates the wrapper object for the specified logger. + + The logger to wrap in a wrapper. + The wrapper object for the logger. + + + This implementation uses the + passed to the constructor to create the wrapper. This method + can be overridden in a subclass. + + + + + + Called when a monitored repository shutdown event is received. + + The that is shutting down + + + This method is called when a that this + is holding loggers for has signaled its shutdown + event . The default + behavior of this method is to release the references to the loggers + and their wrappers generated for this repository. + + + + + + Event handler for repository shutdown event. + + The sender of the event. + The event args. + + + + Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + + + + + The handler to use to create the extension wrapper objects. + + + + + Internal reference to the delegate used to register for repository shutdown events. + + + + + Gets the map of logger repositories. + + + Map of logger repositories. + + + + Gets the hashtable that is keyed on . The + values are hashtables keyed on with the + value being the corresponding . + + + + + + Formats a as "HH:mm:ss,fff". + + + + Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + + + Nicko Cadell + Gert Driesen + + + + Render a as a string. + + + + Interface to abstract the rendering of a + instance into a string. + + + The method is used to render the + date to a text writer. + + + Nicko Cadell + Gert Driesen + + + + Formats the specified date as a string. + + The date to format. + The writer to write to. + + + Format the as a string and write it + to the provided. + + + + + + String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + + + + + String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + + + + + String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + + + + + Renders the date into a string. Format is "HH:mm:ss". + + The date to render into a string. + The string builder to write to. + + + Subclasses should override this method to render the date + into a string using a precision up to the second. This method + will be called at most once per second and the result will be + reused if it is needed again during the same second. + + + + + + Renders the date into a string. Format is "HH:mm:ss,fff". + + The date to render into a string. + The writer to write to. + + + Uses the method to generate the + time string up to the seconds and then appends the current + milliseconds. The results from are + cached and is called at most once + per second. + + + Sub classes should override + rather than . + + + + + + Last stored time with precision up to the second. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Formats a as "dd MMM yyyy HH:mm:ss,fff" + + + + Formats a in the format + "dd MMM yyyy HH:mm:ss,fff" for example, + "06 Nov 1994 15:49:37,459". + + + Nicko Cadell + Gert Driesen + Angelika Schnagl + + + + Default constructor. + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats a DateTime in the format "dd MMM yyyy HH:mm:ss" + for example, "06 Nov 1994 15:49:37". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + The format info for the invariant culture. + + + + + Formats the as "yyyy-MM-dd HH:mm:ss,fff". + + + + Formats the specified as a string: "yyyy-MM-dd HH:mm:ss,fff". + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats the date specified as a string: "yyyy-MM-dd HH:mm:ss". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + Formats the using the method. + + + + Formats the using the method. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The format string. + + + Initializes a new instance of the class + with the specified format string. + + + The format string must be compatible with the options + that can be supplied to . + + + + + + Formats the date using . + + The date to convert to a string. + The writer to write to. + + + Uses the date format string supplied to the constructor to call + the method to format the date. + + + + + + The format string used to format the . + + + + The format string must be compatible with the options + that can be supplied to . + + + + + + This filter drops all . + + + + You can add this filter to the end of a filter chain to + switch from the default "accept all unless instructed otherwise" + filtering behavior to a "deny all unless instructed otherwise" + behavior. + + + Nicko Cadell + Gert Driesen + + + + Subclass this type to implement customized logging event filtering + + + + Users should extend this class to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface to provide customized logging event filtering + + + + Users should implement this interface to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Decide if the logging event should be logged through an appender. + + The LoggingEvent to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Points to the next filter in the filter chain. + + + + See for more information. + + + + + + Initialize the filter with the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Typically filter's options become active immediately on set, + however this method must still be called. + + + + + + Decide if the should be logged through an appender. + + The to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + This method is marked abstract and must be implemented + in a subclass. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Default constructor + + + + + Always returns the integer constant + + the LoggingEvent to filter + Always returns + + + Ignores the event being logged and just returns + . This can be used to change the default filter + chain behavior from to . This filter + should only be used as the last filter in the chain + as any further filters will be ignored! + + + + + + The return result from + + + + The return result from + + + + + + The log event must be dropped immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This filter is neutral with respect to the log event. + The remaining filters, if any, should be consulted for a final decision. + + + + + The log event must be logged immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This is a very simple filter based on matching. + + + + The filter admits two options and + . If there is an exact match between the value + of the option and the of the + , then the method returns in + case the option value is set + to true, if it is false then + is returned. If the does not match then + the result will be . + + + Nicko Cadell + Gert Driesen + + + + flag to indicate if the filter should on a match + + + + + the to match against + + + + + Default constructor + + + + + Tests if the of the logging event matches that of the filter + + the event to filter + see remarks + + + If the of the event matches the level of the + filter then the result of the function depends on the + value of . If it is true then + the function will return , it it is false then it + will return . If the does not match then + the result will be . + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + The level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + This is a simple filter based on matching. + + + + The filter admits three options and + that determine the range of priorities that are matched, and + . If there is a match between the range + of priorities and the of the , then the + method returns in case the + option value is set to true, if it is false + then is returned. If there is no match, is returned. + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when matching a + + + + + the minimum value to match + + + + + the maximum value to match + + + + + Default constructor + + + + + Check if the event should be logged. + + the logging event to check + see remarks + + + If the of the logging event is outside the range + matched by this filter then + is returned. If the is matched then the value of + is checked. If it is true then + is returned, otherwise + is returned. + + + + + + when matching and + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Set the minimum matched + + + + The minimum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Sets the maximum matched + + + + The maximum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a string in the event's logger name. + + + + The works very similar to the . It admits two + options and . If the + of the starts + with the value of the option, then the + method returns in + case the option value is set to true, + if it is false then is returned. + + + Daniel Cazzulino + + + + Flag to indicate the behavior when we have a match + + + + + The logger name string to substring match against the event + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the equals the beginning of + the incoming () + then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + This filter will attempt to match this value against logger name in + the following way. The match will be done against the beginning of the + logger name (using ). The match is + case sensitive. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a keyed string in the + + + + Simple filter to match a keyed string in the + + + As the MDC has been replaced with layered properties the + should be used instead. + + + Nicko Cadell + Gert Driesen + + + + Simple filter to match a string an event property + + + + Simple filter to match a string in the value for a + specific event property + + + Nicko Cadell + + + + Simple filter to match a string in the rendered message + + + + Simple filter to match a string in the rendered message + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when we have a match + + + + + The string to substring match against the message + + + + + A string regex to match + + + + + A regex object to match (generated from m_stringRegexToMatch) + + + + + Default constructor + + + + + Initialize and precompile the Regex if required + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the occurs as a substring within + the message then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching or + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Sets the static string to match + + + + The string that will be substring matched against + the rendered message. If the message contains this + string then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + Sets the regular expression to match + + + + The regular expression pattern that will be matched against + the rendered message. If the message matches this + pattern then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + The key to use to lookup the string from the event properties + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The event property for the is matched against + the . + If the occurs as a substring within + the property value then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + The key to lookup in the event properties and then match against. + + + + The key name to use to lookup in the properties map of the + . The match will be performed against + the value of this property if it exists. + + + + + + Simple filter to match a string in the + + + + Simple filter to match a string in the + + + As the MDC has been replaced with named stacks stored in the + properties collections the should + be used instead. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Sets the to "NDC". + + + + + + Write the event appdomain name to the output + + + + Writes the to the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + + Nicko Cadell + Gert Driesen + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Protected constructor + + + + Initializes a new instance of the class. + + + + + + Evaluate this pattern converter and write the output to a writer. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the appropriate way. + + + + + + Set the next pattern converter in the chains + + the pattern converter that should follow this converter in the chain + the next converter + + + The PatternConverter can merge with its neighbor during this method (or a sub class). + Therefore the return value may or may not be the value of the argument passed in. + + + + + + Write the pattern converter to the writer with appropriate formatting + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + This method calls to allow the subclass to perform + appropriate conversion of the pattern converter. If formatting options have + been specified via the then this method will + apply those formattings before writing the output. + + + + + + Fast space padding method. + + to which the spaces will be appended. + The number of spaces to be padded. + + + Fast space padding method. + + + + + + The option string to the converter + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an object to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the Object to a writer. If the specified + is not null then it is used to render the object to text, otherwise + the object's ToString method is called. + + + + + + Get the next pattern converter in the chain + + + the next pattern converter in the chain + + + + Get the next pattern converter in the chain + + + + + + Gets or sets the formatting info for this converter + + + The formatting info for this converter + + + + Gets or sets the formatting info for this converter + + + + + + Gets or sets the option value for this converter + + + The option for this converter + + + + Gets or sets the option value for this converter + + + + + + + + + + + Initializes a new instance of the class. + + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + + Flag indicating if this converter handles exceptions + + + false if this converter handles exceptions + + + + + Flag indicating if this converter handles the logging event exception + + false if this converter handles the logging event exception + + + If this converter handles the exception object contained within + , then this property should be set to + false. Otherwise, if the layout ignores the exception + object, then the property should be set to true. + + + Set this value to override a this default setting. The default + value is true, this converter does not handle the exception. + + + + + + Write the event appdomain name to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output . + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Abstract class that provides access to the current HttpContext () that + derived classes need. + + + This class handles the case when HttpContext.Current is null by writing + to the writer. + + Ron Grabowski + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Cache will + be written to the output. + + + + + + Converter for items in the . + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net HttpContext item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Session will + be written to the output. + + + + + + Date pattern converter, uses a to format + the date of a . + + + + Render the to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter pattern based on the property. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert the pattern into the rendered message + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the exception text to the output + + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Nicko Cadell + + + + Default constructor + + + + + Write the exception text to the output + + that will receive the formatted result. + the event being logged + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception or the exception property specified + by the Option value does not exist then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Recognized values for the Option parameter are: + + + + Message + + + Source + + + StackTrace + + + TargetSite + + + HelpLink + + + + + + + Writes the caller location file name to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location file name to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Write the caller location info to the output + + + + Writes the to the output writer. + + + Nicko Cadell + + + + Write the caller location info to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Writes the event identity to the output + + + + Writes the value of the to + the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Writes the event identity to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the + to + the output . + + + + + + Write the event level to the output + + + + Writes the display name of the event + to the writer. + + + Nicko Cadell + + + + Write the event level to the output + + that will receive the formatted result. + the event being logged + + + Writes the of the + to the . + + + + + + Write the caller location line number to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location line number to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Converter for logger name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Converter to output and truncate '.' separated strings + + + + This abstract class supports truncating a '.' separated string + to show a specified number of elements from the right hand side. + This is used to truncate class names that are fully qualified. + + + Subclasses should override the method to + return the fully qualified string. + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Get the fully qualified string data + + the event being logged + the fully qualified name + + + Overridden by subclasses to get the fully qualified name before the + precision is applied to it. + + + Return the fully qualified '.' (dot/period) separated string. + + + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + Render the to the precision + specified by the property. + + + + + The fully qualified type of the NamedPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified name of the logger + + the event being logged + The fully qualified logger name + + + Returns the of the . + + + + + + Writes the event message to the output + + + + Uses the method + to write out the event message. + + + Nicko Cadell + + + + Writes the event message to the output + + that will receive the formatted result. + the event being logged + + + Uses the method + to write out the event message. + + + + + + Write the method name to the output + + + + Writes the caller location to + the output. + + + Nicko Cadell + + + + Write the method name to the output + + that will receive the formatted result. + the event being logged + + + Writes the caller location to + the output. + + + + + + Converter to include event NDC + + + + Outputs the value of the event property named NDC. + + + The should be used instead. + + + Nicko Cadell + + + + Write the event NDC to the output + + that will receive the formatted result. + the event being logged + + + As the thread context stacks are now stored in named event properties + this converter simply looks up the value of the NDC property. + + + The should be used instead. + + + + + + Property pattern converter + + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + the event being logged + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + Converter to output the relative time of the event + + + + Converter to output the time of the event relative to the start of the program. + + + Nicko Cadell + + + + Write the relative time to the output + + that will receive the formatted result. + the event being logged + + + Writes out the relative time of the event in milliseconds. + That is the number of milliseconds between the event + and the . + + + + + + Helper method to get the time difference between two DateTime objects + + start time (in the current local time zone) + end time (in the current local time zone) + the time difference in milliseconds + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + Adam Davies + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + Michael Cromwell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the strack frames to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Returns the Name of the method + + + This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter + string + + + + The fully qualified type of the StackTracePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The fully qualified type of the StackTraceDetailPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Converter to include event thread name + + + + Writes the to the output. + + + Nicko Cadell + + + + Write the ThreadName to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the . + + + + + + Pattern converter for the class name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Gets the fully qualified name of the class + + the event being logged + The fully qualified type name for the caller location + + + Returns the of the . + + + + + + Converter to include event user name + + Douglas de la Torre + Nicko Cadell + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + + + Write the TimeStamp to the output + + + + Date pattern converter, uses a to format + the date of a . + + + Uses a to format the + in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the TimeStamp to the output + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone, this is converted + to Universal time before it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + A flexible layout configurable with pattern string that re-evaluates on each call. + + + This class is built on and provides all the + features and capabilities of PatternLayout. PatternLayout is a 'static' class + in that its layout is done once at configuration time. This class will recreate + the layout on each reference. + One important difference between PatternLayout and DynamicPatternLayout is the + treatment of the Header and Footer parameters in the configuration. The Header and Footer + parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, + but should not be marked as type log4net.Util.PatternString. Doing so causes the + pattern to be statically converted at configuration time and causes DynamicPatternLayout + to perform the same as PatternLayout. + Please see for complete documentation. + + <layout type="log4net.Layout.DynamicPatternLayout"> + <param name="Header" value="%newline**** Trace Opened Local: %date{yyyy-MM-dd HH:mm:ss.fff} UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + </layout> + + + + + + A flexible layout configurable with pattern string. + + + + The goal of this class is to a + as a string. The results + depend on the conversion pattern. + + + The conversion pattern is closely related to the conversion + pattern of the printf function in C. A conversion pattern is + composed of literal text and format control expressions called + conversion specifiers. + + + You are free to insert any literal text within the conversion + pattern. + + + Each conversion specifier starts with a percent sign (%) and is + followed by optional format modifiers and a conversion + pattern name. The conversion pattern name specifies the type of + data, e.g. logger, level, date, thread name. The format + modifiers control such things as field width, padding, left and + right justification. The following is a simple example. + + + Let the conversion pattern be "%-5level [%thread]: %message%newline" and assume + that the log4net environment was set to use a PatternLayout. Then the + statements + + + ILog log = LogManager.GetLogger(typeof(TestApp)); + log.Debug("Message 1"); + log.Warn("Message 2"); + + would yield the output + + DEBUG [main]: Message 1 + WARN [main]: Message 2 + + + Note that there is no explicit separator between text and + conversion specifiers. The pattern parser knows when it has reached + the end of a conversion specifier when it reads a conversion + character. In the example above the conversion specifier + %-5level means the level of the logging event should be left + justified to a width of five characters. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + a + Equivalent to appdomain + + + appdomain + + Used to output the friendly name of the AppDomain where the + logging event was generated. + + + + aspnet-cache + + + Used to output all cache items in the case of %aspnet-cache or just one named item if used as %aspnet-cache{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-context + + + Used to output all context items in the case of %aspnet-context or just one named item if used as %aspnet-context{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-request + + + Used to output all request parameters in the case of %aspnet-request or just one named param if used as %aspnet-request{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-session + + + Used to output all session items in the case of %aspnet-session or just one named item if used as %aspnet-session{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + c + Equivalent to logger + + + C + Equivalent to type + + + class + Equivalent to type + + + d + Equivalent to date + + + date + + + Used to output the date of the logging event in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + exception + + + Used to output the exception passed in with the log message. + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + + + F + Equivalent to file + + + file + + + Used to output the file name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + WARNING Generating caller information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + l + Equivalent to location + + + L + Equivalent to line + + + location + + + Used to output location information of the caller which generated + the logging event. + + + The location information depends on the CLI implementation but + usually consists of the fully qualified name of the calling + method followed by the callers source the file name and line + number between parentheses. + + + The location information can be very useful. However, its + generation is extremely slow. Its use should be avoided + unless execution speed is not an issue. + + + See the note below on the availability of caller location information. + + + + + level + + + Used to output the level of the logging event. + + + + + line + + + Used to output the line number from where the logging request + was issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + logger + + + Used to output the logger of the logging event. The + logger conversion specifier can be optionally followed by + precision specifier, that is a decimal constant in + brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the logger name will be + printed. By default the logger name is printed in full. + + + For example, for the logger name "a.b.c" the pattern + %logger{2} will output "b.c". + + + + + m + Equivalent to message + + + M + Equivalent to method + + + message + + + Used to output the application supplied message associated with + the logging event. + + + + + mdc + + + The MDC (old name for the ThreadContext.Properties) is now part of the + combined event properties. This pattern is supported for compatibility + but is equivalent to property. + + + + + method + + + Used to output the method name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + n + Equivalent to newline + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + ndc + + + Used to output the NDC (nested diagnostic context) associated + with the thread that generated the logging event. + + + + + p + Equivalent to level + + + P + Equivalent to property + + + properties + Equivalent to property + + + property + + + Used to output the an event specific property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are added to events by loggers or appenders. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the event properties + + The event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + r + Equivalent to timestamp + + + stacktrace + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktrace{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + This pattern is not available for Compact Framework assemblies. + + + + + stacktracedetail + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktracedetail{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + This pattern is not available for Compact Framework assemblies. + + + + + t + Equivalent to thread + + + timestamp + + + Used to output the number of milliseconds elapsed since the start + of the application until the creation of the logging event. + + + + + thread + + + Used to output the name of the thread that generated the + logging event. Uses the thread number if no name is available. + + + + + type + + + Used to output the fully qualified type name of the caller + issuing the logging request. This conversion specifier + can be optionally followed by precision specifier, that + is a decimal constant in brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the class name will be + printed. By default the class name is output in fully qualified form. + + + For example, for the class name "log4net.Layout.PatternLayout", the + pattern %type{1} will output "PatternLayout". + + + WARNING Generating the caller class information is + slow. Thus, its use should be avoided unless execution speed is + not an issue. + + + See the note below on the availability of caller location information. + + + + + u + Equivalent to identity + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + WARNING Generating caller WindowsIdentity information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + w + Equivalent to username + + + x + Equivalent to ndc + + + X + Equivalent to mdc + + + % + + + The sequence %% outputs a single percent sign. + + + + + + The single letter patterns are deprecated in favor of the + longer more descriptive pattern names. + + + By default the relevant information is output as is. However, + with the aid of format modifiers it is possible to change the + minimum field width, the maximum field width and justification. + + + The optional format modifier is placed between the percent sign + and the conversion pattern name. + + + The first optional format modifier is the left justification + flag which is just the minus (-) character. Then comes the + optional minimum field width modifier. This is a decimal + constant that represents the minimum number of characters to + output. If the data item requires fewer characters, it is padded on + either the left or the right until the minimum width is + reached. The default is to pad on the left (right justify) but you + can specify right padding with the left justification flag. The + padding character is space. If the data item is larger than the + minimum field width, the field is expanded to accommodate the + data. The value is never truncated. + + + This behavior can be changed using the maximum field + width modifier which is designated by a period followed by a + decimal constant. If the data item is longer than the maximum + field, then the extra characters are removed from the + beginning of the data item and not from the end. For + example, it the maximum field width is eight and the data item is + ten characters long, then the first two characters of the data item + are dropped. This behavior deviates from the printf function in C + where truncation is done from the end. + + + Below are various format modifier examples for the logger + conversion specifier. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Format modifierleft justifyminimum widthmaximum widthcomment
%20loggerfalse20none + + Left pad with spaces if the logger name is less than 20 + characters long. + +
%-20loggertrue20none + + Right pad with spaces if the logger + name is less than 20 characters long. + +
%.30loggerNAnone30 + + Truncate from the beginning if the logger + name is longer than 30 characters. + +
%20.30loggerfalse2030 + + Left pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
%-20.30loggertrue2030 + + Right pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
+
+ + Note about caller location information.
+ The following patterns %type %file %line %method %location %class %C %F %L %l %M + all generate caller location information. + Location information uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. +
+ + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + + Additional pattern converters may be registered with a specific + instance using the method. + +
+ + This is a more detailed pattern. + %timestamp [%thread] %level %logger %ndc - %message%newline + + + A similar pattern except that the relative time is + right padded if less than 6 digits, thread name is right padded if + less than 15 characters and truncated if longer and the logger + name is left padded if shorter than 30 characters and truncated if + longer. + %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino +
+ + + Extend this abstract class to create your own log layout format. + + + + This is the base implementation of the + interface. Most layout objects should extend this class. + + + + + + Subclasses must implement the + method. + + + Subclasses should set the in their default + constructor. + + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by layout objects + + + + An object is used to format a + as text. The method is called by an + appender to transform the into a string. + + + The layout can also supply and + text that is appender before any events and after all the events respectively. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text and output to a writer. + + + If the caller does not have a and prefers the + event to be formatted as a then the following + code can be used to format the event into a . + + + StringWriter writer = new StringWriter(); + Layout.Format(writer, loggingEvent); + string formattedEvent = writer.ToString(); + + + + + + The content type output by this layout. + + The content type + + + The content type output by this layout. + + + This is a MIME type e.g. "text/plain". + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handle exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + + + + The header text + + + + See for more information. + + + + + + The footer text + + + + See for more information. + + + + + + Flag indicating if this layout handles exceptions + + + + false if this layout handles exceptions + + + + + + Empty default constructor + + + + Empty default constructor + + + + + + Activate component options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This method must be implemented by the subclass. + + + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text. + + + + + + Convenience method for easily formatting the logging event into a string variable. + + + + Creates a new StringWriter instance to store the formatted logging event. + + + + + The content type output by this layout. + + The content type is "text/plain" + + + The content type output by this layout. + + + This base class uses the value "text/plain". + To change this value a subclass must override this + property. + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handles exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + Set this value to override a this default setting. The default + value is true, this layout does not handle the exception. + + + + + + Default pattern string for log output. + + + + Default pattern string for log output. + Currently set to the string "%message%newline" + which just prints the application supplied message. + + + + + + A detailed conversion pattern + + + + A conversion pattern which includes Time, Thread, Logger, and Nested Context. + Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. + + + + + + Internal map of converter identifiers to converter types. + + + + This static map is overridden by the m_converterRegistry instance map + + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternLayout only + + + + + Initialize the global registry + + + + Defines the builtin global rules. + + + + + + Constructs a PatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + As per the contract the + method must be called after the properties on this object have been + configured. + + + + + + Constructs a PatternLayout using the supplied conversion pattern + + the pattern to use + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + When using this constructor the method + need not be called. This may not be the case when using a subclass. + + + + + + Create the pattern parser instance + + the pattern to parse + The that will format the event + + + Creates the used to parse the conversion string. Sets the + global and instance rules on the . + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string as specified by the conversion pattern. + + the event being logged + The TextWriter to write the formatted event to + + + Parse the using the patter format + specified in the property. + + + + + + Add a converter to this PatternLayout + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternLayout + + the name of the conversion pattern for this converter + the type of the converter + + + Add a named pattern converter to this instance. This + converter will be used in the formatting of the event. + This method must be called before . + + + The specified must extend the + type. + + + + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + The header PatternString + + + + + The footer PatternString + + + + + Constructs a DynamicPatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + + + + Constructs a DynamicPatternLayout using the supplied conversion pattern + + the pattern to use + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + The pattern will be formatted on each get operation. + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + The pattern will be formatted on each get operation. + + + + + A Layout that renders only the Exception text from the logging event + + + + A Layout that renders only the Exception text from the logging event. + + + This Layout should only be used with appenders that utilize multiple + layouts (e.g. ). + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Constructs a ExceptionLayout + + + + + + Activate component options + + + + Part of the component activation + framework. + + + This method does nothing as options become effective immediately. + + + + + + Gets the exception text from the logging event + + The TextWriter to write the formatted event to + the event being logged + + + Write the exception string to the . + The exception string is retrieved from . + + + + + + Interface for raw layout objects + + + + Interface used to format a + to an object. + + + This interface should not be confused with the + interface. This interface is used in + only certain specialized situations where a raw object is + required rather than a formatted string. The + is not generally useful than this interface. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The event to format + returns the formatted event + + + Implement this method to create your own layout format. + + + + + + Adapts any to a + + + + Where an is required this adapter + allows a to be specified. + + + Nicko Cadell + Gert Driesen + + + + The layout to adapt + + + + + Construct a new adapter + + the layout to adapt + + + Create the adapter for the specified . + + + + + + Format the logging event as an object. + + The event to format + returns the formatted event + + + Format the logging event as an object. + + + Uses the object supplied to + the constructor to perform the formatting. + + + + + + Type converter for the interface + + + + Used to convert objects to the interface. + Supports converting from the interface to + the interface using the . + + + Nicko Cadell + Gert Driesen + + + + Interface supported by type converters + + + + This interface supports conversion from arbitrary types + to a single target type. See . + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Test if the can be converted to the + type supported by this converter. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Converts the to the type supported + by this converter. + + + + + + Can the sourceType be converted to an + + the source to be to be converted + true if the source type can be converted to + + + Test if the can be converted to a + . Only is supported + as the . + + + + + + Convert the value to a object + + the value to convert + the object + + + Convert the object to a + object. If the object + is a then the + is used to adapt between the two interfaces, otherwise an + exception is thrown. + + + + + + Extract the value of a property from the + + + + Extract the value of a property from the + + + Nicko Cadell + + + + Constructs a RawPropertyLayout + + + + + Lookup the property for + + The event to format + returns property value + + + Looks up and returns the object value of the property + named . If there is no property defined + with than name then null will be returned. + + + + + + The name of the value to lookup in the LoggingEvent Properties collection. + + + Value to lookup in the LoggingEvent Properties collection + + + + String name of the property to lookup in the . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in local time. To format the time stamp + in universal time use . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawUtcTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in universal time. To format the time stamp + in local time use . + + + + + + A very simple layout + + + + SimpleLayout consists of the level of the log statement, + followed by " - " and then the log message itself. For example, + + DEBUG - Hello world + + + + Nicko Cadell + Gert Driesen + + + + Constructs a SimpleLayout + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a simple formatted output. + + the event being logged + The TextWriter to write the formatted event to + + + Formats the event as the level of the even, + followed by " - " and then the log message itself. The + output is terminated by a newline. + + + + + + Layout that formats the log events as XML elements. + + + + The output of the consists of a series of + log4net:event elements. It does not output a complete well-formed XML + file. The output is designed to be included as an external entity + in a separate file to form a correct XML file. + + + For example, if abc is the name of the file where + the output goes, then a well-formed XML file would + be: + + + <?xml version="1.0" ?> + + <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> + + <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> + &data; + </log4net:events> + + + This approach enforces the independence of the + and the appender where it is embedded. + + + The version attribute helps components to correctly + interpret output generated by . The value of + this attribute should be "1.2" for release 1.2 and later. + + + Alternatively the Header and Footer properties can be + configured to output the correct XML header, open tag and close tag. + When setting the Header and Footer properties it is essential + that the underlying data store not be appendable otherwise the data + will become invalid XML. + + + Nicko Cadell + Gert Driesen + + + + Layout that formats the log events as XML elements. + + + + This is an abstract class that must be subclassed by an implementation + to conform to a specific schema. + + + Deriving classes must implement the method. + + + Nicko Cadell + Gert Driesen + + + + Protected constructor to support subclasses + + + + Initializes a new instance of the class + with no location info. + + + + + + Protected constructor to support subclasses + + + + The parameter determines whether + location information will be output by the layout. If + is set to true, then the + file name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string. + + The event being logged. + The TextWriter to write the formatted event to + + + Format the and write it to the . + + + This method creates an that writes to the + . The is passed + to the method. Subclasses should override the + method rather than this method. + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Subclasses should override this method to format + the as XML. + + + + + + Flag to indicate if location information should be included in + the XML events. + + + + + The string to replace invalid chars with + + + + + Gets a value indicating whether to include location information in + the XML events. + + + true if location information should be included in the XML + events; otherwise, false. + + + + If is set to true, then the file + name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + The string to replace characters that can not be expressed in XML with. + + + Not all characters may be expressed in XML. This property contains the + string to replace those that can not with. This defaults to a ?. Set it + to the empty string to simply remove offending characters. For more + details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets + Character replacement will occur in the log message, the property names + and the property values. + + + + + + + Gets the content type output by this layout. + + + As this is the XML layout, the value is always "text/xml". + + + + As this is the XML layout, the value is always "text/xml". + + + + + + Constructs an XmlLayout + + + + + Constructs an XmlLayout. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SmtpAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Builds a cache of the element names + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Override the base class method + to write the to the . + + + + + + The prefix to use for all generated element names + + + + + The prefix to use for all element names + + + + The default prefix is log4net. Set this property + to change the prefix. If the prefix is set to an empty string + then no prefix will be written. + + + + + + Set whether or not to base64 encode the message. + + + + By default the log message will be written as text to the xml + output. This can cause problems when the message contains binary + data. By setting this to true the contents of the message will be + base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the log message. + + + + + + Set whether or not to base64 encode the property values. + + + + By default the properties will be written as text to the xml + output. This can cause problems when one or more properties contain + binary data. By setting this to true the values of the properties + will be base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the property values. + + + + + + Layout that formats the log events as XML elements compatible with the log4j schema + + + + Formats the log events according to the http://logging.apache.org/log4j schema. + + + Nicko Cadell + + + + The 1st of January 1970 in UTC + + + + + Constructs an XMLLayoutSchemaLog4j + + + + + Constructs an XMLLayoutSchemaLog4j. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Actually do the writing of the xml + + the writer to use + the event to write + + + Generate XML that is compatible with the log4j schema. + + + + + + The version of the log4j schema to use. + + + + Only version 1.2 of the log4j schema is supported. + + + + + + The default object Renderer. + + + + The default renderer supports rendering objects and collections to strings. + + + See the method for details of the output. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface in order to render objects as strings + + + + Certain types require special case conversion to + string form. This conversion is done by an object renderer. + Object renderers implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a + string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + + + + Default constructor + + + + Default constructor + + + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + The default renderer supports rendering objects to strings as follows: + + + + Value + Rendered String + + + null + + "(null)" + + + + + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + , & + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: {a, b, c}. + + + All collection classes that implement its subclasses, + or generic equivalents all implement the interface. + + + + + + + + Rendered as the key, an equals sign ('='), and the value (using the appropriate + renderer). + + + For example: key=value. + + + + + other + + Object.ToString() + + + + + + + + Render the array argument into a string + + The map used to lookup renderers + the array to render + The writer to render to + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + + Render the enumerator argument into a string + + The map used to lookup renderers + the enumerator to render + The writer to render to + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + {a, b, c}. + + + + + + Render the DictionaryEntry argument into a string + + The map used to lookup renderers + the DictionaryEntry to render + The writer to render to + + + Render the key, an equals sign ('='), and the value (using the appropriate + renderer). For example: key=value. + + + + + + Map class objects to an . + + + + Maintains a mapping between types that require special + rendering and the that + is used to render them. + + + The method is used to render an + object using the appropriate renderers defined in this map. + + + Nicko Cadell + Gert Driesen + + + + Default Constructor + + + + Default constructor. + + + + + + Render using the appropriate renderer. + + the object to render to a string + the object rendered as a string + + + This is a convenience method used to render an object to a string. + The alternative method + should be used when streaming output to a . + + + + + + Render using the appropriate renderer. + + the object to render to a string + The writer to render to + + + Find the appropriate renderer for the type of the + parameter. This is accomplished by calling the + method. Once a renderer is found, it is + applied on the object and the result is returned + as a . + + + + + + Gets the renderer for the specified object type + + the object to lookup the renderer for + the renderer for + + + Gets the renderer for the specified object type. + + + Syntactic sugar method that calls + with the type of the object parameter. + + + + + + Gets the renderer for the specified type + + the type to lookup the renderer for + the renderer for the specified type + + + Returns the renderer for the specified type. + If no specific renderer has been defined the + will be returned. + + + + + + Internal function to recursively search interfaces + + the type to lookup the renderer for + the renderer for the specified type + + + + Clear the map of renderers + + + + Clear the custom renderers defined by using + . The + cannot be removed. + + + + + + Register an for . + + the type that will be rendered by + the renderer for + + + Register an object renderer for a specific source type. + This renderer will be returned from a call to + specifying the same as an argument. + + + + + + Get the default renderer instance + + the default renderer + + + Get the default renderer + + + + + + Interface implemented by logger repository plugins. + + + + Plugins define additional behavior that can be associated + with a . + The held by the + property is used to store the plugins for a repository. + + + The log4net.Config.PluginAttribute can be used to + attach plugins to repositories created using configuration + attributes. + + + Nicko Cadell + Gert Driesen + + + + Attaches the plugin to the specified . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + Gets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a PluginCollection instance. + + list to create a readonly wrapper arround + + A PluginCollection wrapper that is read-only. + + + + + Initializes a new instance of the PluginCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the PluginCollection class + that has the specified initial capacity. + + + The number of elements that the new PluginCollection is initially capable of storing. + + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified PluginCollection. + + The PluginCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire PluginCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire PluginCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the PluginCollection. + + The to be added to the end of the PluginCollection. + The index at which the value has been added. + + + + Removes all elements from the PluginCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the PluginCollection. + + The to check for. + true if is found in the PluginCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the PluginCollection. + + The to locate in the PluginCollection. + + The zero-based index of the first occurrence of + in the entire PluginCollection, if found; otherwise, -1. + + + + + Inserts an element into the PluginCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the PluginCollection. + + The to remove from the PluginCollection. + + The specified was not found in the PluginCollection. + + + + + Removes the element at the specified index of the PluginCollection. + + The zero-based index of the element to remove. + + is less than zero. + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the PluginCollection. + + An for the entire PluginCollection. + + + + Adds the elements of another PluginCollection to the current PluginCollection. + + The PluginCollection whose elements should be added to the end of the current PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a array to the current PluginCollection. + + The array whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a collection to the current PluginCollection. + + The collection whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the PluginCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + An object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + + The at the specified index. + + The zero-based index of the element to get or set. + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false. + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false. + + + + Gets or sets the number of elements the PluginCollection can contain. + + + The number of elements the PluginCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + The current element in the collection. + + + + + + + + Map of repository plugins. + + + + This class is a name keyed map of the plugins that are + attached to a repository. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The repository that the plugins should be attached to. + + + Initialize a new instance of the class with a + repository that the plugins should be attached to. + + + + + + Adds a to the map. + + The to add to the map. + + + The will be attached to the repository when added. + + + If there already exists a plugin with the same name + attached to the repository then the old plugin will + be and replaced with + the new plugin. + + + + + + Removes a from the map. + + The to remove from the map. + + + Remove a specific plugin from this map. + + + + + + Gets a by name. + + The name of the to lookup. + + The from the map with the name specified, or + null if no plugin is found. + + + + Lookup a plugin by name. If the plugin is not found null + will be returned. + + + + + + Gets all possible plugins as a list of objects. + + All possible plugins as a list of objects. + + + Get a collection of all the plugins defined in this map. + + + + + + Base implementation of + + + + Default abstract implementation of the + interface. This base class can be used by implementors + of the interface. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + the name of the plugin + + Initializes a new Plugin with the specified name. + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + The name of this plugin. + + + + + The repository this plugin is attached to. + + + + + Gets or sets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + The name of the plugin must not change one the + plugin has been attached to a repository. + + + + + + The repository for this plugin + + + The that this plugin is attached to. + + + + Gets or sets the that this plugin is + attached to. + + + + + + Plugin that listens for events from the + + + + This plugin publishes an instance of + on a specified . This listens for logging events delivered from + a remote . + + + When an event is received it is relogged within the attached repository + as if it had been raised locally. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + The property must be set. + + + + + + Construct with sink Uri. + + The name to publish the sink under in the remoting infrastructure. + See for more details. + + + Initializes a new instance of the class + with specified name. + + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + When the plugin is shutdown the remote logging + sink is disconnected. + + + + + + The fully qualified type of the RemoteLoggingServerPlugin class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the URI of this sink. + + + The URI of this sink. + + + + This is the name under which the object is marshaled. + + + + + + + Delivers objects to a remote sink. + + + + Internal class used to listen for logging events + and deliver them to the local repository. + + + + + + Constructor + + The repository to log to. + + + Initializes a new instance of the for the + specified . + + + + + + Logs the events to the repository. + + The events to log. + + + The events passed are logged to the + + + + + + Obtains a lifetime service object to control the lifetime + policy for this instance. + + null to indicate that this instance should live forever. + + + Obtains a lifetime service object to control the lifetime + policy for this instance. This object should live forever + therefore this implementation returns null. + + + + + + The underlying that events should + be logged to. + + + + + Default implementation of + + + + This default implementation of the + interface is used to create the default subclass + of the object. + + + Nicko Cadell + Gert Driesen + + + + Interface abstracts creation of instances + + + + This interface is used by the to + create new objects. + + + The method is called + to create a named . + + + Implement this interface to create new subclasses of . + + + Nicko Cadell + Gert Driesen + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default internal subclass of + + + + This subclass has no additional behavior over the + class but does allow instances + to be created. + + + + + + Implementation of used by + + + + Internal class used to provide implementation of + interface. Applications should use to get + logger instances. + + + This is one of the central classes in the log4net implementation. One of the + distinctive features of log4net are hierarchical loggers and their + evaluation. The organizes the + instances into a rooted tree hierarchy. + + + The class is abstract. Only concrete subclasses of + can be created. The + is used to create instances of this type for the . + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + + + + This constructor created a new instance and + sets its name. + + The name of the . + + + This constructor is protected and designed to be used by + a subclass that is not abstract. + + + Loggers are constructed by + objects. See for the default + logger creator. + + + + + + Add to the list of appenders of this + Logger instance. + + An appender to add to this logger + + + Add to the list of appenders of this + Logger instance. + + + If is already in the list of + appenders, then it won't be added again. + + + + + + Look for the appender named as name + + The name of the appender to lookup + The appender with the name specified, or null. + + + Returns the named appender, or null if the appender is not found. + + + + + + Remove all previously added appenders from this Logger instance. + + + + Remove all previously added appenders from this Logger instance. + + + This is useful when re-reading configuration information. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The appender to remove + The appender removed from the list + + + Remove the appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The name of the appender to remove + The appender removed from the list + + + Remove the named appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the and . + + + This method must not throw any exception to the caller. + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + This method must not throw any exception to the caller. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + This method must not throw any exception to the caller. + + + + + + Deliver the to the attached appenders. + + The event to log. + + + Call the appenders in the hierarchy starting at + this. If no appenders could be found, emit a + warning. + + + This method calls all the appenders inherited from the + hierarchy circumventing any evaluation of whether to log or not + to log the particular log request. + + + + + + Closes all attached appenders implementing the interface. + + + + Used to ensure that the appenders are correctly shutdown. + + + + + + This is the most generic printing method. This generic form is intended to be used by wrappers + + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the . + + + + + + Creates a new logging event and logs the event without further checks. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generates a logging event and delivers it to the attached + appenders. + + + + + + Creates a new logging event and logs the event without further checks. + + The event being logged. + + + Delivers the logging event to the attached appenders. + + + + + + The fully qualified type of the Logger class. + + + + + The name of this logger. + + + + + The assigned level of this logger. + + + + The level variable need not be + assigned a value in which case it is inherited + form the hierarchy. + + + + + + The parent of this logger. + + + + The parent of this logger. + All loggers have at least one ancestor which is the root logger. + + + + + + Loggers need to know what Hierarchy they are in. + + + + Loggers need to know what Hierarchy they are in. + The hierarchy that this logger is a member of is stored + here. + + + + + + Helper implementation of the interface + + + + + Flag indicating if child loggers inherit their parents appenders + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + + + + + Gets or sets the parent logger in the hierarchy. + + + The parent logger in the hierarchy. + + + + Part of the Composite pattern that makes the hierarchy. + The hierarchy is parent linked rather than child linked. + + + + + + Gets or sets a value indicating if child loggers inherit their parent's appenders. + + + true if child loggers inherit their parent's appenders. + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Gets the effective level for this logger. + + The nearest level in the logger hierarchy. + + + Starting from this logger, searches the logger hierarchy for a + non-null level and returns it. Otherwise, returns the level of the + root logger. + + The Logger class is designed so that this method executes as + quickly as possible. + + + + + Gets or sets the where this + Logger instance is attached to. + + The hierarchy that this logger belongs to. + + + This logger must be attached to a single . + + + + + + Gets or sets the assigned , if any, for this Logger. + + + The of this logger. + + + + The assigned can be null. + + + + + + Get the appenders contained in this logger as an + . + + A collection of the appenders in this logger + + + Get the appenders contained in this logger as an + . If no appenders + can be found, then a is returned. + + + + + + Gets the logger name. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Construct a new Logger + + the name of the logger + + + Initializes a new instance of the class + with the specified name. + + + + + + Delegate used to handle logger creation event notifications. + + The in which the has been created. + The event args that hold the instance that has been created. + + + Delegate used to handle logger creation event notifications. + + + + + + Provides data for the event. + + + + A event is raised every time a + is created. + + + + + + The created + + + + + Constructor + + The that has been created. + + + Initializes a new instance of the event argument + class,with the specified . + + + + + + Gets the that has been created. + + + The that has been created. + + + + The that has been created. + + + + + + Hierarchical organization of loggers + + + + The casual user should not have to deal with this class + directly. + + + This class is specialized in retrieving loggers by name and + also maintaining the logger hierarchy. Implements the + interface. + + + The structure of the logger hierarchy is maintained by the + method. The hierarchy is such that children + link to their parent but parents do not have any references to their + children. Moreover, loggers can be instantiated in any order, in + particular descendant before ancestor. + + + In case a descendant is created before a particular ancestor, + then it creates a provision node for the ancestor and adds itself + to the provision node. Other descendants of the same ancestor add + themselves to the previously created provision node. + + + Nicko Cadell + Gert Driesen + + + + Base implementation of + + + + Default abstract implementation of the interface. + + + Skeleton implementation of the interface. + All types can extend this type. + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by logger repositories. + + + + This interface is implemented by logger repositories. e.g. + . + + + This interface is used by the + to obtain interfaces. + + + Nicko Cadell + Gert Driesen + + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + The name of the logger to lookup + The Logger object with the name specified + + + If the names logger exists it is returned, otherwise + null is returned. + + + + + + Returns all the currently defined loggers as an Array. + + All the defined loggers + + + Returns all the currently defined loggers as an Array. + + + + + + Returns a named logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Returns a named logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + Shutdown the repository + + + Shutting down a repository will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The name of the repository + + + The name of the repository + + + + The name of the repository. + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Collection of internal messages captured during the most + recent configuration process. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + + These properties can be specified on a repository specific basis. + + + + + + Default Constructor + + + + Initializes the repository with default (empty) properties. + + + + + + Construct the repository using specific properties + + the properties to set for this repository + + + Initializes the repository with specified properties. + + + + + + Test if logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the repository + + All the defined loggers + + + Returns all the currently defined loggers in the repository as an Array. + + + + + + Return a new logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Return a new logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + + Shutdown the repository + + + + Shutdown the repository. Can be overridden in a subclass. + This base class implementation notifies the + listeners and all attached plugins of the shutdown event. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The fully qualified type of the LoggerRepositorySkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Adds an object renderer for a specific class. + + The type that will be rendered by the renderer supplied. + The object renderer used to render the object. + + + Adds an object renderer for a specific class. + + + + + + Notify the registered listeners that the repository is shutting down + + Empty EventArgs + + + Notify any listeners that this repository is shutting down. + + + + + + Notify the registered listeners that the repository has had its configuration reset + + Empty EventArgs + + + Notify any listeners that this repository's configuration has been reset. + + + + + + Notify the registered listeners that the repository has had its configuration changed + + Empty EventArgs + + + Notify any listeners that this repository's configuration has changed. + + + + + + Raise a configuration changed event on this repository + + EventArgs.Empty + + + Applications that programmatically change the configuration of the repository should + raise this event notification to notify listeners. + + + + + + The name of the repository + + + The string name of the repository + + + + The name of this repository. The name is + used to store and lookup the repositories + stored by the . + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Contains a list of internal messages captures during the + last configuration. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + These properties can be specified on a repository specific basis + + + + + Basic Configurator interface for repositories + + + + Interface used by basic configurator to configure a + with a default . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified appender + + the appender to use to log all logging events + + + Configure the repository to route all logging events to the + specified appender. + + + + + + Initialize the repository using the specified appenders + + the appenders to use to log all logging events + + + Configure the repository to route all logging events to the + specified appenders. + + + + + + Configure repository using XML + + + + Interface used by Xml configurator to configure a . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified config + + the element containing the root of the config + + + The schema for the XML configuration data is defined by + the implementation. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Construct with properties + + The properties to pass to this repository. + + + Initializes a new instance of the class. + + + + + + Construct with a logger factory + + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Construct with properties and a logger factory + + The properties to pass to this repository. + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Test if a logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the hierarchy. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the hierarchy as an Array + + All the defined loggers + + + Returns all the currently defined loggers in the hierarchy as an Array. + The root logger is not included in the returned + enumeration. + + + + + + Return a new logger instance named as the first parameter using + the default factory. + + + + Return a new logger instance named as the first parameter using + the default factory. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + The name of the logger to retrieve + The logger object with the name specified + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The Shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset all values contained in this hierarchy instance to their default. + + + + Reset all values contained in this hierarchy instance to their + default. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this hierarchy. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are currently configured + + An array containing all the currently configured appenders + + + Returns all the instances that are currently configured. + All the loggers are searched for appenders. The appenders may also be containers + for appenders and these are also searched for additional loggers. + + + The list returned is unordered but does not contain duplicates. + + + + + + Collect the appenders from an . + The appender may also be a container. + + + + + + + Collect the appenders from an container + + + + + + + Initialize the log4net system using the specified appender + + the appender to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Test if this hierarchy is disabled for the specified . + + The level to check against. + + true if the repository is disabled for the level argument, false otherwise. + + + + If this hierarchy has not been configured then this method will + always return true. + + + This method will return true if this repository is + disabled for level object passed as parameter and + false otherwise. + + + See also the property. + + + + + + Clear all logger definitions from the internal hashtable + + + + This call will clear all logger definitions from the internal + hashtable. Invoking this method will irrevocably mess up the + logger hierarchy. + + + You should really know what you are doing before + invoking this method. + + + + + + Return a new logger instance named as the first parameter using + . + + The name of the logger to retrieve + The factory that will make the new logger instance + The logger object with the name specified + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated by the + parameter and linked with its existing + ancestors as well as children. + + + + + + Sends a logger creation event to all registered listeners + + The newly created logger + + Raises the logger creation event. + + + + + Updates all the parents of the specified logger + + The logger to update the parents for + + + This method loops through all the potential parents of + . There 3 possible cases: + + + + No entry for the potential parent of exists + + We create a ProvisionNode for this potential + parent and insert in that provision node. + + + + The entry is of type Logger for the potential parent. + + The entry is 's nearest existing parent. We + update 's parent field with this entry. We also break from + he loop because updating our parent's parent is our parent's + responsibility. + + + + The entry is of type ProvisionNode for this potential parent. + + We add to the list of children for this + potential parent. + + + + + + + + Replace a with a in the hierarchy. + + + + + + We update the links for all the children that placed themselves + in the provision node 'pn'. The second argument 'log' is a + reference for the newly created Logger, parent of all the + children in 'pn'. + + + We loop on all the children 'c' in 'pn'. + + + If the child 'c' has been already linked to a child of + 'log' then there is no need to update 'c'. + + + Otherwise, we set log's parent field to c's parent and set + c's parent field to log. + + + + + + Define or redefine a Level using the values in the argument + + the level values + + + Define or redefine a Level using the values in the argument + + + Supports setting levels via the configuration file. + + + + + + Set a Property using the values in the argument + + the property value + + + Set a Property using the values in the argument. + + + Supports setting property values via the configuration file. + + + + + + The fully qualified type of the Hierarchy class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event used to notify that a logger has been created. + + + + Event raised when a logger is created. + + + + + + Has no appender warning been emitted + + + + Flag to indicate if we have already issued a warning + about not having an appender warning. + + + + + + Get the root of this hierarchy + + + + Get the root of this hierarchy. + + + + + + Gets or sets the default instance. + + The default + + + The logger factory is used to create logger instances. + + + + + + A class to hold the value, name and display name for a level + + + + A class to hold the value, name and display name for a level + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Value of the level + + + + If the value is not set (defaults to -1) the value will be looked + up for the current level with the same name. + + + + + + Name of the level + + + The name of the level + + + + The name of the level. + + + + + + Display name for the level + + + The display name of the level + + + + The display name of the level. + + + + + + Used internally to accelerate hash table searches. + + + + Internal class used to improve performance of + string keyed hashtables. + + + The hashcode of the string is cached for reuse. + The string is stored as an interned value. + When comparing two objects for equality + the reference equality of the interned strings is compared. + + + Nicko Cadell + Gert Driesen + + + + Construct key with string name + + + + Initializes a new instance of the class + with the specified name. + + + Stores the hashcode of the string and interns + the string key to optimize comparisons. + + + The Compact Framework 1.0 the + method does not work. On the Compact Framework + the string keys are not interned nor are they + compared by reference. + + + The name of the logger. + + + + Returns a hash code for the current instance. + + A hash code for the current instance. + + + Returns the cached hashcode. + + + + + + Determines whether two instances + are equal. + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + + Compares the references of the interned strings. + + + + + + Provision nodes are used where no logger instance has been specified + + + + instances are used in the + when there is no specified + for that node. + + + A provision node holds a list of child loggers on behalf of + a logger that does not exist. + + + Nicko Cadell + Gert Driesen + + + + Create a new provision node with child node + + A child logger to add to this node. + + + Initializes a new instance of the class + with the specified child logger. + + + + + + The sits at the root of the logger hierarchy tree. + + + + The is a regular except + that it provides several guarantees. + + + First, it cannot be assigned a null + level. Second, since the root logger cannot have a parent, the + property always returns the value of the + level field without walking the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Construct a + + The level to assign to the root logger. + + + Initializes a new instance of the class with + the specified logging level. + + + The root logger names itself as "root". However, the root + logger cannot be retrieved by name. + + + + + + The fully qualified type of the RootLogger class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the assigned level value without walking the logger hierarchy. + + The assigned level value without walking the logger hierarchy. + + + Because the root logger cannot have a parent and its level + must not be null this property just returns the + value of . + + + + + + Gets or sets the assigned for the root logger. + + + The of the root logger. + + + + Setting the level of the root logger to a null reference + may have catastrophic results. We prevent this here. + + + + + + Initializes the log4net environment using an XML DOM. + + + + Configures a using an XML DOM. + + + Nicko Cadell + Gert Driesen + + + + Construct the configurator for a hierarchy + + The hierarchy to build. + + + Initializes a new instance of the class + with the specified . + + + + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + The root element to parse. + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + + + + + Parse appenders by IDREF. + + The appender ref element. + The instance of the appender that the ref refers to. + + + Parse an XML element that represents an appender and return + the appender. + + + + + + Parses an appender element. + + The appender element. + The appender instance or null when parsing failed. + + + Parse an XML element that represents an appender and return + the appender instance. + + + + + + Parses a logger element. + + The logger element. + + + Parse an XML element that represents a logger. + + + + + + Parses the root logger element. + + The root element. + + + Parse an XML element that represents the root logger. + + + + + + Parses the children of a logger element. + + The category element. + The logger instance. + Flag to indicate if the logger is the root logger. + + + Parse the child elements of a <logger> element. + + + + + + Parses an object renderer. + + The renderer element. + + + Parse an XML element that represents a renderer. + + + + + + Parses a level element. + + The level element. + The logger object to set the level on. + Flag to indicate if the logger is the root logger. + + + Parse an XML element that represents a level. + + + + + + Sets a parameter on an object. + + The parameter element. + The object to set the parameter on. + + The parameter name must correspond to a writable property + on the object. The value of the parameter is a string, + therefore this function will attempt to set a string + property first. If unable to set a string property it + will inspect the property and its argument type. It will + attempt to call a static method called Parse on the + type of the property. This method will take a single + string argument and return a value that can be used to + set the property. + + + + + Test if an element has no attributes or child elements + + the element to inspect + true if the element has any attributes or child elements, false otherwise + + + + Test if a is constructible with Activator.CreateInstance. + + the type to inspect + true if the type is creatable using a default constructor, false otherwise + + + + Look for a method on the that matches the supplied + + the type that has the method + the name of the method + the method info found + + + The method must be a public instance method on the . + The method must be named or "Add" followed by . + The method must take a single parameter. + + + + + + Converts a string value to a target type. + + The type of object to convert the string to. + The string value to use as the value of the object. + + + An object of type with value or + null when the conversion could not be performed. + + + + + + Creates an object as specified in XML. + + The XML element that contains the definition of the object. + The object type to use if not explicitly specified. + The type that the returned object must be or must inherit from. + The object or null + + + Parse an XML element and create an object instance based on the configuration + data. + + + The type of the instance may be specified in the XML. If not + specified then the is used + as the type. However the type is specified it must support the + type. + + + + + + key: appenderName, value: appender. + + + + + The Hierarchy being configured. + + + + + The fully qualified type of the XmlHierarchyConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + + + + + + + + + + + + + + + + + Delegate used to handle logger repository shutdown event notifications + + The that is shutting down. + Empty event args + + + Delegate used to handle logger repository shutdown event notifications. + + + + + + Delegate used to handle logger repository configuration reset event notifications + + The that has had its configuration reset. + Empty event args + + + Delegate used to handle logger repository configuration reset event notifications. + + + + + + Delegate used to handle event notifications for logger repository configuration changes. + + The that has had its configuration changed. + Empty event arguments. + + + Delegate used to handle event notifications for logger repository configuration changes. + + + + + + Write the name of the current AppDomain to the output + + + + Write the name of the current AppDomain to the output writer + + + Nicko Cadell + + + + Write the name of the current AppDomain to the output + + the writer to write to + null, state is not set + + + Writes name of the current AppDomain to the output . + + + + + + Write the current date to the output + + + + Date pattern converter, uses a to format + the current date and time to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The date and time is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current date to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date and time passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an folder path to the output + + + + Write an special path environment folder path to the output writer. + The value of the determines + the name of the variable to output. + should be a value in the enumeration. + + + Ron Grabowski + + + + Write an special path environment folder path to the output + + the writer to write to + null, state is not set + + + Writes the special path environment folder path to the output . + The name of the special path environment folder path to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentFolderPathPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an environment variable to the output + + + + Write an environment variable to the output writer. + The value of the determines + the name of the variable to output. + + + Nicko Cadell + + + + Write an environment variable to the output + + the writer to write to + null, state is not set + + + Writes the environment variable to the output . + The name of the environment variable to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current thread identity to the output + + + + Write the current thread identity to the output writer + + + Nicko Cadell + + + + Write the current thread identity to the output + + the writer to write to + null, state is not set + + + Writes the current thread identity to the output . + + + + + + The fully qualified type of the IdentityPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Pattern converter for literal string instances in the pattern + + + + Writes the literal string value specified in the + property to + the output. + + + Nicko Cadell + + + + Set the next converter in the chain + + The next pattern converter in the chain + The next pattern converter + + + Special case the building of the pattern converter chain + for instances. Two adjacent + literals in the pattern can be represented by a single combined + pattern converter. This implementation detects when a + is added to the chain + after this converter and combines its value with this converter's + literal value. + + + + + + Write the literal to the output + + the writer to write to + null, not set + + + Override the formatting behavior to ignore the FormattingInfo + because we have a literal instead. + + + Writes the value of + to the output . + + + + + + Convert this pattern into the rendered message + + that will receive the formatted result. + null, not set + + + This method is not used. + + + + + + Writes a newline to the output + + + + Writes the system dependent line terminator to the output. + This behavior can be overridden by setting the : + + + + Option Value + Output + + + DOS + DOS or Windows line terminator "\r\n" + + + UNIX + UNIX line terminator "\n" + + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current process ID to the output + + + + Write the current process ID to the output writer + + + Nicko Cadell + + + + Write the current process ID to the output + + the writer to write to + null, state is not set + + + Write the current process ID to the output . + + + + + + The fully qualified type of the ProcessIdPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Property pattern converter + + + + This pattern converter reads the thread and global properties. + The thread properties take priority over global properties. + See for details of the + thread properties. See for + details of the global properties. + + + If the is specified then that will be used to + lookup a single property. If no is specified + then all properties will be dumped as a list of key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + null, state is not set + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + A Pattern converter that generates a string of random characters + + + + The converter generates a string of random characters. By default + the string is length 4. This can be changed by setting the + to the string value of the length required. + + + The random characters in the string are limited to uppercase letters + and numbers only. + + + The random number generator used by this class is not cryptographically secure. + + + Nicko Cadell + + + + Shared random number generator + + + + + Length of random string to generate. Default length 4. + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write a randoim string to the output + + the writer to write to + null, state is not set + + + Write a randoim string to the output . + + + + + + The fully qualified type of the RandomStringPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current threads username to the output + + + + Write the current threads username to the output writer + + + Nicko Cadell + + + + Write the current threads username to the output + + the writer to write to + null, state is not set + + + Write the current threads username to the output . + + + + + + The fully qualified type of the UserNamePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the UTC date time to the output + + + + Date pattern converter, uses a to format + the current date and time in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the current date and time to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date is in Universal time when it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Type converter for Boolean. + + + + Supports conversion from string to bool type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Exception base type for conversion errors. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class + with the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + An instance of the . + + + Creates a new instance of the class. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + A nested exception to include. + An instance of the . + + + Creates a new instance of the class. + + + + + + Register of type converters for specific types. + + + + Maintains a registry of type converters used to convert between + types. + + + Use the and + methods to register new converters. + The and methods + lookup appropriate converters to use. + + + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + Initializes a new instance of the class. + + + + + Static constructor. + + + + This constructor defines the intrinsic type converters. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type converter to use to convert to the destination type. + + + Adds a converter instance for a specific type. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type of the type converter to use to convert to the destination type. + + + Adds a converter for a specific type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted from. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Lookups the type converter to use as specified by the attributes on the + destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + + Creates the instance of the type converter. + + The type of the type converter. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + The type specified for the type converter must implement + the or interfaces + and must have a public default (no argument) constructor. + + + + + + The fully qualified type of the ConverterRegistry class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Mapping from to type converter. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an encoding + the encoding + + + Uses the method to + convert the argument to an . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Interface supported by type converters + + + + This interface supports conversion from a single type to arbitrary types. + See . + + + Nicko Cadell + + + + Returns whether this converter can convert the object to the specified type + + A Type that represents the type you want to convert to + true if the conversion is possible + + + Test if the type supported by this converter can be converted to the + . + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Converts the (which must be of the type supported + by this converter) to the specified.. + + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an IPAddress + the IPAddress + + + Uses the method to convert the + argument to an . + If that fails then the string is resolved as a DNS hostname. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternLayout + the PatternLayout + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Convert between string and + + + + Supports conversion from string to type, + and from a type to a string. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the target type be converted to the type supported by this object + + A that represents the type you want to convert to + true if the conversion is possible + + + Returns true if the is + assignable from a type. + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + . To check for this condition use the + method. + + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternString + the PatternString + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a Type + the Type + + + Uses the method to convert the + argument to a . + Additional effort is made to locate partially specified types + by searching the loaded assemblies. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Attribute used to associate a type converter + + + + Class and Interface level attribute that specifies a type converter + to use with the associated type. + + + To associate a type converter with a target type apply a + TypeConverterAttribute to the target type. Specify the + type of the type converter on the attribute. + + + Nicko Cadell + Gert Driesen + + + + The string type name of the type converter + + + + + Default constructor + + + + Default constructor + + + + + + Create a new type converter attribute for the specified type name + + The string type name of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + Create a new type converter attribute for the specified type + + The type of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + The string type name of the type converter + + + The string type name of the type converter + + + + The type specified must implement the + or the interfaces. + + + + + + A straightforward implementation of the interface. + + + + This is the default implementation of the + interface. Implementors of the interface + should aggregate an instance of this type. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Append on on all attached appenders. + + The event being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Append on on all attached appenders. + + The array of events being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Calls the DoAppende method on the with + the objects supplied. + + The appender + The events + + + If the supports the + interface then the will be passed + through using that interface. Otherwise the + objects in the array will be passed one at a time. + + + + + + Attaches an appender. + + The appender to add. + + + If the appender is already in the list it won't be added again. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Lookup an attached appender by name. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + List of appenders + + + + + Array of appenders, used to cache the m_appenderList + + + + + The fully qualified type of the AppenderAttachedImpl class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets all attached appenders. + + + A collection of attached appenders, or null if there + are no attached appenders. + + + + The read only collection of all currently attached appenders. + + + + + + This class aggregates several PropertiesDictionary collections together. + + + + Provides a dictionary style lookup over an ordered list of + collections. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Add a Properties Dictionary to this composite collection + + the properties to add + + + Properties dictionaries added first take precedence over dictionaries added + later. + + + + + + Flatten this composite collection into a single properties dictionary + + the flattened dictionary + + + Reduces the collection of ordered dictionaries to a single dictionary + containing the resultant values for the keys. + + + + + + Gets the value of a property + + + The value for the property with the specified key + + + + Looks up the value for the specified. + The collections are searched + in the order in which they were added to this collection. The value + returned is the value held by the first collection that contains + the specified key. + + + If none of the collections contain the specified key then + null is returned. + + + + + + Base class for Context Properties implementations + + + + This class defines a basic property get set accessor + + + Nicko Cadell + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Wrapper class used to map converter names to converter types + + + + Pattern converter info class used during configuration by custom + PatternString and PatternLayer converters. + + + + + + default constructor + + + + + + + + + + + Gets or sets the name of the conversion pattern + + + + The name of the pattern in the format string + + + + + + Gets or sets the type of the converter + + + + The value specified must extend the + type. + + + + + + + + + + + Subclass of that maintains a count of + the number of bytes written. + + + + This writer counts the number of bytes written. + + + Nicko Cadell + Gert Driesen + + + + that does not leak exceptions + + + + does not throw exceptions when things go wrong. + Instead, it delegates error handling to its . + + + Nicko Cadell + Gert Driesen + + + + Adapter that extends and forwards all + messages to an instance of . + + + + Adapter that extends and forwards all + messages to an instance of . + + + Nicko Cadell + + + + The writer to forward messages to + + + + + Create an instance of that forwards all + messages to a . + + The to forward to + + + Create an instance of that forwards all + messages to a . + + + + + + Closes the writer and releases any system resources associated with the writer + + + + + + + + + Dispose this writer + + flag indicating if we are being disposed + + + Dispose this writer + + + + + + Flushes any buffered output + + + + Clears all buffers for the writer and causes any buffered data to be written + to the underlying device + + + + + + Writes a character to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a character to the wrapped TextWriter + + + + + + Writes a character buffer to the wrapped TextWriter + + the data buffer + the start index + the number of characters to write + + + Writes a character buffer to the wrapped TextWriter + + + + + + Writes a string to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a string to the wrapped TextWriter + + + + + + Gets or sets the underlying . + + + The underlying . + + + + Gets or sets the underlying . + + + + + + The Encoding in which the output is written + + + The + + + + The Encoding in which the output is written + + + + + + Gets an object that controls formatting + + + The format provider + + + + Gets an object that controls formatting + + + + + + Gets or sets the line terminator string used by the TextWriter + + + The line terminator to use + + + + Gets or sets the line terminator string used by the TextWriter + + + + + + Constructor + + the writer to actually write to + the error handler to report error to + + + Create a new QuietTextWriter using a writer and error handler + + + + + + Writes a character to the underlying writer + + the char to write + + + Writes a character to the underlying writer + + + + + + Writes a buffer to the underlying writer + + the buffer to write + the start index to write from + the number of characters to write + + + Writes a buffer to the underlying writer + + + + + + Writes a string to the output. + + The string data to write to the output. + + + Writes a string to the output. + + + + + + Closes the underlying output writer. + + + + Closes the underlying output writer. + + + + + + The error handler instance to pass all errors to + + + + + Flag to indicate if this writer is closed + + + + + Gets or sets the error handler that all errors are passed to. + + + The error handler that all errors are passed to. + + + + Gets or sets the error handler that all errors are passed to. + + + + + + Gets a value indicating whether this writer is closed. + + + true if this writer is closed, otherwise false. + + + + Gets a value indicating whether this writer is closed. + + + + + + Constructor + + The to actually write to. + The to report errors to. + + + Creates a new instance of the class + with the specified and . + + + + + + Writes a character to the underlying writer and counts the number of bytes written. + + the char to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a buffer to the underlying writer and counts the number of bytes written. + + the buffer to write + the start index to write from + the number of characters to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a string to the output and counts the number of bytes written. + + The string data to write to the output. + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Total number of bytes written. + + + + + Gets or sets the total number of bytes written. + + + The total number of bytes written. + + + + Gets or sets the total number of bytes written. + + + + + + A fixed size rolling buffer of logging events. + + + + An array backed fixed size leaky bucket. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The maximum number of logging events in the buffer. + + + Initializes a new instance of the class with + the specified maximum number of buffered logging events. + + + The argument is not a positive integer. + + + + Appends a to the buffer. + + The event to append to the buffer. + The event discarded from the buffer, if the buffer is full, otherwise null. + + + Append an event to the buffer. If the buffer still contains free space then + null is returned. If the buffer is full then an event will be dropped + to make space for the new event, the event dropped is returned. + + + + + + Get and remove the oldest event in the buffer. + + The oldest logging event in the buffer + + + Gets the oldest (first) logging event in the buffer and removes it + from the buffer. + + + + + + Pops all the logging events from the buffer into an array. + + An array of all the logging events in the buffer. + + + Get all the events in the buffer and clear the buffer. + + + + + + Clear the buffer + + + + Clear the buffer of all events. The events in the buffer are lost. + + + + + + Gets the th oldest event currently in the buffer. + + The th oldest event currently in the buffer. + + + If is outside the range 0 to the number of events + currently in the buffer, then null is returned. + + + + + + Gets the maximum size of the buffer. + + The maximum size of the buffer. + + + Gets the maximum size of the buffer + + + + + + Gets the number of logging events in the buffer. + + The number of logging events in the buffer. + + + This number is guaranteed to be in the range 0 to + (inclusive). + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + The singleton instance of the empty collection. + + + + + Gets the singleton instance of the empty collection. + + The singleton instance of the empty collection. + + + Gets the singleton instance of the empty collection. + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Adds an element with the provided key and value to the + . + + The to use as the key of the element to add. + The to use as the value of the element to add. + + + As the collection is empty no new values can be added. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Removes all elements from the . + + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Determines whether the contains an element + with the specified key. + + The key to locate in the . + false + + + As the collection is empty the method always returns false. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Removes the element with the specified key from the . + + The key of the element to remove. + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + The singleton instance of the empty dictionary. + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + Gets a value indicating whether the has a fixed size. + + true + + + As the collection is empty always returns true. + + + + + + Gets a value indicating whether the is read-only. + + true + + + As the collection is empty always returns true. + + + + + + Gets an containing the keys of the . + + An containing the keys of the . + + + As the collection is empty a is returned. + + + + + + Gets an containing the values of the . + + An containing the values of the . + + + As the collection is empty a is returned. + + + + + + Gets or sets the element with the specified key. + + The key of the element to get or set. + null + + + As the collection is empty no values can be looked up or stored. + If the index getter is called then null is returned. + A is thrown if the setter is called. + + + This dictionary is always empty and cannot be modified. + + + + Contain the information obtained when parsing formatting modifiers + in conversion modifiers. + + + + Holds the formatting information extracted from the format string by + the . This is used by the + objects when rendering the output. + + + Nicko Cadell + Gert Driesen + + + + Defaut Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + + + Initializes a new instance of the class + with the specified parameters. + + + + + + Gets or sets the minimum value. + + + The minimum value. + + + + Gets or sets the minimum value. + + + + + + Gets or sets the maximum value. + + + The maximum value. + + + + Gets or sets the maximum value. + + + + + + Gets or sets a flag indicating whether left align is enabled + or not. + + + A flag indicating whether left align is enabled or not. + + + + Gets or sets a flag indicating whether left align is enabled or not. + + + + + + Implementation of Properties collection for the + + + + This class implements a properties collection that is thread safe and supports both + storing properties and capturing a read only copy of the current propertied. + + + This class is optimized to the scenario where the properties are read frequently + and are modified infrequently. + + + Nicko Cadell + + + + The read only copy of the properties. + + + + This variable is declared volatile to prevent the compiler and JIT from + reordering reads and writes of this thread performed on different threads. + + + + + + Lock object used to synchronize updates within this instance + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property from the global context + + the key for the entry to remove + + + Removing an entry from the global context properties is relatively expensive compared + with reading a value. + + + + + + Clear the global context properties + + + + + Get a readonly immutable copy of the properties + + the current global context properties + + + This implementation is fast because the GlobalContextProperties class + stores a readonly copy of the properties. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Reading the value for a key is faster than setting the value. + When the value is written a new read only copy of + the properties is created. + + + + + + The static class ILogExtensions contains a set of widely used + methods that ease the interaction with the ILog interface implementations. + + + + This class contains methods for logging at different levels and checks the + properties for determining if those logging levels are enabled in the current + configuration. + + + Simple example of logging messages + + using log4net.Util; + + ILog log = LogManager.GetLogger("application-log"); + + log.InfoExt("Application Start"); + log.DebugExt("This is a debug message"); + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Manages a mapping from levels to + + + + Manages an ordered mapping from instances + to subclasses. + + + Nicko Cadell + + + + Default constructor + + + + Initialise a new instance of . + + + + + + Add a to this mapping + + the entry to add + + + If a has previously been added + for the same then that entry will be + overwritten. + + + + + + Lookup the mapping for the specified level + + the level to lookup + the for the level or null if no mapping found + + + Lookup the value for the specified level. Finds the nearest + mapping value for the level that is equal to or less than the + specified. + + + If no mapping could be found then null is returned. + + + + + + Initialize options + + + + Caches the sorted list of in an array + + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + This class stores its properties in a slot on the named + log4net.Util.LogicalThreadContextProperties. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Nicko Cadell + + + + Flag used to disable this context if we don't have permission to access the CallContext. + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove the value for the specified from the context. + + + + + + Clear all the context properties + + + + Clear all the context properties + + + + + + Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doings so. + + + + + + Gets the call context get data. + + The peroperties dictionary stored in the call context + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + Sets the call context data. + + The properties. + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + The fully qualified type of the LogicalThreadContextProperties class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Get or set the property value for the specified. + + + + + + + + + + + + + Outputs log statements from within the log4net assembly. + + + + Log4net components cannot make log4net logging calls. However, it is + sometimes useful for the user to learn about what log4net is + doing. + + + All log4net internal debug calls go to the standard output stream + whereas internal error messages are sent to the standard error output + stream. + + + Nicko Cadell + Gert Driesen + + + + Formats Prefix, Source, and Message in the same format as the value + sent to Console.Out and Trace.Write. + + + + + + Initializes a new instance of the class. + + + + + + + + + Static constructor that initializes logging by reading + settings from the application configuration file. + + + + The log4net.Internal.Debug application setting + controls internal debugging. This setting should be set + to true to enable debugging. + + + The log4net.Internal.Quiet application setting + suppresses all internal logging including error messages. + This setting should be set to true to enable message + suppression. + + + + + + Raises the LogReceived event when an internal messages is received. + + + + + + + + + Writes log4net internal debug messages to the + standard output stream. + + + The message to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal debug messages to the + standard output stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal error messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes output to the standard output stream. + + The message to log. + + + Writes to both Console.Out and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Writes output to the standard error stream. + + The message to log. + + + Writes to both Console.Error and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Default debug level + + + + + In quietMode not even errors generate any output. + + + + + The event raised when an internal message has been received. + + + + + The Type that generated the internal message. + + + + + The DateTime stamp of when the internal message was received. + + + + + A string indicating the severity of the internal message. + + + "log4net: ", + "log4net:ERROR ", + "log4net:WARN " + + + + + The internal log message. + + + + + The Exception related to the message. + + + Optional. Will be null if no Exception was passed. + + + + + Gets or sets a value indicating whether log4net internal logging + is enabled or disabled. + + + true if log4net internal logging is enabled, otherwise + false. + + + + When set to true, internal debug level logging will be + displayed. + + + This value can be set by setting the application setting + log4net.Internal.Debug in the application configuration + file. + + + The default value is false, i.e. debugging is + disabled. + + + + + The following example enables internal debugging using the + application configuration file : + + + + + + + + + + + + + Gets or sets a value indicating whether log4net should generate no output + from internal logging, not even for errors. + + + true if log4net should generate no output at all from internal + logging, otherwise false. + + + + When set to true will cause internal logging at all levels to be + suppressed. This means that no warning or error reports will be logged. + This option overrides the setting and + disables all debug also. + + This value can be set by setting the application setting + log4net.Internal.Quiet in the application configuration file. + + + The default value is false, i.e. internal logging is not + disabled. + + + + The following example disables internal logging using the + application configuration file : + + + + + + + + + + + + + + + + + Test if LogLog.Debug is enabled for output. + + + true if Debug is enabled + + + + Test if LogLog.Debug is enabled for output. + + + + + + Test if LogLog.Warn is enabled for output. + + + true if Warn is enabled + + + + Test if LogLog.Warn is enabled for output. + + + + + + Test if LogLog.Error is enabled for output. + + + true if Error is enabled + + + + Test if LogLog.Error is enabled for output. + + + + + + Subscribes to the LogLog.LogReceived event and stores messages + to the supplied IList instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a native error code and message. + + + + Represents a Win32 platform native error. + + + Nicko Cadell + Gert Driesen + + + + Create an instance of the class with the specified + error number and message. + + The number of the native error. + The message of the native error. + + + Create an instance of the class with the specified + error number and message. + + + + + + Create a new instance of the class for the last Windows error. + + + An instance of the class for the last windows error. + + + + The message for the error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Create a new instance of the class. + + the error number for the native error + + An instance of the class for the specified + error number. + + + + The message for the specified error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Retrieves the message corresponding with a Win32 message identifier. + + Message identifier for the requested message. + + The message corresponding with the specified message identifier. + + + + The message will be searched for in system message-table resource(s) + using the native FormatMessage function. + + + + + + Return error information string + + error information string + + + Return error information string + + + + + + Formats a message string. + + Formatting options, and how to interpret the parameter. + Location of the message definition. + Message identifier for the requested message. + Language identifier for the requested message. + If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . + If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. + Pointer to an array of values that are used as insert values in the formatted message. + + + The function requires a message definition as input. The message definition can come from a + buffer passed into the function. It can come from a message table resource in an + already-loaded module. Or the caller can ask the function to search the system's message + table resource(s) for the message definition. The function finds the message definition + in a message table resource based on a message identifier and a language identifier. + The function copies the formatted message text to an output buffer, processing any embedded + insert sequences if requested. + + + To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + + + + + If the function succeeds, the return value is the number of TCHARs stored in the output + buffer, excluding the terminating null character. + + + If the function fails, the return value is zero. To get extended error information, + call . + + + + + + Gets the number of the native error. + + + The number of the native error. + + + + Gets the number of the native error. + + + + + + Gets the message of the native error. + + + The message of the native error. + + + + + Gets the message of the native error. + + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance. + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current key from the enumerator. + + + Throws an exception because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current value from the enumerator. + + The current value from the enumerator. + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current entry from the enumerator. + + + Throws an because the + never has a current entry. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Get the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + A SecurityContext used when a SecurityContext is not required + + + + The is a no-op implementation of the + base class. It is used where a + is required but one has not been provided. + + + Nicko Cadell + + + + Singleton instance of + + + + Singleton instance of + + + + + + Private constructor + + + + Private constructor for singleton pattern. + + + + + + Impersonate this SecurityContext + + State supplied by the caller + null + + + No impersonation is done and null is always returned. + + + + + + Implements log4net's default error handling policy which consists + of emitting a message for the first error in an appender and + ignoring all subsequent errors. + + + + The error message is processed using the LogLog sub-system by default. + + + This policy aims at protecting an otherwise working application + from being flooded with error messages when logging fails. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Default Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + The prefix to use for each message. + + + Initializes a new instance of the class + with the specified prefix. + + + + + + Reset the error handler back to its initial disabled state. + + + + + Log an Error + + The error message. + The exception. + The internal error code. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + Log the very first error + + The error message. + The exception. + The internal error code. + + + Sends the error information to 's Error method. + + + + + + Log an Error + + The error message. + The exception. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + Log an error + + The error message. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + The date the error was recorded. + + + + + Flag to indicate if it is the first error + + + + + The message recorded during the first error. + + + + + The exception recorded during the first error. + + + + + The error code recorded during the first error. + + + + + String to prefix each message with + + + + + The fully qualified type of the OnlyOnceErrorHandler class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Is error logging enabled + + + + Is error logging enabled. Logging is only enabled for the + first error delivered to the . + + + + + + The date the first error that trigged this error handler occured. + + + + + The message from the first error that trigged this error handler. + + + + + The exception from the first error that trigged this error handler. + + + May be . + + + + + The error code from the first error that trigged this error handler. + + + Defaults to + + + + + A convenience class to convert property values to specific types. + + + + Utility functions for converting types and parsing values. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Converts a string to a value. + + String to convert. + The default value. + The value of . + + + If is "true", then true is returned. + If is "false", then false is returned. + Otherwise, is returned. + + + + + + Parses a file size into a number. + + String to parse. + The default value. + The value of . + + + Parses a file size of the form: number[KB|MB|GB] into a + long value. It is scaled with the appropriate multiplier. + + + is returned when + cannot be converted to a value. + + + + + + Converts a string to an object. + + The target type to convert to. + The string to convert to an object. + + The object converted from a string or null when the + conversion failed. + + + + Converts a string to an object. Uses the converter registry to try + to convert the string value into the specified target type. + + + + + + Checks if there is an appropriate type conversion from the source type to the target type. + + The type to convert from. + The type to convert to. + true if there is a conversion from the source type to the target type. + + Checks if there is an appropriate type conversion from the source type to the target type. + + + + + + + Converts an object to the target type. + + The object to convert to the target type. + The type to convert to. + The converted object. + + + Converts an object to the target type. + + + + + + Instantiates an object given a class name. + + The fully qualified class name of the object to instantiate. + The class to which the new object should belong. + The object to return in case of non-fulfillment. + + An instance of the or + if the object could not be instantiated. + + + + Checks that the is a subclass of + . If that test fails or the object could + not be instantiated, then is returned. + + + + + + Performs variable substitution in string from the + values of keys found in . + + The string on which variable substitution is performed. + The dictionary to use to lookup variables. + The result of the substitutions. + + + The variable substitution delimiters are ${ and }. + + + For example, if props contains key=value, then the call + + + + string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); + + + + will set the variable s to "Value of key is value.". + + + If no value could be found for the specified key, then substitution + defaults to an empty string. + + + For example, if system properties contains no value for the key + "nonExistentKey", then the call + + + + string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); + + + + will set s to "Value of nonExistentKey is []". + + + An Exception is thrown if contains a start + delimiter "${" which is not balanced by a stop delimiter "}". + + + + + + Converts the string representation of the name or numeric value of one or + more enumerated constants to an equivalent enumerated object. + + The type to convert to. + The enum string value. + If true, ignore case; otherwise, regard case. + An object of type whose value is represented by . + + + + The fully qualified type of the OptionConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Most of the work of the class + is delegated to the PatternParser class. + + + + The PatternParser processes a pattern string and + returns a chain of objects. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The pattern to parse. + + + Initializes a new instance of the class + with the specified pattern string. + + + + + + Parses the pattern into a chain of pattern converters. + + The head of a chain of pattern converters. + + + Parses the pattern into a chain of pattern converters. + + + + + + Build the unified cache of converters from the static and instance maps + + the list of all the converter names + + + Build the unified cache of converters from the static and instance maps + + + + + + Internal method to parse the specified pattern to find specified matches + + the pattern to parse + the converter names to match in the pattern + + + The matches param must be sorted such that longer strings come before shorter ones. + + + + + + Process a parsed literal + + the literal text + + + + Process a parsed converter pattern + + the name of the converter + the optional option for the converter + the formatting info for the converter + + + + Resets the internal state of the parser and adds the specified pattern converter + to the chain. + + The pattern converter to add. + + + + The first pattern converter in the chain + + + + + the last pattern converter in the chain + + + + + The pattern + + + + + Internal map of converter identifiers to converter types + + + + This map overrides the static s_globalRulesRegistry map. + + + + + + The fully qualified type of the PatternParser class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Get the converter registry used by this parser + + + The converter registry used by this parser + + + + Get the converter registry used by this parser + + + + + + Sort strings by length + + + + that orders strings by string length. + The longest strings are placed first + + + + + + This class implements a patterned string. + + + + This string has embedded patterns that are resolved and expanded + when the string is formatted. + + + This class functions similarly to the + in that it accepts a pattern and renders it to a string. Unlike the + however the PatternString + does not render the properties of a specific but + of the process in general. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + appdomain + + + Used to output the friendly name of the current AppDomain. + + + + + date + + + Used to output the current date and time in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + env + + + Used to output the a specific environment variable. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %env{COMPUTERNAME} would include the value + of the COMPUTERNAME environment variable. + + + The env pattern is not supported on the .NET Compact Framework. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern name offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + processid + + + Used to output the system process ID for the current process. + + + + + property + + + Used to output a specific context property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are stored in logging contexts. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + random + + + Used to output a random string of characters. The string is made up of + uppercase letters and numbers. By default the string is 4 characters long. + The length of the string can be specified within braces directly following the + pattern specifier, e.g. %random{8} would output an 8 character string. + + + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + % + + + The sequence %% outputs a single percent sign. + + + + + + Additional pattern converters may be registered with a specific + instance using or + . + + + See the for details on the + format modifiers supported by the patterns. + + + Nicko Cadell + + + + Internal map of converter identifiers to converter types. + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternString only + + + + + Initialize the global registry + + + + + Default constructor + + + + Initialize a new instance of + + + + + + Constructs a PatternString + + The pattern to use with this PatternString + + + Initialize a new instance of with the pattern specified. + + + + + + Initialize object options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create the used to parse the pattern + + the pattern to parse + The + + + Returns PatternParser used to parse the conversion string. Subclasses + may override this to return a subclass of PatternParser which recognize + custom conversion pattern name. + + + + + + Produces a formatted string as specified by the conversion pattern. + + The TextWriter to write the formatted event to + + + Format the pattern to the . + + + + + + Format the pattern as a string + + the pattern formatted as a string + + + Format the pattern to a string. + + + + + + Add a converter to this PatternString + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternString + + the name of the conversion pattern for this converter + the type of the converter + + + Add a converter to this PatternString + + + + + + Gets or sets the pattern formatting string + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + String keyed object map. + + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + String keyed object map that is read only. + + + + This collection is readonly and cannot be modified. + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + The Hashtable used to store the properties data + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Copy Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Deserialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Gets the key names. + + An array of all the keys. + + + Gets the key names. + + + + + + Test if the dictionary contains a specified key + + the key to look for + true if the dictionary contains the specified key + + + Test if the dictionary contains a specified key + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + Serializes this object into the provided. + + + + + + See + + + + + See + + + + + + See + + + + + + + Remove all properties from the properties collection + + + + + See + + + + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + The hashtable used to store the properties + + + The internal collection used to store the properties + + + + The hashtable used to store the properties + + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + The number of properties in this collection + + + + + See + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class + with serialized data. + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Because this class is sealed the serialization constructor is private. + + + + + + Remove the entry with the specified key from this dictionary + + the key for the entry to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + an enumerator + + + Returns a over the contest of this collection. + + + + + + See + + the key to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + the key to lookup in the collection + true if the collection contains the specified key + + + Test if this collection contains a specified key. + + + + + + Remove all properties from the properties collection + + + + Remove all properties from the properties collection + + + + + + See + + the key + the value to store for the key + + + Store a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + See + + + false + + + + This collection is modifiable. This property always + returns false. + + + + + + See + + + The value for the key specified. + + + + Get or set a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + A class to hold the key and data for a property set in the config file + + + + A class to hold the key and data for a property set in the config file + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Property Key + + + Property Key + + + + Property Key. + + + + + + Property Value + + + Property Value + + + + Property Value. + + + + + + A that ignores the message + + + + This writer is used in special cases where it is necessary + to protect a writer from being closed by a client. + + + Nicko Cadell + + + + Constructor + + the writer to actually write to + + + Create a new ProtectCloseTextWriter using a writer + + + + + + Attach this instance to a different underlying + + the writer to attach to + + + Attach this instance to a different underlying + + + + + + Does not close the underlying output writer. + + + + Does not close the underlying output writer. + This method does nothing. + + + + + + Defines a lock that supports single writers and multiple readers + + + + ReaderWriterLock is used to synchronize access to a resource. + At any given time, it allows either concurrent read access for + multiple threads, or write access for a single thread. In a + situation where a resource is changed infrequently, a + ReaderWriterLock provides better throughput than a simple + one-at-a-time lock, such as . + + + If a platform does not support a System.Threading.ReaderWriterLock + implementation then all readers and writers are serialized. Therefore + the caller must not rely on multiple simultaneous readers. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Acquires a reader lock + + + + blocks if a different thread has the writer + lock, or if at least one thread is waiting for the writer lock. + + + + + + Decrements the lock count + + + + decrements the lock count. When the count + reaches zero, the lock is released. + + + + + + Acquires the writer lock + + + + This method blocks if another thread has a reader lock or writer lock. + + + + + + Decrements the lock count on the writer lock + + + + ReleaseWriterLock decrements the writer lock count. + When the count reaches zero, the writer lock is released. + + + + + + A that can be and reused + + + + A that can be and reused. + This uses a single buffer for string operations. + + + Nicko Cadell + + + + Create an instance of + + the format provider to use + + + Create an instance of + + + + + + Override Dispose to prevent closing of writer + + flag + + + Override Dispose to prevent closing of writer + + + + + + Reset this string writer so that it can be reused. + + the maximum buffer capacity before it is trimmed + the default size to make the buffer + + + Reset this string writer so that it can be reused. + The internal buffers are cleared and reset. + + + + + + Utility class for system specific information. + + + + Utility class of static methods for system specific information. + + + Nicko Cadell + Gert Driesen + Alexey Solofnenko + + + + Private constructor to prevent instances. + + + + Only static methods are exposed from this type. + + + + + + Initialize default values for private static fields. + + + + Only static methods are exposed from this type. + + + + + + Gets the assembly location path for the specified assembly. + + The assembly to get the location for. + The location of the assembly. + + + This method does not guarantee to return the correct path + to the assembly. If only tries to give an indication as to + where the assembly was loaded from. + + + + + + Gets the fully qualified name of the , including + the name of the assembly from which the was + loaded. + + The to get the fully qualified name for. + The fully qualified name for the . + + + This is equivalent to the Type.AssemblyQualifiedName property, + but this method works on the .NET Compact Framework 1.0 as well as + the full .NET runtime. + + + + + + Gets the short name of the . + + The to get the name for. + The short name of the . + + + The short name of the assembly is the + without the version, culture, or public key. i.e. it is just the + assembly's file name without the extension. + + + Use this rather than Assembly.GetName().Name because that + is not available on the Compact Framework. + + + Because of a FileIOPermission security demand we cannot do + the obvious Assembly.GetName().Name. We are allowed to get + the of the assembly so we + start from there and strip out just the assembly name. + + + + + + Gets the file name portion of the , including the extension. + + The to get the file name for. + The file name of the assembly. + + + Gets the file name portion of the , including the extension. + + + + + + Loads the type specified in the type string. + + A sibling type to use to load the type. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified, it will be loaded from the assembly + containing the specified relative type. If the type is not found in the assembly + then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the + assembly that is directly calling this method. If the type is not found + in the assembly then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + An assembly to load the type from. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the specified + assembly. If the type is not found in the assembly then all the loaded assemblies + will be searched for the type. + + + + + + Generate a new guid + + A new Guid + + + Generate a new guid + + + + + + Create an + + The name of the parameter that caused the exception + The value of the argument that causes this exception + The message that describes the error + the ArgumentOutOfRangeException object + + + Create a new instance of the class + with a specified error message, the parameter name, and the value + of the argument. + + + The Compact Framework does not support the 3 parameter constructor for the + type. This method provides an + implementation that works for all platforms. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Lookup an application setting + + the application settings key to lookup + the value for the key, or null + + + Configuration APIs are not supported under the Compact Framework + + + + + + Convert a path into a fully qualified local file path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + The path specified must be a local file path, a URI is not supported. + + + + + + Creates a new case-insensitive instance of the class with the default initial capacity. + + A new case-insensitive instance of the class with the default initial capacity + + + The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. + + + + + + Gets an empty array of types. + + + + The Type.EmptyTypes field is not available on + the .NET Compact Framework 1.0. + + + + + + The fully qualified type of the SystemInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Cache the host name for the current machine + + + + + Cache the application friendly name + + + + + Text to output when a null is encountered. + + + + + Text to output when an unsupported feature is requested. + + + + + Start time for the current process. + + + + + Gets the system dependent line terminator. + + + The system dependent line terminator. + + + + Gets the system dependent line terminator. + + + + + + Gets the base directory for this . + + The base directory path for the current . + + + Gets the base directory for this . + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the configuration file for the current . + + The path to the configuration file for the current . + + + The .NET Compact Framework 1.0 does not have a concept of a configuration + file. For this runtime, we use the entry assembly location as the root for + the configuration file name. + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the file that first executed in the current . + + The path to the entry assembly. + + + Gets the path to the file that first executed in the current . + + + + + + Gets the ID of the current thread. + + The ID of the current thread. + + + On the .NET framework, the AppDomain.GetCurrentThreadId method + is used to obtain the thread ID for the current thread. This is the + operating system ID for the thread. + + + On the .NET Compact Framework 1.0 it is not possible to get the + operating system thread ID for the current thread. The native method + GetCurrentThreadId is implemented inline in a header file + and cannot be called. + + + On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this + gives a stable id unrelated to the operating system thread ID which may + change if the runtime is using fibers. + + + + + + Get the host name or machine name for the current machine + + + The hostname or machine name + + + + Get the host name or machine name for the current machine + + + The host name () or + the machine name (Environment.MachineName) for + the current machine, or if neither of these are available + then NOT AVAILABLE is returned. + + + + + + Get this application's friendly name + + + The friendly name of this application as a string + + + + If available the name of the application is retrieved from + the AppDomain using AppDomain.CurrentDomain.FriendlyName. + + + Otherwise the file name of the entry assembly is used. + + + + + + Get the start time for the current process. + + + + This is the time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. + + + + + + Text to output when a null is encountered. + + + + Use this value to indicate a null has been encountered while + outputting a string representation of an item. + + + The default value is (null). This value can be overridden by specifying + a value for the log4net.NullText appSetting in the application's + .config file. + + + + + + Text to output when an unsupported feature is requested. + + + + Use this value when an unsupported feature is requested. + + + The default value is NOT AVAILABLE. This value can be overridden by specifying + a value for the log4net.NotAvailableText appSetting in the application's + .config file. + + + + + + Utility class that represents a format string. + + + + Utility class that represents a format string. + + + Nicko Cadell + + + + Initialise the + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + + + Format the string and arguments + + the formatted string + + + + Replaces the format item in a specified with the text equivalent + of the value of a corresponding instance in a specified array. + A specified parameter supplies culture-specific formatting information. + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + A copy of format in which the format items have been replaced by the + equivalent of the corresponding instances of in args. + + + + This method does not throw exceptions. If an exception thrown while formatting the result the + exception and arguments are returned in the result string. + + + + + + Process an error during StringFormat + + + + + Dump the contents of an array into a string builder + + + + + Dump an object to a string + + + + + The fully qualified type of the SystemStringFormat class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + Nicko Cadell + + + + Each thread will automatically have its instance. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove a property + + + + + + Get the keys stored in the properties. + + + Gets the keys stored in the properties. + + a set of the defined keys + + + + Clear all properties + + + + Clear all properties + + + + + + Get the PropertiesDictionary for this thread. + + create the dictionary if it does not exist, otherwise return null if does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doing so. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Implementation of Stack for the + + + + Implementation of Stack for the + + + Nicko Cadell + + + + The stack store. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Clears all the contextual information held in this stack. + + + + Clears all the contextual information held in this stack. + Only call this if you think that this tread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. + + + + + + Removes the top context from this stack. + + The message in the context that was removed from the top of this stack. + + + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. + + + + + + Pushes a new context message into this stack. + + The new context message. + + An that can be used to clean up the context stack. + + + + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + + + + + Gets the current context information for this stack. + + The current context information. + + + + Gets the current context information for this stack. + + Gets the current context information + + + Gets the current context information for this stack. + + + + + + Get a portable version of this object + + the portable instance of this object + + + Get a cross thread portable version of this object + + + + + + The number of messages in the stack + + + The current number of messages in the stack + + + + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. + + + + + + Gets and sets the internal stack used by this + + The internal storage stack + + + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. + + + + + + Inner class used to represent a single context frame in the stack. + + + + Inner class used to represent a single context frame in the stack. + + + + + + Constructor + + The message for this context. + The parent context in the chain. + + + Initializes a new instance of the class + with the specified message and parent context. + + + + + + Get the message. + + The message. + + + Get the message. + + + + + + Gets the full text of the context down to the root level. + + + The full text of the context down to the root level. + + + + Gets the full text of the context down to the root level. + + + + + + Struct returned from the method. + + + + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. + + + + + + The ThreadContextStack internal stack + + + + + The depth to trim the stack to when this instance is disposed + + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. + + + Initializes a new instance of the class with + the specified stack and return depth. + + + + + + Returns the stack to the correct depth. + + + + Returns the stack to the correct depth. + + + + + + Implementation of Stacks collection for the + + + + Implementation of Stacks collection for the + + + Nicko Cadell + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + The fully qualified type of the ThreadContextStacks class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the named thread context stack + + + The named stack + + + + Gets the named thread context stack + + + + + + Utility class for transforming strings. + + + + Utility class for transforming strings. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Write a string to an + + the writer to write to + the string to write + The string to replace non XML compliant chars with + + + The test is escaped either using XML escape entities + or using CDATA sections. + + + + + + Replace invalid XML characters in text string + + the XML text input string + the string to use in place of invalid characters + A string that does not contain invalid XML characters. + + + Certain Unicode code points are not allowed in the XML InfoSet, for + details see: http://www.w3.org/TR/REC-xml/#charsets. + + + This method replaces any illegal characters in the input string + with the mask string specified. + + + + + + Count the number of times that the substring occurs in the text + + the text to search + the substring to find + the number of times the substring occurs in the text + + + The substring is assumed to be non repeating within itself. + + + + + + Characters illegal in XML 1.0 + + + + + Impersonate a Windows Account + + + + This impersonates a Windows account. + + + How the impersonation is done depends on the value of . + This allows the context to either impersonate a set of user credentials specified + using username, domain name and password or to revert to the process credentials. + + + + + + Default constructor + + + + Default constructor + + + + + + Initialize the SecurityContext based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The security context will try to Logon the specified user account and + capture a primary token for impersonation. + + + The required , + or properties were not specified. + + + + Impersonate the Windows account specified by the and properties. + + caller provided state + + An instance that will revoke the impersonation of this SecurityContext + + + + Depending on the property either + impersonate a user using credentials supplied or revert + to the process credentials. + + + + + + Create a given the userName, domainName and password. + + the user name + the domain name + the password + the for the account specified + + + Uses the Windows API call LogonUser to get a principal token for the account. This + token is used to initialize the WindowsIdentity. + + + + + + Gets or sets the impersonation mode for this security context + + + The impersonation mode for this security context + + + + Impersonate either a user with user credentials or + revert this thread to the credentials of the process. + The value is one of the + enum. + + + The default value is + + + When the mode is set to + the user's credentials are established using the + , and + values. + + + When the mode is set to + no other properties need to be set. If the calling thread is + impersonating then it will be reverted back to the process credentials. + + + + + + Gets or sets the Windows username for this security context + + + The Windows username for this security context + + + + This property must be set if + is set to (the default setting). + + + + + + Gets or sets the Windows domain name for this security context + + + The Windows domain name for this security context + + + + The default value for is the local machine name + taken from the property. + + + This property must be set if + is set to (the default setting). + + + + + + Sets the password for the Windows account specified by the and properties. + + + The password for the Windows account specified by the and properties. + + + + This property must be set if + is set to (the default setting). + + + + + + The impersonation modes for the + + + + See the property for + details. + + + + + + Impersonate a user using the credentials supplied + + + + + Revert this the thread to the credentials of the process + + + + + Adds to + + + + Helper class to expose the + through the interface. + + + + + + Constructor + + the impersonation context being wrapped + + + Constructor + + + + + + Revert the impersonation + + + + Revert the impersonation + + + + + + The log4net Global Context. + + + + The GlobalContext provides a location for global debugging + information to be stored. + + + The global context has a properties map and these properties can + be included in the output of log messages. The + supports selecting and outputing these properties. + + + By default the log4net:HostName property is set to the name of + the current machine. + + + + + GlobalContext.Properties["hostname"] = Environment.MachineName; + + + + Nicko Cadell + + + + Private Constructor. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + The global context properties instance + + + + + The global properties map. + + + The global properties map. + + + + The global properties map. + + + + + + Provides information about the environment the assembly has + been built for. + + + + Version of the assembly + + + Version of the framework targeted + + + Type of framework targeted + + + Does it target a client profile? + + + + Identifies the version and target for this assembly. + + + + + The log4net Logical Thread Context. + + + + The LogicalThreadContext provides a location for specific debugging + information to be stored. + The LogicalThreadContext properties override any or + properties with the same name. + + + The Logical Thread Context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Logical Thread Context provides a diagnostic context for the current call context. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Logical Thread Context is managed on a per basis. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Example of using the thread context properties to store a username. + + LogicalThreadContext.Properties["user"] = userName; + log.Info("This log message has a LogicalThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) + { + log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The LogicalThreadContext properties override any + or properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The logical thread stacks. + + + + + + This class is used by client applications to request logger instances. + + + + This class has static methods that are used by a client to request + a logger instance. The method is + used to retrieve a logger. + + + See the interface for more details. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + Returns the named logger if it exists. + + Returns the named logger if it exists. + + + + If the named logger exists (in the default repository) then it + returns a reference to the logger, otherwise it returns null. + + + The fully qualified logger name to look for. + The logger found, or null if no logger could be found. + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the logger doesn't exist in the specified + repository. + + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the repository for the specified assembly) then it + returns a reference to the logger, otherwise it returns + null. + + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger, or null if the logger doesn't exist in the specified + assembly's repository. + + + + Get the currently defined loggers. + + Returns all the currently defined loggers in the default repository. + + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + + The root logger is not included in the returned array. + + All the defined loggers. + + + Get or create a logger. + + Retrieves or creates a named logger. + + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Get the logger for the fully qualified name of the type specified. + + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The repository to lookup in. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The assembly to use to lookup the repository. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + Shutdown a logger repository. + + Shuts down the default repository. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + default repository. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The repository to shutdown. + + + + Shuts down the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The assembly to use to lookup the repository. + + + Reset the configuration of a repository + + Resets all values contained in this repository instance to their defaults. + + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The repository to reset. + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The assembly to use to lookup the repository to reset. + + + Get the logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Get a logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Create a domain + + Creates a repository with the specified repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + Create a logger repository. + + Creates a repository with the specified repository type. + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + + + + Creates a repository with the specified name. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name. + + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Creates a repository for the specified assembly and repository type. + + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Gets the list of currently defined repositories. + + + + Get an array of all the objects that have been created. + + + An array of all the known objects. + + + + Looks up the wrapper object for the logger specified. + + The logger to get the wrapper for. + The wrapper for the logger specified. + + + + Looks up the wrapper objects for the loggers specified. + + The loggers to get the wrappers for. + The wrapper objects for the loggers specified. + + + + Create the objects used by + this manager. + + The logger to wrap. + The wrapper for the logger specified. + + + + The wrapper map to use to hold the objects. + + + + + Implementation of Mapped Diagnostic Contexts. + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + The MDC class is similar to the class except that it is + based on a map instead of a stack. It provides mapped + diagnostic contexts. A Mapped Diagnostic Context, or + MDC in short, is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The MDC is managed on a per thread basis. + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Gets the context value identified by the parameter. + + The key to lookup in the MDC. + The string value held for the key, or a null reference if no corresponding value is found. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + If the parameter does not look up to a + previously defined context then null will be returned. + + + + + + Add an entry to the MDC + + The key to store the value under. + The value to store. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Puts a context value (the parameter) as identified + with the parameter into the current thread's + context map. + + + If a value is already defined for the + specified then the value will be replaced. If the + is specified as null then the key value mapping will be removed. + + + + + + Removes the key value mapping for the key specified. + + The key to remove. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove the specified entry from this thread's MDC + + + + + + Clear all entries in the MDC + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove all the entries from this thread's MDC + + + + + + Implementation of Nested Diagnostic Contexts. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + A Nested Diagnostic Context, or NDC in short, is an instrument + to distinguish interleaved log output from different sources. Log + output is typically interleaved when a server handles multiple + clients near-simultaneously. + + + Interleaved log output can still be meaningful if each log entry + from different contexts had a distinctive stamp. This is where NDCs + come into play. + + + Note that NDCs are managed on a per thread basis. The NDC class + is made up of static methods that operate on the context of the + calling thread. + + + How to push a message into the context + + using(NDC.Push("my context message")) + { + ... all log calls will have 'my context message' included ... + + } // at the end of the using block the message is automatically removed + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Clears all the contextual information held on the current thread. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Clears the stack of NDC data held on the current thread. + + + + + + Creates a clone of the stack of context information. + + A clone of the context info for this thread. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The results of this method can be passed to the + method to allow child threads to inherit the context of their + parent thread. + + + + + + Inherits the contextual information from another thread. + + The context stack to inherit. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This thread will use the context information from the stack + supplied. This can be used to initialize child threads with + the same contextual information as their parent threads. These + contexts will NOT be shared. Any further contexts that + are pushed onto the stack will not be visible to the other. + Call to obtain a stack to pass to + this method. + + + + + + Removes the top context from the stack. + + + The message in the context that was removed from the top + of the stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Remove the top context from the stack, and return + it to the caller. If the stack is empty then an + empty string (not null) is returned. + + + + + + Pushes a new context message. + + The new context message. + + An that can be used to clean up + the context stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.NDC.Push("NDC_Message")) + { + log.Warn("This should have an NDC message"); + } + + + + + + Removes the context information for this thread. It is + not required to call this method. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This method is not implemented. + + + + + + Forces the stack depth to be at most . + + The maximum depth of the stack + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Forces the stack depth to be at most . + This may truncate the head of the stack. This only affects the + stack in the current thread. Also it does not prevent it from + growing, it only sets the maximum depth at the time of the + call. This can be used to return to a known context depth. + + + + + + Gets the current context depth. + + The current context depth. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The number of context values pushed onto the context stack. + + + Used to record the current depth of the context. This can then + be restored using the method. + + + + + + + The log4net Thread Context. + + + + The ThreadContext provides a location for thread specific debugging + information to be stored. + The ThreadContext properties override any + properties with the same name. + + + The thread context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Thread Context provides a diagnostic context for the current thread. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Thread Context is managed on a per thread basis. + + + Example of using the thread context properties to store a username. + + ThreadContext.Properties["user"] = userName; + log.Info("This log message has a ThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(ThreadContext.Stacks["NDC"].Push("my context message")) + { + log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The ThreadContext properties override any + properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The thread local stacks. + + + + + diff --git a/packages/log4net.2.0.2/log4net.2.0.2.nupkg b/packages/log4net.2.0.2/log4net.2.0.2.nupkg new file mode 100644 index 000000000..c195484f3 Binary files /dev/null and b/packages/log4net.2.0.2/log4net.2.0.2.nupkg differ diff --git a/packages/log4net.2.0.2/log4net.2.0.2.nuspec b/packages/log4net.2.0.2/log4net.2.0.2.nuspec new file mode 100644 index 000000000..e70006f0d --- /dev/null +++ b/packages/log4net.2.0.2/log4net.2.0.2.nuspec @@ -0,0 +1,23 @@ + + + + log4net + 2.0.2 + log4net [1.2.12] + Apache Software Foundation + Apache Software Foundation + http://logging.apache.org/log4net/license.html + http://logging.apache.org/log4net/ + false + log4net is a tool to help the programmer output log statements to a variety of output targets. In case of problems with an application, it is helpful to enable logging so that the problem can be located. With log4net it is possible to enable logging at runtime without modifying the application binary. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost. It follows that the speed of logging (or rather not logging) is crucial. + +At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity. + +log4net is designed with two distinct goals in mind: speed and flexibility + The Apache log4net library is a tool to help the programmer output log statements to a variety of output targets. + + + + logging log tracing logfiles + + \ No newline at end of file diff --git a/packages/repositories.config b/packages/repositories.config new file mode 100644 index 000000000..26f707710 --- /dev/null +++ b/packages/repositories.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file