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