";
+ //
+ // acquisitionPauseButton
+ //
+ this.acquisitionPauseButton.Location = new System.Drawing.Point(116, 18);
+ this.acquisitionPauseButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+ this.acquisitionPauseButton.Name = "acquisitionPauseButton";
+ this.acquisitionPauseButton.Size = new System.Drawing.Size(64, 22);
+ this.acquisitionPauseButton.TabIndex = 6;
+ this.acquisitionPauseButton.Text = "";
+ this.acquisitionPauseButton.UseVisualStyleBackColor = true;
+ this.acquisitionPauseButton.Click += new System.EventHandler(this.acquisitionPauseButton_Click);
//
// intervalLabel
//
- this.intervalLabel.AutoSize = true;
this.intervalLabel.Location = new System.Drawing.Point(7, 50);
this.intervalLabel.Name = "intervalLabel";
this.intervalLabel.Size = new System.Drawing.Size(94, 13);
this.intervalLabel.TabIndex = 10;
- this.intervalLabel.Text = "Intervall: 500ms *";
+ this.intervalLabel.Text = "";
//
// csvFormatGroup
//
@@ -194,7 +193,7 @@ private void InitializeComponent()
this.csvFormatGroup.Size = new System.Drawing.Size(107, 60);
this.csvFormatGroup.TabIndex = 8;
this.csvFormatGroup.TabStop = false;
- this.csvFormatGroup.Text = "CSV-Format";
+ this.csvFormatGroup.Text = "";
//
// csvFormatUSRadio
//
@@ -218,14 +217,13 @@ private void InitializeComponent()
this.csvFormatDERadio.Text = "DE: 0,12; 0,23";
this.csvFormatDERadio.UseVisualStyleBackColor = true;
//
- // acquireStatusLabel
+ // acquisitionStatusLabel
//
- this.acquireStatusLabel.AutoSize = true;
- this.acquireStatusLabel.Location = new System.Drawing.Point(6, 76);
- this.acquireStatusLabel.Name = "acquireStatusLabel";
- this.acquireStatusLabel.Size = new System.Drawing.Size(266, 13);
- this.acquireStatusLabel.TabIndex = 5;
- this.acquireStatusLabel.Text = "Status: Pausiert. Aufzeichnung ({0} seit 1h 25m 13s)";
+ this.acquisitionStatusLabel.Location = new System.Drawing.Point(6, 76);
+ this.acquisitionStatusLabel.Name = "acquisitionStatusLabel";
+ this.acquisitionStatusLabel.Size = new System.Drawing.Size(292, 13);
+ this.acquisitionStatusLabel.TabIndex = 5;
+ this.acquisitionStatusLabel.Text = "";
//
// intervalNumeric
//
@@ -264,7 +262,7 @@ private void InitializeComponent()
this.connectionGroup.Size = new System.Drawing.Size(199, 69);
this.connectionGroup.TabIndex = 0;
this.connectionGroup.TabStop = false;
- this.connectionGroup.Text = "Verbindung";
+ this.connectionGroup.Text = "";
//
// connectButton
//
@@ -272,18 +270,17 @@ private void InitializeComponent()
this.connectButton.Name = "connectButton";
this.connectButton.Size = new System.Drawing.Size(45, 23);
this.connectButton.TabIndex = 3;
- this.connectButton.Text = "Start";
+ this.connectButton.Text = "";
this.connectButton.UseVisualStyleBackColor = true;
this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
//
// connectionStatusLabel
//
- this.connectionStatusLabel.AutoSize = true;
this.connectionStatusLabel.Location = new System.Drawing.Point(6, 45);
this.connectionStatusLabel.Name = "connectionStatusLabel";
- this.connectionStatusLabel.Size = new System.Drawing.Size(103, 13);
+ this.connectionStatusLabel.Size = new System.Drawing.Size(135, 13);
this.connectionStatusLabel.TabIndex = 3;
- this.connectionStatusLabel.Text = "Status: Verbunden";
+ this.connectionStatusLabel.Text = "";
//
// refreshPortsButton
//
@@ -292,18 +289,17 @@ private void InitializeComponent()
this.refreshPortsButton.Name = "refreshPortsButton";
this.refreshPortsButton.Size = new System.Drawing.Size(45, 23);
this.refreshPortsButton.TabIndex = 2;
- this.refreshPortsButton.Text = "Aktualisieren";
+ this.refreshPortsButton.Text = "[";
this.refreshPortsButton.UseVisualStyleBackColor = true;
this.refreshPortsButton.Click += new System.EventHandler(this.refreshPortsButton_Click);
//
// portLabel
//
- this.portLabel.AutoSize = true;
this.portLabel.Location = new System.Drawing.Point(6, 20);
this.portLabel.Name = "portLabel";
this.portLabel.Size = new System.Drawing.Size(31, 13);
this.portLabel.TabIndex = 1;
- this.portLabel.Text = "Port:";
+ this.portLabel.Text = "";
//
// portsListBox
//
@@ -323,7 +319,7 @@ private void InitializeComponent()
this.windowGroup.Size = new System.Drawing.Size(103, 69);
this.windowGroup.TabIndex = 11;
this.windowGroup.TabStop = false;
- this.windowGroup.Text = "Fenster";
+ this.windowGroup.Text = "";
//
// minimizeButton
//
@@ -331,7 +327,7 @@ private void InitializeComponent()
this.minimizeButton.Name = "minimizeButton";
this.minimizeButton.Size = new System.Drawing.Size(87, 23);
this.minimizeButton.TabIndex = 13;
- this.minimizeButton.Text = "Minimieren";
+ this.minimizeButton.Text = "";
this.minimizeButton.UseVisualStyleBackColor = true;
this.minimizeButton.Click += new System.EventHandler(this.minimizeButton_Click);
//
@@ -340,9 +336,9 @@ private void InitializeComponent()
this.topMostCheck.AutoSize = true;
this.topMostCheck.Location = new System.Drawing.Point(11, 18);
this.topMostCheck.Name = "topMostCheck";
- this.topMostCheck.Size = new System.Drawing.Size(71, 17);
+ this.topMostCheck.Size = new System.Drawing.Size(89, 17);
this.topMostCheck.TabIndex = 12;
- this.topMostCheck.Text = "Deckend";
+ this.topMostCheck.Text = "";
this.topMostCheck.UseVisualStyleBackColor = true;
this.topMostCheck.CheckedChanged += new System.EventHandler(this.topMostCheck_CheckedChanged);
//
@@ -388,7 +384,7 @@ private void InitializeComponent()
this.Controls.Add(this.copyrightLabel);
this.Controls.Add(this.windowGroup);
this.Controls.Add(this.connectionGroup);
- this.Controls.Add(this.acquireGroup);
+ this.Controls.Add(this.acquisitionGroup);
this.Controls.Add(this.readoutPanel);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -397,18 +393,16 @@ private void InitializeComponent()
this.MaximizeBox = false;
this.Name = "MainWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "ParksideView v1.1";
+ this.Text = "ParksideView v1.2";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing);
this.readoutLayout.ResumeLayout(false);
this.readoutLayout.PerformLayout();
this.readoutPanel.ResumeLayout(false);
- this.acquireGroup.ResumeLayout(false);
- this.acquireGroup.PerformLayout();
+ this.acquisitionGroup.ResumeLayout(false);
this.csvFormatGroup.ResumeLayout(false);
this.csvFormatGroup.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.intervalNumeric)).EndInit();
this.connectionGroup.ResumeLayout(false);
- this.connectionGroup.PerformLayout();
this.windowGroup.ResumeLayout(false);
this.windowGroup.PerformLayout();
this.ResumeLayout(false);
@@ -423,8 +417,8 @@ private void InitializeComponent()
private System.Windows.Forms.Label modeLabel;
private System.Windows.Forms.Panel readoutPanel;
private System.Windows.Forms.Button recordToggleButton;
- private System.Windows.Forms.GroupBox acquireGroup;
- private System.Windows.Forms.Label acquireStatusLabel;
+ private System.Windows.Forms.GroupBox acquisitionGroup;
+ private System.Windows.Forms.Label acquisitionStatusLabel;
private System.Windows.Forms.NumericUpDown intervalNumeric;
private System.Windows.Forms.GroupBox connectionGroup;
private System.Windows.Forms.Label intervalLabel;
@@ -439,7 +433,7 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox topMostCheck;
private System.Windows.Forms.Label copyrightLabel;
private System.Windows.Forms.Button minimizeButton;
- private System.Windows.Forms.Button acquirePauseButton;
+ private System.Windows.Forms.Button acquisitionPauseButton;
private System.Windows.Forms.Button connectButton;
private System.Windows.Forms.Timer acquireTimer;
private System.Windows.Forms.ProgressBar bargraphBar;
diff --git a/ParksideView/MainWindow.cs b/ParksideView/MainWindow.cs
index d9efcad..23543a4 100644
--- a/ParksideView/MainWindow.cs
+++ b/ParksideView/MainWindow.cs
@@ -8,7 +8,7 @@
namespace ParksideView
{
- public partial class MainWindow : Form
+ internal partial class MainWindow : Form
{
private bool isConnected = false, isPaused = false, isRecording = false, isTimerUpdatePending = false, isAlive = true;
private StringBuilder recordingBuffer = new StringBuilder();
@@ -21,10 +21,25 @@ public MainWindow()
// Initialize the controls
InitializeComponent();
+ // Translate the static parts of the UI
+ // Connection group
+ connectionGroup.Text = Language.ConnectionHeading;
+ portLabel.Text = Language.PortLabel;
+ refreshPortsButton.Text = Language.RefreshButton;
+ // Window group
+ windowGroup.Text = Language.WindowHeading;
+ topMostCheck.Text = Language.TopMostCheckBox;
+ minimizeButton.Text = Language.MinimizeButton;
+ // Acquisition group
+ acquisitionGroup.Text = Language.AcquisitionHeading;
+ intervalLabel.Text = Language.Interval;
+ // CSV group
+ csvFormatGroup.Text = Language.CSVFormatHeading;
+
// Refresh the ports list
RefreshPorts();
- // Setup the UI
+ // Setup the UI (handles translation of the dynamic parts)
ChangeUI(false, false, false);
UpdateTimer();
}
@@ -137,44 +152,44 @@ private void acquireTimer_Tick(object sender, EventArgs e)
switch (sample.Mode)
{
case Mode.Ampere:
- modeLabel.Text = "Strom";
+ modeLabel.Text = Language.ModeCurrent;
break;
case Mode.AmpereMicro:
- modeLabel.Text = "Strom";
+ modeLabel.Text = Language.ModeCurrent;
break;
case Mode.AmpereMilli:
- modeLabel.Text = "Strom";
+ modeLabel.Text = Language.ModeCurrent;
break;
case Mode.ContinuityOhm:
- modeLabel.Text = "Kontinuität";
+ modeLabel.Text = Language.ModeContinuity;
break;
case Mode.DiodeVolt:
- modeLabel.Text = "Diode";
+ modeLabel.Text = Language.ModeDiode;
break;
case Mode.ResistanceOhm:
- modeLabel.Text = "Widerstand";
+ modeLabel.Text = Language.ModeResistance;
break;
case Mode.VoltAC:
- modeLabel.Text = "Spannung (AC)";
+ modeLabel.Text = Language.ModeVoltageAC;
break;
case Mode.VoltDC:
- modeLabel.Text = "Spannung (DC)";
+ modeLabel.Text = Language.ModeVoltageDC;
break;
case Mode.Squarewave:
- modeLabel.Text = "Rechtecksignal";
+ modeLabel.Text = Language.ModeSquarewave;
valueMode = false;
break;
default:
- modeLabel.Text = "Unbekannter Modus!";
+ modeLabel.Text = Language.ModeUnknown;
valueMode = false;
validMode = false;
break;
@@ -296,7 +311,7 @@ private void connectButton_Click(object sender, EventArgs e)
Connect(portName);
}
- private void acquirePauseButton_Click(object sender, EventArgs e)
+ private void acquisitionPauseButton_Click(object sender, EventArgs e)
{
// Toggle the acquisition state
if (isPaused)
@@ -378,8 +393,8 @@ private void CopyValue()
return;
// Ask the user about copying the value into the clipboard
- if (MessageBox.Show(string.Format("Wert \"{0}\" in die Zwischenablage kopieren?", value),
- "Wert kopieren", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
+ if (MessageBox.Show(string.Format(Language.CopyValueText, value),
+ Language.CopyValueTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
Clipboard.SetText(value);
}
@@ -411,11 +426,8 @@ private void RefreshPorts()
catch (Exception ex)
{
// If there was any error, exit, as there is no recovery from this
- MessageBox.Show(string.Format(
- "Abrufen der Portliste fehlgeschlagen!\nDas Programm wird beendet.\n\nFehler: {0}", ex.Message),
- "Kritischer Fehler!",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error);
+ MessageBox.Show(string.Format(Language.PortsListErrorText, ex.Message),
+ Language.PortsListErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}
}
@@ -442,11 +454,8 @@ private void Connect(string portName)
if (error != null)
{
// If there was any error, exit, as there is no recovery from this
- MessageBox.Show(string.Format(
- "Port {0} konnte nicht geöffnet werden!\n\nFehler: {1}", portName, error.Message),
- "Fehler!",
- MessageBoxButtons.OK,
- MessageBoxIcon.Exclamation);
+ MessageBox.Show(string.Format(Language.ConnectionErrorText, portName, error.Message),
+ Language.ConnectionErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
ChangeUI(false);
return;
}
@@ -514,35 +523,35 @@ private void StartRecording()
recordingStart = DateTime.Now;
// Write the model
- recordingBuffer.Append("Model");
+ recordingBuffer.Append(Language.CSVModel);
recordingBuffer.Append(GetCSVDelimiter());
- recordingBuffer.Append("Parkside PDM300 C2");
+ recordingBuffer.Append("Parkside PDM-300-C2");
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendLine();
// Write the version
- recordingBuffer.Append("Software");
+ recordingBuffer.Append(Language.CSVSoftware);
recordingBuffer.Append(GetCSVDelimiter());
- recordingBuffer.AppendFormat("{0} {1} by Benedikt Muessig", Application.ProductName, Application.ProductVersion);
+ recordingBuffer.AppendFormat(Language.CSVVersionFormat, Application.ProductName, Application.ProductVersion);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendLine();
// Write the date
- recordingBuffer.Append("Datum");
+ recordingBuffer.Append(Language.CSVDate);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendFormat("{0:00}.{1:00}.{2:0000}", recordingStart.Day, recordingStart.Month, recordingStart.Year);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendLine();
// Write the time
- recordingBuffer.Append("Uhrzeit");
+ recordingBuffer.Append(Language.CSVTime);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendFormat("{0:00}:{1:00}:{2:00}:{3:000}",
recordingStart.Hour, recordingStart.Minute, recordingStart.Second, recordingStart.Millisecond);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendLine();
- recordingBuffer.Append("Intervall (s)");
+ recordingBuffer.Append(Language.CSVInterval);
recordingBuffer.Append(GetCSVDelimiter());
recordingBuffer.AppendFormat(new NumberFormatInfo() { NumberDecimalSeparator = GetCSVFractionalSeparator().ToString(), NumberDecimalDigits = 2 },
"{0:E}", acquireTimer.Interval / 1000d);
@@ -551,11 +560,11 @@ private void StartRecording()
recordingBuffer.AppendLine();
// Write the CSV header (3 columns)
- recordingBuffer.Append("Zeitdifferenz (s)");
+ recordingBuffer.Append(Language.CSVDelta);
recordingBuffer.Append(GetCSVDelimiter());
- recordingBuffer.Append("Wert");
+ recordingBuffer.Append(Language.CSVValue);
recordingBuffer.Append(GetCSVDelimiter());
- recordingBuffer.Append("Einheit");
+ recordingBuffer.Append(Language.CSVUnit);
recordingBuffer.AppendLine();
// Update the UI
@@ -592,8 +601,8 @@ private void SaveRecording()
while (true)
{
while (recordSaveDialog.ShowDialog() != DialogResult.OK)
- if (MessageBox.Show(string.Format("Möchten Sie wirklich die {0} aufgezeichneten Datenpunkte ungespeichert verwerfen?", recordingCount),
- "Daten verwerfen", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
+ if (MessageBox.Show(string.Format(Language.DiscardDataText, recordingCount), Language.DiscardDataTitle,
+ MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
return;
// Save the data
@@ -606,8 +615,7 @@ private void SaveRecording()
}
catch (Exception)
{
- MessageBox.Show("Speichern fehlgeschlagen!\nBitte versuchen Sie es erneut!", "Speichern fehlgeschlagen",
- MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ MessageBox.Show(Language.SavingFailedText, Language.SavingFailedTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
@@ -644,11 +652,11 @@ private void ChangeUI(bool isConnected, bool isPaused, bool isRecording)
// Decide what to do with the UI
refreshPortsButton.Enabled = !isConnected;
portsListBox.Enabled = !isConnected;
- connectButton.Text = isConnected ? "Stop" : "Start";
- recordToggleButton.Text = (isRecording && isConnected) ? "Speichern" : "Aufzeichnen";
- acquirePauseButton.Text = (isPaused && isConnected) ? "Weiter" : "Pause";
+ connectButton.Text = isConnected ? Language.StopButton : Language.StartButton;
+ recordToggleButton.Text = (isRecording && isConnected) ? Language.SaveButton : Language.RecordButton;
+ acquisitionPauseButton.Text = (isPaused && isConnected) ? Language.ContinueButton : Language.PauseButton;
recordToggleButton.Enabled = isConnected;
- acquirePauseButton.Enabled = isConnected;
+ acquisitionPauseButton.Enabled = isConnected;
csvFormatGroup.Enabled = isConnected && !isRecording;
intervalNumeric.Enabled = !isRecording;
@@ -668,17 +676,17 @@ private void UpdateStatusLabels()
// Handle idle
if (!isConnected)
{
- connectionStatusLabel.Text = "Status: Nicht verbunden.";
- acquireStatusLabel.Text = connectionStatusLabel.Text;
+ connectionStatusLabel.Text = Language.AcqStatusPrefix + Language.AcqStatusDisconnected;
+ acquisitionStatusLabel.Text = connectionStatusLabel.Text;
return;
}
// Always set the connected label
- connectionStatusLabel.Text = "Status: Verbunden.";
+ connectionStatusLabel.Text = Language.AcqStatusPrefix + Language.AcqStatusConnected;
// Assemble the acquire status text
- StringBuilder statusBuilder = new StringBuilder("Status: ");
- statusBuilder.Append(isAlive ? (isPaused ? "Pausiert." : "Laufend.") : "Stumm.");
+ StringBuilder statusBuilder = new StringBuilder(Language.AcqStatusPrefix);
+ statusBuilder.Append(isAlive ? (isPaused ? Language.AcqStatusPaused : Language.AcqStatusRunning) : Language.AcqStatusSilent);
if (isRecording)
{
// Calculate the time that has passed
@@ -686,11 +694,11 @@ private void UpdateStatusLabels()
int seconds = recordingSpan.Seconds, minutes = recordingSpan.Minutes, hours = recordingSpan.Hours + recordingSpan.Days * 24;
// Update the builder
- statusBuilder.AppendFormat(" Aufzeichnung ({0} seit {1:00}h {2:00}m {3:00}s).", recordingCount, hours, minutes, seconds);
+ statusBuilder.AppendFormat(Language.AcqStatusRecording, recordingCount, hours, minutes, seconds);
}
// Apply the label
- acquireStatusLabel.Text = string.Copy(statusBuilder.ToString());
+ acquisitionStatusLabel.Text = string.Copy(statusBuilder.ToString());
statusBuilder.Clear();
}
diff --git a/ParksideView/ParksideView.csproj b/ParksideView/ParksideView.csproj
index 78aee91..9b887a4 100644
--- a/ParksideView/ParksideView.csproj
+++ b/ParksideView/ParksideView.csproj
@@ -25,11 +25,11 @@
4
- x86
+ AnyCPU
pdbonly
true
bin\Release\
- TRACE
+ TRACE;EXTOPT GERMAN
prompt
4
@@ -49,6 +49,7 @@
+
Form
diff --git a/ParksideView/Program.cs b/ParksideView/Program.cs
index 144e077..d8224e9 100644
--- a/ParksideView/Program.cs
+++ b/ParksideView/Program.cs
@@ -3,7 +3,7 @@
namespace ParksideView
{
- static class Program
+ internal static class Program
{
///
/// Application entry point.
diff --git a/ParksideView/Properties/AssemblyInfo.cs b/ParksideView/Properties/AssemblyInfo.cs
index 528e537..d566491 100644
--- a/ParksideView/Properties/AssemblyInfo.cs
+++ b/ParksideView/Properties/AssemblyInfo.cs
@@ -33,6 +33,6 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: NeutralResourcesLanguageAttribute("de-DE")]
]