qRead)
+ {
+ string sep = "";
+ StringBuilder sb = new StringBuilder();
+ int lineCount = 0;
+ string lookingFor = null;
+ while(qRead.Count > 0)
+ {
+ // Read a line at a time
+ string str = qRead.Peek();
+ if(lineCount == 0 && str.StartsWith(""))
+ {
+ lookingFor = "
";
+ str = str.Replace("", "");
+ }
+ lineCount++;
+ str = Regex.Replace(str, "<[^<>]+>", "").Trim(" \t".ToCharArray()).Replace(">", "");
+ str = str.Replace('\x25CB', 'o').Replace("\u2022", "\\u9679?");
+ //str = str.Replace('\x25CB', 'o').Replace("\u2022", "\\u7?");
+ // If Text begins with number then
+ if (lookingFor != null)
+ {
+ if (str.Contains(lookingFor))
+ {
+ sb.Append(sep + str.Replace(lookingFor, ""));
+ return sb.ToString();
+ }
+ }
+ else if (Regex.IsMatch(str, "[0-9].*") || str.StartsWith("
"))
+ return sb.ToString();
+ //append string
+ if (sb.ToString() != "" && str != "")
+ sep = "\r\n";
+ sb.Append(sep + str);
+ qRead.Dequeue();// Remove current line from queue
+ }
+ return sb.ToString();
+ }
+
+ private void ProcessChars(string str)
+ {
+ foreach (char c in str)
+ {
+ if (c < 0x20 || c > 0x7F)
+ Console.WriteLine("{0:X4}", (int)c);
+ }
+ }
+ public void ResetSpecial()
+ {
+ FoundSpecial = new List();
+ }
+ List FoundSpecial = new List();
+ private void HasSpecialCharacters(string lineText)
+ {
+ StringBuilder sb = new StringBuilder();
+ foreach (char c in lineText)
+ {
+ if ((c < 0x20 || c > 0x7F) && !FoundSpecial.Contains(c))
+ {
+ Console.WriteLine("*** Special Character {0:X4}", (int)c);
+ FoundSpecial.Add(c);
+ }
+ }
+ }
+
+ private static string GetAnnotationText(string fileName)
+ {
+ return string.Format("FileName:{0}\r\nShortName:{1}\r\nFullName:{2}\r\nSystem:{3}\r\nPNSNo:{4}\r\nRelatedFunction:{5}" ,
+ fileName,ShortName,FullName,ApSystem,PNSNo ,RelatedFunction);
+ }
+ private static string GetAnnotationText2(string lineText)
+ {
+ //return string.Format("LineText:{0}\r\nShortName:{1}\r\nFullName:{2}\r\nSystem:{3}\r\nPNSNo:{4}\r\nRelatedFunction:{5}",
+ // lineText, ShortName, FullName, apSystem, PNSNo, RelatedFunction);
+ return string.Format("LineText:{0}",
+ lineText);
+ }
+ }
+ public class StepLookup : SortedDictionary
+ {
+ public StepInfo this[int i]
+ {
+ get
+ {
+ if (this.ContainsKey(i.ToString())) return base[i.ToString()];
+ return null;
+ }
+ set
+ {
+ if (i > this.Count)
+ throw new Exception("Gap in Stack");
+ if (value == null)
+ throw new Exception("Null StepInfo");
+ //if (value.MyHLS.Ordinal==5 && (value.IsNote || value.IsCaution ))
+ // Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,5,"=====> Adding Caution or Note on Step 5 {0}",value);
+ if (this.ContainsKey(i.ToString()))
+ {
+ base[i.ToString()] = value;
+ while (this.ContainsKey((i + 1).ToString()))
+ base.Remove((base.Count - 1).ToString());
+ }
+ else base.Add(i.ToString(), value);
+ //ListMySteps("Set ", this);
+ }
+ }
+ public void AddOne(StepInfo previousStep)
+ {
+ this[this.Count] = previousStep;
+ }
+ private static void ListMySteps(string str, StepLookup mySteps)
+ {
+ int i = 0;
+ foreach (string key in mySteps.Keys)
+ {
+ if (key != i.ToString())
+ Console.WriteLine("{0} {1} {2} {3}", str, i, key, mySteps[key].DisplayText);
+ i++;
+ }
+ }
+ }
+}
diff --git a/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.Designer.cs b/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.Designer.cs
new file mode 100644
index 00000000..e892e41a
--- /dev/null
+++ b/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.Designer.cs
@@ -0,0 +1,499 @@
+namespace ConvertAlarms
+{
+ partial class frmConvertAlarms
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.tbFileName = new System.Windows.Forms.TextBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.btnRun = new System.Windows.Forms.Button();
+ this.btnBrowse = new System.Windows.Forms.Button();
+ this.btnAll = new System.Windows.Forms.Button();
+ this.label2 = new System.Windows.Forms.Label();
+ this.btnConvert = new System.Windows.Forms.Button();
+ this.label7 = new System.Windows.Forms.Label();
+ this.tbServer = new System.Windows.Forms.TextBox();
+ this.cmbDatabase = new System.Windows.Forms.ComboBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cmbDocVersion = new System.Windows.Forms.ComboBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.ofd = new System.Windows.Forms.OpenFileDialog();
+ this.sc1 = new System.Windows.Forms.SplitContainer();
+ this.tcXML = new System.Windows.Forms.TabControl();
+ this.tpXML = new System.Windows.Forms.TabPage();
+ this.tbXML = new System.Windows.Forms.TextBox();
+ this.tpColorCoded = new System.Windows.Forms.TabPage();
+ this.rtbXML = new System.Windows.Forms.RichTextBox();
+ this.tabControl1 = new System.Windows.Forms.TabControl();
+ this.tpHTML = new System.Windows.Forms.TabPage();
+ this.wb = new System.Windows.Forms.WebBrowser();
+ this.tpRaw = new System.Windows.Forms.TabPage();
+ this.tbPROMS = new System.Windows.Forms.TextBox();
+ this.tpStructure = new System.Windows.Forms.TabPage();
+ this.tv = new System.Windows.Forms.TreeView();
+ this.tpGrid = new System.Windows.Forms.TabPage();
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.tspb = new System.Windows.Forms.ToolStripProgressBar();
+ this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
+ this.tmr = new System.Windows.Forms.Timer(this.components);
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.sc1)).BeginInit();
+ this.sc1.Panel1.SuspendLayout();
+ this.sc1.Panel2.SuspendLayout();
+ this.sc1.SuspendLayout();
+ this.tcXML.SuspendLayout();
+ this.tpXML.SuspendLayout();
+ this.tpColorCoded.SuspendLayout();
+ this.tabControl1.SuspendLayout();
+ this.tpHTML.SuspendLayout();
+ this.tpRaw.SuspendLayout();
+ this.tpStructure.SuspendLayout();
+ this.statusStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.tbFileName);
+ this.panel1.Controls.Add(this.panel2);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(954, 88);
+ this.panel1.TabIndex = 0;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(23, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "File";
+ //
+ // tbFileName
+ //
+ this.tbFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.tbFileName.Location = new System.Drawing.Point(56, 6);
+ this.tbFileName.Name = "tbFileName";
+ this.tbFileName.Size = new System.Drawing.Size(692, 20);
+ this.tbFileName.TabIndex = 0;
+ this.tbFileName.Text = "H:\\Barakah Alarms\\1N2-OP-ARP-CS-0001_Rev_02_FINAL_Zipped_XML_20190804\\ARP-3442-10" +
+ "01 CS CNMT Spray HDR Block VLV V0001 TRBL.xml";
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.btnRun);
+ this.panel2.Controls.Add(this.btnBrowse);
+ this.panel2.Controls.Add(this.btnAll);
+ this.panel2.Controls.Add(this.label2);
+ this.panel2.Controls.Add(this.btnConvert);
+ this.panel2.Controls.Add(this.label7);
+ this.panel2.Controls.Add(this.tbServer);
+ this.panel2.Controls.Add(this.cmbDatabase);
+ this.panel2.Controls.Add(this.label4);
+ this.panel2.Controls.Add(this.cmbDocVersion);
+ this.panel2.Controls.Add(this.label6);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel2.Location = new System.Drawing.Point(0, 0);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(954, 88);
+ this.panel2.TabIndex = 9;
+ //
+ // btnRun
+ //
+ this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnRun.Location = new System.Drawing.Point(862, 3);
+ this.btnRun.Name = "btnRun";
+ this.btnRun.Size = new System.Drawing.Size(37, 24);
+ this.btnRun.TabIndex = 13;
+ this.btnRun.Text = "Run";
+ this.btnRun.UseVisualStyleBackColor = true;
+ this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
+ //
+ // btnBrowse
+ //
+ this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowse.Location = new System.Drawing.Point(758, 3);
+ this.btnBrowse.Name = "btnBrowse";
+ this.btnBrowse.Size = new System.Drawing.Size(72, 24);
+ this.btnBrowse.TabIndex = 2;
+ this.btnBrowse.Text = "Browse...";
+ this.btnBrowse.UseVisualStyleBackColor = true;
+ this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
+ //
+ // btnAll
+ //
+ this.btnAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnAll.Location = new System.Drawing.Point(799, 44);
+ this.btnAll.Name = "btnAll";
+ this.btnAll.Size = new System.Drawing.Size(37, 25);
+ this.btnAll.TabIndex = 12;
+ this.btnAll.Text = "All";
+ this.btnAll.UseVisualStyleBackColor = true;
+ this.btnAll.Click += new System.EventHandler(this.btnAll_Click);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(396, 35);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(53, 13);
+ this.label2.TabIndex = 4;
+ this.label2.Text = "Database";
+ //
+ // btnConvert
+ //
+ this.btnConvert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnConvert.Location = new System.Drawing.Point(717, 44);
+ this.btnConvert.Name = "btnConvert";
+ this.btnConvert.Size = new System.Drawing.Size(76, 28);
+ this.btnConvert.TabIndex = 11;
+ this.btnConvert.Text = "Convert";
+ this.btnConvert.UseVisualStyleBackColor = true;
+ this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(12, 35);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(38, 13);
+ this.label7.TabIndex = 10;
+ this.label7.Text = "Server";
+ //
+ // tbServer
+ //
+ this.tbServer.Location = new System.Drawing.Point(56, 32);
+ this.tbServer.Name = "tbServer";
+ this.tbServer.Size = new System.Drawing.Size(329, 20);
+ this.tbServer.TabIndex = 9;
+ //
+ // cmbDatabase
+ //
+ this.cmbDatabase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbDatabase.FormattingEnabled = true;
+ this.cmbDatabase.Location = new System.Drawing.Point(455, 32);
+ this.cmbDatabase.Name = "cmbDatabase";
+ this.cmbDatabase.Size = new System.Drawing.Size(256, 21);
+ this.cmbDatabase.TabIndex = 8;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(11, 61);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(75, 13);
+ this.label4.TabIndex = 7;
+ this.label4.Text = "Procedure Set";
+ //
+ // cmbDocVersion
+ //
+ this.cmbDocVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbDocVersion.FormattingEnabled = true;
+ this.cmbDocVersion.Location = new System.Drawing.Point(92, 58);
+ this.cmbDocVersion.Name = "cmbDocVersion";
+ this.cmbDocVersion.Size = new System.Drawing.Size(619, 21);
+ this.cmbDocVersion.TabIndex = 6;
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(12, 9);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(23, 13);
+ this.label6.TabIndex = 1;
+ this.label6.Text = "File";
+ //
+ // sc1
+ //
+ this.sc1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.sc1.Location = new System.Drawing.Point(0, 88);
+ this.sc1.Name = "sc1";
+ //
+ // sc1.Panel1
+ //
+ this.sc1.Panel1.Controls.Add(this.tcXML);
+ //
+ // sc1.Panel2
+ //
+ this.sc1.Panel2.Controls.Add(this.tabControl1);
+ this.sc1.Size = new System.Drawing.Size(954, 392);
+ this.sc1.SplitterDistance = 372;
+ this.sc1.TabIndex = 1;
+ //
+ // tcXML
+ //
+ this.tcXML.Controls.Add(this.tpXML);
+ this.tcXML.Controls.Add(this.tpColorCoded);
+ this.tcXML.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tcXML.Location = new System.Drawing.Point(0, 0);
+ this.tcXML.Name = "tcXML";
+ this.tcXML.SelectedIndex = 0;
+ this.tcXML.Size = new System.Drawing.Size(372, 392);
+ this.tcXML.TabIndex = 2;
+ //
+ // tpXML
+ //
+ this.tpXML.Controls.Add(this.tbXML);
+ this.tpXML.Location = new System.Drawing.Point(4, 22);
+ this.tpXML.Name = "tpXML";
+ this.tpXML.Padding = new System.Windows.Forms.Padding(3);
+ this.tpXML.Size = new System.Drawing.Size(364, 366);
+ this.tpXML.TabIndex = 1;
+ this.tpXML.Text = "XML";
+ this.tpXML.UseVisualStyleBackColor = true;
+ //
+ // tbXML
+ //
+ this.tbXML.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tbXML.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tbXML.HideSelection = false;
+ this.tbXML.Location = new System.Drawing.Point(3, 3);
+ this.tbXML.Multiline = true;
+ this.tbXML.Name = "tbXML";
+ this.tbXML.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.tbXML.Size = new System.Drawing.Size(358, 360);
+ this.tbXML.TabIndex = 0;
+ this.tbXML.TextChanged += new System.EventHandler(this.tbXML_TextChanged);
+ //
+ // tpColorCoded
+ //
+ this.tpColorCoded.Controls.Add(this.rtbXML);
+ this.tpColorCoded.Location = new System.Drawing.Point(4, 22);
+ this.tpColorCoded.Name = "tpColorCoded";
+ this.tpColorCoded.Padding = new System.Windows.Forms.Padding(3);
+ this.tpColorCoded.Size = new System.Drawing.Size(364, 366);
+ this.tpColorCoded.TabIndex = 0;
+ this.tpColorCoded.Text = "Color Coded";
+ this.tpColorCoded.UseVisualStyleBackColor = true;
+ //
+ // rtbXML
+ //
+ this.rtbXML.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.rtbXML.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.rtbXML.Location = new System.Drawing.Point(3, 3);
+ this.rtbXML.Name = "rtbXML";
+ this.rtbXML.Size = new System.Drawing.Size(358, 360);
+ this.rtbXML.TabIndex = 1;
+ this.rtbXML.Text = "";
+ this.rtbXML.SelectionChanged += new System.EventHandler(this.rtbXML_SelectionChanged);
+ this.rtbXML.TextChanged += new System.EventHandler(this.rtbXML_TextChanged);
+ //
+ // tabControl1
+ //
+ this.tabControl1.Controls.Add(this.tpHTML);
+ this.tabControl1.Controls.Add(this.tpRaw);
+ this.tabControl1.Controls.Add(this.tpStructure);
+ this.tabControl1.Controls.Add(this.tpGrid);
+ this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl1.Location = new System.Drawing.Point(0, 0);
+ this.tabControl1.Name = "tabControl1";
+ this.tabControl1.SelectedIndex = 0;
+ this.tabControl1.Size = new System.Drawing.Size(578, 392);
+ this.tabControl1.TabIndex = 0;
+ //
+ // tpHTML
+ //
+ this.tpHTML.Controls.Add(this.wb);
+ this.tpHTML.Location = new System.Drawing.Point(4, 22);
+ this.tpHTML.Name = "tpHTML";
+ this.tpHTML.Padding = new System.Windows.Forms.Padding(3);
+ this.tpHTML.Size = new System.Drawing.Size(570, 366);
+ this.tpHTML.TabIndex = 0;
+ this.tpHTML.Text = "HTML";
+ this.tpHTML.UseVisualStyleBackColor = true;
+ //
+ // wb
+ //
+ this.wb.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.wb.Location = new System.Drawing.Point(3, 3);
+ this.wb.MinimumSize = new System.Drawing.Size(20, 20);
+ this.wb.Name = "wb";
+ this.wb.Size = new System.Drawing.Size(564, 360);
+ this.wb.TabIndex = 0;
+ //
+ // tpRaw
+ //
+ this.tpRaw.Controls.Add(this.tbPROMS);
+ this.tpRaw.Location = new System.Drawing.Point(4, 22);
+ this.tpRaw.Name = "tpRaw";
+ this.tpRaw.Padding = new System.Windows.Forms.Padding(3);
+ this.tpRaw.Size = new System.Drawing.Size(570, 366);
+ this.tpRaw.TabIndex = 1;
+ this.tpRaw.Text = "Raw Text";
+ this.tpRaw.UseVisualStyleBackColor = true;
+ //
+ // tbPROMS
+ //
+ this.tbPROMS.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tbPROMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tbPROMS.Location = new System.Drawing.Point(3, 3);
+ this.tbPROMS.Multiline = true;
+ this.tbPROMS.Name = "tbPROMS";
+ this.tbPROMS.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.tbPROMS.Size = new System.Drawing.Size(564, 360);
+ this.tbPROMS.TabIndex = 0;
+ //
+ // tpStructure
+ //
+ this.tpStructure.Controls.Add(this.tv);
+ this.tpStructure.Location = new System.Drawing.Point(4, 22);
+ this.tpStructure.Name = "tpStructure";
+ this.tpStructure.Size = new System.Drawing.Size(570, 366);
+ this.tpStructure.TabIndex = 2;
+ this.tpStructure.Text = "Structure";
+ this.tpStructure.UseVisualStyleBackColor = true;
+ //
+ // tv
+ //
+ this.tv.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tv.Location = new System.Drawing.Point(0, 0);
+ this.tv.Name = "tv";
+ this.tv.Size = new System.Drawing.Size(570, 366);
+ this.tv.TabIndex = 0;
+ //
+ // tpGrid
+ //
+ this.tpGrid.Location = new System.Drawing.Point(4, 22);
+ this.tpGrid.Name = "tpGrid";
+ this.tpGrid.Size = new System.Drawing.Size(570, 366);
+ this.tpGrid.TabIndex = 3;
+ this.tpGrid.Text = "Grid";
+ this.tpGrid.UseVisualStyleBackColor = true;
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tspb,
+ this.tsslStatus});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 480);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(954, 22);
+ this.statusStrip1.TabIndex = 2;
+ this.statusStrip1.Text = "statusStrip1";
+ this.statusStrip1.Click += new System.EventHandler(this.statusStrip1_Click);
+ //
+ // tspb
+ //
+ this.tspb.Name = "tspb";
+ this.tspb.Size = new System.Drawing.Size(300, 16);
+ this.tspb.Visible = false;
+ //
+ // tsslStatus
+ //
+ this.tsslStatus.Name = "tsslStatus";
+ this.tsslStatus.Size = new System.Drawing.Size(39, 17);
+ this.tsslStatus.Text = "Ready";
+ this.tsslStatus.Click += new System.EventHandler(this.tsslStatus_Click);
+ //
+ // tmr
+ //
+ this.tmr.Interval = 2000;
+ this.tmr.Tick += new System.EventHandler(this.tmr_Tick);
+ //
+ // frmConvertAlarms
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(954, 502);
+ this.Controls.Add(this.sc1);
+ this.Controls.Add(this.panel1);
+ this.Controls.Add(this.statusStrip1);
+ this.Name = "frmConvertAlarms";
+ this.Text = "Convert Alarms";
+ this.Load += new System.EventHandler(this.frmConvertAlarms_Load);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.panel2.PerformLayout();
+ this.sc1.Panel1.ResumeLayout(false);
+ this.sc1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.sc1)).EndInit();
+ this.sc1.ResumeLayout(false);
+ this.tcXML.ResumeLayout(false);
+ this.tpXML.ResumeLayout(false);
+ this.tpXML.PerformLayout();
+ this.tpColorCoded.ResumeLayout(false);
+ this.tabControl1.ResumeLayout(false);
+ this.tpHTML.ResumeLayout(false);
+ this.tpRaw.ResumeLayout(false);
+ this.tpRaw.PerformLayout();
+ this.tpStructure.ResumeLayout(false);
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button btnBrowse;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox tbFileName;
+ private System.Windows.Forms.OpenFileDialog ofd;
+ private System.Windows.Forms.SplitContainer sc1;
+ private System.Windows.Forms.TextBox tbXML;
+ private System.Windows.Forms.WebBrowser wb;
+ private System.Windows.Forms.TextBox tbPROMS;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStripStatusLabel tsslStatus;
+ private System.Windows.Forms.RichTextBox rtbXML;
+ private System.Windows.Forms.TabControl tcXML;
+ private System.Windows.Forms.TabPage tpXML;
+ private System.Windows.Forms.TabPage tpColorCoded;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tpHTML;
+ private System.Windows.Forms.TabPage tpRaw;
+ private System.Windows.Forms.TabPage tpStructure;
+ private System.Windows.Forms.TreeView tv;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.TextBox tbServer;
+ private System.Windows.Forms.ComboBox cmbDatabase;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.ComboBox cmbDocVersion;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Button btnConvert;
+ private System.Windows.Forms.Button btnAll;
+ private System.Windows.Forms.TabPage tpGrid;
+ private System.Windows.Forms.Button btnRun;
+ private System.Windows.Forms.ToolStripProgressBar tspb;
+ private System.Windows.Forms.Timer tmr;
+ }
+}
+
diff --git a/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.cs b/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.cs
new file mode 100644
index 00000000..9991541f
--- /dev/null
+++ b/PROMS/BarakahConvert/ConvertAlarms/frmConvertAlarms.cs
@@ -0,0 +1,886 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.IO;
+using System.Xml;
+using System.Text.RegularExpressions;
+using VEPROMS.CSLA.Library;
+using log4net;
+using Volian.Controls.Library;
+using C1.Win.C1FlexGrid;
+using System.Data.SqlClient;
+
+namespace ConvertAlarms
+{
+ public partial class frmConvertAlarms : Form
+ {
+ public frmConvertAlarms()
+ {
+ InitializeComponent();
+ }
+ private void SetDatabaseConnection()
+ {
+ Database.VEPROMS_Connection = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True", tbServer.Text, cmbDatabase.SelectedText);
+ }
+ private void btnBrowse_Click(object sender, EventArgs e)
+ {
+ FileInfo fi = new FileInfo(tbFileName.Text);
+ ofd.InitialDirectory = fi.DirectoryName;
+ ofd.FileName = fi.Name;
+ if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ {
+ tbFileName.Text = ofd.FileName;
+ ProcessXML();
+ }
+ }
+ private void ProcessXML()
+ {
+ string fileName = tbFileName.Text;
+ ProcessXmlFile(fileName);
+ }
+ private void ProcessXmlFile(string fileName)
+ {
+ UpdateHTML = false;
+ tbXML.Clear();
+ UpdateHTML = true;
+ XmlDocument xDoc = new XmlDocument();
+ xDoc.Load(fileName);
+ XmlElement xe1 = xDoc.DocumentElement;
+ XmlElement xe2 = xe1.ChildNodes[0] as XmlElement;
+ XmlElement xe3 = xe2.ChildNodes[0] as XmlElement;
+ XmlElement xe4 = (xe1.ChildNodes[1] as XmlElement).ChildNodes[0] as XmlElement;
+ RelatedFunction = xe3.Attributes["relatedFunction"].Value;
+ PNSNo = xe3.Attributes["PNSNo"].Value;
+ ShortName = xe3.Attributes["shortName"].Value;
+ FullName = xe3.Attributes["fullName"].Value;
+ RevisionNumber = xe3.Attributes["revisionNumber"].Value;
+ Priority = xe3.Attributes["priority"].Value;
+ Number = xe3.Attributes["number"].Value;
+ Responsibility = xe4.Attributes["implementor"].Value;
+ ApSystem = GetSystem(xe3);
+ XmlNode xn = xDoc.DocumentElement.LastChild.LastChild.LastChild;
+ string html = GetHtml(xn);
+ tbXML.Text = html;
+ }
+ private static string _RelatedFunction;
+ public static string RelatedFunction
+ {
+ get { return _RelatedFunction; }
+ set { _RelatedFunction = value; }
+ }
+ private static string _PNSNo;
+ public static string PNSNo
+ {
+ get { return _PNSNo; }
+ set { _PNSNo = value; }
+ }
+ private static string _fullName;
+ public static string FullName
+ {
+ get { return _fullName; }
+ set { _fullName = value; }
+ }
+ private static string _Number;
+ public static string Number
+ {
+ get { return frmConvertAlarms._Number; }
+ set { frmConvertAlarms._Number = value; }
+ }
+ private static string _RevisionNumber;
+ public static string RevisionNumber
+ {
+ get { return frmConvertAlarms._RevisionNumber; }
+ set { frmConvertAlarms._RevisionNumber = value; }
+ }
+ private static string _Priority;
+ public static string Priority
+ {
+ get { return frmConvertAlarms._Priority; }
+ set { frmConvertAlarms._Priority = value; }
+ }
+ private static string Responsibility;
+ public static string Responsibility1
+ {
+ get { return frmConvertAlarms.Responsibility; }
+ set { frmConvertAlarms.Responsibility = value; }
+ }
+ private static string _shortName;
+ public static string ShortName
+ {
+ get { return _shortName; }
+ set { _shortName = value; }
+ }
+ private static string _system;
+ public static string ApSystem
+ {
+ get { return _system; }
+ set { _system = value; }
+ }
+ private static string _MyFileName;
+
+ public static string MyFileName
+ {
+ get { return frmConvertAlarms._MyFileName; }
+ set { frmConvertAlarms._MyFileName = value; }
+ }
+ private static string GetHtml(XmlNode xn)
+ {
+ XmlNode pr = xn.PreviousSibling;
+ int i = 0;
+ string html = xn.Attributes["content"].Value;
+ //Console.WriteLine(@"{0} ""{1}""", i++, html);
+ if (xn != pr)
+ {
+ while (pr != null && pr.Name == "NoteInstruction")
+ {
+ string html2 = pr.Attributes["content"].Value;
+ //Console.WriteLine(@"{0} ""{1}""", i++, html2);
+ html = MergeHTML(html2, html);
+ //Console.WriteLine(@"{0} ""{1}""", -1, html);
+ pr = pr.PreviousSibling;
+ }
+ }
+ return html;
+ }
+
+ private static string MergeHTML(string part1, string part2)
+ {
+ part1 = part1.Replace("