examples/DS401_Slave_Gui/main.cpp
author Edouard Tisserant
Thu, 24 Jan 2019 13:53:01 +0100
changeset 808 de1fc3261f21
parent 641 404a51700f40
permissions -rw-r--r--
Adding -fPIC isn't necessary of xeno-config is set correctly. Backed out changeset b9f1fcda7d30
641
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
     1
#if defined(WIN32) && !defined(__CYGWIN__)
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
     2
#include <windows.h>
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
     3
#include "getopt.h"
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
     4
#endif
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
     5
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
     6
#include <wx/wxprec.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
     7
#include <wx/wx.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
     8
#include <wx/textctrl.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
     9
#include <wx/spinctrl.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    10
#include <wx/tglbtn.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    11
#include <wx/slider.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    12
#include <iostream>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    13
#include <wx/brush.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    14
#include <sstream>
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    15
#include <string.h>
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    16
#include <wx/listbox.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    17
#include <wx/dynarray.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    18
#include <wx/dcclient.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    19
#include <wx/gauge.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    20
#include <wx/spinctrl.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    21
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    22
//#include "monicone.xpm"
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    23
641
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    24
//#if defined(WIN32) && !defined(__CYGWIN__)
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    25
//#include <windows.h>
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    26
//extern "C"
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    27
//{
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    28
//#include "getopt.h"
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    29
//}
404a51700f40 CHANGED: - moved wxwidget header
Christian Taedcke <Christian.Taedcke@ica-traffic.de>
parents: 615
diff changeset
    30
//#endif
329
7717252e3ed9 Changes to compile for win32
greg
parents: 316
diff changeset
    31
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    32
#include "main.h"
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    33
#include "TestSlaveGui.h"
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    34
extern "C"
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    35
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    36
#include "canfestival.h"
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    37
#include "ObjDict.h"
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    38
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    39
#include "wx/wxprec.h"
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    40
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    41
#ifdef __BORLANDC__
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    42
#pragma hdrstop
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    43
#endif
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    44
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    45
#ifndef WX_PRECOMP
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    46
#include "wx/wx.h"
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    47
#endif
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    48
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    49
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    50
wxTextCtrl *textLog;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    51
int node_id_ext;
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    52
int to_start = 0;
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
    53
int openInput = 0;
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
    54
int openOutput = 0;
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
    55
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    56
MyFrame *frame;
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    57
#define MAXLENGTH_BUSNAME 32
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    58
#define MAXLENGTH_BAUDRATE 8
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    59
char _busname[MAXLENGTH_BUSNAME] = "vcan0";
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    60
char _baudrate[MAXLENGTH_BAUDRATE] = "500K";
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    61
s_BOARD SlaveBoard = { _busname, _baudrate };
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    62
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
    63
#define MAXLENGTH_LIBPATH 1024
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
    64
