forked from LegacyNsfw/TimingEditor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
LogOverlay.cs
76 lines (72 loc) · 2.43 KB
/
LogOverlay.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace NSFW.TimingEditor
{
public partial class LogOverlay : Form
{
public LogOverlay()
{
InitializeComponent();
}
public String[] LogParameters
{
get
{
if (this.headerListBox.SelectedItems.Count > 0)
{
int i = 0;
String[] s = new String[this.headerListBox.CheckedItems.Count];
foreach (Object o in this.headerListBox.CheckedItems)
s[i++] = o.ToString();
return s;
}
else
return new String[0];
}
set
{
if (value.Length > 0)
{
this.headerListBox.Items.Clear();
this.xAxisComboBox.Items.Clear();
this.yAxisComboBox.Items.Clear();
String engLoad = null;
String engSpeed = null;
foreach (String s in value)
{
this.headerListBox.Items.Add(s);
this.xAxisComboBox.Items.Add(s);
this.yAxisComboBox.Items.Add(s);
if (Regex.IsMatch(s, ".*\\bengine[_\\s]load\\b.*", RegexOptions.IgnoreCase))
engLoad = s;
else if (Regex.IsMatch(s, ".*\\b(engine[_\\s]speed|rpm)\\b.*", RegexOptions.IgnoreCase))
engSpeed = s;
}
if (engLoad != null)
this.xAxisComboBox.SelectedItem = engLoad;
else
this.xAxisComboBox.SelectedIndex = 0;
if (engSpeed != null)
this.yAxisComboBox.SelectedItem = engSpeed;
else
this.yAxisComboBox.SelectedIndex = 0;
}
}
}
public String XAxis
{
get { return this.xAxisComboBox.SelectedItem.ToString(); }
}
public String YAxis
{
get { return this.yAxisComboBox.SelectedItem.ToString(); }
}
}
}