diff --git a/pl5engine.sln b/PL.Net.sln similarity index 95% rename from pl5engine.sln rename to PL.Net.sln index 1bc8ef6..9a8751e 100644 --- a/pl5engine.sln +++ b/PL.Net.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApplication1", "WindowsFormsApplication1\WindowsFormsApplication1.csproj", "{6F3E695F-A476-4387-A83E-145597EFDDF5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pl5engine", "pl5engine\pl5engine.csproj", "{0D9A8225-58D7-4F5C-9251-2D1734553752}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PLEngine", "pl5engine\PLEngine.csproj", "{0D9A8225-58D7-4F5C-9251-2D1734553752}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/WindowsFormsApplication1/Form1.Designer.cs b/WindowsFormsApplication1/Form1.Designer.cs index fb94989..e190989 100644 --- a/WindowsFormsApplication1/Form1.Designer.cs +++ b/WindowsFormsApplication1/Form1.Designer.cs @@ -47,222 +47,229 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.dataGridView2 = new System.Windows.Forms.DataGridView(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); - this.pl5engine1 = new Planimate5engine.pl5engine(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); - this.SuspendLayout(); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.pl5engine1); - this.splitContainer1.Size = new System.Drawing.Size(862, 493); - this.splitContainer1.SplitterDistance = 287; - this.splitContainer1.TabIndex = 1; - // - // dataGridView1 - // - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView1.Location = new System.Drawing.Point(0, 0); - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.Size = new System.Drawing.Size(287, 137); - this.dataGridView1.TabIndex = 0; - // - // dataGridViewTextBoxColumn1 - // - this.dataGridViewTextBoxColumn1.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn1.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; - // - // dataGridViewTextBoxColumn2 - // - this.dataGridViewTextBoxColumn2.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn2.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; - // - // dataGridViewTextBoxColumn3 - // - this.dataGridViewTextBoxColumn3.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn3.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; - // - // dataGridViewTextBoxColumn4 - // - this.dataGridViewTextBoxColumn4.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn4.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; - // - // dataGridViewTextBoxColumn5 - // - this.dataGridViewTextBoxColumn5.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn5.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; - // - // dataGridViewTextBoxColumn6 - // - this.dataGridViewTextBoxColumn6.DataPropertyName = "Tag"; - this.dataGridViewTextBoxColumn6.HeaderText = "Tag"; - this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.dataGridView1); - this.splitContainer2.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No; - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.splitContainer3); - this.splitContainer2.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.splitContainer2.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.splitContainer2.Size = new System.Drawing.Size(287, 493); - this.splitContainer2.SplitterDistance = 137; - this.splitContainer2.TabIndex = 1; - // - // splitContainer3 - // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer3.Panel1 - // - this.splitContainer3.Panel1.Controls.Add(this.dataGridView2); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.numericUpDown1); - this.splitContainer3.Panel2.Controls.Add(this.button3); - this.splitContainer3.Panel2.Controls.Add(this.button2); - this.splitContainer3.Panel2.Controls.Add(this.button1); - this.splitContainer3.Size = new System.Drawing.Size(287, 352); - this.splitContainer3.SplitterDistance = 206; - this.splitContainer3.TabIndex = 0; - // - // dataGridView2 - // - this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView2.Location = new System.Drawing.Point(0, 0); - this.dataGridView2.Name = "dataGridView2"; - this.dataGridView2.Size = new System.Drawing.Size(287, 206); - this.dataGridView2.TabIndex = 0; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(75, 3); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(92, 28); - this.button1.TabIndex = 0; - this.button1.Text = "Reload Table"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(75, 37); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(92, 25); - this.button2.TabIndex = 1; - this.button2.Text = "Resend Table"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button3 - // - this.button3.Location = new System.Drawing.Point(75, 68); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(92, 27); - this.button3.TabIndex = 2; - this.button3.Text = "Send Broadcast"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); - // - // numericUpDown1 - // - this.numericUpDown1.Location = new System.Drawing.Point(8, 75); - this.numericUpDown1.Name = "numericUpDown1"; - this.numericUpDown1.Size = new System.Drawing.Size(61, 20); - this.numericUpDown1.TabIndex = 4; - // - // pl5engine1 - // - this.pl5engine1.dll_pathname = "planimate.dll"; - this.pl5engine1.Dock = System.Windows.Forms.DockStyle.Fill; - this.pl5engine1.Location = new System.Drawing.Point(0, 0); - this.pl5engine1.Name = "pl5engine1"; - this.pl5engine1.Size = new System.Drawing.Size(571, 493); - this.pl5engine1.TabIndex = 0; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(862, 493); - this.Controls.Add(this.splitContainer1); - this.Name = "Form1"; - this.Text = "Form1"; - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); - this.splitContainer3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); - this.ResumeLayout(false); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.dataGridView2 = new System.Windows.Forms.DataGridView(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.button3 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.PLLoader1 = new Planimate.Engine.PLLoader(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.PLLoader1); + this.splitContainer1.Size = new System.Drawing.Size(862, 493); + this.splitContainer1.SplitterDistance = 287; + this.splitContainer1.TabIndex = 1; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.dataGridView1); + this.splitContainer2.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No; + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.splitContainer3); + this.splitContainer2.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.splitContainer2.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.splitContainer2.Size = new System.Drawing.Size(287, 493); + this.splitContainer2.SplitterDistance = 137; + this.splitContainer2.TabIndex = 1; + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(0, 0); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.Size = new System.Drawing.Size(287, 137); + this.dataGridView1.TabIndex = 0; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.dataGridView2); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.numericUpDown1); + this.splitContainer3.Panel2.Controls.Add(this.button3); + this.splitContainer3.Panel2.Controls.Add(this.button2); + this.splitContainer3.Panel2.Controls.Add(this.button1); + this.splitContainer3.Size = new System.Drawing.Size(287, 352); + this.splitContainer3.SplitterDistance = 206; + this.splitContainer3.TabIndex = 0; + // + // dataGridView2 + // + this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView2.Location = new System.Drawing.Point(0, 0); + this.dataGridView2.Name = "dataGridView2"; + this.dataGridView2.Size = new System.Drawing.Size(287, 206); + this.dataGridView2.TabIndex = 0; + // + // numericUpDown1 + // + this.numericUpDown1.Location = new System.Drawing.Point(8, 75); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(61, 20); + this.numericUpDown1.TabIndex = 4; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(75, 68); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(92, 27); + this.button3.TabIndex = 2; + this.button3.Text = "Send Broadcast"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(75, 37); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(92, 25); + this.button2.TabIndex = 1; + this.button2.Text = "Resend Table"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(75, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(92, 28); + this.button1.TabIndex = 0; + this.button1.Text = "Reload Table"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // PLLoader1 + // + this.PLLoader1.dll_pathname = "planimate.dll"; + this.PLLoader1.Dock = System.Windows.Forms.DockStyle.Fill; + this.PLLoader1.loader_dll_pathname = "pl5loader.dll"; + this.PLLoader1.Location = new System.Drawing.Point(0, 0); + this.PLLoader1.Name = "PLLoader1"; + this.PLLoader1.Size = new System.Drawing.Size(571, 493); + this.PLLoader1.TabIndex = 0; + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn1.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn2.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn3.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + // + // dataGridViewTextBoxColumn4 + // + this.dataGridViewTextBoxColumn4.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn4.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; + // + // dataGridViewTextBoxColumn5 + // + this.dataGridViewTextBoxColumn5.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn5.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; + // + // dataGridViewTextBoxColumn6 + // + this.dataGridViewTextBoxColumn6.DataPropertyName = "Tag"; + this.dataGridViewTextBoxColumn6.HeaderText = "Tag"; + this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(862, 493); + this.Controls.Add(this.splitContainer1); + this.Name = "Form1"; + this.Text = "Form1"; + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); } #endregion - private Planimate5engine.pl5engine pl5engine1; + private Planimate.Engine.PLLoader PLLoader1; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; diff --git a/WindowsFormsApplication1/Form1.cs b/WindowsFormsApplication1/Form1.cs index a4fab47..dc1c7fa 100644 --- a/WindowsFormsApplication1/Form1.cs +++ b/WindowsFormsApplication1/Form1.cs @@ -26,7 +26,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; -using Planimate5engine; +using Planimate.Engine; namespace WindowsFormsApplication1 { @@ -36,11 +36,12 @@ public partial class Form1 : Form public Form1() { InitializeComponent(); - pl5engine1.EngineInit("demo", this.Handle); - dataGridView1.DataSource = pl5engine1.GetDataTable("Input_1", true); - dataGridView2.DataSource = pl5engine1.GetDataTable("Formats", true); + PLLoader1.InitPLLoader(); + PLLoader1.CreatePL("demo.mdl /debugdll"); + dataGridView1.DataSource = PLLoader1.GetEngine().GetDataTable("Input_1", true); + dataGridView2.DataSource = PLLoader1.GetEngine().GetDataTable("Formats", true); DataTable dt = (DataTable)dataGridView2.DataSource; - pl5engine1.SetDataTable(ref dt,pl5engine1.FindDataObjectName("formats_copy")); + PLLoader1.GetEngine().SetDataTable(ref dt, PLLoader1.GetEngine().FindDataObjectName("formats_copy")); } public ePLRESULT broadcast_callback_function(IntPtr broadcast, int no_params, string[] tuple_names, double[] tuple_values) @@ -51,27 +52,27 @@ public ePLRESULT broadcast_callback_function(IntPtr broadcast, int no_params, st private void button3_Click(object sender, EventArgs e) { - IntPtr broadcast = pl5engine1.FindBroadcastName("Process"); + IntPtr broadcast = PLLoader1.GetEngine().FindBroadcastName("Process"); if (broadcast == IntPtr.Zero) { MessageBox.Show("Broadcast Not Found"); return; } - pl5engine.tPL_BroadcastCallback callback; - callback = new pl5engine.tPL_BroadcastCallback(broadcast_callback_function); - ePLRESULT reg_res = pl5engine1.RegisterBroadcastCallback(broadcast, callback); - ePLRESULT brd_res = pl5engine1.SendBroadcast(broadcast, 1, new string[] { "_height" }, new double[] { Convert.ToDouble(numericUpDown1.Value) }); + PLEngine.tPL_BroadcastCallback callback; + callback = new PLEngine.tPL_BroadcastCallback(broadcast_callback_function); + ePLRESULT reg_res = PLLoader1.GetEngine().RegisterBroadcastCallback(broadcast, callback); + ePLRESULT brd_res = PLLoader1.GetEngine().SendBroadcast(broadcast, 1, new string[] { "_height" }, new double[] { Convert.ToDouble(numericUpDown1.Value) }); } private void button1_Click(object sender, EventArgs e) { - dataGridView2.DataSource = pl5engine1.GetDataTable("Formats", true); + dataGridView2.DataSource = PLLoader1.GetEngine().GetDataTable("Formats", true); } private void button2_Click(object sender, EventArgs e) { DataTable dt = (DataTable)dataGridView2.DataSource; - pl5engine1.SetDataTable(ref dt, pl5engine1.FindDataObjectName("formats_copy")); + PLLoader1.GetEngine().SetDataTable(ref dt, PLLoader1.GetEngine().FindDataObjectName("formats_copy")); } } } diff --git a/WindowsFormsApplication1/Form1.resx b/WindowsFormsApplication1/Form1.resx index 19dc0dd..d58980a 100644 --- a/WindowsFormsApplication1/Form1.resx +++ b/WindowsFormsApplication1/Form1.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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/WindowsFormsApplication1/WindowsFormsApplication1.csproj b/WindowsFormsApplication1/WindowsFormsApplication1.csproj index 68cf427..b07f7a6 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1.csproj +++ b/WindowsFormsApplication1/WindowsFormsApplication1.csproj @@ -107,9 +107,9 @@ - + {0D9A8225-58D7-4F5C-9251-2D1734553752} - pl5engine + PLEngine diff --git a/WindowsFormsApplication1/bin/Debug/WindowsFormsApplication1.exe.config b/WindowsFormsApplication1/bin/Debug/WindowsFormsApplication1.exe.config deleted file mode 100644 index 51278a4..0000000 --- a/WindowsFormsApplication1/bin/Debug/WindowsFormsApplication1.exe.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/WindowsFormsApplication1/bin/Release/demo.MDL b/WindowsFormsApplication1/bin/Release/demo.MDL index 7a1a682..5833ea9 100644 --- a/WindowsFormsApplication1/bin/Release/demo.MDL +++ b/WindowsFormsApplication1/bin/Release/demo.MDL @@ -1,26 +1,27 @@ -; This model last saved by Planimate(r) Win V5.24h on Tue Mar 23 13:48:51 2010 -; User: Craig Chandler, InterDynamics Pty Ltd -V 578 -IFFontTable 13 --13 0 0 0 400 0 0 0 0 0 0 0 48 0 "Arial" ; (14) +;PlanimateModel +V 693 +SavedUsing "Planimate(r) Win V7.11.2" +SavedDate "Tue Aug 05 19:06:58 2014" +SavedBy "Craig Chandler, InterDynamics Pty Ltd" +End +IFFontTable 11 +-13 0 0 0 400 0 0 0 0 0 0 0 48 0 "Arial" ; (15) -16 0 0 0 400 0 0 0 0 0 0 0 48 0 "Arial" ; (3) -19 0 0 0 400 0 0 0 0 0 0 0 48 0 "Arial" ; (2) -13 0 0 0 400 0 0 0 0 0 0 0 49 0 "Courier New" ; (1) --16 0 0 0 900 0 0 0 0 0 0 0 48 16777215 "Arial" ; (1) --16 0 0 0 400 0 0 0 0 0 0 0 48 16777215 "Arial" ; (1) --16 0 0 0 900 0 0 0 0 0 0 0 48 64512 "Arial" ; (1) --16 0 0 0 400 0 0 0 0 0 0 0 48 64764 "Arial" ; (1) --16 0 0 0 400 0 0 0 0 0 0 0 48 64512 "Arial" ; (1) --16 0 0 0 400 0 0 0 0 0 0 0 48 16579584 "Arial" ; (1) --16 0 0 0 900 0 0 0 0 0 0 0 48 64764 "Arial" ; (1) --16 0 0 0 400 1 0 0 0 0 0 0 48 16777215 "Arial" ; (1) -12 0 0 0 400 0 0 0 0 0 0 0 49 0 "Courier New" ; (1) +-12 0 0 0 400 0 0 0 0 0 0 0 48 32896 "Consolas" ; (5) +-12 0 0 0 900 0 0 0 0 0 0 0 48 0 "Consolas" ; (2) +-12 0 0 0 900 0 0 0 0 0 0 0 48 16515072 "Consolas" ; (1) +-12 0 0 0 400 0 0 0 0 0 0 0 48 32768 "Consolas" ; (1) +-12 0 0 0 400 0 0 0 0 0 0 0 48 8388608 "Consolas" ; (1) +-12 0 0 0 400 1 0 0 0 0 0 0 48 32768 "Consolas" ; (1) 6 0 0 ; FREF 0 0 ; FREF 1 0 ; FREF 0 0 ; FREF -12 0 ; FREF +4 0 ; FREF 2 0 ; FREF 0 0 ; FREF @@ -38,786 +39,697 @@ IFFontTable 13 0 0 ; FREF 0 0 ; FREF 0 0 ; FREF -4 0 ; FREF -5 0 ; FREF +0 0 ; FREF 6 0 ; FREF 7 0 ; FREF +6 0 ; FREF +5 0 ; FREF +5 0 ; FREF +5 0 ; FREF +5 0 ; FREF 8 0 ; FREF 9 0 ; FREF +5 0 ; FREF 10 0 ; FREF -11 0 ; FREF Colors 48 - 99ffff - 8282ff - 6699ff - 71c6ff - 1de29d - caffe4 - f1cea3 - f7f3ef - cccccc - ffe097 - cccc00 - cc9933 - ccccff - 9999cc - cc99cc - 66ffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff - ffffff + ff99ffff + ff8282ff + ff6699ff + ff71c6ff + ff1de29d + ffcaffe4 + fff1cea3 + fff7f3ef + ffcccccc + ffffe097 + ffcccc00 + ffcc9933 + ffccccff + ff9999cc + ffcc99cc + ff66ffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff + ffffffff IDInfo "" "" "" "" -Scenarios 30 0 -"Data Set" "DATASET" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -"" "" -ExSet 1 0 "" "" "" "" "" "" "" -Set 0 2 16908288 134217728 512 44 5000 5000 +ExSet 1 0 0 "" "" "" "" "" "" "" + "0.0.0.0" "1.0" "" "" "" "" +Set 0 3 0x01020000 0x08000000 0x00000000 +512 44 5000 5000 Stream 0 1 End Clock 0 0 0 0 3 0 -1 1 -1 0 0 1009843200 1293926400 0 1 15 0 255 -LabelLists 19 -"_boolean" 1 2 -0 "False" -0 -1 "True" -0 -0 -0 "_border_styles" 1 7 -0 "None" -0 -1 "Single" -0 -2 "Double" -0 -3 "Shadow" -0 -4 "Double Shadow" -0 -5 "Indent" -0 -6 "Double Indent" -0 +LabelLists 27 +"_alignment" 1 3 +0 "Left" 0 +1 "Right" 0 +2 "Center" 0 +0 +0 "_boolean" 1 2 +0 "False" 0 +1 "True" 0 +0 +0 "_border_styles" 1 10 +0 "None" 0 +1 "Single" 0 +2 "Double" 0 +3 "Shadow" 0 +4 "Double Shadow" 0 +5 "Indent" 0 +6 "Double Indent" 0 +7 "Rounded" 0 +8 "Rounded Edge" 0 +9 "Rounded Double" 0 0 0 "_colors" 1 17 -0 "Black" -0 -1 "Blue" -0 -2 "Green" -0 -3 "Cyan" -0 -4 "Red" -0 -5 "Purple" -0 -6 "Brown" -0 -7 "Light Grey" -0 -8 "Dark Grey" -0 -9 "Light Blue" -0 -10 "Light Green" -0 -11 "Light Cyan" -0 -12 "Light Red" -0 -13 "Light Magenta" -0 -14 "Yellow" -0 -15 "White" -0 -255 "None" -0 -0 -0 "_column_properties" 1 25 -0 "Width" -0 -1 "ClearValue" -0 -2 "ContentAlignment" -0 -3 "TitleAlignment" -0 -4 "ProtectFromEdit" -0 -5 "IncludeInGantt" -0 -6 "EditResetProperty" -0 -7 "DontShowZero" -0 -8 "HideRepeated" -0 -9 "KeepPrivate" -0 -10 "InPlaceLabelEdit" -0 -11 "InPlaceLabelRename" -0 -12 "PreciseEdits" -0 -13 "TitleToolTips" -0 -15 "InPlaceLabelCombo" -0 -16 "OnlyExistingLabels" -0 -17 "ComboListWidth" -0 -18 "OpenWithComboList" -0 -19 "RotateTitle" -0 -20 "BackgroundColor" -0 -21 "TextColor" -0 -22 "IgnoreHoverColor" -0 -23 "DynamicList" -0 -24 "NoClip" -0 -25 "DisableFilter" -0 +0 "Black" 0 +1 "Blue" 0 +2 "Green" 0 +3 "Cyan" 0 +4 "Red" 0 +5 "Purple" 0 +6 "Brown" 0 +7 "Light Grey" 0 +8 "Dark Grey" 0 +9 "Light Blue" 0 +10 "Light Green" 0 +11 "Light Cyan" 0 +12 "Light Red" 0 +13 "Light Magenta" 0 +14 "Yellow" 0 +15 "White" 0 +255 "None" 0 +0 +0 "_column_properties" 1 29 +0 "Width" 0 +1 "ClearValue" 0 +2 "ContentAlignment" 0 +3 "TitleAlignment" 0 +4 "ProtectFromEdit" 0 +5 "IncludeInGantt" 0 +6 "EditResetProperty" 0 +7 "DontShowZero" 0 +8 "HideRepeated" 0 +9 "KeepPrivate" 0 +10 "InPlaceLabelEdit" 0 +11 "InPlaceLabelRename" 0 +12 "PreciseEdits" 0 +13 "TitleToolTips" 0 +15 "InPlaceLabelCombo" 0 +16 "OnlyExistingLabels" 0 +17 "ComboListWidth" 0 +18 "OpenWithComboList" 0 +19 "RotateTitle" 0 +20 "BackgroundColor" 0 +21 "TextColor" 0 +22 "IgnoreHoverColor" 0 +23 "DynamicList" 0 +24 "NoClip" 0 +25 "DisableFilter" 0 +26 "RoundValues" 0 +27 "RoundWidth" 0 +28 "DontShowClearValue" 0 +29 "UserData" 0 0 0 "_dataset_errors" 1 16 -0 "None" -0 -1 "Bad Data Reference" -0 -2 "Repeated Data Object" -0 -3 "Missing Control Columns" -0 -4 "No DataSet Table Rows" -0 -5 "File Open Failed" -0 -6 "File Write Failed" -0 -7 "XML Parse Error" -0 -8 "XML Load Bad" -0 -9 "Resource Index Is Zero" -0 -10 "Invalid Resource Index" -0 -11 "Data Type Mismatch" -0 -12 "Blob header corrupt" -0 -13 "Blob data invalid" -0 -14 "Blob not found" -0 -15 "Blob size mismatch" -0 +0 "None" 0 +1 "Bad Data Reference" 0 +2 "Repeated Data Object" 0 +3 "Missing Control Columns" 0 +4 "No DataSet Table Rows" 0 +5 "File Open Failed" 0 +6 "File Write Failed" 0 +7 "XML Parse Error" 0 +8 "XML Load Bad" 0 +9 "Resource Index Is Zero" 0 +10 "Invalid Resource Index" 0 +11 "Data Type Mismatch" 0 +12 "Blob header corrupt" 0 +13 "Blob data invalid" 0 +14 "Blob not found" 0 +15 "Blob size mismatch" 0 0 0 "_external_files" 1 0 0 -0 "_keycodes" 1 12 -15104 "F1" -0 -15360 "F2" -0 -15616 "F3" -0 -15872 "F4" -0 -16128 "F5" -0 -16384 "F6" -0 -16640 "F7" -0 -16896 "F8" -0 -17152 "F9" -0 -17408 "F10" -0 -17664 "F11" -0 -17920 "F12" +0 "_fileoptions" 1 19 +1 "Formatted" 0 +2 "RowLabels" 0 +4 "ColLabels" 0 +8 "CommaDelimit" 0 +16 "IncompleteRows" 0 +32 "PreciseValues" 0 +64 "FourDigitYears" 0 +128 "NoTrailingSpaces" 0 +256 "StripSingleQuote" 0 +512 "AutoAddLabel" 0 +1024 "Append" 0 +2048 "QuoteAll" 0 +4096 "NoDelimit" 0 +8192 "IgnoreErrors" 0 +16384 "ReadOver" 0 +32768 "AllowEmptyZero" 0 +65536 "FreeTextAsText" 0 +131072 "PrecisionAsDisplayed" 0 +262144 "SecondColLabels" 0 0 +0 "_keycodes" 1 12 +15104 "F1" 0 +15360 "F2" 0 +15616 "F3" 0 +15872 "F4" 0 +16128 "F5" 0 +16384 "F6" 0 +16640 "F7" 0 +16896 "F8" 0 +17152 "F9" 0 +17408 "F10" 0 +17664 "F11" 0 +17920 "F12" 0 0 0 "_labellist_properties" 1 14 -0 "SortByName" -0 -1 "LabelRegions" -0 -2 "CyclicSelection" -0 -3 "OnlyModellersAdd" -0 -4 "AutoAddLabelsOnImport" -0 -5 "AutoIndexStartingAtZero" -0 -6 "DontClearWhenImporting" -0 -7 "DontAcceptNumericLabels" -0 -8 "TreatNumericLabelsAsIndicies" -0 -9 "RemoveLeadingSpaces" -0 -10 "RemoveTrailingSpaces" -0 -11 "Interpret0AsLabelIndex0" -0 -12 "InterpretEmptyInputAsLabelIndex0" -0 -13 "DataSet2LoadsLabelsByIndexNotLabel" -0 +0 "SortByName" 0 +1 "LabelRegions" 0 +2 "CyclicSelection" 0 +3 "OnlyModellersAdd" 0 +4 "AutoAddLabelsOnImport" 0 +5 "AutoIndexStartingAtZero" 0 +6 "DontClearWhenImporting" 0 +7 "DontAcceptNumericLabels" 0 +8 "TreatNumericLabelsAsIndicies" 0 +9 "RemoveLeadingSpaces" 0 +10 "RemoveTrailingSpaces" 0 +11 "Interpret0AsLabelIndex0" 0 +12 "InterpretEmptyInputAsLabelIndex0" 0 +13 "DataSet2LoadsLabelsByIndexNotLabel" 0 0 0 "_line_styles" 1 9 -0 "Solid" -0 -1 "Long Dashed" -0 -2 "Medium Dotted" -0 -3 "Dash Dotted" -0 -4 "Medium Dashed" -0 -5 "Dash 2 Dots" -0 -6 "Short Dashed" -0 -7 "Dense Dotted" -0 -8 "Sparse Dotted" -0 +0 "Solid" 0 +1 "Long Dashed" 0 +2 "Medium Dotted" 0 +3 "Dash Dotted" 0 +4 "Medium Dashed" 0 +5 "Dash 2 Dots" 0 +6 "Short Dashed" 0 +7 "Dense Dotted" 0 +8 "Sparse Dotted" 0 +0 +0 "_link_types" 1 3 +1 "SpatialLink" 0 +2 "Track" 0 +3 "Pipe" 0 0 0 "_object_types" 1 11 -1 "Entry" -0 -2 "Queue" -0 -3 "MultiServer" -0 -4 "Splitter" -0 -7 "Portal" -0 -11 "Dispatcher" -0 -12 "DropOff" -0 -13 "PickUp" -0 -16 "Section" -0 -17 "TrLoopOld" -0 -20 "Pipe" -0 -0 -0 "_paint_properties" 1 21 -0 "BottomLeftX" -0 -1 "BottomLeftY" -0 -2 "Width" -0 -3 "Height" -0 -4 "BackgroundColor" -0 -5 "BorderColor" -0 -6 "TextColor" -0 -7 "GradientTL" -0 -8 "GradientTR" -0 -9 "GradientBL" -0 -10 "GradientBR" -0 -11 "BorderStyle" -0 -12 "BorderThickness" -0 -13 "TextRotation" -0 -14 "TextWidth" -0 -15 "ImageXOffset" -0 -16 "ImageYOffset" -0 -17 "ImageUseWidth" -0 -18 "ImageUseHeight" -0 -19 "ImageWidth" -0 -20 "ImageHeight" -0 -0 -0 "_plot_modes" 1 10 -0 "no change" -0 -1 "no plot" -0 -2 "line" -0 -3 "stepped" -0 -4 "horizontal bar" -0 -5 "vertical bar" -0 -6 "area" -0 -7 "labelled bar" -0 -8 "centred label" -0 -9 "point" -0 -0 -0 "_section_types" 1 8 -0 "-" -0 -1 "Single" -0 -2 "Double (No Overtake)" -0 -3 "Double (Overtake)" -0 -4 "Double (Any Overtake)" -0 -5 "Double (Other Road On Closure)" -0 -6 "Triple (Shared Track)" -0 -7 "Triple (Any Overtake)" -0 +1 "Entry" 0 +2 "Queue" 0 +3 "MultiServer" 0 +4 "Splitter" 0 +7 "Portal" 0 +11 "Dispatcher" 0 +12 "DropOff" 0 +13 "PickUp" 0 +15 "Track" 0 +19 "Link" 0 +20 "Pipe" 0 +0 +0 "_paint_properties" 1 38 +0 "BottomLeftX" 0 +1 "BottomLeftY" 0 +2 "Width" 0 +3 "Height" 0 +4 "BackgroundColor" 0 +5 "BorderColor" 0 +6 "TextColor" 0 +7 "GradientTL" 0 +8 "GradientTR" 0 +9 "GradientBL" 0 +10 "GradientBR" 0 +11 "BorderStyle" 0 +12 "BorderThickness" 0 +13 "TextRotation" 0 +14 "TextWidth" 0 +15 "ImageXOffset" 0 +16 "ImageYOffset" 0 +17 "ImageUseWidth" 0 +18 "ImageUseHeight" 0 +19 "ImageWidth" 0 +20 "ImageHeight" 0 +21 "Transparency" 0 +22 "ImageRotation" 0 +23 "ShowInAnimateLayer" 0 +24 "ImageTimeStep" 0 +25 "ViewOrder" 0 +26 "LongitudeFrom" 0 +27 "LatitudeFrom" 0 +28 "LongitudeTo" 0 +29 "LatitudeTo" 0 +30 "TileZoomLevel" 0 +31 "ImageFrame" 0 +32 "ImageFrameCount" 0 +33 "Longitude" 0 +34 "Latitude" 0 +35 "FixedMapZoom" 0 +36 "TextShadow" 0 +37 "BorderRadius" 0 +0 +0 "_panel_properties" 1 9 +0 "HideObjectNames" 0 +1 "HideViews" 0 +2 "HidePaint" 0 +3 "ShowPathNumbers" 0 +4 "ShowAllPaths" 0 +5 "HideTracks" 0 +6 "HideSpatialLinks" 0 +7 "HidePipes" 0 +8 "HideBendPoints" 0 +0 +0 "_paneldrag_commands" 1 10 +0 "Click" 0 +1 "BeginDrag" 0 +2 "Drag" 0 +3 "EndDrag" 0 +4 "BeginPan" 0 +5 "Pan" 0 +6 "EndPan" 0 +7 "BeginZoom" 0 +8 "Zoom" 0 +9 "EndZoom" 0 +0 +0 "_pipe_bc_flags" 1 3 +1 "TargetAtUpperLimit" 0 +2 "SourceAtLowerLimit" 0 +4 "LoadLimitAtZero" 0 +0 +0 "_plot_modes" 1 14 +0 "No Change" 0 +1 "No Plot" 0 +2 "Line" 0 +3 "Stepped" 0 +4 "Horizontal Bar" 0 +5 "Vertical Bar" 0 +6 "Area" 0 +7 "Labelled Bar" 0 +8 "Centred Label" 0 +9 "Point" 0 +10 "Curve" 0 +11 "Area Stepped" 0 +12 "Point Rectangle" 0 +13 "Point Line" 0 +0 +0 "_print_orientation" 1 2 +1 "Portrait" 0 +2 "Landscape" 0 +0 +0 "_print_papersize" 1 6 +1 "Letter 8.5x11 in" 0 +5 "Legal 8.5x14 in" 0 +8 "A3 297x420 mm" 0 +9 "A4 210x297 mm" 0 +11 "A5 148x210 mm" 0 +66 "A2 420x594 mm" 0 +0 +0 "_section_types" 1 11 +0 "-" 0 +1 "Single" 0 +2 "Double (No Overtake)" 0 +3 "Double (Overtake)" 0 +4 "Double (Any Overtake)" 0 +5 "Double (Other Road On Closure)" 0 +6 "Triple (Shared Track)" 0 +7 "Triple (Any Overtake)" 0 +8 "Four Tracks" 0 +9 "Five Tracks" 0 +10 "Six Tracks" 0 0 0 "_stop_reasons" 1 8 -0 "Loaded/No Previous Run" -0 -1 "User Stopped Run" -0 -2 "Model Stopped Run" -0 -3 "Platform Required" -0 -4 "Error In Model/Engine" -0 -5 "Broadcast Option" -0 -6 "UI/Portal Click Option" -0 -7 "Restart Dispatcher" -0 +0 "Loaded/No Previous Run" 0 +1 "User Stopped Run" 0 +2 "Model Stopped Run" 0 +3 "Platform Required" 0 +4 "Error In Model/Engine" 0 +5 "Broadcast Option" 0 +6 "UI/Portal Click Option" 0 +7 "Restart Dispatcher" 0 0 0 "_system_colors" 1 22 -0 "3D Face" -0 -1 "3D Highlight" -0 -2 "3D Light" -0 -3 "3D Shadow" -0 -4 "Active Border" -0 -5 "Inactive Border" -0 -6 "Active Titlebar Left" -0 -7 "Inactive Titlebar Left" -0 -8 "Active Title Text" -0 -9 "Inactive Title Text" -0 -10 "Workspace" -0 -11 "Desktop" -0 -12 "Button Text" -0 -13 "Inactive Text (Grayed)" -0 -14 "Highlight (Selected)" -0 -15 "Highlight Text" -0 -16 "Menu Color" -0 -17 "Menu Text" -0 -18 "Scrollbar Color" -0 -19 "Window" -0 -20 "Window Border" -0 -21 "Window Text" -0 -0 -0 "_tableview_properties" 1 39 -0 "BottomLeftX" -0 -1 "BottomLeftY" -0 -2 "Width" -0 -3 "Height" -0 -4 "BackgroundColor" -0 -5 "BorderColor" -0 -6 "TextColor" -0 -7 "GradientTL" -0 -8 "GradientTR" -0 -9 "GradientBL" -0 -10 "GradientBR" -0 -11 "BorderStyle" -0 -1000 "CellBackground1" -0 -1001 "CellBackground2" -0 -1002 "CellText" -0 -1003 "CellBorder" -0 -1004 "ColumnBackground" -0 -1005 "ColumnText" -0 -1006 "ColumnSecondText" -0 -1007 "ColumnDividerLines" -0 -1008 "RowBackground1" -0 -1009 "RowBackground2" -0 -1010 "RowText" -0 -1011 "RowDividerLines" -0 -1012 "FilterBackground" -0 -1013 "FilterText" -0 -1014 "TopLine" -0 -1015 "DataAreaBackgrond" -0 -1016 "HoverCellBackground" -0 -1017 "HoverCellText" -0 -1018 "HoverRowBackground" -0 -1019 "HoverRowText" -0 -1020 "HoverColumnBackground" -0 -1021 "HoverColumnText" -0 -1022 "MarkedBackground" -0 -1023 "MarkedText" -0 -1024 "TitleText" -0 -1025 "TitleBackgroundL" -0 -1026 "TitleBackgroundR" -0 -0 -0 "_value_formats" 1 74 -0 "Time HH:MM SS" -0 -1 "Value" -0 -2 "Money $x.xx" -0 -3 "Rate/Sec" -0 -4 "Rate/Min" -0 -5 "Rate/Hour" -0 -6 "Rate/Day" -0 -7 "Rate/Week" -0 -8 "Rate/Month" -0 -9 "Rate/Year" -0 -10 "Calendar HH:MM SS" -0 -11 "Label" -0 -12 "Money $x" -0 -13 "Calendar HHMM" -0 -14 "Value with Commas" -0 -15 "Time Of Day HHMM" -0 -16 "Time Of Day 12hr" -0 -17 "Hexadecimal" -0 -18 "Time HH:MM:SS" -0 -19 "Calendar HH:MM:SS" -0 -20 "Time Minutes" -0 -21 "Time Hours" -0 -22 "Time Days" -0 -23 "Time Weeks" -0 -24 "Fixed xxxx.x" -0 -25 "Fixed xxxx.xx" -0 -26 "Fixed x,xxx.x" -0 -27 "Fixed x,xxx.xx" -0 -28 "Calendar Date Only" -0 -29 "Calendar Day Of Week" -0 -30 "Week, Day (from 1)" -0 -31 "Fixed 000xxx" -0 -32 "US Calendar HH:MM:SS" -0 -33 "Long DDD:MM:SS[E|W]" -0 -34 "Long [-]DDD:MM:SS.SS" -0 -35 "Lat DD:MM:SS[N|S]" -0 -36 "Lat [-] DD:MM:SS.SS" -0 -37 "Time Of Day HH:MM" -0 -38 "Calendar YYYY-MM-DD" -0 -39 "Text" -1 +0 "3D Face" 0 +1 "3D Highlight" 0 +2 "3D Light" 0 +3 "3D Shadow" 0 +4 "Active Border" 0 +5 "Inactive Border" 0 +6 "Active Titlebar Left" 0 +7 "Inactive Titlebar Left" 0 +8 "Active Title Text" 0 +9 "Inactive Title Text" 0 +10 "Workspace" 0 +11 "Desktop" 0 +12 "Button Text" 0 +13 "Inactive Text (Grayed)" 0 +14 "Highlight (Selected)" 0 +15 "Highlight Text" 0 +16 "Menu Color" 0 +17 "Menu Text" 0 +18 "Scrollbar Color" 0 +19 "Window" 0 +20 "Window Border" 0 +21 "Window Text" 0 +0 +0 "_tableview_properties" 1 154 +0 "BottomLeftX" 0 +1 "BottomLeftY" 0 +2 "Width" 0 +3 "Height" 0 +4 "BackgroundColor" 0 +5 "BorderColor" 0 +6 "TextColor" 0 +7 "GradientTL" 0 +8 "GradientTR" 0 +9 "GradientBL" 0 +10 "GradientBR" 0 +11 "BorderStyle" 0 +12 "GanttBarOffset" 0 +13 "GanttTextOffset" 0 +14 "TimeLabelColor" 0 +15 "TextLabelColor" 0 +16 "SelectLeft" 0 +17 "SelectTop" 0 +18 "SelectRight" 0 +19 "SelectBottom" 0 +20 "MinXValue" 0 +21 "MaxXValue" 0 +22 "MinYValue" 0 +23 "MaxYValue" 0 +24 "MinYValueRHS" 0 +25 "MaxYValueRHS" 0 +200 "ShowXScale" 0 +201 "XScaleInterval" 0 +202 "XScaleColor" 0 +203 "XScaleFont" 0 +204 "XScaleCharMargin" 0 +205 "ShowXTitle" 0 +206 "XTitle" 0 +207 "XTitleColor" 0 +208 "XTitleFont" 0 +209 "ShowXMajorGrid" 0 +210 "XMajorGridInterval" 0 +211 "XMajorGridColor" 0 +212 "XMajorGridWidth" 0 +213 "XMajorGridStyle" 0 +214 "ShowXMinorGrid" 0 +215 "XMinorGridInterval" 0 +216 "XMinorGridColor" 0 +217 "XMinorGridWidth" 0 +218 "XMinorGridStyle" 0 +219 "ShowXTicks" 0 +220 "XTickInterval" 0 +221 "XTickColor" 0 +222 "XTickLength" 0 +223 "XTickWidth" 0 +224 "ShowYScale" 0 +225 "YScaleInterval" 0 +226 "YScaleColor" 0 +227 "YScaleFont" 0 +228 "YScaleChars" 0 +229 "YScaleFmtOverride" 0 +230 "ShowYTitle" 0 +231 "YTitle" 0 +232 "YTitleColor" 0 +233 "YTitleFont" 0 +234 "ShowYMajorGrid" 0 +235 "YMajorGridInterval" 0 +236 "YMajorGridColor" 0 +237 "YMajorGridWidth" 0 +238 "YMajorGridStyle" 0 +239 "ShowYMinorGrid" 0 +240 "YMinorGridInterval" 0 +241 "YMinorGridColor" 0 +242 "YMinorGridWidth" 0 +243 "YMinorGridStyle" 0 +244 "ShowYTicks" 0 +245 "YTickInterval" 0 +246 "YTickColor" 0 +247 "YTickLength" 0 +248 "YTickWidth" 0 +249 "ShowYScaleRHS" 0 +250 "YScaleIntervalRHS" 0 +251 "YScaleColorRHS" 0 +252 "YScaleFontRHS" 0 +253 "YScaleCharsRHS" 0 +254 "YScaleFmtOverrideRHS" 0 +255 "ShowYTitleRHS" 0 +256 "YTitleRHS" 0 +257 "YTitleColorRHS" 0 +258 "YTitleFontRHS" 0 +259 "ShowYMajorGridRHS" 0 +260 "YMajorGridIntervalRHS" 0 +261 "YMajorGridColorRHS" 0 +262 "YMajorGridWidthRHS" 0 +263 "YMajorGridStyleRHS" 0 +264 "ShowYMinorGridRHS" 0 +265 "YMinorGridIntervalRHS" 0 +266 "YMinorGridColorRHS" 0 +267 "YMinorGridWidthRHS" 0 +268 "YMinorGridStyleRHS" 0 +269 "ShowYTicksRHS" 0 +270 "YTickIntervalRHS" 0 +271 "YTickColorRHS" 0 +272 "YTickLengthRHS" 0 +273 "YTickWidthRHS" 0 +274 "GraphBorderColor" 0 +275 "XLineColor" 0 +276 "XLineWidth" 0 +277 "YLineColor" 0 +278 "YLineWidth" 0 +279 "YLineColorRHS" 0 +280 "YLineWidthRHS" 0 +281 "GraphTLColor" 0 +282 "GraphTRColor" 0 +283 "GraphBLColor" 0 +284 "GraphBRColor" 0 +285 "GanttTimeLabels" 0 +286 "XAxisAuto" 0 +287 "XIncludeZero" 0 +288 "AllowNegativeX" 0 +289 "MinUserX" 0 +290 "MaxUserX" 0 +291 "UseXAxisMargin" 0 +292 "XMarginPercent" 0 +293 "YAxisAuto" 0 +294 "YIncludeZero" 0 +295 "MinUserY" 0 +296 "MaxUserY" 0 +297 "MinUserYRHS" 0 +298 "MaxUserYRHS" 0 +299 "UseYAxisMargin" 0 +300 "YMarginPercent" 0 +1000 "CellBackground1" 0 +1001 "CellBackground2" 0 +1002 "CellText" 0 +1003 "CellBorder" 0 +1004 "ColumnBackground" 0 +1005 "ColumnText" 0 +1006 "ColumnSecondText" 0 +1007 "ColumnDividerLines" 0 +1008 "RowBackground1" 0 +1009 "RowBackground2" 0 +1010 "RowText" 0 +1011 "RowDividerLines" 0 +1012 "FilterBackground" 0 +1013 "FilterText" 0 +1014 "TopLine" 0 +1015 "DataAreaBackgrond" 0 +1016 "HoverCellBackground" 0 +1017 "HoverCellText" 0 +1018 "HoverRowBackground" 0 +1019 "HoverRowText" 0 +1020 "HoverColumnBackground" 0 +1021 "HoverColumnText" 0 +1022 "MarkedBackground" 0 +1023 "MarkedText" 0 +1024 "TitleText" 0 +1025 "TitleBackgroundL" 0 +1026 "TitleBackgroundR" 0 +0 +0 "_value_formats" 1 87 +0 "Time [#w #d] hh:mm ss.ss" 0 +1 "Value" 0 +2 "Currency $x.xx" 0 +3 "Rate/Sec" 0 +4 "Rate/Min" 0 +5 "Rate/Hour" 0 +6 "Rate/Day" 0 +7 "Rate/Week" 0 +8 "Rate/Month" 0 +9 "Rate/Year" 0 +10 "Calendar D Mmm Y hh:mm ss" 0 +11 "Label" 0 +12 "Currency $x" 0 +13 "Calendar D Mmm Y hhmm" 0 +14 "Value with Commas" 0 +15 "Time Of Day hhmm" 0 +16 "Time Of Day hhmm PM (12hr)" 0 +17 "Hexadecimal ########" 0 +18 "Time [#w #d] hh:mm:ss" 0 +19 "Calendar D Mmm Y hh:mm:ss" 0 +20 "Time Minutes (scaled)" 0 +21 "Time Hours (scaled)" 0 +22 "Time Days (scaled)" 0 +23 "Time Weeks (scaled)" 0 +24 "Fixed #.#" 0 +25 "Fixed #.##" 0 +26 "Fixed #,###.#" 0 +27 "Fixed #,###.##" 0 +28 "Calendar D Mmm Y" 0 +29 "Calendar Day D Mmm Y (Day Name)" 0 +30 "Date W# D# hh:mm (Week/Day from 1)" 0 +31 "Fixed 000###" 0 +32 "Calendar Mmm D Y hh:mm:ss" 0 +33 "Long ddd:mm:ss[E|W]" 0 +34 "Long [-]ddd:mm:ss.ss" 0 +35 "Lat ddd:mm:ss[N|S]" 0 +36 "Lat [-]ddd:mm:ss.ss" 0 +37 "Time Of Day hh:mm" 0 +38 "Calendar YYYY-MM-DD" 0 +39 "Text" 1 "Free Text Entry" -40 "Money Rx.xx" -0 -41 "Money Rx" -0 -42 "Money €x.xx" -0 -43 "Money €x" -0 -44 "Time HH:MM (no seconds)" -0 -45 "Calendar HH:MM:SS.SSS" -0 -46 "Calendar YYYY-MM-DD HH:MM:SS" -0 -47 "Day Of Week; Time HHMM" -0 -48 "Day # (1..); Time HHMM" -0 -49 "Percentage x.xx%" -0 -50 "Percentage (optional fraction)" -0 -51 "Calendar YYYYMMDD" -0 -52 "Scientific x.xxxxxxe+yyy" -0 -53 "Calendar Day Mon DD HH:MM:SS YYYY" -0 -54 "Percentage x.xxx%" -0 -55 "Parts Per Million (ppm)" -0 -56 "Percentage x.xx" -0 -57 "Parts Per Million (no ppm)" -0 -58 "Percentage x.xxxxxx%" -0 -59 "Value with Commas No Decimal" -0 -60 "Calendar dd Mon (no year)" -0 -61 "Calendar dd Mon HHMM (no year)" -0 -62 "Time xxhr yymin" -0 -63 "OS Date Time" -0 -64 "OS Date" -0 -65 "OS Time" -0 -66 "OS Currency" -0 -67 "OS Value" -0 -68 "OS Percent" -0 -69 "RGB colour value" -0 -70 "Value No Decimal" -0 -71 "Fixed xxxx.xxx" -0 -72 "Fixed x,xxx.xxx" -0 -73 "Percentage x.x%" -0 +40 "Currency R#.##" 0 +41 "Currency R#" 0 +42 "Currency €#.##" 0 +43 "Currency €#" 0 +44 "Time [#w #d] hh:mm" 0 +45 "Calendar D Mmm Y hh:mm:ss.sss" 0 +46 "Calendar YYYY-MM-DD hh:mm:ss" 0 +47 "Time Day hhmm (Sun..Sat)" 0 +48 "Time D# hhmm (Day from 1)" 0 +49 "Percentage #.##%" 0 +50 "Percentage (optional fraction)" 0 +51 "Calendar YYYYMMDD" 0 +52 "Scientific #.######e+###" 0 +53 "Calendar Day Mmm DD hh:mm:ss YYYY" 0 +54 "Percentage #.###%" 0 +55 "Parts Per Million (ppm)" 0 +56 "Percentage #.##" 0 +57 "Parts Per Million (no ppm)" 0 +58 "Percentage #.######%" 0 +59 "Value with Commas No Decimal" 0 +60 "Calendar DD Mmm (no year)" 0 +61 "Calendar DD Mmm hhmm (no year)" 0 +62 "Time ##hr ##min" 0 +63 "OS Date Time" 0 +64 "OS Date" 0 +65 "OS Time" 0 +66 "OS Currency" 0 +67 "OS Value" 0 +68 "OS Percent" 0 +69 "Colour value RRGGBB" 0 +70 "Value No Decimal" 0 +71 "Fixed #.###" 0 +72 "Fixed #,###.###" 0 +73 "Percentage #.#%" 0 +74 "Calendar YYYY-MM-DD hhmmss" 0 +75 "Time [#d] hh:mm" 0 +76 "Time [#d] 0h:mm (hour always 2 digits)" 0 +77 "Time D# hh:mm (Day from 1)" 0 +78 "Date W# D# (Week/Day from 1)" 0 +79 "Date D# (Day From 1)" 0 +80 "Calendar YYYYMMDDhhmmss" 0 +81 "Time #w #d hh:mm:ss.ss Minimal" 0 +82 "Calendar D Mmm Y hh:mm" 0 +83 "Calendar DD.MM.YYYY" 0 +84 "Time hhh:mm" 0 +85 "Calendar YYYY-MM-DD-hh:mm:ss" 0 +86 "Colour value AARRGGBB" 0 0 0 "_view_types" 1 6 -1 "Table" -0 -2 "ColumnOverlay" -0 -3 "Gantt" -0 -4 "TrainGraph" -0 -5 "LogDriven" -0 -6 "Grid" -0 +1 "Table" 0 +2 "ColumnOverlay" 0 +3 "Gantt" 0 +4 "TrainGraph" 0 +5 "LogDriven" 0 +6 "Grid" 0 0 0 "test_ll" 1 2 -1 "First" -0 -2 "Second" -0 +1 "First" 0 +2 "Second" 0 0 1 "test_ll" 2 Sockets 0 0 80 -Broadcast 29 -"_PreInit Start" 10000 "" -"_PreInit End" 10001 "" -"_Run Start" 10002 "" -"_Run Pause" 10003 "" -"_Run Continue" 10004 "" -"_Run End" 10005 "" -"_Panel Opened" 10006 "" -"_Panel Closed" 10007 "" -"_System Close" 10008 "" -"_Portal Moved" 10009 "" -"_Portal Clicked" 10010 "" -"_Model Loaded" 10011 "" -"_Video Stopped" 10012 "" -"_Page Printed" 10013 "" -"_Dataset Loaded" 10014 "" -"_Link Clicked" 10015 "" -"_Dataset Saved" 10016 "" -"_Portal Hover" 10017 "" -"_Real Time Tick" 10018 "" -"_Menu Command" 10019 "" -"_Popup Opened" 10020 "" -"_Popup Closed" 10021 "" -"_Value Change" 10022 "" -"_Pipe Event" 10023 "" -"_Panel Drag" 10024 "" -"_Track Clicked" 10025 "" +Broadcast 38 +"_PreInit_Start" 10000 "" +"_PreInit_End" 10001 "" +"_Run_Start" 10002 "" +"_Run_Pause" 10003 "" +"_Run_Continue" 10004 "" +"_Run_End" 10005 "" +"_Panel_Opened" 10006 "" +"_Panel_Closed" 10007 "" +"_System_Close" 10008 "" +"_Portal_Moved" 10009 "" +"_Portal_Clicked" 10010 "" +"_Model_Loaded" 10011 "" +"_Video_Stopped" 10012 "" +"_Page_Printed" 10013 "" +"_Dataset_Loaded" 10014 "" +"_Link_Clicked" 10015 "" +"_Dataset_Saved" 10016 "" +"_Portal_Hover" 10017 "" +"_Real_Time_Tick" 10018 "" +"_Menu_Command" 10019 "" +"_Popup_Opened" 10020 "" +"_Popup_Closed" 10021 "" +"_Value_Change" 10022 "" +"_Pipe_Event" 10023 "" +"_Panel_Drag" 10024 "" +"_Track_Clicked" 10025 "" "_Key" 10026 "" -"_Panel Resized" 10027 "" +"_Panel_Resized" 10027 "" "Process" 1 "" +"_Panel_Scroll" 10028 "" +"_Panel_Visible" 10029 "" +"_Follow_Item" 10030 "" +"_Item_Click" 10031 "" +"_Panel_Repainted" 10032 "" +"_TrainTailExit" 10033 "" +"_TrainTailExitSrv" 10034 "" +"_Pipe_Clicked" 10035 "" +"_ObjectChange" 10036 "" Class 1 0 "item" 8 1 1 "_ITEM00" "_PERS1P" "_ITEM00" 1 255 0 -1 1 1 1 0 0 15 7 0 7 7 7 7 +1 1 1 1 0 0 15 7 0 255 7 7 7 7 6 End SubLabelList 0 MultiLabelLists 0 @@ -826,14 +738,14 @@ Screen 0 "" ScrnSize 1016 672 0 0 0 0 1 7 1 2 65616 0 "" 0 255 "" Paint -PButton 72 480 192 544 1 4 7 0 0 7 7 7 7 -0 0 +PButton 72 480 192 544 1 4 7 0 0 255 7 7 7 7 6 0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 72 480 192 544 0 4 7 0 0 7 7 7 7 +0 1 72 480 192 544 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "" "" "" 12 0 "" End @@ -845,8 +757,8 @@ Table 0 "" 0 "" 11 6 2 3 0 0 8 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 1 "formats" 3 "" 807 611 1659 911 0 0 1 100 0 1 "" -1 "seconds" "" 10 0 1 4 255 255 0 0 "seconds" 0 0 20 "minutes" "" 10 0 1 4 255 255 0 0 "minutes" 0 0 21 "hours" "" 10 0 1 4 255 255 0 0 "hours" 0 0 22 "days" "" 10 0 1 4 255 255 0 0 "days" 0 0 23 "weeks" "" 10 0 1 4 255 255 0 0 "weeks" 0 0 0 "hh_mm ss" "" 10 0 1 4 255 255 0 0 "hh_mm ss" 0 0 10 "D Mmm YY HH:MM SS" "" 15 0 1 4 255 255 0 0 "D Mmm YY HH:MM SS" 0 0 11 "test_ll" -"Label" "" 9 0 0 4 255 255 0 0 "Label" 0 0 39 "Text" "" 22 0 0 4 255 255 0 0 "Text" 0 0 34 2040 122400 2937600 20563200 12840 315705600 2 0 +1 "seconds" "" "" 10 0 1 4 255 255 0 0 "seconds" 0 0 0 20 "minutes" "" "" 10 0 1 4 255 255 0 0 "minutes" 0 0 0 21 "hours" "" "" 10 0 1 4 255 255 0 0 "hours" 0 0 0 22 "days" "" "" 10 0 1 4 255 255 0 0 "days" 0 0 0 23 "weeks" "" "" 10 0 1 4 255 255 0 0 "weeks" 0 0 0 0 "hh_mm ss" "" "" 10 0 1 4 255 255 0 0 "hh_mm ss" 0 0 0 10 "D Mmm YY HH:MM SS" "" "" 15 0 1 4 255 255 0 0 "D Mmm YY HH:MM SS" 0 0 0 11 "test_ll" +"Label" "" "" 9 0 0 4 255 255 0 0 "Label" 0 0 0 39 "Text" "" "" 22 0 0 4 255 255 0 0 "Text" 0 0 0 34 2040 122400 2937600 20563200 12840 315705600 2 0 0 0 0 @@ -864,8 +776,8 @@ Table 0 "" 0 "" 11 6 2 3 0 0 8 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 1 "formats_copy" 4 "" 655 630 1543 930 0 0 1 100 0 1 "" -1 "seconds" "" 10 0 1 4 255 255 0 0 "seconds" 0 0 20 "minutes" "" 10 0 1 4 255 255 0 0 "minutes" 0 0 21 "hours" "" 10 0 1 4 255 255 0 0 "hours" 0 0 22 "days" "" 10 0 1 4 255 255 0 0 "days" 0 0 23 "weeks" "" 10 0 1 4 255 255 0 0 "weeks" 0 0 0 "hh_mm ss" "" 10 0 1 4 255 255 0 0 "hh_mm ss" 0 0 10 "D Mmm YY HH:MM SS" "" 15 0 1 4 255 255 0 0 "D Mmm YY HH:MM SS" 0 0 11 "test_ll" -"Label" "" 9 0 0 4 255 255 0 0 "Label" 0 0 39 "Text" "" 22 0 0 4 255 255 0 0 "Text" 0 0 0 0 0 0 0 0 0 0 0 +1 "seconds" "" "" 10 0 1 4 255 255 0 0 "seconds" 0 0 0 20 "minutes" "" "" 10 0 1 4 255 255 0 0 "minutes" 0 0 0 21 "hours" "" "" 10 0 1 4 255 255 0 0 "hours" 0 0 0 22 "days" "" "" 10 0 1 4 255 255 0 0 "days" 0 0 0 23 "weeks" "" "" 10 0 1 4 255 255 0 0 "weeks" 0 0 0 0 "hh_mm ss" "" "" 10 0 1 4 255 255 0 0 "hh_mm ss" 0 0 0 10 "D Mmm YY HH:MM SS" "" "" 15 0 1 4 255 255 0 0 "D Mmm YY HH:MM SS" 0 0 0 11 "test_ll" +"Label" "" "" 9 0 0 4 255 255 0 0 "Label" 0 0 0 39 "Text" "" "" 22 0 0 4 255 255 0 0 "Text" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -884,13 +796,13 @@ Table 0 1 "Input_1" 1 "" 388 280 988 580 0 0 1 100 0 1 "" 11 "test_ll" -"Test" "" 10 0 0 4 255 255 0 0 "From" 0 0 1 "2" "" 10 0 1 4 255 255 0 0 "To" 0 0 1 "33" "" 10 0 1 4 255 255 0 0 "Time" 0 0 1 2 33.3 +"Test" "" "" 10 0 0 4 255 255 0 0 "From" 0 0 0 1 "2" "" "" 10 0 1 4 255 255 0 0 "To" 0 0 0 1 "33" "" "" 10 0 1 4 255 255 0 0 "Time" 0 0 0 1 2 33.3 0 0 0 -Routines 0 - Entry "Process" 72 600 "_BCSENT" "_ENTBLKD" "_ENTDONE" -1 0 "Process" Queue "Queue 1" 240 600 240 600 + Entry "Process" 72 600 0 + "_BCSENT" "_ENTBLKD" "_ENTDONE" +1 0 "Process" Queue "Queue 1" 240 600 240 600 0 392 616 0 10 5 0 1 0 0 0 1 1 @@ -898,7 +810,7 @@ Routines 0 0 0 1 "" 0 - Portal "Portal" 120 512 152 512 + Portal "Portal" 120 512 152 512 0 100 100 0 "_PORIDLE" "_PORBUSY" @@ -908,69 +820,69 @@ Screen 1 "" ScrnSize 1252 693 0 0 600 500 1 7 1 2 65616 8 "" 0 255 "" Paint -B 16 262 871 592 0 1 255 0 0 9 11 1 22 +B 16 262 871 592 0 1 255 0 0 255 9 11 1 22 6 1 "Rectangle" 1 2 -2 0 -B 1026 541 1130 589 0 1 255 0 0 7 7 7 7 +0 2 0 +B 1026 541 1130 589 0 1 255 0 0 255 7 7 7 7 6 0 1 -2 0 -L 1138 541 1206 634 0 1 255 0 0 7 7 7 7 +0 2 0 +L 1138 541 1206 634 0 1 255 0 0 255 7 7 7 7 6 0 1 - 2 0 1138 541 1206 634 0 6 -T 1114 509 1168 529 0 0 255 0 0 7 7 7 7 +0 2 0 1138 541 1206 634 0 6 +T 1114 509 1168 529 0 0 255 0 0 255 7 7 7 7 6 0 1 -"asdasd" 1114 509 0 +0 "asdasd" 1114 509 0 -O 946 445 1002 485 0 1 27 0 0 27 27 27 27 +O 946 445 1002 485 0 1 27 0 27 255 27 27 27 27 6 0 1 -PButton 1018 445 1157 493 0 4 7 0 0 7 7 7 7 +0 PButton 1018 445 1157 493 0 4 7 0 0 255 7 7 7 7 6 0 1 -0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 896 694 928 774 0 4 7 0 0 7 7 7 7 +0 1 896 694 928 774 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "Button" "" "" 12 0 -"" PButton 1014 16 1214 80 0 4 7 0 0 7 7 7 7 +"" PButton 1014 16 1214 80 0 4 7 0 0 255 7 7 7 7 6 0 3 -0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 896 16 1096 80 0 4 7 0 0 7 7 7 7 +0 1 896 16 1096 80 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "Bottom Right" "" "" 12 0 -"" PButton 16 20 216 84 0 4 7 0 0 7 7 7 7 +"" PButton 16 20 216 84 0 4 7 0 0 255 7 7 7 7 6 0 2 -0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 896 16 1096 80 0 4 7 0 0 7 7 7 7 +0 1 896 16 1096 80 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "Bottom Left" "" "" 12 0 -"" PButton 16 613 216 677 0 4 7 0 0 7 7 7 7 -0 0 +"" PButton 16 613 216 677 0 4 7 0 0 255 7 7 7 7 6 0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 896 16 1096 80 0 4 7 0 0 7 7 7 7 +0 1 896 16 1096 80 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "Top Left" "" "" 12 0 -"" PButton 1026 613 1226 677 0 4 7 0 0 7 7 7 7 +"" PButton 1026 613 1226 677 0 4 7 0 0 255 7 7 7 7 6 0 1 -0 0 +0 0 0 0 1 1 0 0 1 0 0 1 "" -0 1 896 16 1096 80 0 4 7 0 0 7 7 7 7 +0 1 896 16 1096 80 0 4 7 0 0 255 7 7 7 7 6 "State 1" 1 "Top Right" "" "" 12 0 "" End @@ -986,7 +898,7 @@ Parameter 0 "" 0 "" 11 6 2 3 0 0 8 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 0 "" 250 43 850 343 0 0 1 100 0 1 "" -1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 1 "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 +1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 1 "" "" "" 10 0 1 4 255 255 0 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -998,200 +910,136 @@ Parameter 0 0 0 -Routines 0 - Entry "_Panel Opened" 264 637 "_BCSENT" "_ENTBLKD" "_ENTDONE" -1 0 "_Panel Opened" Portal "Portal 1" -245 -219 -213 -219 + Entry "_Panel Opened" 264 637 0 + "_BCSENT" "_ENTBLKD" "_ENTDONE" +1 0 "_Panel_Opened" Portal "Portal 1" -245 -219 -213 -219 0 100 100 0 "_PORIDLE" "_PORBUSY" 8198 0 0 "" 0 - Portal "Portal 2" 336 637 368 637 + Portal "Portal 2" 336 637 368 637 0 100 100 0 "_PORIDLE" "_PORBUSY" 4 0 0 "" 0 - PEntry "Portal" 32 645 "_PENIDLE" - PExit "Portal" 128 645 "_PEXIDLE" + PEntry "Portal" 32 645 0 + "_PENIDLE" + PExit "Portal" 128 645 0 + "_PEXIDLE" End Screen 2 "" ScrnSize 1016 672 0 0 0 0 1 7 1 2 65616 0 "" 0 255 "" Paint -End +O 16 592 88 640 0 2 255 0 0 255 7 7 7 7 6 +0 0 +0 End Parameter -1 -"portal" "" 0 0 1 0 0 0 -0 Routines 0 - Entry "_Panel Resized" 32 624 "_BCSENT" "_ENTBLKD" "_ENTDONE" -1 0 "_Panel Resized" Entry "_Run Start" 32 568 "_BCSENT" "_ENTBLKD" "_ENTDONE" -1 0 "_Run Start" Exit "Exit 1" 200 584 0 0 2 7 "" -"" "_EXTIDLE" - PEntry "Portal 2" 32 528 "_PENIDLE" - PExit "Portal 2" 152 512 "_PEXIDLE" - Transform "Change 1" 112 584 "_CHGRO2" - 0 0 0 0 1 0 "" "" - -0000 -0 0 -0 1 1 -0 0 1 -0 0 1 -"" -0 0 -0 1 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -4 61 -0 0 1 -0 0 1 -"" - + PEntry "Portal 1" 32 624 0 + "_PENIDLE" + PExit "Portal 1" 128 624 0 + "_PEXIDLE" + Transform "Change 1" 48 600 0 + "_TRAIDLE" + 0 0 0 End Screen 3 "" ScrnSize 1016 672 0 0 0 0 1 7 1 2 65616 0 "" 0 255 "" Paint -O 16 592 88 640 0 2 255 0 0 7 7 7 7 -0 0 End Parameter +1 +"portal" "" 0 0 1 0 0 0 -Routines 0 - PEntry "Portal 1" 32 624 "_PENIDLE" - PExit "Portal 1" 128 624 "_PEXIDLE" - Transform "Change 1" 48 600 "_TRAIDLE" - 0 0 0 0 1 0 "" "" - -0000 -0 0 -0 1 1 -0 0 1 -0 0 1 -"" -0 0 -0 1 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -0 0 1 -0 0 1 -0 0 1 -"" -0 0 -4 61 -0 0 1 -0 0 1 -"" - +0 Entry "_Panel Resized" 32 624 0 + "_BCSENT" "_ENTBLKD" "_ENTDONE" +1 0 "_Panel_Resized" Entry "_Run Start" 32 568 0 + "_BCSENT" "_ENTBLKD" "_ENTDONE" +1 0 "_Run_Start" Exit "Exit 1" 200 584 0 +0 0 2 7 "" +"" "_EXTIDLE" + PEntry "Portal 2" 32 528 0 + "_PENIDLE" + PExit "Portal 2" 152 512 0 + "_PEXIDLE" + Transform "Change 1" 112 584 0 + "_CHGRO2" + 0 0 0 End -SysLev "B8863E2E28336855D6F066A7DF1C96772759DFF1076CECF3C143CB093ABB3B1413A515493791" +SysLev "251E70AD9CDDB74655BD0CAED6FC588E7FD40F98F2D1F49DB0FDB085B338286E3A45CAFA2EC2" Paths 1 0 2 "_height" "" 32 0 1 "_width" "" 0 0 1 0 0 3 -0 1 -2 - Entry 0 - Queue 0 1 1 2 - Entry 0 - Portal 1 -2 3 +Entry 0 +Portal 1 +3 3 3 - Entry 0 - Transform 0 - Exit 0 +Entry 0 +Transform 0 +Exit 0 2 - Entry 1 - Transform 0 +Entry 1 +Transform 0 2 - PEntry 0 - Transform 0 +PEntry 0 +Transform 0 +0 1 +2 +Entry 0 +Queue 0 ScreenDet 0 PaintDet -0 0 0 "" 1 0 1 1 1 1 -1 -1 +0 0 "" 1 0 1 1 1 1 -1 -1 0 0 End - Portal "Portal" 1 End -TTableStat 288 464 588 624 1 5 15 7 1 7 7 7 7 + Portal 0 1 End +Stats 3 +TTableStat 288 464 588 624 1 5 15 7 1 255 7 7 7 7 6 0 27 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 -131202 0 0 "Input_1" 0 0 0 2 303 0 "" 0 0 "" "" "" "" 0 +4325506 0 0 "Input_1" 0 0 0 2 319 0 "" 0 0 "" "" "" "" "" 0 -TTableStat 24 352 856 432 1 5 15 7 1 7 7 7 7 +TTableStat 24 352 856 432 1 5 15 7 1 255 7 7 7 7 6 0 27 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 -131202 0 0 "Formats" 0 0 0 6 303 0 "" 0 0 "" "" "" "" 0 +4325506 0 0 "Formats" 0 0 0 6 319 0 "" 0 0 "" "" "" "" "" 0 -TTableStat 24 256 856 344 1 5 15 7 1 7 7 7 7 +TTableStat 24 256 856 344 1 5 15 7 1 255 7 7 7 7 6 0 27 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 -131202 0 0 "formats_copy" 0 0 0 0 303 0 "" 0 0 "" "" "" "" 0 +4325506 0 0 "formats_copy" 0 0 0 0 319 0 "" 0 0 "" "" "" "" "" 0 End ScreenDet 1 PaintDet -0 0 0 "" 0 0 0 -1 0 0 "" 0 0 0 -3 0 0 "" 0 0 0 -4 0 0 "" 0 0 0 -5 0 0 "" 0 0 0 -6 0 0 "" 0 0 0 -7 0 0 "" 0 0 0 -8 0 0 "" 0 0 0 -9 0 0 "" 0 0 0 +0 0 "" 0 0 0 +1 0 "" 0 0 0 +2 0 "" 0 0 0 +3 0 "" 0 0 0 +4 0 "" 0 0 0 +5 0 "" 0 0 0 +6 0 "" 0 0 0 +7 0 "" 0 0 0 +8 0 "" 0 0 0 +9 0 "" 0 0 0 End ViewPorts 1 -1002 301 1146 429 0 0 1 7 1 "" 1 1 3 - Portal "Portal 1" 3 End - Portal "Portal 2" 2 End -TTableStat 16 93 871 251 0 5 15 7 1 7 7 7 7 +1002 301 1146 429 0 0 1 7 1 "" 1 1 2 + Portal 0 2 End + Portal 1 3 End +Stats 2 +TTableStat 16 93 871 251 0 5 15 7 1 255 7 7 7 7 6 2 27 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 -131202 0 1 "test" 0 0 0 0 303 0 "" 0 0 "" "" "" "" 0 +4325506 0 1 "test" 0 0 0 0 303 0 "" 0 0 "" "" "" "" "" 0 TableStat 1 "test" 0 0 0 0 0 1 1 @@ -1203,14 +1051,20 @@ TableStat 1 "test" 0 0 0 0 0 0 1 0 0 1 "" -883 18 1013 58 0 5 15 0 0 7 7 7 7 +883 18 1013 58 0 5 15 0 0 255 7 7 7 7 6 3 8 1 -18 0 0 0 0 0 0 "" End ScreenDet 2 PaintDet +0 0 "" 0 0 0 +End + Transform 0 0 0 0 +0 + End - Transform "Change 1" 0 0 1 14 "" 1 0 +ScreenDet 3 + Transform 0 0 0 1 14 "" 1 0 324 137 1668 977 75 0 "This responds to resize events and updates the 'map' area." @@ -1373,7 +1227,7 @@ End 0 0 1 "" "" -4 +5 2 0 0 0 1 0 0 1 @@ -1394,6 +1248,11 @@ End 0 0 1 0 0 1 "" +0 0 +0 1 1 +0 0 1 +0 0 1 +"" 299 1 0 0 @@ -1402,7 +1261,7 @@ End 0 0 1 "" "" -4 +5 2 0 0 0 1 0 0 1 @@ -1423,10 +1282,15 @@ End 0 0 1 0 0 1 "" +0 0 +0 1 1 +0 0 1 +0 0 1 +"" 300 0 "" -5 +6 2 0 0 0 1 0 0 1 @@ -1466,10 +1330,15 @@ End 0 0 1 0 0 1 "" +0 0 +0 1 1 +0 0 1 +0 0 1 +"" 300 0 "" -5 +6 2 0 0 0 1 0 0 1 @@ -1505,6 +1374,11 @@ End 0 0 1 0 0 1 "" +0 0 +0 1 1 +0 0 1 +0 0 1 +"" 137 0 "" @@ -1535,12 +1409,18 @@ End 0 End -ScreenDet 3 -PaintDet -0 0 0 "" 0 0 0 -End - Transform "Change 1" 0 0 0 -0 - -End +ModelButtons 12 +0 "" 0 +1 "" 0 +2 "" 0 +3 "" 0 +4 "" 0 +5 "" 0 +6 "" 0 +7 "" 0 +8 "" 0 +9 "" 0 +10 "" 0 +11 "" 0 End +;CRC=47F4672D COUNT=00005ECE diff --git a/WindowsFormsApplication1/obj/Debug/WindowsFormsApplication1.csproj.FileListAbsolute.txt b/WindowsFormsApplication1/obj/Debug/WindowsFormsApplication1.csproj.FileListAbsolute.txt index 6cd6f02..ed74bec 100644 --- a/WindowsFormsApplication1/obj/Debug/WindowsFormsApplication1.csproj.FileListAbsolute.txt +++ b/WindowsFormsApplication1/obj/Debug/WindowsFormsApplication1.csproj.FileListAbsolute.txt @@ -1,2 +1 @@ C:\Users\crchandl\Documents\Visual Studio 2013\Projects\pl5engine\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config -C:\Users\crchandl\Documents\Visual Studio 2013\Projects\PL.Net\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config diff --git a/pl5engine/pl5engine.csproj b/pl5engine/PLEngine.csproj similarity index 97% rename from pl5engine/pl5engine.csproj rename to pl5engine/PLEngine.csproj index 29e1d9c..fcf7a45 100644 --- a/pl5engine/pl5engine.csproj +++ b/pl5engine/PLEngine.csproj @@ -8,7 +8,7 @@ {0D9A8225-58D7-4F5C-9251-2D1734553752} Library Properties - pl5engine + Planimate.Engine pl5engine v4.5 512 @@ -51,7 +51,7 @@ TRACE prompt 4 - bin\Release\pl5engine.XML + bin\Release\pl5engine.xml false diff --git a/pl5engine/pl5engine.csproj.user b/pl5engine/PLEngine.csproj.user similarity index 100% rename from pl5engine/pl5engine.csproj.user rename to pl5engine/PLEngine.csproj.user diff --git a/pl5engine/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/pl5engine/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 099c811..a96ab45 100644 Binary files a/pl5engine/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/pl5engine/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/pl5engine/pl5engine.Designer.cs b/pl5engine/pl5engine.Designer.cs index 0aee159..26c7620 100644 --- a/pl5engine/pl5engine.Designer.cs +++ b/pl5engine/pl5engine.Designer.cs @@ -17,9 +17,9 @@ * along with pl5engine. If not, see . */ -namespace Planimate5engine +namespace Planimate.Engine { - partial class pl5engine + partial class PLLoader { /// Required designer variable. private System.ComponentModel.IContainer components = null; diff --git a/pl5engine/pl5engine.cs b/pl5engine/pl5engine.cs index d141ca9..8c6f5a9 100644 --- a/pl5engine/pl5engine.cs +++ b/pl5engine/pl5engine.cs @@ -1,14 +1,14 @@ ļ»æ/* Copyright 2009 Craig Chandler * * - * This file is part of pl5engine. + * This file is part of PL.Net. * - * pl5engine is free software: you can redistribute it and/or modify + * PL.Net 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 3 of the License, or * (at your option) any later version. * - * Foobar is distributed in the hope that it will be useful, + * PL.Net 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. @@ -34,9 +34,9 @@ using System.Runtime.InteropServices; using System.Collections; // DllImport -namespace Planimate5engine +namespace Planimate.Engine { - #region pl5engine enums + #region PL.Net enums /// PlanimateĀ® system attributes the DLL can read (some can be set) public enum ePLSysInfo { @@ -51,7 +51,21 @@ public enum ePLSysInfo PLSI_OLDESTFILEVERSION, PLSI_LOADEDFILEVERSION, /// Returns the version of the engine (not the core PlanimateĀ® version) - PLSI_DLLVERSION + PLSI_DLLVERSION, + /// R/W/E: controls if PL pauses after advance-to-time + PLSI_PAUSEAFTERADVANCE + }; + + /// + /// Major mode for PlanimateĀ® engine + /// + public enum ePLMode + { + MD_OBJECT = 0, // editing objects or user mode with engine stopped + MD_FLOWEDIT, // flow or interaction edit mode (flow editor has submode) + MD_PAINT, // editing paint object layer + MD_SIMULATE, // engine started and model is running + MD_PAUSED // engine started and model is paused }; /// PlanimateĀ® data object types @@ -67,7 +81,7 @@ public enum eDOTypes PLDO_TABLE }; - /// PlanimateĀ® 5 engine return results + /// PlanimateĀ® engine return results public enum ePLRESULT { /// Not found @@ -249,11 +263,96 @@ public enum eTFUnit UNIT_MODECOUNT, /// special case - must be 255 and last UNIT_NULL = 255 - } + }; + + /// + /// Thread proc status for Planimate DLL loader class + /// This is different to the PL Run Engine State + /// NOTE:The PL Engine is only valid when thread is in PLT_Running state + /// + enum ePLThreadState + { + PLT_None, + PLT_LoadError, + PLT_BindError, + PLT_ThreadPending, + PLT_ThreadStart, + PLT_InitDone, + PLT_Running, + PLT_Terminating, + PLT_ThreadEnd + }; + + /// + /// Function enum for Planimate5 DLL loader class and instance user + /// the GETPLPROC() macro in loadpl.cpp makes use of these + /// + public enum ePLProcs + { + ePL_SetInstance, + ePL_Init, + ePL_Term, + ePL_AppVersion, + ePL_LoadModel, + ePL_Run, + ePL_GetSystemInfo, + ePL_SetSystemInfo, + ePL_DataObjectCount, + ePL_GetDataObject, + ePL_FindDataObjectName, + ePL_FindDataObject, + ePL_DataObjectType, + ePL_DataObjectName, + ePL_ListFromDataObject, + ePL_GetNamedLabelList, + ePL_LabelCount, + ePL_GetLabelName, + ePL_GetLabelIndex, + ePL_FindLabelName, + ePL_LookUpLabel, + ePL_LookUpLValue, + ePL_LookUpDValue, + ePL_FindLabelAutoAdd, + ePL_Rows, + ePL_Columns, + ePL_ColumnName, + ePL_GetColumnFormat, + ePL_SetColumnFormat, + ePL_GetColumnLabels, + ePL_FindColumn, + ePL_TableResize, + ePL_GetCell, + ePL_SetCell, + ePL_GetCellText, + ePL_SetCellText, + ePL_GetColumn, + ePL_SetColumn, + ePL_InsertRow, + ePL_DeleteRow, + ePL_InsertColumn, + ePL_DeleteColumn, + ePL_BroadcastCount, + ePL_GetBroadcast, + ePL_GetBroadcastName, + ePL_SendBroadcast, + ePL_SendBroadcastTuple, + ePL_RegisterBroadcastCallback, + ePL_FormatModeCount, + ePL_FormatName, + ePL_StringToValue, + ePL_ValueToString, + ePL_GetWindow, + ePL_Process, + ePL_SuspendThread, + ePL_ResumeThread, + ePL_RegisterPauseCallback, + + ePL_PROCCOUNT + }; #endregion - /// Implements a UserControl that contains a PlanimateĀ® engine - public partial class pl5engine : System.Windows.Forms.UserControl, IDataSourceDesigner + /// Implements a UserControl that contains a PlanimateĀ® engine loader + public partial class PLLoader : System.Windows.Forms.UserControl { #region kernel32 import [DllImport("kernel32.dll")] @@ -266,152 +365,32 @@ public partial class pl5engine : System.Windows.Forms.UserControl, IDataSourceDe private static extern bool FreeLibrary(IntPtr hModule); #endregion - #region pl5engine function delegations - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_AppVersion(); - + #region PLLoader function delegations [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void tPL_SetInstance(IntPtr handle); + private delegate IntPtr tPLL_Init([MarshalAs(UnmanagedType.LPStr)] string dll_name, + [MarshalAs(UnmanagedType.LPStr)] string cmdline, + IntPtr inplace_window); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_Init([MarshalAs(UnmanagedType.LPStr)] string cmdline, - IntPtr inplace_window); + private delegate IntPtr tPLL_Term(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void tPL_Term(IntPtr handle); + private delegate IntPtr tPLL_State(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_LoadModel([MarshalAs(UnmanagedType.LPStr)] string cmdline); + private delegate IntPtr tPLL_OwnerWindow(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate double tGetSystemInfo(ePLSysInfo sysinfo_id); + private delegate IntPtr tPLL_WaitRunning(IntPtr handle, int timeout); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SetSystemInfo(ePLSysInfo sysinfo_id, double value); + private delegate IntPtr tPLL_SuspendThread(); - /// Data Object interface - /// - /// Data Objects are the data placed in the data objects label list in the model. - /// They can be tables, label lists, attributes and sub label lists. - /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_DataObjectCount(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetDataObject(int w); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_FindDataObjectName([MarshalAs(UnmanagedType.LPStr)] string DO_name); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_FindDataObject(int index); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate eDOTypes tPL_DataObjectType(IntPtr dataobject); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_DataObjectName(IntPtr dataobject); - - #region For label list data objects - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_ListFromDataObject(IntPtr dataobject); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetNamedLabelList([MarshalAs(UnmanagedType.LPStr)] string list_name); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_LabelCount(IntPtr labellist); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetLabelName(IntPtr labellist, int order); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate Int32 tPL_GetLabelIndex(IntPtr labellist, int order); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_FindLabelName(IntPtr labellist, [MarshalAs(UnmanagedType.LPStr)] string label); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate Int32 tPL_LookUpLabel(IntPtr labellist, [MarshalAs(UnmanagedType.LPStr)] string label); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_LookUpLValue(IntPtr labellist, Int32 index); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_LookUpDValue(IntPtr labellist, double index); - #endregion - - #region For Table data objects: - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_Rows(IntPtr dataobject); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_Columns(IntPtr dataobject); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_ColumnName(IntPtr dataobject, int column); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate eTFUnit tPL_GetColumnFormat(IntPtr dataobject, int column); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetColumnLabels(IntPtr dataobject, int column); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int tPL_FindColumn(IntPtr dataobject, - [MarshalAs(UnmanagedType.LPStr)] string col_name); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_TableResize(IntPtr dataobject, int rows, int cols); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate double tPL_GetCell(IntPtr dataobject, int row, int col); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SetCell(IntPtr dataobject, int row, int col, double data); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetCellText(IntPtr dataobject, int row, int col); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SetCellText(IntPtr dataobject, int row, int col, [MarshalAs(UnmanagedType.LPStr)] string data); - - //Entire Column operations - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_GetColumn(IntPtr dataobject, int column, int rows, double[] into); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SetColumn(IntPtr dataobject, int column, int rows, double[] to); - - #endregion - - #region Broadcasts - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate IntPtr tPL_GetBroadcastName([MarshalAs(UnmanagedType.LPStr)] string broadcast_name); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SendBroadcast(IntPtr broadcast); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_SendBroadcastTuple(IntPtr broadcast, int no_params, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] tuple_names, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] double[] tuple_values); - - /// PlanimateĀ® broadcast callback function definition - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate ePLRESULT tPL_BroadcastCallback(IntPtr broadcast, int no_params, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] tuple_names, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] double[] tuple_values); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_RegisterBroadcastCallback(IntPtr broadcast, tPL_BroadcastCallback function); - #endregion + private delegate IntPtr tPLL_ResumeThread(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate ePLRESULT tPL_StringToValue([MarshalAs(UnmanagedType.LPStr)] string str, - IntPtr val, // double* - eTFUnit format); + private delegate IntPtr tPLL_GetProc(IntPtr handle, ePLProcs function); #endregion /// Override the OnResize handler to force a repaint message to be sent through to PlanimateĀ® @@ -421,9 +400,21 @@ protected override void OnResize(EventArgs e) this.Invalidate(true); } - /// Path to PlanimateĀ® 5 engine DLL + /// Path to PlanimateĀ® Loader DLL + [ + Category("PLEngine"), + Description("Compiled Planimate Loader DLL path/filename"), + Editor(typeof(FileNameEditor), typeof(UITypeEditor)) + ] + public String loader_dll_pathname + { + get; + set; + } + + /// Path to PlanimateĀ® engine DLL [ - Category("PL5Engine"), + Category("PLEngine"), Description("Compiled Planimate DLL path/filename"), Editor(typeof(FileNameEditor), typeof(UITypeEditor)) ] @@ -433,989 +424,1111 @@ public String dll_pathname set; } - private IntPtr dll_handle = IntPtr.Zero; + private IntPtr loader_dll_handle = IntPtr.Zero; + private IntPtr engine_handle = IntPtr.Zero; + private PLEngine engine = null; /// Engine constructor - public pl5engine() + public PLLoader() { InitializeComponent(); } - private IntPtr DLLHandle() + private IntPtr LoaderDLLHandle() { - if (dll_handle == IntPtr.Zero) - dll_handle = LoadLibrary(dll_pathname); + if (loader_dll_handle == IntPtr.Zero) + loader_dll_handle = LoadLibrary(loader_dll_pathname); - return dll_handle; + return loader_dll_handle; } - /// Returns the PlanimateĀ® version powering the engine. - public string PlanimateVersion() + /// Initialise the PlanimateĀ® loader engine. + public ePLRESULT InitPLLoader() { - if (DLLHandle() == IntPtr.Zero) - return ""; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_AppVersion"); + if (LoaderDLLHandle() == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; + return 0; + } + + public void WaitRunning(IntPtr handle, int timeout) + { + if (LoaderDLLHandle() == IntPtr.Zero) + return; + + IntPtr pAddressOfFunctionToCall = GetProcAddress(LoaderDLLHandle(), "PLL_WaitRunning"); //oh dear, error handling here if (pAddressOfFunctionToCall == IntPtr.Zero) - return ""; + return; - tPL_AppVersion ltPL_AppVersion = (tPL_AppVersion)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_AppVersion)); - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_AppVersion()); + tPLL_WaitRunning ltPLL_WaitRunning = (tPLL_WaitRunning)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPLL_WaitRunning)); + ltPLL_WaitRunning(handle, timeout); } - /// Initialise the PlanimateĀ® engine. + /// Creates a new PlanimateĀ® engine. /// can be a PlanimateĀ® commandline option or just "" - /// should be the handle of a window into which /// PlanimateĀ® will place a child window for its display.If NULL PL will create a new window - public ePLRESULT EngineInit(string cmdline, IntPtr par_handle) + public ePLRESULT CreatePL(string cmdline) { - if (DLLHandle() == IntPtr.Zero) + if (LoaderDLLHandle() == IntPtr.Zero) return ePLRESULT.PLR_NOTFOUND; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SetInstance"); + IntPtr pAddressOfFunctionToCall = GetProcAddress(LoaderDLLHandle(), "PLL_Init"); //oh dear, error handling here if (pAddressOfFunctionToCall == IntPtr.Zero) return ePLRESULT.PLR_NOTFOUND; - tPL_SetInstance ltPL_SetInstance = (tPL_SetInstance)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetInstance)); - ltPL_SetInstance(DLLHandle()); + tPLL_Init ltPLL_Init = (tPLL_Init)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPLL_Init)); + engine_handle = ltPLL_Init(dll_pathname, cmdline, this.Handle); - pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_Init"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) + if (engine_handle == IntPtr.Zero) return ePLRESULT.PLR_NOTFOUND; - tPL_Init ltPL_Init = (tPL_Init)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_Init)); - return ltPL_Init(cmdline, this.Handle); + WaitRunning(engine_handle, 60000); + + engine = new PLEngine(this, engine_handle); + + return 0; } - // Data Object Functions + public PLEngine GetEngine() + { + return engine; + } - /// Finds a PlanimateĀ® data object by name - /// String name of the PlanimateĀ® data object - public IntPtr FindDataObjectName(string DO_name) + public IntPtr GetProc(IntPtr handle, ePLProcs function) { - if (DLLHandle() == IntPtr.Zero) + if (LoaderDLLHandle() == IntPtr.Zero) return IntPtr.Zero; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_FindDataObjectName"); + IntPtr pAddressOfFunctionToCall = GetProcAddress(LoaderDLLHandle(), "PLL_GetProc"); //oh dear, error handling here if (pAddressOfFunctionToCall == IntPtr.Zero) return IntPtr.Zero; - tPL_FindDataObjectName ltPL_FindDataObjectName = (tPL_FindDataObjectName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_FindDataObjectName)); - return ltPL_FindDataObjectName(DO_name); + tPLL_GetProc ltPLL_GetProc = (tPLL_GetProc)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPLL_GetProc)); + return ltPLL_GetProc(handle, function); } + } - /// Returns the data object type - /// Pointer to PlanimateĀ® data object - public eDOTypes DataObjectType(IntPtr data_object) - { - if (DLLHandle() == IntPtr.Zero) - return (eDOTypes)(-1); +public partial class PLEngine +{ + #region pl5engine function delegations - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_DataObjectType"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return (eDOTypes)(-1); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_AppVersion(); - tPL_DataObjectType ltPL_DataObjectType = (tPL_DataObjectType)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_DataObjectType)); - return ltPL_DataObjectType(data_object); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void tPL_SetInstance(IntPtr handle); - /// Returns the number of rows in a table data object - /// Pointer to PlanimateĀ® data object - public int Rows(IntPtr data_object) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_Init([MarshalAs(UnmanagedType.LPStr)] string cmdline, + IntPtr inplace_window); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_Rows"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void tPL_Term(IntPtr handle); - tPL_Rows ltPL_Rows = (tPL_Rows)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_Rows)); - return ltPL_Rows(data_object); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_LoadModel([MarshalAs(UnmanagedType.LPStr)] string cmdline); - /// Returns the number of columns in a table data object - /// Pointer to PlanimateĀ® data object - public int Columns(IntPtr data_object) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate double tPL_GetSystemInfo(ePLSysInfo sysinfo_id); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_Columns"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SetSystemInfo(ePLSysInfo sysinfo_id, double value); - tPL_Columns ltPL_Columns = (tPL_Columns)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_Columns)); - return ltPL_Columns(data_object); - } + /// Data Object interface + /// + /// Data Objects are the data placed in the data objects label list in the model. + /// They can be tables, label lists, attributes and sub label lists. + /// + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_DataObjectCount(); - /// Returns the column name of the specified column - /// Pointer to PlanimateĀ® data object - /// Index of the column - public string ColumnName(IntPtr data_object, int column) - { - if (DLLHandle() == IntPtr.Zero) - return ""; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetDataObject(int w); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_ColumnName"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ""; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_FindDataObjectName([MarshalAs(UnmanagedType.LPStr)] string DO_name); - tPL_ColumnName ltPL_ColumnName = (tPL_ColumnName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_ColumnName)); - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_ColumnName(data_object, column)); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_FindDataObject(int index); - /// Returns PlanimateĀ® value format of the specified column - /// Pointer to PlanimateĀ® data object - /// Index of the column - public eTFUnit GetColumnFormat(IntPtr data_object, int column) - { - if (DLLHandle() == IntPtr.Zero) - return (eTFUnit)(-1); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate eDOTypes tPL_DataObjectType(IntPtr dataobject); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetColumnFormat"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return (eTFUnit)(-1); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_DataObjectName(IntPtr dataobject); - tPL_GetColumnFormat ltPL_GetColumnFormat = (tPL_GetColumnFormat)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumnFormat)); - return ltPL_GetColumnFormat(data_object, column); - } + #region For label list data objects + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_ListFromDataObject(IntPtr dataobject); - /// Returns PlanimateĀ® label list that the specified column is formatted to. - /// Pointer to PlanimateĀ® data object - /// Index of the column - public IntPtr GetColumnLabelList(IntPtr data_object, int column) - { - if (DLLHandle() == IntPtr.Zero) - return IntPtr.Zero; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetNamedLabelList([MarshalAs(UnmanagedType.LPStr)] string list_name); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetColumnLabels"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return IntPtr.Zero; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_LabelCount(IntPtr labellist); - tPL_GetColumnLabels ltPL_GetColumnLabels = (tPL_GetColumnLabels)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumnLabels)); - return ltPL_GetColumnLabels(data_object, column); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetLabelName(IntPtr labellist, int order); - /// Finds the column index based on the string name of the column - /// Pointer to PlanimateĀ® data object - /// String column name of the target column - public int FindColumn(IntPtr data_object, string col_name) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate Int32 tPL_GetLabelIndex(IntPtr labellist, int order); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_FindColumn"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_FindLabelName(IntPtr labellist, [MarshalAs(UnmanagedType.LPStr)] string label); - tPL_FindColumn ltPL_FindColumn = (tPL_FindColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_FindColumn)); - return ltPL_FindColumn(data_object, col_name); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate Int32 tPL_LookUpLabel(IntPtr labellist, [MarshalAs(UnmanagedType.LPStr)] string label); - /// Gets the value from a cell - /// Pointer to PlanimateĀ® data object (table) - /// Cell row index - /// Cell column index - public double GetCell(IntPtr data_object, int row, int col) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_LookUpLValue(IntPtr labellist, Int32 index); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetCell"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_LookUpDValue(IntPtr labellist, double index); + #endregion - tPL_GetCell ltPL_GetCell = (tPL_GetCell)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetCell)); - return ltPL_GetCell(data_object, row, col); - } + #region For Table data objects: + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_Rows(IntPtr dataobject); - /// Sets the value of a cell - /// Pointer to PlanimateĀ® data object (table) - /// Cell row index - /// Cell column index - /// Data to write to the cell - public ePLRESULT SetCell(IntPtr data_object, int row, int col, double data) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_Columns(IntPtr dataobject); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SetCell"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_ColumnName(IntPtr dataobject, int column); - tPL_SetCell ltPL_SetCell = (tPL_SetCell)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetCell)); - return ltPL_SetCell(data_object, row, col, data); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate eTFUnit tPL_GetColumnFormat(IntPtr dataobject, int column); - /// Sets the value of a Free Text cell - /// Pointer to PlanimateĀ® data object (table) - /// Cell row index - /// Cell column index - /// Data to write to the cell (string) - public ePLRESULT SetCell(IntPtr data_object, int row, int col, string data) - { - if (DLLHandle() == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetColumnLabels(IntPtr dataobject, int column); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SetCellText"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return 0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int tPL_FindColumn(IntPtr dataobject, + [MarshalAs(UnmanagedType.LPStr)] string col_name); - tPL_SetCellText ltPL_SetCellText = (tPL_SetCellText)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetCellText)); - return ltPL_SetCellText(data_object, row, col, data); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_TableResize(IntPtr dataobject, int rows, int cols); - /// Gets the text from a Free Text cell - /// Pointer to PlanimateĀ® data object (table) - /// Cell row index - /// Cell column index - public string GetCellText(IntPtr data_object, int row, int col) - { - if (DLLHandle() == IntPtr.Zero) - return ""; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate double tPL_GetCell(IntPtr dataobject, int row, int col); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetCellText"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ""; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SetCell(IntPtr dataobject, int row, int col, double data); - tPL_GetCellText ltPL_GetCellText = (tPL_GetCellText)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetCellText)); - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_GetCellText(data_object, row, col)); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetCellText(IntPtr dataobject, int row, int col); - // Label list functions - /// Returns a label list object based on a string label list name - /// Label list name - public IntPtr GetNamedLabelList(string list_name) - { - if (DLLHandle() == IntPtr.Zero) - return IntPtr.Zero; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SetCellText(IntPtr dataobject, int row, int col, [MarshalAs(UnmanagedType.LPStr)] string data); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetNamedLabelList"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return IntPtr.Zero; + //Entire Column operations + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_GetColumn(IntPtr dataobject, int column, int rows, double[] into); - tPL_GetNamedLabelList ltPL_GetNamedLabelList = (tPL_GetNamedLabelList)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetNamedLabelList)); - return ltPL_GetNamedLabelList(list_name); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SetColumn(IntPtr dataobject, int column, int rows, double[] to); - /// Returns the label string based on a long(Int32) label index - /// Pointer to PlanimateĀ® data object (label list) - /// Label index as integer - public string LookUpLabelLValue(IntPtr data_object, Int32 index) - { - if (DLLHandle() == IntPtr.Zero) - return ""; + #endregion - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_LookUpLValue"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ""; + #region Broadcasts + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr tPL_GetBroadcastName([MarshalAs(UnmanagedType.LPStr)] string broadcast_name); - tPL_LookUpLValue ltPL_LookUpLValue = (tPL_LookUpLValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpLValue)); - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_LookUpLValue(data_object, index)); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SendBroadcast(IntPtr broadcast); - /// Returns the label string based on a double label index - /// Pointer to PlanimateĀ® data object (label list) - /// Label index as double - public string LookUpLabelDValue(IntPtr data_object, double index) - { - if (DLLHandle() == IntPtr.Zero) - return ""; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_SendBroadcastTuple(IntPtr broadcast, int no_params, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] tuple_names, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] double[] tuple_values); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_LookUpDValue"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ""; + /// PlanimateĀ® broadcast callback function definition + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate ePLRESULT tPL_BroadcastCallback(IntPtr broadcast, int no_params, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] tuple_names, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] double[] tuple_values); - tPL_LookUpDValue ltPL_LookUpDValue = (tPL_LookUpDValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpDValue)); - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_LookUpDValue(data_object, index)); - } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_RegisterBroadcastCallback(IntPtr broadcast, tPL_BroadcastCallback function); + #endregion - /// Returns the label index based on a label string - /// Pointer to PlanimateĀ® data object (label list) - /// Label string - public Int32 LookUpLabelIndex(IntPtr data_object, string label) - { - if (DLLHandle() == IntPtr.Zero) - return -1; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ePLRESULT tPL_StringToValue([MarshalAs(UnmanagedType.LPStr)] string str, + IntPtr val, // double* + eTFUnit format); + #endregion - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_LookUpLabel"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return -1; + /// Path to PlanimateĀ® engine DLL + [ + Category("PLEngine"), + Description("Compiled Planimate DLL path/filename"), + Editor(typeof(FileNameEditor), typeof(UITypeEditor)) + ] + public String dll_pathname + { + get; + set; + } - tPL_LookUpLabel ltPL_LookUpLabel = (tPL_LookUpLabel)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpLabel)); - return ltPL_LookUpLabel(data_object, label); - } + private IntPtr dll_handle = IntPtr.Zero; + private IntPtr engine_handle = IntPtr.Zero; - // Entire Column - /// Returns a column as an array - /// Pointer to PlanimateĀ® data object (table) - /// Index of column in DataTable - /// The number of rows to return in the array - /// Array of double to place column in - public ePLRESULT GetColumn(IntPtr data_object, int column, int rows, double[] into) - { - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + /// + /// Owning loader class + /// + private PLLoader loader = null; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetColumn"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + /// Engine constructor + public PLEngine() + { - tPL_GetColumn ltPL_GetColumn = (tPL_GetColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumn)); - return ltPL_GetColumn(data_object, column, rows, into); - } + } - /// Sets an array to a column - /// Pointer to PlanimateĀ® data object (table) - /// Index of column in DataTable - /// The number of rows to set from the array - /// Array of doubles to place into the column - public ePLRESULT SetColumn(IntPtr data_object, int column, int rows, double[] to) - { - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + public PLEngine(PLLoader newLoader, IntPtr newEngine_handle) + { + loader = newLoader; + engine_handle = newEngine_handle; + } - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SetColumn"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + private IntPtr GetFunction(ePLProcs function) + { + if (engine_handle == IntPtr.Zero) + return IntPtr.Zero; - tPL_SetColumn ltPL_SetColumn = (tPL_SetColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetColumn)); - return ltPL_SetColumn(data_object, column, rows, to); - } + return loader.GetProc(engine_handle, function); + } - /// Updates a DataTable object with data from a PlanimateĀ® data object - /// table and returns it as a DataTable. If the DataTable is specified to be formatted, - /// all columns will be correct .NET data formats. Unformatted data is formatted as type - /// Double - /// DataTable that will be updated - /// Pointer to PlanimateĀ® data object (table) - /// Specifies if the returned DataTable should be formatted. True = format - public ePLRESULT UpdateDataTable(ref DataTable pl_table, IntPtr data_object, Boolean formatted) - { - ePLRESULT res = ePLRESULT.PLR_OK; + /// Returns the PlanimateĀ® version powering the engine. + public string PlanimateVersion() + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_AppVersion); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ""; - int columns = Columns(data_object); - int rows = Rows(data_object); + tPL_AppVersion ltPL_AppVersion = (tPL_AppVersion)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_AppVersion)); + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_AppVersion()); + } - pl_table.Clear(); - pl_table.Columns.Clear(); + /// Gets PlanimateĀ® System info. Times are in seconds with 0 = the run start date + /// System info id from ePLSysInfo. + public double GetSystemInfo(ePLSysInfo sysinfo_id) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetSystemInfo); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; - double[] col = new double[rows]; + tPL_GetSystemInfo ltPL_GetSystemInfo = (tPL_GetSystemInfo)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetSystemInfo)); + return ltPL_GetSystemInfo(sysinfo_id); + } - if (formatted) - { - for (int i = 0; i < columns; i++) - { - eTFUnit col_unit = GetColumnFormat(data_object, i); - switch (col_unit) - { - case eTFUnit.UNIT_ABSTIME: - case eTFUnit.UNIT_ABSTIME2: - case eTFUnit.UNIT_TIMEOFDAY: - case eTFUnit.UNIT_TIMEAMPM: - case eTFUnit.UNIT_ABSTIME3: - case eTFUnit.UNIT_DATEONLY: - case eTFUnit.UNIT_DAYDATE: - case eTFUnit.UNIT_ABSTIME3U: - case eTFUnit.UNIT_TIMEOFDAY_2: - case eTFUnit.UNIT_DATE2: - case eTFUnit.UNIT_ABSTIMEMS: - case eTFUnit.UNIT_DATE2TIME: - case eTFUnit.UNIT_DATE3: - case eTFUnit.UNIT_ABSTIMEC: - case eTFUnit.UNIT_DATE4: - case eTFUnit.UNIT_DATE5: - case eTFUnit.UNIT_OS_DATETIME: - case eTFUnit.UNIT_OS_DATEONLY: - case eTFUnit.UNIT_OS_TIME: - case eTFUnit.UNIT_DATE3TIME: - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; - pl_table.Columns.Add(ColumnName(data_object, i), typeof(DateTime)); - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - DateTime dt = new DateTime(0); - dt = ConvertFromPLTimestamp(col[j]); - pl_table.Rows[j][i] = dt; - } - break; - case eTFUnit.UNIT_TIME: - case eTFUnit.UNIT_TIME2: - case eTFUnit.UNIT_TIME3: - case eTFUnit.UNIT_MINUTES: - case eTFUnit.UNIT_HOURS: - case eTFUnit.UNIT_DAYS: - case eTFUnit.UNIT_WEEKS: - case eTFUnit.UNIT_HOURMIN: - case eTFUnit.UNIT_WEEKDAY1: - case eTFUnit.UNIT_TIMEDHHMM: - case eTFUnit.UNIT_TIMED0HMM: - case eTFUnit.UNIT_DAY2HHMM: - case eTFUnit.UNIT_DAY2HHMMCOLON: - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; - pl_table.Columns.Add(ColumnName(data_object, i), typeof(TimeSpan)); - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - TimeSpan span = new TimeSpan(0, 0, Convert.ToInt32(col[j].ToString())); - pl_table.Rows[j][i] = span; - } - break; - case eTFUnit.UNIT_LABEL: - IntPtr llist = GetColumnLabelList(data_object, i); - if (llist == IntPtr.Zero) - return ePLRESULT.PLR_BADFORMAT; - - pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; - - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - Int32 val = Convert.ToInt32(col[j].ToString()); - pl_table.Rows[j][i] = LookUpLabelLValue(llist, val); - } - break; - case eTFUnit.UNIT_FREETEXT: - pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; - - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - pl_table.Rows[j][i] = GetCellText(data_object, j, i); - } - break; - default: - pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); - - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; - - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - pl_table.Rows[j][i] = col[j]; - } - break; - - }; + /// Sets writable PlanimateĀ® System info. Times are in seconds with 0 = the run start date + /// System info id from ePLSysInfo. + /// Value to write. + public ePLRESULT SetSystemInfo(ePLSysInfo sysinfo_id, double value) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SetSystemInfo); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - } - } - else // unformatted (all columns doubles) - { - for (int i = 0; i < columns; i++) - { - pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); + tPL_SetSystemInfo ltPL_SetSystemInfo = (tPL_SetSystemInfo)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetSystemInfo)); + return ltPL_SetSystemInfo(sysinfo_id, value); + } - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return res; + // Data Object Functions - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); + /// Finds a PlanimateĀ® data object by name + /// String name of the PlanimateĀ® data object + public IntPtr FindDataObjectName(string DO_name) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_FindDataObjectName); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return IntPtr.Zero; - pl_table.Rows[j][i] = col[j]; - } - } - } - return res; - } + tPL_FindDataObjectName ltPL_FindDataObjectName = (tPL_FindDataObjectName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_FindDataObjectName)); + return ltPL_FindDataObjectName(DO_name); + } - /// Finds a PlanimateĀ® data object by name and updates the supplied DataTable. - /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. - /// Unformatted data is formatted as type Double - /// DataTable that will be updated. - /// String name of the PlanimateĀ® table data object - /// Specifies if the returned DataTable should be formatted. True = format - public ePLRESULT UpdateDataTable(ref DataTable rTable, string DO_name, Boolean formatted) - { - IntPtr PL_data_object = FindDataObjectName(DO_name); - if (PL_data_object == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + /// Returns the data object type + /// Pointer to PlanimateĀ® data object + public eDOTypes DataObjectType(IntPtr data_object) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_DataObjectType); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return (eDOTypes)(-1); - return UpdateDataTable(ref rTable, PL_data_object, formatted); - } + tPL_DataObjectType ltPL_DataObjectType = (tPL_DataObjectType)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_DataObjectType)); + return ltPL_DataObjectType(data_object); + } - /// Gets a PlanimateĀ® data object table and returns it as a DataTable. - /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. - /// Unformatted data is formatted as type Double - /// Pointer to PlanimateĀ® data object (table) - /// Specifies if the returned DataTable should be formatted. True = format - public DataTable GetDataTable(IntPtr data_object, Boolean formatted) - { - ePLRESULT res = ePLRESULT.PLR_OK; + /// Returns the number of rows in a table data object + /// Pointer to PlanimateĀ® data object + public int Rows(IntPtr data_object) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_Rows); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_Rows ltPL_Rows = (tPL_Rows)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_Rows)); + return ltPL_Rows(data_object); + } + + /// Returns the number of columns in a table data object + /// Pointer to PlanimateĀ® data object + public int Columns(IntPtr data_object) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_Columns); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_Columns ltPL_Columns = (tPL_Columns)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_Columns)); + return ltPL_Columns(data_object); + } + + /// Returns the column name of the specified column + /// Pointer to PlanimateĀ® data object + /// Index of the column + public string ColumnName(IntPtr data_object, int column) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_ColumnName); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ""; + + tPL_ColumnName ltPL_ColumnName = (tPL_ColumnName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_ColumnName)); + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_ColumnName(data_object, column)); + } - int columns = Columns(data_object); - int rows = Rows(data_object); + /// Returns PlanimateĀ® value format of the specified column + /// Pointer to PlanimateĀ® data object + /// Index of the column + public eTFUnit GetColumnFormat(IntPtr data_object, int column) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetColumnFormat); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return (eTFUnit)(-1); - DataTable pl_table = new DataTable(); + tPL_GetColumnFormat ltPL_GetColumnFormat = (tPL_GetColumnFormat)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumnFormat)); + return ltPL_GetColumnFormat(data_object, column); + } - double[] col = new double[rows]; + /// Returns PlanimateĀ® label list that the specified column is formatted to. + /// Pointer to PlanimateĀ® data object + /// Index of the column + public IntPtr GetColumnLabelList(IntPtr data_object, int column) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetColumnLabels); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return IntPtr.Zero; - if (formatted) + tPL_GetColumnLabels ltPL_GetColumnLabels = (tPL_GetColumnLabels)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumnLabels)); + return ltPL_GetColumnLabels(data_object, column); + } + + /// Finds the column index based on the string name of the column + /// Pointer to PlanimateĀ® data object + /// String column name of the target column + public int FindColumn(IntPtr data_object, string col_name) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_FindColumn); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_FindColumn ltPL_FindColumn = (tPL_FindColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_FindColumn)); + return ltPL_FindColumn(data_object, col_name); + } + + /// Gets the value from a cell + /// Pointer to PlanimateĀ® data object (table) + /// Cell row index + /// Cell column index + public double GetCell(IntPtr data_object, int row, int col) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetCell); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_GetCell ltPL_GetCell = (tPL_GetCell)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetCell)); + return ltPL_GetCell(data_object, row, col); + } + + /// Sets the value of a cell + /// Pointer to PlanimateĀ® data object (table) + /// Cell row index + /// Cell column index + /// Data to write to the cell + public ePLRESULT SetCell(IntPtr data_object, int row, int col, double data) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SetCell); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_SetCell ltPL_SetCell = (tPL_SetCell)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetCell)); + return ltPL_SetCell(data_object, row, col, data); + } + + /// Sets the value of a Free Text cell + /// Pointer to PlanimateĀ® data object (table) + /// Cell row index + /// Cell column index + /// Data to write to the cell (string) + public ePLRESULT SetCell(IntPtr data_object, int row, int col, string data) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SetCellText); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return 0; + + tPL_SetCellText ltPL_SetCellText = (tPL_SetCellText)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetCellText)); + return ltPL_SetCellText(data_object, row, col, data); + } + + /// Gets the text from a Free Text cell + /// Pointer to PlanimateĀ® data object (table) + /// Cell row index + /// Cell column index + public string GetCellText(IntPtr data_object, int row, int col) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetCellText); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ""; + + tPL_GetCellText ltPL_GetCellText = (tPL_GetCellText)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetCellText)); + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_GetCellText(data_object, row, col)); + } + + // Label list functions + /// Returns a label list object based on a string label list name + /// Label list name + public IntPtr GetNamedLabelList(string list_name) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetNamedLabelList); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return IntPtr.Zero; + + tPL_GetNamedLabelList ltPL_GetNamedLabelList = (tPL_GetNamedLabelList)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetNamedLabelList)); + return ltPL_GetNamedLabelList(list_name); + } + + /// Returns the label string based on a long(Int32) label index + /// Pointer to PlanimateĀ® data object (label list) + /// Label index as integer + public string LookUpLabelLValue(IntPtr data_object, Int32 index) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_LookUpLValue); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ""; + + tPL_LookUpLValue ltPL_LookUpLValue = (tPL_LookUpLValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpLValue)); + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_LookUpLValue(data_object, index)); + } + + /// Returns the label string based on a double label index + /// Pointer to PlanimateĀ® data object (label list) + /// Label index as double + public string LookUpLabelDValue(IntPtr data_object, double index) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_LookUpDValue); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ""; + + tPL_LookUpDValue ltPL_LookUpDValue = (tPL_LookUpDValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpDValue)); + return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ltPL_LookUpDValue(data_object, index)); + } + + /// Returns the label index based on a label string + /// Pointer to PlanimateĀ® data object (label list) + /// Label string + public Int32 LookUpLabelIndex(IntPtr data_object, string label) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_LookUpLabel); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return -1; + + tPL_LookUpLabel ltPL_LookUpLabel = (tPL_LookUpLabel)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_LookUpLabel)); + return ltPL_LookUpLabel(data_object, label); + } + + // Entire Column + /// Returns a column as an array + /// Pointer to PlanimateĀ® data object (table) + /// Index of column in DataTable + /// The number of rows to return in the array + /// Array of double to place column in + public ePLRESULT GetColumn(IntPtr data_object, int column, int rows, double[] into) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetColumn); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; + + tPL_GetColumn ltPL_GetColumn = (tPL_GetColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetColumn)); + return ltPL_GetColumn(data_object, column, rows, into); + } + + /// Sets an array to a column + /// Pointer to PlanimateĀ® data object (table) + /// Index of column in DataTable + /// The number of rows to set from the array + /// Array of doubles to place into the column + public ePLRESULT SetColumn(IntPtr data_object, int column, int rows, double[] to) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SetColumn); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; + + tPL_SetColumn ltPL_SetColumn = (tPL_SetColumn)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SetColumn)); + return ltPL_SetColumn(data_object, column, rows, to); + } + + /// Updates a DataTable object with data from a PlanimateĀ® data object + /// table and returns it as a DataTable. If the DataTable is specified to be formatted, + /// all columns will be correct .NET data formats. Unformatted data is formatted as type + /// Double + /// DataTable that will be updated + /// Pointer to PlanimateĀ® data object (table) + /// Specifies if the returned DataTable should be formatted. True = format + public ePLRESULT UpdateDataTable(ref DataTable pl_table, IntPtr data_object, Boolean formatted) + { + ePLRESULT res = ePLRESULT.PLR_OK; + + int columns = Columns(data_object); + int rows = Rows(data_object); + + pl_table.Clear(); + pl_table.Columns.Clear(); + + double[] col = new double[rows]; + + if (formatted) + { + for (int i = 0; i < columns; i++) { - for (int i = 0; i < columns; i++) + eTFUnit col_unit = GetColumnFormat(data_object, i); + switch (col_unit) { - eTFUnit col_unit = GetColumnFormat(data_object, i); - switch (col_unit) - { - case eTFUnit.UNIT_ABSTIME: - case eTFUnit.UNIT_ABSTIME2: - case eTFUnit.UNIT_TIMEOFDAY: - case eTFUnit.UNIT_TIMEAMPM: - case eTFUnit.UNIT_ABSTIME3: - case eTFUnit.UNIT_DATEONLY: - case eTFUnit.UNIT_DAYDATE: - case eTFUnit.UNIT_ABSTIME3U: - case eTFUnit.UNIT_TIMEOFDAY_2: - case eTFUnit.UNIT_DATE2: - case eTFUnit.UNIT_ABSTIMEMS: - case eTFUnit.UNIT_DATE2TIME: - case eTFUnit.UNIT_DATE3: - case eTFUnit.UNIT_ABSTIMEC: - case eTFUnit.UNIT_DATE4: - case eTFUnit.UNIT_DATE5: - case eTFUnit.UNIT_OS_DATETIME: - case eTFUnit.UNIT_OS_DATEONLY: - case eTFUnit.UNIT_OS_TIME: - case eTFUnit.UNIT_DATE3TIME: - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; - pl_table.Columns.Add(ColumnName(data_object, i), typeof(DateTime)); - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - DateTime dt = new DateTime(0); - dt = ConvertFromPLTimestamp(col[j]); - pl_table.Rows[j][i] = dt; - } + case eTFUnit.UNIT_ABSTIME: + case eTFUnit.UNIT_ABSTIME2: + case eTFUnit.UNIT_TIMEOFDAY: + case eTFUnit.UNIT_TIMEAMPM: + case eTFUnit.UNIT_ABSTIME3: + case eTFUnit.UNIT_DATEONLY: + case eTFUnit.UNIT_DAYDATE: + case eTFUnit.UNIT_ABSTIME3U: + case eTFUnit.UNIT_TIMEOFDAY_2: + case eTFUnit.UNIT_DATE2: + case eTFUnit.UNIT_ABSTIMEMS: + case eTFUnit.UNIT_DATE2TIME: + case eTFUnit.UNIT_DATE3: + case eTFUnit.UNIT_ABSTIMEC: + case eTFUnit.UNIT_DATE4: + case eTFUnit.UNIT_DATE5: + case eTFUnit.UNIT_OS_DATETIME: + case eTFUnit.UNIT_OS_DATEONLY: + case eTFUnit.UNIT_OS_TIME: + case eTFUnit.UNIT_DATE3TIME: + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(DateTime)); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); + + DateTime dt = new DateTime(0); + dt = ConvertFromPLTimestamp(col[j]); + pl_table.Rows[j][i] = dt; + } break; - case eTFUnit.UNIT_TIME: - case eTFUnit.UNIT_TIME2: - case eTFUnit.UNIT_TIME3: - case eTFUnit.UNIT_MINUTES: - case eTFUnit.UNIT_HOURS: - case eTFUnit.UNIT_DAYS: - case eTFUnit.UNIT_WEEKS: - case eTFUnit.UNIT_HOURMIN: - case eTFUnit.UNIT_WEEKDAY1: - case eTFUnit.UNIT_TIMEDHHMM: - case eTFUnit.UNIT_TIMED0HMM: - case eTFUnit.UNIT_DAY2HHMM: - case eTFUnit.UNIT_DAY2HHMMCOLON: - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; - pl_table.Columns.Add(ColumnName(data_object, i), typeof(TimeSpan)); - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); - - TimeSpan span = new TimeSpan(0,0,Convert.ToInt32(col[j].ToString())); - pl_table.Rows[j][i] = span; - } + case eTFUnit.UNIT_TIME: + case eTFUnit.UNIT_TIME2: + case eTFUnit.UNIT_TIME3: + case eTFUnit.UNIT_MINUTES: + case eTFUnit.UNIT_HOURS: + case eTFUnit.UNIT_DAYS: + case eTFUnit.UNIT_WEEKS: + case eTFUnit.UNIT_HOURMIN: + case eTFUnit.UNIT_WEEKDAY1: + case eTFUnit.UNIT_TIMEDHHMM: + case eTFUnit.UNIT_TIMED0HMM: + case eTFUnit.UNIT_DAY2HHMM: + case eTFUnit.UNIT_DAY2HHMMCOLON: + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(TimeSpan)); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); + + TimeSpan span = new TimeSpan(0, 0, Convert.ToInt32(col[j].ToString())); + pl_table.Rows[j][i] = span; + } break; - case eTFUnit.UNIT_LABEL: - IntPtr llist = GetColumnLabelList(data_object, i); - if (llist == IntPtr.Zero) - return null; + case eTFUnit.UNIT_LABEL: + IntPtr llist = GetColumnLabelList(data_object, i); + if (llist == IntPtr.Zero) + return ePLRESULT.PLR_BADFORMAT; - pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); + pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - Int32 val = Convert.ToInt32(col[j].ToString()); - pl_table.Rows[j][i] = LookUpLabelLValue(llist, val); - } + Int32 val = Convert.ToInt32(col[j].ToString()); + pl_table.Rows[j][i] = LookUpLabelLValue(llist, val); + } break; - case eTFUnit.UNIT_FREETEXT: - pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); + case eTFUnit.UNIT_FREETEXT: + pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - pl_table.Rows[j][i] = GetCellText(data_object, j, i); - } + pl_table.Rows[j][i] = GetCellText(data_object, j, i); + } break; - default: - pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); + default: + pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - pl_table.Rows[j][i] = col[j]; - } + pl_table.Rows[j][i] = col[j]; + } break; - }; + }; - } } - else // unformatted (all columns doubles) + } + else // unformatted (all columns doubles) + { + for (int i = 0; i < columns; i++) { - for (int i = 0; i < columns; i++) - { - pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); + pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); - res = GetColumn(data_object, i, rows, col); - if (res != ePLRESULT.PLR_OK) - return null; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return res; - for (int j = 0; j < rows; j++) - { - if (i == 0) - pl_table.Rows.Add(); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - pl_table.Rows[j][i] = col[j]; - } + pl_table.Rows[j][i] = col[j]; } } - return pl_table; } + return res; + } - /// Finds a PlanimateĀ® data object by name and returns it as a DataTable. - /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. - /// Unformatted data is formatted as type Double - /// String name of the PlanimateĀ® table data object - /// Specifies if the returned DataTable should be formatted. True = format - public DataTable GetDataTable(string DO_name, Boolean formatted) - { - IntPtr PL_data_object = FindDataObjectName(DO_name); - if (PL_data_object == IntPtr.Zero) - return null; + /// Finds a PlanimateĀ® data object by name and updates the supplied DataTable. + /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. + /// Unformatted data is formatted as type Double + /// DataTable that will be updated. + /// String name of the PlanimateĀ® table data object + /// Specifies if the returned DataTable should be formatted. True = format + public ePLRESULT UpdateDataTable(ref DataTable rTable, string DO_name, Boolean formatted) + { + IntPtr PL_data_object = FindDataObjectName(DO_name); + if (PL_data_object == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - return GetDataTable(PL_data_object, formatted); - } + return UpdateDataTable(ref rTable, PL_data_object, formatted); + } - /// Sets a PlanimateĀ® data object table and from a DataTable. - /// Reference to the DataTable to be written to PlanimateĀ® - /// Pointer to PlanimateĀ® data object (table) - public ePLRESULT SetDataTable(ref DataTable data_table, IntPtr data_object) - { - if (data_table == null || data_object == IntPtr.Zero) - return ePLRESULT.PLR_BADINDEX; + /// Gets a PlanimateĀ® data object table and returns it as a DataTable. + /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. + /// Unformatted data is formatted as type Double + /// Pointer to PlanimateĀ® data object (table) + /// Specifies if the returned DataTable should be formatted. True = format + public DataTable GetDataTable(IntPtr data_object, Boolean formatted) + { + ePLRESULT res = ePLRESULT.PLR_OK; + + int columns = Columns(data_object); + int rows = Rows(data_object); - for (int i = 0; i < data_table.Columns.Count; i++) + DataTable pl_table = new DataTable(); + + double[] col = new double[rows]; + + if (formatted) + { + for (int i = 0; i < columns; i++) { - for (int j = 0; j < data_table.Rows.Count; j++) + eTFUnit col_unit = GetColumnFormat(data_object, i); + switch (col_unit) { - if (data_table.Columns[i].DataType == typeof(double)) - { - SetCell(data_object, j, i, (double)data_table.Rows[j][i]); - } - else if (data_table.Columns[i].DataType == typeof(string)) - { - eTFUnit col_unit = GetColumnFormat(data_object, i); - if (col_unit == eTFUnit.UNIT_LABEL) + case eTFUnit.UNIT_ABSTIME: + case eTFUnit.UNIT_ABSTIME2: + case eTFUnit.UNIT_TIMEOFDAY: + case eTFUnit.UNIT_TIMEAMPM: + case eTFUnit.UNIT_ABSTIME3: + case eTFUnit.UNIT_DATEONLY: + case eTFUnit.UNIT_DAYDATE: + case eTFUnit.UNIT_ABSTIME3U: + case eTFUnit.UNIT_TIMEOFDAY_2: + case eTFUnit.UNIT_DATE2: + case eTFUnit.UNIT_ABSTIMEMS: + case eTFUnit.UNIT_DATE2TIME: + case eTFUnit.UNIT_DATE3: + case eTFUnit.UNIT_ABSTIMEC: + case eTFUnit.UNIT_DATE4: + case eTFUnit.UNIT_DATE5: + case eTFUnit.UNIT_OS_DATETIME: + case eTFUnit.UNIT_OS_DATEONLY: + case eTFUnit.UNIT_OS_TIME: + case eTFUnit.UNIT_DATE3TIME: + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(DateTime)); + for (int j = 0; j < rows; j++) { - IntPtr llist = GetColumnLabelList(data_object, i); - if (llist == IntPtr.Zero) - return ePLRESULT.PLR_BADFORMAT; + if (i == 0) + pl_table.Rows.Add(); - SetCell(data_object, j, i, Convert.ToDouble(LookUpLabelIndex(llist, (string)data_table.Rows[j][i]))); + DateTime dt = new DateTime(0); + dt = ConvertFromPLTimestamp(col[j]); + pl_table.Rows[j][i] = dt; } - else - SetCell(data_object, j, i, (string)data_table.Rows[j][i]); - } - else if (data_table.Columns[i].DataType == typeof(DateTime)) - { - SetCell(data_object, j, i, ConvertToPLTimestamp((DateTime)data_table.Rows[j][i])); - } - else if (data_table.Columns[i].DataType == typeof(TimeSpan)) - { - TimeSpan span = (TimeSpan)data_table.Rows[j][i]; - SetCell(data_object, j, i, span.TotalSeconds); - } - else - { - return ePLRESULT.PLR_BADFORMAT; - } - } - } - return ePLRESULT.PLR_OK; - } + break; + case eTFUnit.UNIT_TIME: + case eTFUnit.UNIT_TIME2: + case eTFUnit.UNIT_TIME3: + case eTFUnit.UNIT_MINUTES: + case eTFUnit.UNIT_HOURS: + case eTFUnit.UNIT_DAYS: + case eTFUnit.UNIT_WEEKS: + case eTFUnit.UNIT_HOURMIN: + case eTFUnit.UNIT_WEEKDAY1: + case eTFUnit.UNIT_TIMEDHHMM: + case eTFUnit.UNIT_TIMED0HMM: + case eTFUnit.UNIT_DAY2HHMM: + case eTFUnit.UNIT_DAY2HHMMCOLON: + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(TimeSpan)); + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - #region Broadcast Functions - /// Returns a broadcast object based on a string broadcast name - /// Name of broadcast (string) - public IntPtr FindBroadcastName(string BC_name) - { - if (DLLHandle() == IntPtr.Zero) - return IntPtr.Zero; + TimeSpan span = new TimeSpan(0, 0, Convert.ToInt32(col[j].ToString())); + pl_table.Rows[j][i] = span; + } + break; + case eTFUnit.UNIT_LABEL: + IntPtr llist = GetColumnLabelList(data_object, i); + if (llist == IntPtr.Zero) + return null; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_GetBroadcastName"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return IntPtr.Zero; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - tPL_GetBroadcastName ltPL_GetBroadcastName = (tPL_GetBroadcastName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetBroadcastName)); - return ltPL_GetBroadcastName(BC_name); - } + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; - /// Sends a broadcast into the engine based on broadcast object - /// Pointer to broadcast object - public ePLRESULT SendBroadcast(IntPtr broadcast) - { - if (broadcast == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + Int32 val = Convert.ToInt32(col[j].ToString()); + pl_table.Rows[j][i] = LookUpLabelLValue(llist, val); + } + break; + case eTFUnit.UNIT_FREETEXT: + pl_table.Columns.Add(ColumnName(data_object, i), typeof(string)); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SendBroadcast"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; - tPL_SendBroadcast ltPL_SendBroadcast = (tPL_SendBroadcast)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SendBroadcast)); - return ltPL_SendBroadcast(broadcast); - } + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - /// Sends a broadcast into the engine based on broadcast name - /// Name of broadcast (string) - public ePLRESULT SendBroadcast(string BC_name) - { - IntPtr broadcast = FindBroadcastName(BC_name); - if (broadcast != IntPtr.Zero) - return SendBroadcast(broadcast); - else - return ePLRESULT.PLR_NOTFOUND; - } + pl_table.Rows[j][i] = GetCellText(data_object, j, i); + } + break; + default: + pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); - /// Sends a broadcast into the engine based on broadcast object and include tuple data for the item - /// Pointer to broadcast object - /// Number of tuple parameters to include - /// Array of tuple names (length = no_params) - /// Array of tuple values (length = no_params) - public ePLRESULT SendBroadcast(IntPtr broadcast, int no_params, string[] tuple_names, double[] tuple_values) - { - if (broadcast == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; + + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + pl_table.Rows[j][i] = col[j]; + } + break; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_SendBroadcastTuple"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + }; - tPL_SendBroadcastTuple ltPL_SendBroadcastTuple = (tPL_SendBroadcastTuple)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SendBroadcastTuple)); - return ltPL_SendBroadcastTuple(broadcast, no_params, tuple_names, tuple_values); } - - /// Sends a broadcast into the engine based on broadcast object and include tuple data for the item - /// Pointer to broadcast object - /// Function to register as callback - public ePLRESULT RegisterBroadcastCallback(IntPtr broadcast, tPL_BroadcastCallback callback_func) + } + else // unformatted (all columns doubles) + { + for (int i = 0; i < columns; i++) { - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + pl_table.Columns.Add(ColumnName(data_object, i), typeof(double)); - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_RegisterBroadcastCallback"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + res = GetColumn(data_object, i, rows, col); + if (res != ePLRESULT.PLR_OK) + return null; - tPL_RegisterBroadcastCallback ltPL_RegisterBroadcastCallback = (tPL_RegisterBroadcastCallback)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_RegisterBroadcastCallback)); - return ltPL_RegisterBroadcastCallback(broadcast, callback_func); - } + for (int j = 0; j < rows; j++) + { + if (i == 0) + pl_table.Rows.Add(); - #endregion + pl_table.Rows[j][i] = col[j]; + } + } + } + return pl_table; + } - /// Converts a string to a PlanimateĀ® value based on the specified PlanimateĀ® format - /// String to convert - /// Pointer to value that will be returned (as double) - /// PlanimateĀ® format of the string 'str' - public ePLRESULT ConvertStringToPLValue(string str, IntPtr val, eTFUnit format) - { - if (DLLHandle() == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + /// Finds a PlanimateĀ® data object by name and returns it as a DataTable. + /// If the DataTable is specified to be formatted, all columns will be correct .NET data formats. + /// Unformatted data is formatted as type Double + /// String name of the PlanimateĀ® table data object + /// Specifies if the returned DataTable should be formatted. True = format + public DataTable GetDataTable(string DO_name, Boolean formatted) + { + IntPtr PL_data_object = FindDataObjectName(DO_name); + if (PL_data_object == IntPtr.Zero) + return null; - IntPtr pAddressOfFunctionToCall = GetProcAddress(DLLHandle(), "PL_StringToValue"); - //oh dear, error handling here - if (pAddressOfFunctionToCall == IntPtr.Zero) - return ePLRESULT.PLR_NOTFOUND; + return GetDataTable(PL_data_object, formatted); + } - tPL_StringToValue ltPL_StringToValue = (tPL_StringToValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_StringToValue)); - - return ltPL_StringToValue(str, val, format); - } + /// Sets a PlanimateĀ® data object table and from a DataTable. + /// Reference to the DataTable to be written to PlanimateĀ® + /// Pointer to PlanimateĀ® data object (table) + public ePLRESULT SetDataTable(ref DataTable data_table, IntPtr data_object) + { + if (data_table == null || data_object == IntPtr.Zero) + return ePLRESULT.PLR_BADINDEX; - /// Converts a PlanimateĀ® timestamp (seconds) into a DateTime structure. - /// PlanimateĀ® timestamp (seconds from offset) - public DateTime ConvertFromPLTimestamp(double timestamp) + for (int i = 0; i < data_table.Columns.Count; i++) { - double[] ref_time = new double[1]; - IntPtr double_ref = Marshal.AllocHGlobal(Marshal.SizeOf(ref_time[0])); - DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); - - ePLRESULT res = ConvertStringToPLValue("1 Jan 1970 00:00 00", double_ref, eTFUnit.UNIT_ABSTIME); - if (res == ePLRESULT.PLR_OK) + for (int j = 0; j < data_table.Rows.Count; j++) { - Marshal.Copy(double_ref, ref_time, 0, 1); - return origin.AddSeconds(timestamp - ref_time[0]); + if (data_table.Columns[i].DataType == typeof(double)) + { + SetCell(data_object, j, i, (double)data_table.Rows[j][i]); + } + else if (data_table.Columns[i].DataType == typeof(string)) + { + eTFUnit col_unit = GetColumnFormat(data_object, i); + if (col_unit == eTFUnit.UNIT_LABEL) + { + IntPtr llist = GetColumnLabelList(data_object, i); + if (llist == IntPtr.Zero) + return ePLRESULT.PLR_BADFORMAT; + + SetCell(data_object, j, i, Convert.ToDouble(LookUpLabelIndex(llist, (string)data_table.Rows[j][i]))); + } + else + SetCell(data_object, j, i, (string)data_table.Rows[j][i]); + } + else if (data_table.Columns[i].DataType == typeof(DateTime)) + { + SetCell(data_object, j, i, ConvertToPLTimestamp((DateTime)data_table.Rows[j][i])); + } + else if (data_table.Columns[i].DataType == typeof(TimeSpan)) + { + TimeSpan span = (TimeSpan)data_table.Rows[j][i]; + SetCell(data_object, j, i, span.TotalSeconds); + } + else + { + return ePLRESULT.PLR_BADFORMAT; + } } - else - return origin; } + return ePLRESULT.PLR_OK; + } - /// Converts a DateTime structure into a PlanimateĀ® timestamp (seconds). - /// DateTime structure to convert - public double ConvertToPLTimestamp(DateTime date) - { - double[] ref_time = new double[1]; - IntPtr double_ref = Marshal.AllocHGlobal(Marshal.SizeOf(ref_time[0])); - DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); + #region Broadcast Functions + /// Returns a broadcast object based on a string broadcast name + /// Name of broadcast (string) + public IntPtr FindBroadcastName(string BC_name) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_GetBroadcastName); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return IntPtr.Zero; - ePLRESULT res = ConvertStringToPLValue("1 Jan 1970 00:00 00", double_ref, eTFUnit.UNIT_ABSTIME); - if (res == ePLRESULT.PLR_OK) - { - Marshal.Copy(double_ref, ref_time, 0, 1); - TimeSpan diff = date - origin; - return Math.Floor(diff.TotalSeconds + ref_time[0]); - } - else - return 0; - } + tPL_GetBroadcastName ltPL_GetBroadcastName = (tPL_GetBroadcastName)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_GetBroadcastName)); + return ltPL_GetBroadcastName(BC_name); + } - #region IDataSourceDesigner Members + /// Sends a broadcast into the engine based on broadcast object + /// Pointer to broadcast object + public ePLRESULT SendBroadcast(IntPtr broadcast) + { + if (broadcast == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - public bool CanConfigure - { - get { throw new NotImplementedException(); } - } + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SendBroadcast); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - public bool CanRefreshSchema - { - get { throw new NotImplementedException(); } - } + tPL_SendBroadcast ltPL_SendBroadcast = (tPL_SendBroadcast)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SendBroadcast)); + return ltPL_SendBroadcast(broadcast); + } - public void Configure() - { - throw new NotImplementedException(); - } + /// Sends a broadcast into the engine based on broadcast name + /// Name of broadcast (string) + public ePLRESULT SendBroadcast(string BC_name) + { + IntPtr broadcast = FindBroadcastName(BC_name); + if (broadcast != IntPtr.Zero) + return SendBroadcast(broadcast); + else + return ePLRESULT.PLR_NOTFOUND; + } - DesignerDataSourceView IDataSourceDesigner.GetView(string viewName) - { - throw new NotImplementedException(); - } + /// Sends a broadcast into the engine based on broadcast object and include tuple data for the item + /// Pointer to broadcast object + /// Number of tuple parameters to include + /// Array of tuple names (length = no_params) + /// Array of tuple values (length = no_params) + public ePLRESULT SendBroadcast(IntPtr broadcast, int no_params, string[] tuple_names, double[] tuple_values) + { + if (broadcast == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - string[] IDataSourceDesigner.GetViewNames() - { - throw new NotImplementedException(); - } + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_SendBroadcastTuple); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - public void RefreshSchema(bool preferSilent) - { - throw new NotImplementedException(); - } + tPL_SendBroadcastTuple ltPL_SendBroadcastTuple = (tPL_SendBroadcastTuple)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_SendBroadcastTuple)); + return ltPL_SendBroadcastTuple(broadcast, no_params, tuple_names, tuple_values); + } - public void ResumeDataSourceEvents() - { - throw new NotImplementedException(); - } + /// Sends a broadcast into the engine based on broadcast object and include tuple data for the item + /// Pointer to broadcast object + /// Function to register as callback + public ePLRESULT RegisterBroadcastCallback(IntPtr broadcast, tPL_BroadcastCallback callback_func) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_RegisterBroadcastCallback); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; + + tPL_RegisterBroadcastCallback ltPL_RegisterBroadcastCallback = (tPL_RegisterBroadcastCallback)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_RegisterBroadcastCallback)); + return ltPL_RegisterBroadcastCallback(broadcast, callback_func); + } - public event EventHandler SchemaRefreshed; + #endregion - public event EventHandler DataSourceChanged; + /// Converts a string to a PlanimateĀ® value based on the specified PlanimateĀ® format + /// String to convert + /// Pointer to value that will be returned (as double) + /// PlanimateĀ® format of the string 'str' + public ePLRESULT ConvertStringToPLValue(string str, IntPtr val, eTFUnit format) + { + IntPtr pAddressOfFunctionToCall = GetFunction(ePLProcs.ePL_StringToValue); + //oh dear, error handling here + if (pAddressOfFunctionToCall == IntPtr.Zero) + return ePLRESULT.PLR_NOTFOUND; - public void SuppressDataSourceEvents() - { - throw new NotImplementedException(); - } + tPL_StringToValue ltPL_StringToValue = (tPL_StringToValue)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(tPL_StringToValue)); - #endregion + return ltPL_StringToValue(str, val, format); } - public class pl5DesignerDataSourceView : DesignerDataSourceView + /// Converts a PlanimateĀ® timestamp (seconds) into a DateTime structure. + /// PlanimateĀ® timestamp (seconds from offset) + public DateTime ConvertFromPLTimestamp(double timestamp) { - private pl5engine _owner; + double[] ref_time = new double[1]; + IntPtr double_ref = Marshal.AllocHGlobal(Marshal.SizeOf(ref_time[0])); + DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); - public pl5DesignerDataSourceView(pl5engine owner, string viewName) - : base(owner, viewName) + ePLRESULT res = ConvertStringToPLValue("1 Jan 1970 00:00 00", double_ref, eTFUnit.UNIT_ABSTIME); + if (res == ePLRESULT.PLR_OK) { - _owner = owner; + Marshal.Copy(double_ref, ref_time, 0, 1); + return origin.AddSeconds(timestamp - ref_time[0]); } + else + return origin; + } - public override IDataSourceViewSchema Schema + /// Converts a DateTime structure into a PlanimateĀ® timestamp (seconds). + /// DateTime structure to convert + public double ConvertToPLTimestamp(DateTime date) + { + double[] ref_time = new double[1]; + IntPtr double_ref = Marshal.AllocHGlobal(Marshal.SizeOf(ref_time[0])); + DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); + + ePLRESULT res = ConvertStringToPLValue("1 Jan 1970 00:00 00", double_ref, eTFUnit.UNIT_ABSTIME); + if (res == ePLRESULT.PLR_OK) { - get - { - TypeSchema ts = new TypeSchema(typeof(string)); - return ts.GetViews()[0]; - } + Marshal.Copy(double_ref, ref_time, 0, 1); + TimeSpan diff = date - origin; + return Math.Floor(diff.TotalSeconds + ref_time[0]); } + else + return 0; } - - class PLDataObject { } } + + class PLDataObject { } +} \ No newline at end of file