char LibraryPath[MAXLENGTH_LIBPATH] = "libcanfestival_can_virtual.so";
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    65
331
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    66
#if defined(WIN32)
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    67
#define LIB_EXTENT wxT("*.dll")
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    68
#else
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    69
#define LIB_EXTENT wxT("*.so")
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    70
#endif
da55aa2f9e64 Minor changes, mostly PCAN/windows related.
etisserant
parents: 329
diff changeset
    71
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    72
// Declare some IDs. These are arbitrary.
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    73
const int BOOKCTRL = 100;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    74
const int FILE_QUIT = wxID_EXIT;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    75
const int HELP_ABOUT = wxID_ABOUT;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    76
const int ADD = 105;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    77
const int REMOVE = 108;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    78
const int QUIT = 109;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    79
const int FREQBOX = 110;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    80
const int START = 112;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    81
const int TEXTBOX1 = 113;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    82
const int STOP = 114;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    83
const int LOAD = 115;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    84
const int INBT1 = 118;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    85
const int INBT2 = 119;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    86
const int INBT3 = 120;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    87
const int INBT4 = 121;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    88
const int INBT5 = 122;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    89
const int INBT6 = 123;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    90
const int INBT7 = 124;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    91
const int INBT8 = 125;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    92
const int INS1 = 126;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    93
const int INS2 = 127;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    94
const int INS3 = 128;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    95
const int INS4 = 129;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    96
const int INS5 = 135;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    97
const int INS6 = 136;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    98
const int INS7 = 137;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    99
const int INS8 = 138;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   100
const int TIMER_ID = 130;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   101
const int INST1 = 131;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   102
const int INST2 = 132;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   103
const int INST3 = 133;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   104
const int INST4 = 134;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   105
const int INST5 = 135;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   106
const int INST6 = 136;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   107
const int INST7 = 137;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   108
const int INST8 = 138;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   109
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   110
// Attach the event handlers. Put this after MyFrame declaration.
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   111
BEGIN_EVENT_TABLE (MyFrame, wxFrame)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   112
EVT_BUTTON (STOP, MyFrame::OnStop)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   113
EVT_BUTTON (LOAD, MyFrame::OnLoad)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   114
EVT_BUTTON (START, MyFrame::OnStart)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   115
EVT_TOGGLEBUTTON (INBT1, MyFrame::OnInbt1)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   116
EVT_TOGGLEBUTTON (INBT2, MyFrame::OnInbt2)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   117
EVT_TOGGLEBUTTON (INBT3, MyFrame::OnInbt3)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   118
EVT_TOGGLEBUTTON (INBT4, MyFrame::OnInbt4)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   119
EVT_TOGGLEBUTTON (INBT5, MyFrame::OnInbt5)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   120
EVT_TOGGLEBUTTON (INBT6, MyFrame::OnInbt6)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   121
EVT_TOGGLEBUTTON (INBT7, MyFrame::OnInbt7)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   122
EVT_TOGGLEBUTTON (INBT8, MyFrame::OnInbt8)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   123
EVT_COMMAND_SCROLL (INS1, MyFrame::OnIns1)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   124
EVT_COMMAND_SCROLL (INS2, MyFrame::OnIns2)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   125
EVT_COMMAND_SCROLL (INS3, MyFrame::OnIns3)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   126
EVT_COMMAND_SCROLL (INS4, MyFrame::OnIns4)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   127
EVT_COMMAND_SCROLL (INS5, MyFrame::OnIns5)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   128
EVT_COMMAND_SCROLL (INS6, MyFrame::OnIns6)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   129
EVT_COMMAND_SCROLL (INS7, MyFrame::OnIns7)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   130
EVT_COMMAND_SCROLL (INS8, MyFrame::OnIns8)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   131
EVT_SPINCTRL (INST1, MyFrame::OnInst1)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   132
EVT_SPINCTRL (INST2, MyFrame::OnInst2)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   133
EVT_SPINCTRL (INST3, MyFrame::OnInst3)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   134
EVT_SPINCTRL (INST4, MyFrame::OnInst4)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   135
EVT_SPINCTRL (INST5, MyFrame::OnInst5)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   136
EVT_SPINCTRL (INST6, MyFrame::OnInst6)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   137
EVT_SPINCTRL (INST7, MyFrame::OnInst7)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   138
EVT_SPINCTRL (INST8, MyFrame::OnInst8)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   139
EVT_LISTBOX (FREQBOX, MyFrame::OnFreqBoxClick)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   140
EVT_MENU (FILE_QUIT, MyFrame::OnQuit)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   141
EVT_BUTTON (QUIT, MyFrame::OnQuit) EVT_MENU (HELP_ABOUT, MyFrame::OnAbout)
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   142
EVT_TIMER (TIMER_ID, MyFrame::OnTimer)
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   143
END_EVENT_TABLE ()IMPLEMENT_APP_NO_MAIN (MyApp);
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   144
IMPLEMENT_WX_THEME_SUPPORT;
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   145
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   146
     void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   147
     help ()
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   148
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   149
  printf ("**************************************************************\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   150
  printf ("*  DS-401 Slave GUI                                          *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   151
  printf ("*                                                            *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   152
  printf ("*   Usage:                                                   *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   153
  printf ("*   ./DS401_Slave_Gui [OPTIONS]                              *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   154
  printf ("*                                                            *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   155
  printf ("*   OPTIONS:                                                 *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   156
  printf
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   157
    ("*     -l : Can library [\"libcanfestival_can_virtual.so\"]     *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   158
  printf ("*                                                            *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   159
  printf ("*    Slave:                                                  *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   160
  printf ("*     -i : Node id format [0x01 , 0x7F]                      *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   161
  printf ("*                                                            *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   162
  printf ("*    CAN bus:                                                *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   163
  printf
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   164
    ("*     -b : bus name [\"1\"]                                    *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   165
  printf ("*     -B : 1M,500K,250K,125K,100K,50K,20K,10K                *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   166
  printf ("*                                                            *\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   167
  printf ("**************************************************************\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   168
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   169
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   170
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   171
int
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   172
main (int argc, char **argv)
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   173
{
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   174
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   175
  int c;
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   176
  extern char *optarg;
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   177
  char *snodeid;
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   178
  while ((c = getopt (argc, argv, "-b:B:l:i:sIO")) != EOF)
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   179
    {
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   180
      switch (c)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   181
	{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   182
	case 'b':
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   183
	  if (optarg[0] == 0)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   184
	    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   185
	      help ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   186
	      exit (1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   187
	    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   188
	  SlaveBoard.busname = optarg;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   189
	  break;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   190
	case 'B':
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   191
	  if (optarg[0] == 0)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   192
	    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   193
	      help ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   194
	      exit (1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   195
	    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   196
	  SlaveBoard.baudrate = optarg;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   197
	  break;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   198
	case 'l':
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   199
	  if (optarg[0] == 0)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   200
	    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   201
	      help ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   202
	      exit (1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   203
	    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   204
	  strncpy (LibraryPath, optarg, MAXLENGTH_LIBPATH);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   205
	  break;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   206
	case 'i':
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   207
	  if (optarg[0] == 0)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   208
	    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   209
	      help ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   210
	      exit (1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   211
	    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   212
	  snodeid = optarg;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   213
	  sscanf (snodeid, "%x", &node_id_ext);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   214
	  break;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   215
	case 's':
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   216
	  to_start = 1;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   217
	  break;
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   218
	case 'I':
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   219
	  openInput = 1;
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   220
	  break;
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   221
	case 'O':
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   222
	  openOutput = 1;
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   223
	  break;
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   224
	default:
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   225
	  help ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   226
	  exit (1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   227
	}
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   228
    }
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   229
  wxEntry (argc, argv);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   230
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   231
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   232
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   233
bool
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   234
MyApp::OnInit ()
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   235
{
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   236
  frame = new MyFrame (wxString::Format(wxT("CanOpen virtual DS-401 - Id : %d"),node_id_ext));
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   237
  frame->Show (true);
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   238
  if(openInput) frame->book->SetSelection(2);
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   239
  else if(openOutput) frame->book->SetSelection(3);
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   240
  return true;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   241
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   242
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   243
MyFrame::MyFrame (const wxString & title):wxFrame (NULL, wxID_ANY, title, wxDefaultPosition, wxSize (800, 740),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   244
	 wxDEFAULT_FRAME_STYLE, wxT ("frame")), m_timer (this,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   245
							 TIMER_ID)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   246
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   247
  wxMenu *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   248
    fileMenu = new wxMenu;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   249
  wxMenu *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   250
    helpMenu = new wxMenu;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   251
  wxPanel *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   252
    panel;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   253
  wxButton *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   254
    quit;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   255
  wxButton *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   256
    load;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   257
  wxBoxSizer *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   258
    mysizer;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   259
  wxBoxSizer *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   260
    mysssizer;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   261
  wxBoxSizer *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   262
    myhsizer;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   263
  wxBoxSizer *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   264
    mybsizer;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   265
  wxBoxSizer *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   266
    myentrysizer;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   267
  wxListBox *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   268
    freqlist;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   269
  wxStaticBox *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   270
    namebox;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   271
  wxStaticBox *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   272
    freqbox;
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   273
295
25ff2fadff89 DS401 Slave GUI : Added command line interface, cleaned up parts of code, added EDS.
etisserant
parents: 246
diff changeset
   274
// SetIcon(wxICON(monicone));
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   275
  SetBackgroundColour (wxSystemSettings::GetColour (wxSYS_COLOUR_BTNFACE));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   276
  helpMenu->Append (HELP_ABOUT, _T ("&About...\tF1"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   277
		    _T ("Show about dialog"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   278
  fileMenu->Append (FILE_QUIT, _T ("E&xit\tAlt-X"), _T ("Quit this program"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   279
  wxMenuBar *
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   280
    menuBar = new wxMenuBar ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   281
  menuBar->Append (fileMenu, _T ("&File"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   282
  menuBar->Append (helpMenu, _T ("&Help"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   283
  SetMenuBar (menuBar);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   284
  CreateStatusBar (2);
615
1eec2f9a7f5f Wiped out references to Lolitech
edouard
parents: 407
diff changeset
   285
  SetStatusText (_T ("DS-401 GUI."), 0);
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   286
  SetStatusText (_T ("Welcome."), 1);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   287
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   288
  book = new wxNotebook (this, BOOKCTRL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   289
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   290
  panel = new wxPanel (book);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   291
  book->AddPage (panel, _T ("Configuration"), true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   292
  mysizer = new wxBoxSizer (wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   293
  panel->SetSizer (mysizer);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   294
  wxString
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   295
    choices[] = {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   296
    _T ("10K"), _T ("20K"), _T ("50K"), _T ("100K"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   297
    _T ("125K"), _T ("250K"), _T ("500K"), _T ("1M")
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   298
  };
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   299
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   300
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   301
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   302
			  wxStaticBox (panel, wxID_ANY, _T ("Bus driver")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   303
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   304
  mysizer->Add (myhsizer, 0, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   305
  load = new wxButton (panel, LOAD, _T ("Load can driver"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   306
  myhsizer->Add (load, 0, wxLEFT, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   307
  drivername =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   308
    new wxTextCtrl (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   309
		    wxString ((const char *) LibraryPath, wxConvLocal));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   310
  myhsizer->Add (drivername, 1, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   311
  myentrysizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   312
  mysizer->Add (myentrysizer, 0, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   313
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   314
    new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T ("Bus name")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   315
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   316
  myentrysizer->Add (myhsizer, 0, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   317
  busname =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   318
    new wxTextCtrl (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   319
		    wxString ((const char *) SlaveBoard.busname,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   320
			      wxConvLocal));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   321
  myhsizer->Add (busname, 0, wxLEFT, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   322
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   323
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   324
			  wxStaticBox (panel, wxID_ANY,
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   325
				       _T ("Node ID (Decimal)")), wxHORIZONTAL);
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   326
  myentrysizer->Add (myhsizer, 0, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   327
  node_id =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   328
    new wxSpinCtrl (panel, wxID_ANY, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   329
		    wxDefaultSize, wxSP_ARROW_KEYS, 1, 127, node_id_ext,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   330
		    _T ("wxSpinCtrl"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   331
  myhsizer->Add (node_id, 0, wxRIGHT, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   332
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   333
    new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T ("Baudrate")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   334
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   335
  mysizer->Add (myhsizer, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   336
  freqlist =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   337
    new wxListBox (panel, FREQBOX, wxDefaultPosition, wxDefaultSize, 8,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   338
		   choices, wxLB_SINGLE | wxLB_HSCROLL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   339
  myhsizer->Add (freqlist, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   340
  quit = new wxButton (panel, QUIT, _T ("QUIT"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   341
  mysizer->Add (quit, 0, wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   342
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   343
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   344
  panel = new wxPanel (book);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   345
  book->AddPage (panel, wxT ("Inputs"), true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   346
  mysizer = new wxBoxSizer (wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   347
  panel->SetSizer (mysizer);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   348
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   349
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   350
			  wxStaticBox (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   351
				       _T ("Read Inputs UNSIGNED8")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   352
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   353
  mysizer->Add (myhsizer, 0, wxEXPAND | wxALL, 30);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   354
  inbt1 = new wxToggleButton (panel, INBT1, wxT ("1"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   355
  inbt2 = new wxToggleButton (panel, INBT2, wxT ("2"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   356
  inbt3 = new wxToggleButton (panel, INBT3, wxT ("3"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   357
  inbt4 = new wxToggleButton (panel, INBT4, wxT ("4"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   358
  inbt5 = new wxToggleButton (panel, INBT5, wxT ("5"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   359
  inbt6 = new wxToggleButton (panel, INBT6, wxT ("6"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   360
  inbt7 = new wxToggleButton (panel, INBT7, wxT ("7"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   361
  inbt8 = new wxToggleButton (panel, INBT8, wxT ("8"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   362
  myhsizer->Add (inbt1, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   363
  myhsizer->Add (inbt2, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   364
  myhsizer->Add (inbt3, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   365
  myhsizer->Add (inbt4, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   366
  myhsizer->Add (inbt5, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   367
  myhsizer->Add (inbt6, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   368
  myhsizer->Add (inbt7, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   369
  myhsizer->Add (inbt8, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   370
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   371
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   372
			  wxStaticBox (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   373
				       _T ("Analogue Inputs INTEGER16")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   374
			  wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   375
  mysizer->Add (myhsizer, wxEXPAND | wxALL, wxEXPAND | wxALL, 30);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   376
  mysssizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   377
  myhsizer->Add (mysssizer, 0, wxEXPAND | wxALL, 0);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   378
  inst1 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   379
    new wxSpinCtrl (panel, INST1, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   380
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   381
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   382
  inst2 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   383
    new wxSpinCtrl (panel, INST2, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   384
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   385
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   386
  inst3 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   387
    new wxSpinCtrl (panel, INST3, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   388
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   389
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   390
  inst4 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   391
    new wxSpinCtrl (panel, INST4, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   392
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   393
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   394
  inst5 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   395
    new wxSpinCtrl (panel, INST5, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   396
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   397
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   398
  inst6 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   399
    new wxSpinCtrl (panel, INST6, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   400
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   401
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   402
  inst7 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   403
    new wxSpinCtrl (panel, INST7, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   404
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   405
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   406
  inst8 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   407
    new wxSpinCtrl (panel, INST8, wxEmptyString, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   408
		    wxDefaultSize, wxSP_ARROW_KEYS, -32768, 32767, 0,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   409
		    _T ("0"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   410
  mysssizer->Add (inst1, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   411
  mysssizer->Add (inst2, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   412
  mysssizer->Add (inst3, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   413
  mysssizer->Add (inst4, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   414
  mysssizer->Add (inst5, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   415
  mysssizer->Add (inst6, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   416
  mysssizer->Add (inst7, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   417
  mysssizer->Add (inst8, wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   418
  mysssizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   419
  myhsizer->Add (mysssizer, wxEXPAND | wxALL, wxEXPAND | wxALL, 0);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   420
  ins1 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   421
    new wxSlider (panel, INS1, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   422
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   423
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   424
  ins2 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   425
    new wxSlider (panel, INS2, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   426
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   427
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   428
  ins3 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   429
    new wxSlider (panel, INS3, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   430
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   431
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   432
  ins4 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   433
    new wxSlider (panel, INS4, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   434
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   435
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   436
  ins5 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   437
    new wxSlider (panel, INS5, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   438
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   439
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   440
  ins6 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   441
    new wxSlider (panel, INS6, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   442
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   443
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   444
  ins7 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   445
    new wxSlider (panel, INS7, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   446
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   447
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   448
  ins8 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   449
    new wxSlider (panel, INS8, 0, -32768, 32767, wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   450
		  wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   451
		  wxDefaultValidator, wxT ("slider"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   452
  mysssizer->Add (ins1, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   453
  mysssizer->Add (ins2, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   454
  mysssizer->Add (ins3, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   455
  mysssizer->Add (ins4, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   456
  mysssizer->Add (ins5, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   457
  mysssizer->Add (ins6, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   458
  mysssizer->Add (ins7, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   459
  mysssizer->Add (ins8, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   460
  quit = new wxButton (panel, QUIT, _T ("QUIT"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   461
  mysizer->Add (quit, 0, wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   462
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   463
  panel = new wxPanel (book);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   464
  book->AddPage (panel, wxT ("Outputs"), true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   465
  mysizer = new wxBoxSizer (wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   466
  panel->SetSizer (mysizer);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   467
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   468
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   469
			  wxStaticBox (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   470
				       _T ("Write Outputs UNSIGNED8")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   471
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   472
  mysizer->Add (myhsizer, 0, wxEXPAND | wxALL, 30);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   473
  outbt1 = new wxToggleButton (panel, wxID_ANY, wxT ("1"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   474
  outbt2 = new wxToggleButton (panel, wxID_ANY, wxT ("2"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   475
  outbt3 = new wxToggleButton (panel, wxID_ANY, wxT ("3"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   476
  outbt4 = new wxToggleButton (panel, wxID_ANY, wxT ("4"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   477
  outbt5 = new wxToggleButton (panel, wxID_ANY, wxT ("5"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   478
  outbt6 = new wxToggleButton (panel, wxID_ANY, wxT ("6"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   479
  outbt7 = new wxToggleButton (panel, wxID_ANY, wxT ("7"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   480
  outbt8 = new wxToggleButton (panel, wxID_ANY, wxT ("8"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   481
  myhsizer->Add (outbt1, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   482
  myhsizer->Add (outbt2, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   483
  myhsizer->Add (outbt3, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   484
  myhsizer->Add (outbt4, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   485
  myhsizer->Add (outbt5, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   486
  myhsizer->Add (outbt6, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   487
  myhsizer->Add (outbt7, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   488
  myhsizer->Add (outbt8, wxEXPAND | wxALL, 0, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   489
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   490
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   491
			  wxStaticBox (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   492
				       _T ("Analogue Output INTEGER16")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   493
			  wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   494
  mysizer->Add (myhsizer, wxEXPAND | wxALL, wxEXPAND | wxALL, 30);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   495
  mysssizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   496
  myhsizer->Add (mysssizer, 0, wxEXPAND | wxALL, 0);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   497
  outst1 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   498
    new wxStaticText (panel, wxID_ANY, wxT ("label"), wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   499
		      wxDefaultSize, 0, wxT ("staticText"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   500
  outst2 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   501
    new wxStaticText (panel, wxID_ANY, wxT ("label"), wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   502
		      wxDefaultSize, 0, wxT ("staticText"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   503
  outst3 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   504
    new wxStaticText (panel, wxID_ANY, wxT ("label"), wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   505
		      wxDefaultSize, 0, wxT ("staticText"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   506
  outst4 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   507
    new wxStaticText (panel, wxID_ANY, wxT ("label"), wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   508
		      wxDefaultSize, 0, wxT ("staticText"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   509
  mysssizer->Add (outst1, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   510
  mysssizer->Add (outst2, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   511
  mysssizer->Add (outst3, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   512
  mysssizer->Add (outst4, wxEXPAND | wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   513
  mysssizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   514
  myhsizer->Add (mysssizer, wxEXPAND | wxALL, wxEXPAND | wxALL, 0);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   515
  outs1 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   516
    new wxGauge (panel, wxID_ANY, 65535, wxDefaultPosition, wxDefaultSize,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   517
		 wxSL_VERTICAL | wxSL_INVERSE, wxDefaultValidator,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   518
		 wxT ("gauge"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   519
  outs2 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   520
    new wxGauge (panel, wxID_ANY, 65535, wxDefaultPosition, wxDefaultSize,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   521
		 wxSL_VERTICAL | wxSL_INVERSE, wxDefaultValidator,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   522
		 wxT ("gauge"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   523
  outs3 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   524
    new wxGauge (panel, wxID_ANY, 65535, wxDefaultPosition, wxDefaultSize,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   525
		 wxSL_VERTICAL | wxSL_INVERSE, wxDefaultValidator,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   526
		 wxT ("gauge"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   527
  outs4 =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   528
    new wxGauge (panel, wxID_ANY, 65535, wxDefaultPosition, wxDefaultSize,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   529
		 wxSL_VERTICAL | wxSL_INVERSE, wxDefaultValidator,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   530
		 wxT ("gauge"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   531
  mysssizer->Add (outs1, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   532
  mysssizer->Add (outs2, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   533
  mysssizer->Add (outs3, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   534
  mysssizer->Add (outs4, wxEXPAND | wxALL, wxEXPAND | wxALL, 15);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   535
  quit = new wxButton (panel, QUIT, _T ("QUIT"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   536
  mysizer->Add (quit, 0, wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   537
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   538
  wxString
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   539
    choice[] = {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   540
    _T ("Analogue Out 1"), _T ("Analogue Out 2"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   541
    _T ("Analogue Out 3"), _T ("Analogue Out 4"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   542
    _T ("Bool Out 1"), _T ("Bool Out 2"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   543
    _T ("Bool Out 3"), _T ("Bool Out 4"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   544
    _T ("Bool Out 5"), _T ("Bool Out 6"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   545
    _T ("Bool Out 7"), _T ("Bool Out 8"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   546
    _T ("Analogue Input 1"), _T ("Analogue Input 2"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   547
    _T ("Analogue Input 3"), _T ("Analogue Input 4"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   548
    _T ("Analogue Input 5"), _T ("Analogue Input 6"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   549
    _T ("Analogue Input 7"), _T ("Analogue Input 8"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   550
    _T ("Bool Input 1"), _T ("Bool Input 2"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   551
    _T ("Bool Input 3"), _T ("Bool Input 4"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   552
    _T ("Bool Input 5"), _T ("Bool Input 6"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   553
    _T ("Bool Input 7"), _T ("Bool Input 8"),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   554
  };
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   555
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   556
  panel = new wxPanel (book);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   557
  book->InsertPage (0, panel, wxT ("Control"), true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   558
  mysizer = new wxBoxSizer (wxVERTICAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   559
  panel->SetSizer (mysizer);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   560
  myhsizer = new wxBoxSizer (wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   561
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   562
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   563
			  wxStaticBox (panel, wxID_ANY,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   564
				       _T ("Control your node")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   565
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   566
  mysizer->Add (myhsizer, 0, wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   567
  start = new wxButton (panel, START, _T ("START"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   568
  stop = new wxButton (panel, STOP, _T ("STOP"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   569
  stop->Enable (false);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   570
  myhsizer->Add (start, 0, wxRIGHT, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   571
  myhsizer->Add (stop, 0, wxLEFT, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   572
  myhsizer =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   573
    new wxStaticBoxSizer (new
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   574
			  wxStaticBox (panel, wxID_ANY, _T ("Operation log")),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   575
			  wxHORIZONTAL);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   576
  mysizer->Add (myhsizer, wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   577
  textLog =
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   578
    new wxTextCtrl (panel, TEXTBOX1, _T (""), wxDefaultPosition,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   579
		    wxDefaultSize, wxTE_MULTILINE, wxDefaultValidator,
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   580
		    wxTextCtrlNameStr);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   581
  myhsizer->Add (textLog, wxALL, wxEXPAND | wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   582
  quit = new wxButton (panel, QUIT, _T ("QUIT"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   583
  mysizer->Add (quit, 0, wxALL, 5);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   584
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   585
  m_timer.Start (100);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   586
  if (to_start)
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   587
    {
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   588
      Start ();
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   589
    }
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   590
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   591
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   592
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   593
MyFrame::OnQuit (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   594
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   595
  Close (true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   596
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   597
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   598
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   599
MyFrame::Start ()
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   600
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   601
  if (main_can (SlaveBoard, LibraryPath))
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   602
    {
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   603
      printf ("[KO]\n");
407
384c3cd7afa2 Fixed some win32 stdout related problems. May not worl wit visualstudio debug log anymore.
etisserant
parents: 385
diff changeset
   604
      fflush(stdout);
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   605
      *textLog <<
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   606
	wxT
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   607
	("----------------------------------------------------Initialization [KO]\n");
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   608
    }
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   609
  else
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   610
    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   611
      printf ("[OK]\n");
407
384c3cd7afa2 Fixed some win32 stdout related problems. May not worl wit visualstudio debug log anymore.
etisserant
parents: 385
diff changeset
   612
      fflush(stdout);
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   613
      *textLog <<
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   614
	wxT
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   615
	("----------------------------------------------------Initialization [OK]\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   616
      stop->Enable (true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   617
      start->Enable (false);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   618
    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   619
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   620
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   621
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   622
MyFrame::OnStart (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   623
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   624
  wxString s;
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   625
  
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   626
  node_id_ext = node_id->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   627
  s = busname->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   628
  strncpy (SlaveBoard.busname, s.mb_str (), MAXLENGTH_BUSNAME);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   629
  *textLog << wxT ("-- Bus name: ------> ") << s << wxT ("\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   630
  *textLog << wxT ("-- Node ID: -------> ") << node_id->
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   631
    GetValue () << wxT ("\n");
385
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   632
  SetTitle(wxString::Format(wxT("CanOpen virtual DS-401 - Id : %d"),node_id->
fff25f16c923 Cleaned DS-401GUI (definitively removed graph) added options to open directly on the right Input or Output page. Little fixes.
etisserant
parents: 382
diff changeset
   633
		    GetValue ()));
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   634
  Start ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   635
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   636
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   637
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   638
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   639
MyFrame::OnStop (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   640
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   641
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   642
  *textLog <<
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   643
    wxT
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   644
    ("----------------------------------------------------Slave [STOPPED]") <<
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   645
    wxT ("\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   646
  stop_slave ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   647
  stop->Enable (false);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   648
  start->Enable (true);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   649
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   650
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   651
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   652
MyFrame::OnLoad (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   653
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   654
  wxFileDialog fd (this, wxT ("Choose a can driver library"), wxT (""),
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   655
		   wxT (""), LIB_EXTENT);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   656
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   657
  if (fd.ShowModal () == wxID_OK)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   658
    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   659
      drivername->Clear ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   660
      drivername->AppendText (fd.GetPath ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   661
      *textLog << wxT ("LibraryPath: ") << fd.GetPath () << wxT ("\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   662
      strncpy (LibraryPath, fd.GetPath ().mb_str (), MAXLENGTH_LIBPATH);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   663
      printf ("path=%s", LibraryPath);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   664
    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   665
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   666
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   667
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   668
MyFrame::OnInbt1 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   669
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   670
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x1;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   671
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   672
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   673
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   674
MyFrame::OnInbt2 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   675
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   676
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x2;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   677
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   678
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   679
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   680
MyFrame::OnInbt3 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   681
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   682
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x4;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   683
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   684
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   685
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   686
MyFrame::OnInbt4 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   687
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   688
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x8;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   689
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   690
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   691
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   692
MyFrame::OnInbt5 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   693
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   694
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x10;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   695
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   696
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   697
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   698
MyFrame::OnInbt6 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   699
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   700
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x20;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   701
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   702
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   703
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   704
MyFrame::OnInbt7 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   705
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   706
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x40;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   707
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   708
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   709
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   710
MyFrame::OnInbt8 (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   711
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   712
  Read_Inputs_8_Bit[0] = Read_Inputs_8_Bit[0] ^ 0x80;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   713
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   714
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   715
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   716
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   717
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   718
MyFrame::OnIns1 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   719
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   720
  Read_Analogue_Input_16_Bit[0] = ins1->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   721
  inst1->SetValue (ins1->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   722
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   723
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   724
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   725
MyFrame::OnIns2 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   726
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   727
  Read_Analogue_Input_16_Bit[1] = ins2->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   728
  inst2->SetValue (ins2->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   729
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   730
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   731
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   732
MyFrame::OnIns3 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   733
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   734
  Read_Analogue_Input_16_Bit[2] = ins3->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   735
  inst3->SetValue (ins3->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   736
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   737
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   738
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   739
MyFrame::OnIns4 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   740
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   741
  Read_Analogue_Input_16_Bit[3] = ins4->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   742
  inst4->SetValue (ins4->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   743
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   744
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   745
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   746
MyFrame::OnIns5 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   747
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   748
  Read_Analogue_Input_16_Bit[4] = ins5->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   749
  inst5->SetValue (ins5->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   750
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   751
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   752
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   753
MyFrame::OnIns6 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   754
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   755
  Read_Analogue_Input_16_Bit[5] = ins6->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   756
  inst6->SetValue (ins6->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   757
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   758
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   759
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   760
MyFrame::OnIns7 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   761
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   762
  Read_Analogue_Input_16_Bit[6] = ins7->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   763
  inst7->SetValue (ins7->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   764
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   765
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   766
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   767
MyFrame::OnIns8 (wxScrollEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   768
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   769
  Read_Analogue_Input_16_Bit[7] = ins8->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   770
  inst8->SetValue (ins8->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   771
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   772
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   773
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   774
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   775
MyFrame::OnInst1 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   776
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   777
  Read_Analogue_Input_16_Bit[0] = inst1->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   778
  ins1->SetValue (inst1->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   779
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   780
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   781
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   782
MyFrame::OnInst2 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   783
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   784
  Read_Analogue_Input_16_Bit[1] = inst2->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   785
  ins2->SetValue (inst2->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   786
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   787
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   788
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   789
MyFrame::OnInst3 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   790
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   791
  Read_Analogue_Input_16_Bit[2] = inst3->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   792
  ins3->SetValue (inst3->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   793
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   794
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   795
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   796
MyFrame::OnInst4 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   797
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   798
  Read_Analogue_Input_16_Bit[3] = inst4->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   799
  ins4->SetValue (inst4->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   800
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   801
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   802
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   803
MyFrame::OnInst5 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   804
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   805
  Read_Analogue_Input_16_Bit[4] = inst5->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   806
  ins5->SetValue (inst5->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   807
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   808
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   809
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   810
MyFrame::OnInst6 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   811
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   812
  Read_Analogue_Input_16_Bit[5] = inst6->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   813
  ins6->SetValue (inst6->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   814
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   815
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   816
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   817
MyFrame::OnInst7 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   818
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   819
  Read_Analogue_Input_16_Bit[6] = inst7->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   820
  ins7->SetValue (inst7->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   821
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   822
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   823
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   824
MyFrame::OnInst8 (wxSpinEvent & ev)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   825
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   826
  Read_Analogue_Input_16_Bit[7] = inst8->GetValue ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   827
  ins8->SetValue (inst8->GetValue ());
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   828
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   829
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   830
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   831
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   832
MyFrame::OnAbout (wxCommandEvent & WXUNUSED (event))
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   833
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   834
  wxString msg;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   835
  msg.Printf (_T ("About.\n\n")
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   836
	      _T
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   837
	      ("Input-Output simulation by GRANDEMANGE Nicolas for CanFestival!!"));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   838
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   839
  wxMessageBox (msg, _T ("About !!!"), wxOK | wxICON_INFORMATION, this);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   840
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   841
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   842
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   843
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   844
MyFrame::OnFreqBoxClick (wxCommandEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   845
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   846
  wxString wxstr;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   847
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   848
  wxstr = event.GetString ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   849
  strncpy (SlaveBoard.baudrate, wxstr.mb_str (), MAXLENGTH_BAUDRATE);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   850
  *textLog << wxT ("Baudrate:") << event.GetString () << wxT ("\n");
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   851
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   852
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   853
static int
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   854
is_set (int i, wxListBox * inlist, wxArrayInt in)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   855
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   856
  inlist->GetSelections (in);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   857
  for (int j = 0; j < in.GetCount (); j++)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   858
    {
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   859
      if (i == (in[j] + 1))
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   860
	{
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   861
	  return (i);
246
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   862
	}
382
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   863
    }
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   864
  return (0);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   865
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   866
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   867
static int
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   868
get_bit (UNS8 input, int bit)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   869
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   870
  return input & (((UNS8) 1) << bit - 1) ? 1 : 0;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   871
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   872
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   873
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   874
actu_output (void)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   875
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   876
  wxString tmp;
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   877
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   878
  frame->outbt1->SetValue (get_bit (Write_Outputs_8_Bit[0], 1));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   879
  frame->outbt2->SetValue (get_bit (Write_Outputs_8_Bit[0], 2));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   880
  frame->outbt3->SetValue (get_bit (Write_Outputs_8_Bit[0], 3));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   881
  frame->outbt4->SetValue (get_bit (Write_Outputs_8_Bit[0], 4));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   882
  frame->outbt5->SetValue (get_bit (Write_Outputs_8_Bit[0], 5));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   883
  frame->outbt6->SetValue (get_bit (Write_Outputs_8_Bit[0], 6));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   884
  frame->outbt7->SetValue (get_bit (Write_Outputs_8_Bit[0], 7));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   885
  frame->outbt8->SetValue (get_bit (Write_Outputs_8_Bit[0], 8));
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   886
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   887
  frame->outs1->SetValue (Write_Analogue_Output_16_Bit[0] + 32768);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   888
  frame->outs2->SetValue (Write_Analogue_Output_16_Bit[1] + 32768);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   889
  frame->outs3->SetValue (Write_Analogue_Output_16_Bit[2] + 32768);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   890
  frame->outs4->SetValue (Write_Analogue_Output_16_Bit[3] + 32768);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   891
  tmp.Printf (wxT ("       %i"), Write_Analogue_Output_16_Bit[0]);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   892
  frame->outst1->SetLabel (tmp);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   893
  tmp.Printf (wxT ("       %i"), Write_Analogue_Output_16_Bit[1]);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   894
  frame->outst2->SetLabel (tmp);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   895
  tmp.Printf (wxT ("       %i"), Write_Analogue_Output_16_Bit[2]);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   896
  frame->outst3->SetLabel (tmp);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   897
  tmp.Printf (wxT ("       %i"), Write_Analogue_Output_16_Bit[3]);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   898
  frame->outst4->SetLabel (tmp);
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   899
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   900
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   901
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   902
actu (void)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   903
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   904
  actu_output ();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   905
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   906
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   907
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   908
MyFrame::OnTimer (wxTimerEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   909
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   910
  actu ();			// do whatever you want to do every second here
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   911
}
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   912
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   913
void
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   914
MyFrame::OnPaint (wxPaintEvent & event)
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   915
{
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   916
  //Paint();
860e858685d3 Cleaned re-indented code of DS401_Slave_Gui
etisserant
parents: 331
diff changeset
   917
}