diff --git a/pc/CODEC2 GUI/CODEC2 GUI.sln b/pc/CODEC2 GUI/CODEC2 GUI.sln index 95ccb6e..2272084 100644 --- a/pc/CODEC2 GUI/CODEC2 GUI.sln +++ b/pc/CODEC2 GUI/CODEC2 GUI.sln @@ -24,6 +24,7 @@ Global {19634B34-7569-4D1D-8182-B10AC27E13FF}.Debug|x86.ActiveCfg = Debug|x86 {19634B34-7569-4D1D-8182-B10AC27E13FF}.Debug|x86.Build.0 = Debug|x86 {19634B34-7569-4D1D-8182-B10AC27E13FF}.Release|Any CPU.ActiveCfg = Release|x86 + {19634B34-7569-4D1D-8182-B10AC27E13FF}.Release|Any CPU.Build.0 = Release|x86 {19634B34-7569-4D1D-8182-B10AC27E13FF}.Release|x86.ActiveCfg = Release|x86 {19634B34-7569-4D1D-8182-B10AC27E13FF}.Release|x86.Build.0 = Release|x86 {7927817C-D5EF-4A9E-B38E-29668F308343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/pc/CODEC2 GUI/CODEC2 GUI/Form1.cs b/pc/CODEC2 GUI/CODEC2 GUI/Form1.cs index 9baa74e..541d371 100644 --- a/pc/CODEC2 GUI/CODEC2 GUI/Form1.cs +++ b/pc/CODEC2 GUI/CODEC2 GUI/Form1.cs @@ -289,25 +289,38 @@ namespace CODEC2_GUI void slc_WaveformStatusReceived(Slice slc, string status) { - string[] words = status.Split(' '); - - foreach (string kv in words) + if(status.StartsWith("string")) { - string[] tokens = kv.Split('='); - if (tokens.Length != 2) + Debug.WriteLine(status); + string x = "ASDLKFJASLDKJ"; + + int start_pos = status.IndexOf("\""); + // did we find beginning quotes? + if(start_pos < 0) return; // no -- return + + /*int end_pos = status.LastIndexOf("\""); + // did we find ending quotes? + if(end_pos == start_pos) return; // no -- return + */ + start_pos += 1; // ignore beginning quotes + string value = status.Substring(start_pos); + + Control c = FindControlByName(this, "txtIn" + slc.Index); + if (c == null) return; + + TextBox txtbox = c as TextBox; + if (txtbox == null) return; + + if (InvokeRequired) { - Debug.WriteLine("slc_WaveformStatusReceived: Invalid key/value pair (" + kv + ")"); - continue; + Invoke(new MethodInvoker(delegate + { + txtbox.Text = value; + })); } - - string key = tokens[0]; - string value = tokens[1]; - - switch (key) + else { - case "string": - // TODO: update the string - break; + txtbox.Text = value; } } }