[chronojump] ChroonpicWizard integrateed with chronopicWin and rest of the software
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ChroonpicWizard integrateed with chronopicWin and rest of the software
- Date: Thu, 8 Sep 2016 15:39:46 +0000 (UTC)
commit 2379da6355ea5057865419e618e2e0c9c34b7213
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Sep 8 17:34:03 2016 +0200
ChroonpicWizard integrateed with chronopicWin and rest of the software
diagrams/classes/chronopicConnection.dia | Bin 4536 -> 5250 bytes
src/gui/chronojump.cs | 44 +++++++++++++++++++++++-------
src/gui/chronopic.cs | 6 ++++
3 files changed, 40 insertions(+), 10 deletions(-)
---
diff --git a/diagrams/classes/chronopicConnection.dia b/diagrams/classes/chronopicConnection.dia
index 2de3d02..cfdd9f7 100644
Binary files a/diagrams/classes/chronopicConnection.dia and b/diagrams/classes/chronopicConnection.dia differ
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 74f7379..555aa1b 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3248,19 +3248,15 @@ public partial class ChronoJumpWindow
//it's not visible at startup
main_menu.Visible = true;
- /*
+
+ //if wizard has been used, mark Chronopic as connected
if(Constants.Menuitem_mode_IsContacts(m) && wizardPortContacts != "")
chronopicWin.Connected = true;
- else if (! Constants.Menuitem_mode_IsContacts(m) && wizardPortEncoder != "")
+ else if(! Constants.Menuitem_mode_IsContacts(m) && wizardPortEncoder != "")
chronopicWin.Connected = true;
- */
-
-//mySp = new SerialPort(myPort);
-//myCp = new Chronopic(mySp);
-//pensar en duplicats de chronopic i serial port
-//connectar amb chronopicInit.Do ?
+ //change multitest firmware or autoDetectChronopic
if(Constants.Menuitem_mode_IsContacts(m))
{
if(chronopicWin.Connected)
@@ -5037,8 +5033,8 @@ public partial class ChronoJumpWindow
{
ArrayList cpd = new ArrayList();
for(int i=1; i<=4;i++) {
- ChronopicPortData a = new ChronopicPortData(i,"",false);
- cpd.Add(a);
+ ChronopicPortData cpdata = new ChronopicPortData(i,"",false);
+ cpd.Add(cpdata);
}
createChronopicWindow(null, cpd, recreate, encoderPort);
}
@@ -6999,7 +6995,35 @@ LogB.Debug("X");
LogB.Information("wizardPortContacts: " + wizardPortContacts);
LogB.Information("wizardPortEncoder: " + wizardPortEncoder);
+
+ /*
+ * createChronopicWindow (pass cp,...)
+ * recreate is true because it has been created on first ChronojumpWindow call
+ */
+ //contacts and encoder
+ if(wizardPortContacts != "")
+ {
+ Chronopic cpW; //cp Wizard
+ chronopicWin.CreateSPifNeeded(wizardPortContacts);
+ cpW = new Chronopic(chronopicWin.SP);
+ ChronopicPortData cpdata = new ChronopicPortData(1, wizardPortContacts, true);
+ ArrayList cpd = new ArrayList();
+ cpd.Add(cpdata);
+
+ if(wizardPortEncoder == "") //no encoder
+ createChronopicWindow(cpW, cpd, true, "");
+ else
+ createChronopicWindow(cpW, cpd, true, wizardPortEncoder);
+ }
+ else { //only encoder
+ createChronopicWindow(true, wizardPortEncoder);
+ }
+ //need to do this because createChronopicWindow does it but relying on menuitem_mode, and now
we are on start page
+ if(wizardPortEncoder != "")
+ chronopicEncoderLabels(true);
+
+ //all the needed info is take. Can destroy wizard window
chronopicWizardWin.HideAndNull();
}
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 6fe1234..71f2203 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -1060,6 +1060,12 @@ public class ChronopicWindow
*/
return encoderPort;
}
+
+ public void CreateSPifNeeded(string port)
+ {
+ if(sp == null)
+ sp = new SerialPort(port);
+ }
public Chronopic CP {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]