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