forked from Blackfrosch/VAGEDCSuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SymbolAxesTranslator.cs
104 lines (95 loc) · 3.16 KB
/
SymbolAxesTranslator.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
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
using System;
using System.Collections.Generic;
using System.Text;
namespace VAGSuite
{
class SymbolAxesTranslator
{
private Int32 GetSymbolAxisXID(SymbolCollection curSymbolCollection, string symbolname)
{
foreach (SymbolHelper sh in curSymbolCollection)
{
if (sh.Varname == symbolname || sh.Userdescription == symbolname)
{
return sh.X_axis_ID;
}
}
return 0;
}
private Int32 GetSymbolAxisYID(SymbolCollection curSymbolCollection, string symbolname)
{
foreach (SymbolHelper sh in curSymbolCollection)
{
if (sh.Varname == symbolname || sh.Userdescription == symbolname)
{
return sh.Y_axis_ID;
}
}
return 0;
}
public bool GetAxisSymbols(SymbolCollection curSymbols, string symbolname, out string x_axis, out string y_axis, out string x_axis_description, out string y_axis_description, out string z_axis_description)
{
bool retval = false;
x_axis = "";
y_axis = "";
x_axis_description = "x-axis";
y_axis_description = "y-axis";
z_axis_description = "z-axis";
int xid = GetSymbolAxisXID(curSymbols, symbolname);
y_axis_description = TranslateAxisID(xid);
int yid = GetSymbolAxisYID(curSymbols, symbolname);
x_axis_description = TranslateAxisID(yid);
/*
switch (symbolname)
{
case "MAFCal.WeightConstFuelMap":
x_axis = "MAFCal.n_EngineXSP";
y_axis = "MAFCal.p_InletGradYSP";
x_axis_description = "Engine speed (%)";
y_axis_description = "Inlet pressure (kPa)";
break;
}
if (y_axis != "") retval = true;*/
return retval;
}
public string TranslateAxisID(int id)
{
string retval = id.ToString("X4");
/* switch (id)
{
case 0xEC38:
case 0xEC2E:
retval = "Injection Quantity mg/stroke";
break;
case 0xC048:
case 0xC042:
case 0xC030:
case 0xC0BA:
case 0xC044:
case 0xC036:
case 0xDA70:
case 0xC5A4:
retval = "Engine speed (rpm)";
break;
case 0xF94A:
retval = "Airflow mg/hub";
break;
case 0xC19E:
retval = "Air intake temp";
break;
break;
}*/
return retval;
}
public string GetXaxisSymbol(string symbolname)
{
string retval = string.Empty;
return retval;
}
public string GetYaxisSymbol(string symbolname)
{
string retval = string.Empty;
return retval;
}
}
}