175 lines
15 KiB
C#
175 lines
15 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Globalization;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Drawing.Printing;
|
|
using ZedGraph;
|
|
using System.IO;
|
|
|
|
namespace GenesisDisplayTool
|
|
{
|
|
|
|
public partial class GENESIS_DISPLAY_TOOL : Form
|
|
{
|
|
private String CsvMeanPage(Boolean replaceUnits)
|
|
{
|
|
String Data = String.Empty;
|
|
|
|
try
|
|
{
|
|
Data =
|
|
l_MeanValuesTof0UpPath0.Text + ";" + l_MeanValuesTof0UpDispPath0.Text + ";" + l_MeanValuesTof0UpDispPath1.Text + ";" + l_MeanValuesTof0UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof1UpPath0.Text + ";" + l_MeanValuesTof1UpDispPath0.Text + ";" + l_MeanValuesTof1UpDispPath1.Text + ";" + l_MeanValuesTof1UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof2UpPath0.Text + ";" + l_MeanValuesTof2UpDispPath0.Text + ";" + l_MeanValuesTof2UpDispPath1.Text + ";" + l_MeanValuesTof2UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof3UpPath0.Text + ";" + l_MeanValuesTof3UpDispPath0.Text + ";" + l_MeanValuesTof3UpDispPath1.Text + ";" + l_MeanValuesTof3UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof4UpPath0.Text + ";" + l_MeanValuesTof4UpDispPath0.Text + ";" + l_MeanValuesTof4UpDispPath1.Text + ";" + l_MeanValuesTof4UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof5UpPath0.Text + ";" + l_MeanValuesTof5UpDispPath0.Text + ";" + l_MeanValuesTof5UpDispPath1.Text + ";" + l_MeanValuesTof5UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof6UpPath0.Text + ";" + l_MeanValuesTof6UpDispPath0.Text + ";" + l_MeanValuesTof6UpDispPath1.Text + ";" + l_MeanValuesTof6UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof7UpPath0.Text + ";" + l_MeanValuesTof7UpDispPath0.Text + ";" + l_MeanValuesTof7UpDispPath1.Text + ";" + l_MeanValuesTof7UpDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof0DownPath0.Text + ";" + l_MeanValuesTof0DownDispPath0.Text + ";" + l_MeanValuesTof0DownDispPath1.Text + ";" + l_MeanValuesTof0DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof1DownPath0.Text + ";" + l_MeanValuesTof1DownDispPath0.Text + ";" + l_MeanValuesTof1DownDispPath1.Text + ";" + l_MeanValuesTof1DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof2DownPath0.Text + ";" + l_MeanValuesTof2DownDispPath0.Text + ";" + l_MeanValuesTof2DownDispPath1.Text + ";" + l_MeanValuesTof2DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof3DownPath0.Text + ";" + l_MeanValuesTof3DownDispPath0.Text + ";" + l_MeanValuesTof3DownDispPath1.Text + ";" + l_MeanValuesTof3DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof4DownPath0.Text + ";" + l_MeanValuesTof4DownDispPath0.Text + ";" + l_MeanValuesTof4DownDispPath1.Text + ";" + l_MeanValuesTof4DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof5DownPath0.Text + ";" + l_MeanValuesTof5DownDispPath0.Text + ";" + l_MeanValuesTof5DownDispPath1.Text + ";" + l_MeanValuesTof5DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof6DownPath0.Text + ";" + l_MeanValuesTof6DownDispPath0.Text + ";" + l_MeanValuesTof6DownDispPath1.Text + ";" + l_MeanValuesTof6DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTof7DownPath0.Text + ";" + l_MeanValuesTof7DownDispPath0.Text + ";" + l_MeanValuesTof7DownDispPath1.Text + ";" + l_MeanValuesTof7DownDispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof0Path0.Text + ";" + l_MeanValuesDifTof0DispPath0.Text + ";" + l_MeanValuesDifTof0DispPath1.Text + ";" + l_MeanValuesDifTof0DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof1Path0.Text + ";" + l_MeanValuesDifTof1DispPath0.Text + ";" + l_MeanValuesDifTof1DispPath1.Text + ";" + l_MeanValuesDifTof1DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof2Path0.Text + ";" + l_MeanValuesDifTof2DispPath0.Text + ";" + l_MeanValuesDifTof2DispPath1.Text + ";" + l_MeanValuesDifTof2DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof3Path0.Text + ";" + l_MeanValuesDifTof3DispPath0.Text + ";" + l_MeanValuesDifTof3DispPath1.Text + ";" + l_MeanValuesDifTof3DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof4Path0.Text + ";" + l_MeanValuesDifTof4DispPath0.Text + ";" + l_MeanValuesDifTof4DispPath1.Text + ";" + l_MeanValuesDifTof4DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof5Path0.Text + ";" + l_MeanValuesDifTof5DispPath0.Text + ";" + l_MeanValuesDifTof5DispPath1.Text + ";" + l_MeanValuesDifTof5DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof6Path0.Text + ";" + l_MeanValuesDifTof6DispPath0.Text + ";" + l_MeanValuesDifTof6DispPath1.Text + ";" + l_MeanValuesDifTof6DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof7Path0.Text + ";" + l_MeanValuesDifTof7DispPath0.Text + ";" + l_MeanValuesDifTof7DispPath1.Text + ";" + l_MeanValuesDifTof7DispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof3ZcPath0.Text + ";" + l_MeanValuesDifTof3ZcDispPath0.Text + ";" + l_MeanValuesDifTof3ZcDispPath1.Text + ";" + l_MeanValuesDifTof3ZcDispPath2.Text + ";\n" +
|
|
l_MeanValuesDifTof8ZcPath0.Text + ";" + l_MeanValuesDifTof8ZcDispPath0.Text + ";" + l_MeanValuesDifTof8ZcDispPath1.Text + ";" + l_MeanValuesDifTof8ZcDispPath2.Text + ";\n" +
|
|
l_MeanValuesAmplitudeUpPath0.Text + ";" + l_MeanValuesAmplitudeUpDispPath0.Text + ";" + l_MeanValuesAmplitudeUpDispPath1.Text + ";" + l_MeanValuesAmplitudeUpDispPath2.Text + ";\n" +
|
|
l_MeanValuesAmplitudeUpPath0.Text + ";" + l_MeanValuesAmplitudeUpDispPath0.Text + ";" + l_MeanValuesAmplitudeUpDispPath1.Text + ";" + l_MeanValuesAmplitudeDownDispPath2.Text + ";\n" +
|
|
l_MeanValuesPulsewidthUpPath0.Text + ";" + l_MeanValuesPulsewidthUpDispPath0.Text + ";" + l_MeanValuesPulsewidthUpDispPath1.Text + ";" + l_MeanValuesPulsewidthUpDispPath2.Text + ";\n" +
|
|
l_MeanValuesPulsewidthDownPath0.Text + ";" + l_MeanValuesPulsewidthUpDispPath0.Text + ";" + l_MeanValuesPulsewidthUpDispPath1.Text + ";" + l_MeanValuesPulsewidthDownDispPath2.Text + ";\n" +
|
|
l_MeanValuesTemperaturePath0.Text + ";" + l_MeanValuesTemperatureDispPath0.Text + ";" + l_MeanValuesTemperatureDispPath1.Text + ";" + l_MeanValuesTemperatureDispPath2.Text + ";\n";
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
#region Error
|
|
ErrorLog.Log(LogErrReason.Exception(), "CsvMeanPage() failed", "0x" + ex.HResult.ToString("X", globalCulture), String.Empty);
|
|
#endregion
|
|
|
|
}
|
|
if (replaceUnits)
|
|
{
|
|
Data = Data.Replace(Units.TempDispString, String.Empty);
|
|
Data = Data.Replace(Units.AmpDispString, String.Empty);
|
|
Data = Data.Replace(Units.Flow, String.Empty);
|
|
Data = Data.Replace(Units.TofDispString, String.Empty);
|
|
Data = Data.Replace(Units.DifTofDispString, String.Empty);
|
|
Data = Data.Replace("---", String.Empty);
|
|
}
|
|
return Data;
|
|
}
|
|
private String CsvDecodedDataPage(Boolean replaceUnits)
|
|
{
|
|
String Data = String.Empty;
|
|
|
|
try
|
|
{
|
|
Data =
|
|
l_HccValPath0.Text + ";" + l_HccValDispPath0.Text + ";" + l_HccValDispPath1.Text + ";" + l_HccValDispPath2.Text + ";\n" +
|
|
l_HccCorrectionFactorPath0.Text + ";" + l_HccCorrectionFactorDispPath0.Text + ";" + l_HccCorrectionFactorDispPath1.Text + ";" + l_HccCorrectionFactorDispPath2.Text + ";\n" +
|
|
l_TofSumOfAllUpPath0.Text + ";" + l_TofSumOfAllUpDispPath0.Text + ";" + l_TofSumOfAllUpDispPath1.Text + ";" + l_TofSumOfAllUpDispPath2.Text + ";\n" +
|
|
l_TofSumOfAllDownPath0.Text + ";" + l_TofSumOfAllDownDispPath0.Text + ";" + l_TofSumOfAllDownDispPath1.Text + ";" + l_TofSumOfAllDownDispPath2.Text + ";\n" +
|
|
l_PwUpPath0.Text + ";" + l_PwUpDispPath0.Text + ";" + l_PwUpDispPath1.Text + ";" + l_PwUpDispPath2.Text + ";\n" +
|
|
l_PwDownPath0.Text + ";" + l_PwDownDispPath0.Text + ";" + l_PwDownDispPath1.Text + ";" + l_PwDownDispPath2.Text + ";\n" +
|
|
l_AmpUpPath0.Text + ";" + l_AmpUpDispPath0.Text + ";" + l_AmpUpDispPath1.Text + ";" + l_AmpUpDispPath2.Text + ";\n" +
|
|
l_AmpDownPath0.Text + ";" + l_AmpDownDispPath0.Text + ";" + l_AmpDownDispPath1.Text + ";" + l_AmpDownDispPath2.Text + ";\n" +
|
|
l_Tof0UpPath0.Text + ";" + l_Tof0UpDispPath0.Text + ";" + l_Tof0UpDispPath1.Text + ";" + l_MeanValuesTof0UpDispPath2.Text + ";\n" +
|
|
l_Tof1UpPath0.Text + ";" + l_Tof1UpDispPath0.Text + ";" + l_Tof1UpDispPath1.Text + ";" + l_MeanValuesTof1UpDispPath2.Text + ";\n" +
|
|
l_Tof2UpPath0.Text + ";" + l_Tof2UpDispPath0.Text + ";" + l_Tof2UpDispPath1.Text + ";" + l_MeanValuesTof2UpDispPath2.Text + ";\n" +
|
|
l_Tof3UpPath0.Text + ";" + l_Tof3UpDispPath0.Text + ";" + l_Tof3UpDispPath1.Text + ";" + l_MeanValuesTof3UpDispPath2.Text + ";\n" +
|
|
l_Tof4UpPath0.Text + ";" + l_Tof4UpDispPath0.Text + ";" + l_Tof4UpDispPath1.Text + ";" + l_MeanValuesTof4UpDispPath2.Text + ";\n" +
|
|
l_Tof5UpPath0.Text + ";" + l_Tof5UpDispPath0.Text + ";" + l_Tof5UpDispPath1.Text + ";" + l_MeanValuesTof5UpDispPath2.Text + ";\n" +
|
|
l_Tof6UpPath0.Text + ";" + l_Tof6UpDispPath0.Text + ";" + l_Tof6UpDispPath1.Text + ";" + l_MeanValuesTof6UpDispPath2.Text + ";\n" +
|
|
l_Tof7UpPath0.Text + ";" + l_Tof7UpDispPath0.Text + ";" + l_Tof7UpDispPath1.Text + ";" + l_MeanValuesTof7UpDispPath2.Text + ";\n" +
|
|
l_Tof0DownPath0.Text + ";" + l_Tof0DownDispPath0.Text + ";" + l_Tof0DownDispPath1.Text + ";" + l_Tof0DownDispPath2.Text + ";\n" +
|
|
l_Tof1DownPath0.Text + ";" + l_Tof1DownDispPath0.Text + ";" + l_Tof1DownDispPath1.Text + ";" + l_Tof1DownDispPath2.Text + ";\n" +
|
|
l_Tof2DownPath0.Text + ";" + l_Tof2DownDispPath0.Text + ";" + l_Tof2DownDispPath1.Text + ";" + l_Tof2DownDispPath2.Text + ";\n" +
|
|
l_Tof3DownPath0.Text + ";" + l_Tof3DownDispPath0.Text + ";" + l_Tof3DownDispPath1.Text + ";" + l_Tof3DownDispPath2.Text + ";\n" +
|
|
l_Tof4DownPath0.Text + ";" + l_Tof4DownDispPath0.Text + ";" + l_Tof4DownDispPath1.Text + ";" + l_Tof4DownDispPath2.Text + ";\n" +
|
|
l_Tof5DownPath0.Text + ";" + l_Tof5DownDispPath0.Text + ";" + l_Tof5DownDispPath1.Text + ";" + l_Tof5DownDispPath2.Text + ";\n" +
|
|
l_Tof6DownPath0.Text + ";" + l_Tof6DownDispPath0.Text + ";" + l_Tof6DownDispPath1.Text + ";" + l_Tof6DownDispPath2.Text + ";\n" +
|
|
l_Tof7DownPath0.Text + ";" + l_Tof7DownDispPath0.Text + ";" + l_Tof7DownDispPath1.Text + ";" + l_Tof7DownDispPath2.Text + ";\n" +
|
|
l_DifTof0Path0.Text + ";" + l_DifTof0DispPath0.Text + ";" + l_DifTof0DispPath1.Text + ";" + l_DifTof0DispPath2.Text + ";\n" +
|
|
l_DifTof1Path0.Text + ";" + l_DifTof1DispPath0.Text + ";" + l_DifTof1DispPath1.Text + ";" + l_DifTof1DispPath2.Text + ";\n" +
|
|
l_DifTof2Path0.Text + ";" + l_DifTof2DispPath0.Text + ";" + l_DifTof2DispPath1.Text + ";" + l_DifTof2DispPath2.Text + ";\n" +
|
|
l_DifTof3Path0.Text + ";" + l_DifTof3DispPath0.Text + ";" + l_DifTof3DispPath1.Text + ";" + l_DifTof3DispPath2.Text + ";\n" +
|
|
l_DifTof4Path0.Text + ";" + l_DifTof4DispPath0.Text + ";" + l_DifTof4DispPath1.Text + ";" + l_DifTof4DispPath2.Text + ";\n" +
|
|
l_DifTof5Path0.Text + ";" + l_DifTof5DispPath0.Text + ";" + l_DifTof5DispPath1.Text + ";" + l_DifTof5DispPath2.Text + ";\n" +
|
|
l_DifTof6Path0.Text + ";" + l_DifTof6DispPath0.Text + ";" + l_DifTof6DispPath1.Text + ";" + l_DifTof6DispPath2.Text + ";\n" +
|
|
l_DifTof7Path0.Text + ";" + l_DifTof7DispPath0.Text + ";" + l_DifTof7DispPath1.Text + ";" + l_DifTof7DispPath2.Text + ";\n" +
|
|
l_TemperaturePath0.Text + ";" + l_TemperatureDispPath0.Text + ";" + l_TemperatureDispPath1.Text + ";" + l_TemperatureDispPath2.Text + ";\n" +
|
|
l_FlowPath0.Text + ";" + l_FlowDispPath0.Text + ";" + l_FlowDispPath1.Text + ";" + l_FlowDispPath2.Text + ";\n";
|
|
|
|
|
|
if (replaceUnits)
|
|
{
|
|
Data = Data.Replace(Units.TofDispString, String.Empty);
|
|
Data = Data.Replace(Units.DifTofDispString, String.Empty);
|
|
Data = Data.Replace(Units.TempDispString, String.Empty);
|
|
Data = Data.Replace(Units.AmpDispString, String.Empty);
|
|
Data = Data.Replace(Units.Flow, String.Empty);
|
|
Data = Data.Replace("---", String.Empty);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
#region Error
|
|
ErrorLog.Log(LogErrReason.Exception(), "CsvDecodedDataPage() failed", "0x" + ex.HResult.ToString("X", globalCulture), String.Empty);
|
|
#endregion
|
|
}
|
|
|
|
return Data;
|
|
}
|
|
private String CsvStdDeviationPage(Boolean replaceUnits)
|
|
{
|
|
String Data = String.Empty;
|
|
|
|
try
|
|
{
|
|
Data =
|
|
l_StdDev0PATH0.Text + ";" + l_StdDev0DispPATH0.Text + ";" + l_StdDev0DispPATH1.Text + ";" + l_StdDev0DispPATH2.Text + ";\n" +
|
|
l_StdDev1PATH0.Text + ";" + l_StdDev1DispPATH0.Text + ";" + l_StdDev1DispPATH1.Text + ";" + l_StdDev1DispPATH2.Text + ";\n" +
|
|
l_StdDev2PATH0.Text + ";" + l_StdDev2DispPATH0.Text + ";" + l_StdDev2DispPATH1.Text + ";" + l_StdDev2DispPATH2.Text + ";\n" +
|
|
l_StdDev3PATH0.Text + ";" + l_StdDev3DispPATH0.Text + ";" + l_StdDev3DispPATH1.Text + ";" + l_StdDev3DispPATH2.Text + ";\n" +
|
|
l_StdDev4PATH0.Text + ";" + l_StdDev4DispPATH0.Text + ";" + l_StdDev4DispPATH1.Text + ";" + l_StdDev4DispPATH2.Text + ";\n" +
|
|
l_StdDev5PATH0.Text + ";" + l_StdDev5DispPATH0.Text + ";" + l_StdDev5DispPATH1.Text + ";" + l_StdDev5DispPATH2.Text + ";\n" +
|
|
l_StdDev6PATH0.Text + ";" + l_StdDev6DispPATH0.Text + ";" + l_StdDev6DispPATH1.Text + ";" + l_StdDev6DispPATH2.Text + ";\n" +
|
|
l_StdDev7PATH0.Text + ";" + l_StdDev7DispPATH0.Text + ";" + l_StdDev7DispPATH1.Text + ";" + l_StdDev7DispPATH2.Text + ";\n" +
|
|
l_StdDev8ZeroCrossingsPath0.Text + ";" + l_StdDev8ZeroCrossingsDispPath0.Text + ";" + l_StdDev8ZeroCrossingsDispPath1.Text + ";" + l_StdDev8ZeroCrossingsDispPath2.Text + ";\n" +
|
|
l_StdDev3ZeroCrossingsPath0.Text + ";" + l_StdDev3ZeroCrossingsDispPath0.Text + ";" + l_StdDev3ZeroCrossingsDispPath1.Text + ";" + l_StdDev3ZeroCrossingsDispPath2.Text + ";\n";
|
|
if (replaceUnits)
|
|
{
|
|
Data = Data.Replace(Units.StdDevDispString, String.Empty);
|
|
Data = Data.Replace("---", String.Empty);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
#region Error
|
|
ErrorLog.Log(LogErrReason.Exception(), "CsvStdDeviationPage() failed", "0x" + ex.HResult.ToString("X", globalCulture), String.Empty);
|
|
#endregion
|
|
}
|
|
|
|
return Data;
|
|
|
|
}
|
|
}
|
|
} |