Skip to content

Commit

Permalink
Needs testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
LegacyNsfw committed Sep 8, 2024
1 parent 45232a2 commit 2b48cec
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 124 deletions.
4 changes: 2 additions & 2 deletions Apps/PcmHammer/PcmHammer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IntermediateOutputPath>C:\Users\Jouko\AppData\Local\Temp\vsD06A.tmp\Debug\</IntermediateOutputPath>
<IntermediateOutputPath>C:\Users\nate\AppData\Local\Temp\vsAB0C.tmp\Debug\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -46,7 +46,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IntermediateOutputPath>C:\Users\Jouko\AppData\Local\Temp\vsD06A.tmp\Release\</IntermediateOutputPath>
<IntermediateOutputPath>C:\Users\nate\AppData\Local\Temp\vsAB0C.tmp\Release\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>0411_256px.ico</ApplicationIcon>
Expand Down
5 changes: 4 additions & 1 deletion Apps/PcmLibrary/Logging/LogColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ public class LogColumn
/// </summary>
public Conversion Conversion { get; private set; }

public bool Zoom { get; private set; }

/// <summary>
/// Constructor.
/// </summary>
public LogColumn(Parameter parameter, Conversion conversion)
public LogColumn(Parameter parameter, Conversion conversion, bool zoom)
{
this.Parameter = parameter;
this.Conversion = conversion;
this.Zoom = zoom;
}

/// <summary>
Expand Down
7 changes: 4 additions & 3 deletions Apps/PcmLibrary/Logging/LogProfileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ private void LoadParameters<T>(XDocument xml) where T : Parameter
{
string id = parameterElement.Attribute("id").Value;
string units = parameterElement.Attribute("units").Value;
this.AddParameterToProfile<T>(id, units);
bool zoom = parameterElement.Attribute("zoom").Value == "true";
this.AddParameterToProfile<T>(id, units, zoom);
}
}
}

private void AddParameterToProfile<T>(string id, string units) where T : Parameter
private void AddParameterToProfile<T>(string id, string units, bool zoom) where T : Parameter
{
T parameter;
if (!this.database.TryGetParameter<T>(id, out parameter))
Expand All @@ -86,7 +87,7 @@ private void AddParameterToProfile<T>(string id, string units) where T : Paramet
throw new Exception(String.Format("Conversion {0} for parameter {1} not found when loading profile.", units, id));
}

LogColumn column = new LogColumn(parameter, conversion);
LogColumn column = new LogColumn(parameter, conversion, zoom);

this.profile.AddColumn(column);
}
Expand Down
1 change: 1 addition & 0 deletions Apps/PcmLibrary/Logging/LogProfileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private static void WriteParameters<T>(LogProfile profile, XElement top) where T
XElement element = new XElement(parameterType);
element.SetAttributeValue("id", column.Parameter.Id);
element.SetAttributeValue("units", column.Conversion.Units);
element.SetAttributeValue("zoom", column.Zoom.ToString());
parameterListElement.Add(element);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Apps/PcmLibrary/Logging/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ public static Logger Create(

if (xColumn == null)
{
xColumn = new LogColumn(mathParameter.XColumn.Parameter, mathParameter.XColumn.Conversion);
xColumn = new LogColumn(mathParameter.XColumn.Parameter, mathParameter.XColumn.Conversion, false);
pcmColumns.Add(xColumn);
}

LogColumn yColumn = pcmColumns.Where(y => y.Parameter == mathParameter.YColumn.Parameter).FirstOrDefault();
if (yColumn == null)
{
yColumn = new LogColumn(mathParameter.YColumn.Parameter, mathParameter.YColumn.Conversion);
yColumn = new LogColumn(mathParameter.YColumn.Parameter, mathParameter.YColumn.Conversion, false);
pcmColumns.Add(yColumn);
}

Expand Down
2 changes: 1 addition & 1 deletion Apps/PcmLibrary/Logging/ParameterDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private LogColumn BuildLogColumnForMathParameter(string id, string units, string
throw new Exception(String.Format("No conversion found for {0} in {1}", units, parameterName));
}

return new LogColumn(xParameter, xConversion);
return new LogColumn(xParameter, xConversion, false);
}

List<Conversion> GetConversions(XElement parameterElement)
Expand Down
Loading

0 comments on commit 2b48cec

Please sign in to comment.