GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ASTMViewer/ASTMParserGUI.cs at master · vheinitz/ASTMViewer

Expand file tree

/

ASTMParserGUI.cs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
120 lines (104 loc) · 3.95 KB
/

ASTMParserGUI.cs

Copy path

File metadata and controls

120 lines (104 loc) · 3.95 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* Valentin Heinitz, 2014-10-30 01:54
* http://heinitz-it.de
* Test gui for ASTM-1394 parser.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using ASTMParser;
namespace ASTMViewer
{
public partial class ASTMParserGUI : Form
{
public ASTMParserGUI()
{
InitializeComponent();
}
List<ASTM_Message> messages = new List<ASTM_Message>();
void populateData(ASTM_Record r, TreeNode n, int fromIdx=1)
{
for (int fi = fromIdx; fi <= r.fieldsCount(); fi++)
{
if (r.fieldValue(fi) != null && r.fieldValue(fi).Length > 0)
n.Nodes.Add(r.fieldName(fi) + ":\t" + r.fieldValue(fi));
}
if (r.comments()!=null)
{
foreach (ASTM_Comment c in r.comments())
{
TreeNode curCommentNode = n.Nodes.Add("Comment");
for (int fi = fromIdx; fi <= c.fieldsCount(); fi++)
{
if (c.fieldValue(fi) != null && c.fieldValue(fi).Length > 0)
curCommentNode.Nodes.Add(c.fieldName(fi) + ":\t" + c.fieldValue(fi));
}
}
}
if (r.manufacturerInfo() != null)
{
foreach (ASTM_Manufacturer m in r.manufacturerInfo())
{
TreeNode curManNode = n.Nodes.Add("Manufacturer Info");
for (int fi = fromIdx; fi <= m.fieldsCount(); fi++)
{
if (m.fieldValue(fi) != null && m.fieldValue(fi).Length > 0)
curManNode.Nodes.Add(m.fieldName(fi) + ":\t" + m.fieldValue(fi));
}
}
}
}
void populateData()
{
messagesData.Nodes.Clear();
foreach (ASTM_Message m in messages)
{
TreeNode curMessageNode = messagesData.Nodes.Add("Message");
populateData(m, curMessageNode, 3);
foreach (ASTM_Patient p in m.patientRecords)
{
TreeNode curPatientNode = curMessageNode.Nodes.Add("Patient");
populateData(p, curPatientNode, 3);
foreach (ASTM_Order o in p.orderRecords)
{
TreeNode curOrderNode = curPatientNode.Nodes.Add("Order");
populateData(o, curOrderNode, 3);
foreach (ASTM_Result r in o.resultRecords)
{
TreeNode curResultNode = curOrderNode.Nodes.Add("Result");
populateData(r, curResultNode, 3);
}
}
}
foreach (ASTM_Request q in m.requestRecords)
{
TreeNode curRequestNode = curMessageNode.Nodes.Add("Request Order");
populateData(q, curRequestNode, 3);
}
foreach (ASTM_Scientific s in m.scientificRecords)
{
TreeNode curScientificNode = curMessageNode.Nodes.Add("Scientific");
populateData(s, curScientificNode, 3);
}
}
messagesData.ExpandAll();
}
public void clear()
{
messages.Clear();
}
private void button1_Click(object sender, EventArgs e)
{
clear();
Parser parser = new Parser();
parser.parse(this.astmData.Text, ref messages);
populateData();
}
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.