examples/DS401_Slave_Gui/main.cpp
author etisserant
Mon, 10 Sep 2007 15:14:41 +0200
changeset 270 178030c1dff8
parent 246 d635cfc520ee
child 295 25ff2fadff89
permissions -rw-r--r--
Removed debug prints
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>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    10
#include <wx/listbox.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    11
#include <wx/dynarray.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    12
#include <wx/dcclient.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    13
#include <wx/gauge.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    14
#include <wx/spinctrl.h>
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    15
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    16
#include "monicone.xpm"
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    17
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    18
#include "main.h"
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    19
#include "tools.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;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    38
MyFrame 		*frame; 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    39
s_BOARD			SlaveBoard = {NULL, NULL};
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    40
char* 			LibraryPath = NULL;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    41
double			Gtime = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    42
double			y[28][45];
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    43
double			hdelta = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    44
double			old_max = 5;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    45
double			old_min = -5;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    46
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    47
// Declare some IDs. These are arbitrary.
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    48
const int BOOKCTRL = 100;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    49
const int FILE_QUIT = wxID_EXIT;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    50
const int HELP_ABOUT = wxID_ABOUT;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    51
const int ADD = 105;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    52
const int REMOVE = 108;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    53
const int QUIT = 109;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    54
const int FREQBOX = 110;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    55
const int START = 112;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    56
const int TEXTBOX1 = 113;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    57
const int STOP = 114;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    58
const int LOAD = 115;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    59
const int INBT1 = 118;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    60
const int INBT2 = 119;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    61
const int INBT3 = 120;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    62
const int INBT4 = 121;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    63
const int INBT5 = 122;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    64
const int INBT6 = 123;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    65
const int INBT7 = 124;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    66
const int INBT8 = 125;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    67
const int INS1 = 126;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    68
const int INS2 = 127;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    69
const int INS3 = 128;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    70
const int INS4 = 129;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    71
const int INS5 = 135;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    72
const int INS6 = 136;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    73
const int INS7 = 137;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    74
const int INS8 = 138;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    75
const int TIMER_ID = 130;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    76
const int INST1 = 131;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    77
const int INST2 = 132;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    78
const int INST3 = 133;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    79
const int INST4 = 134;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    80
const int INST5 = 135;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    81
const int INST6 = 136;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    82
const int INST7 = 137;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    83
const int INST8 = 138;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    84
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    85
// 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
    86
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    87
 EVT_BUTTON(STOP, MyFrame::OnStop)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    88
 EVT_BUTTON(LOAD, MyFrame::OnLoad)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    89
 EVT_BUTTON(START, MyFrame::OnStart)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    90
 EVT_TOGGLEBUTTON(INBT1, MyFrame::OnInbt1)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    91
 EVT_TOGGLEBUTTON(INBT2, MyFrame::OnInbt2)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    92
 EVT_TOGGLEBUTTON(INBT3, MyFrame::OnInbt3)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    93
 EVT_TOGGLEBUTTON(INBT4, MyFrame::OnInbt4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    94
 EVT_TOGGLEBUTTON(INBT5, MyFrame::OnInbt5)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    95
 EVT_TOGGLEBUTTON(INBT6, MyFrame::OnInbt6)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    96
 EVT_TOGGLEBUTTON(INBT7, MyFrame::OnInbt7)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    97
 EVT_TOGGLEBUTTON(INBT8, MyFrame::OnInbt8)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    98
 EVT_COMMAND_SCROLL(INS1, MyFrame::OnIns1)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
    99
 EVT_COMMAND_SCROLL(INS2, MyFrame::OnIns2)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   100
 EVT_COMMAND_SCROLL(INS3, MyFrame::OnIns3)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   101
 EVT_COMMAND_SCROLL(INS4, MyFrame::OnIns4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   102
 EVT_COMMAND_SCROLL(INS5, MyFrame::OnIns5)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   103
 EVT_COMMAND_SCROLL(INS6, MyFrame::OnIns6)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   104
 EVT_COMMAND_SCROLL(INS7, MyFrame::OnIns7)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   105
 EVT_COMMAND_SCROLL(INS8, MyFrame::OnIns8)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   106
 EVT_SPINCTRL(INST1, MyFrame::OnInst1)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   107
 EVT_SPINCTRL(INST2, MyFrame::OnInst2)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   108
 EVT_SPINCTRL(INST3, MyFrame::OnInst3)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   109
 EVT_SPINCTRL(INST4, MyFrame::OnInst4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   110
 EVT_SPINCTRL(INST5, MyFrame::OnInst5)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   111
 EVT_SPINCTRL(INST6, MyFrame::OnInst6)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   112
 EVT_SPINCTRL(INST7, MyFrame::OnInst7)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   113
 EVT_SPINCTRL(INST8, MyFrame::OnInst8)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   114
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   115
 EVT_LISTBOX(FREQBOX, MyFrame::OnFreqBoxClick)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   116
 EVT_MENU(FILE_QUIT, MyFrame::OnQuit)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   117
 EVT_BUTTON(QUIT, MyFrame::OnQuit)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   118
 EVT_MENU(HELP_ABOUT, MyFrame::OnAbout)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   119
 EVT_PAINT(MyFrame::OnPaint)
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_TIMER(TIMER_ID, MyFrame::OnTimer)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   122
END_EVENT_TABLE()
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   123
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   124
IMPLEMENT_APP(MyApp)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   125
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   126
bool MyApp::OnInit()
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   127
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   128
 	frame = new MyFrame( _T("I-O simulator"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   129
 	frame->Show(true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   130
 return true;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   131
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   132
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   133
MyFrame::MyFrame(const wxString& title)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   134
  : 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
   135
  ,m_timer(this, TIMER_ID)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   136
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   137
 wxMenu			*fileMenu = new wxMenu;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   138
 wxMenu			*helpMenu = new wxMenu;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   139
 wxPanel		*panel;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   140
 wxButton		*quit;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   141
 wxButton		*load;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   142
 wxBoxSizer		*mysizer;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   143
 wxBoxSizer		*mysssizer;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   144
 wxBoxSizer		*myhsizer;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   145
 wxBoxSizer		*mybsizer;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   146
 wxBoxSizer		*myentrysizer;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   147
 wxListBox		*freqlist;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   148
 wxStaticBox	*namebox;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   149
 wxStaticBox	*freqbox;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   150
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   151
 SetIcon(wxICON(monicone));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   152
 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   153
 helpMenu->Append(HELP_ABOUT, _T("&About...\tF1"),
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   154
 _T("Show about dialog"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   155
 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
   156
 _T("Quit this program"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   157
 wxMenuBar *menuBar = new wxMenuBar();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   158
 menuBar->Append(fileMenu, _T("&File"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   159
 menuBar->Append(helpMenu, _T("&Help"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   160
 SetMenuBar(menuBar);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   161
 CreateStatusBar(2);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   162
 SetStatusText(_T("Lolitech."), 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   163
 SetStatusText(_T("Welcome."), 1);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   164
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   165
 book = new wxNotebook(this, BOOKCTRL);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   166
  
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   167
 panel = new wxPanel(book);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   168
 book->AddPage(panel, _T("Configuration"), true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   169
 mysizer = new wxBoxSizer( wxVERTICAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   170
 panel->SetSizer(mysizer);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   171
 wxString choices[] =
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   172
 {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   173
  _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
   174
  _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
   175
 };
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   176
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   177
 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
   178
 mysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   179
 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
   180
 myhsizer->Add(load, 0, wxLEFT, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   181
 drivername = new wxTextCtrl(panel, wxID_ANY, _T("No driver loaded!!"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   182
 myhsizer->Add(drivername, 1, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   183
 myentrysizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   184
 mysizer->Add(myentrysizer, 0, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   185
 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
   186
 myentrysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   187
 busname = new wxTextCtrl(panel, wxID_ANY, _T("0"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   188
 myhsizer->Add(busname, 0, wxLEFT, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   189
 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
   190
 myentrysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   191
 node_id = new wxSpinCtrl(panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 127, 1, _T("wxSpinCtrl"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   192
 myhsizer->Add(node_id, 0, wxRIGHT, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   193
 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
   194
 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
   195
 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
   196
 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
   197
 quit = new wxButton( panel, QUIT, _T("QUIT"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   198
 mysizer->Add(quit, 0, wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   199
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   200
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   201
 panel = new wxPanel(book);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   202
 book->AddPage(panel, wxT("Inputs"), true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   203
 mysizer = new wxBoxSizer( wxVERTICAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   204
 panel->SetSizer(mysizer);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   205
 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
   206
 mysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 30);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   207
 inbt1 = new wxToggleButton(panel, INBT1, wxT("1"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   208
 inbt2 = new wxToggleButton(panel, INBT2, wxT("2"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   209
 inbt3 = new wxToggleButton(panel, INBT3, wxT("3"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   210
 inbt4 = new wxToggleButton(panel, INBT4, wxT("4"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   211
 inbt5 = new wxToggleButton(panel, INBT5, wxT("5"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   212
 inbt6 = new wxToggleButton(panel, INBT6, wxT("6"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   213
 inbt7 = new wxToggleButton(panel, INBT7, wxT("7"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   214
 inbt8 = new wxToggleButton(panel, INBT8, wxT("8"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   215
 myhsizer->Add(inbt1, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   216
 myhsizer->Add(inbt2, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   217
 myhsizer->Add(inbt3, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   218
 myhsizer->Add(inbt4, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   219
 myhsizer->Add(inbt5, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   220
 myhsizer->Add(inbt6, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   221
 myhsizer->Add(inbt7, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   222
 myhsizer->Add(inbt8, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   223
 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
   224
 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
   225
 mysssizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   226
 myhsizer->Add(mysssizer, 0, wxEXPAND | wxALL, 0); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   227
 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
   228
 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
   229
 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
   230
 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
   231
 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
   232
 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
   233
 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
   234
 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
   235
 mysssizer->Add(inst1, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   236
 mysssizer->Add(inst2, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   237
 mysssizer->Add(inst3, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   238
 mysssizer->Add(inst4, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   239
 mysssizer->Add(inst5, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   240
 mysssizer->Add(inst6, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   241
 mysssizer->Add(inst7, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   242
 mysssizer->Add(inst8, wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   243
 mysssizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   244
 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
   245
 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
   246
 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
   247
 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
   248
 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
   249
 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
   250
 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
   251
 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
   252
 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
   253
 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
   254
 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
   255
 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
   256
 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
   257
 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
   258
 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
   259
 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
   260
 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
   261
 quit = new wxButton( panel, QUIT, _T("QUIT"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   262
 mysizer->Add(quit, 0, wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   263
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   264
 panel = new wxPanel(book);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   265
 book->AddPage(panel, wxT("Outputs"), true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   266
 mysizer = new wxBoxSizer( wxVERTICAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   267
 panel->SetSizer(mysizer);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   268
 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
   269
 mysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 30);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   270
 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
   271
 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
   272
 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
   273
 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
   274
 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
   275
 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
   276
 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
   277
 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
   278
 myhsizer->Add(outbt1, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   279
 myhsizer->Add(outbt2, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   280
 myhsizer->Add(outbt3, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   281
 myhsizer->Add(outbt4, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   282
 myhsizer->Add(outbt5, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   283
 myhsizer->Add(outbt6, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   284
 myhsizer->Add(outbt7, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   285
 myhsizer->Add(outbt8, wxEXPAND | wxALL, 0, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   286
 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
   287
 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
   288
 mysssizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   289
 myhsizer->Add(mysssizer, 0, wxEXPAND | wxALL, 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   290
 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
   291
 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
   292
 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
   293
 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
   294
 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
   295
 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
   296
 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
   297
 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
   298
 mysssizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   299
 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
   300
 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
   301
 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
   302
 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
   303
 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
   304
 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
   305
 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
   306
 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
   307
 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
   308
 quit = new wxButton( panel, QUIT, _T("QUIT"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   309
 mysizer->Add(quit, 0, wxALL, 5); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   310
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   311
  wxString choice[] =
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   312
 {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   313
  _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
   314
  _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
   315
  _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
   316
  _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
   317
  _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
   318
  _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
   319
  _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
   320
  _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
   321
  _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
   322
  _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
   323
  _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
   324
  _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
   325
  _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
   326
  _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
   327
 panel = new wxPanel(book); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   328
 book->AddPage(panel, wxT("Graphic"), true); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   329
 mysizer = new wxBoxSizer( wxVERTICAL ); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   330
 panel->SetSizer(mysizer); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   331
 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
   332
 mysizer->Add(myhsizer, 0, wxEXPAND | wxALL, 10); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   333
 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
   334
 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
   335
 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
   336
 myhsizer->Add(echelle, 0, wxEXPAND | wxALL, 0); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   337
 mybsizer = new wxBoxSizer( wxHORIZONTAL ); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   338
 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
   339
 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
   340
 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
   341
 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
   342
 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
   343
 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
   344
 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
   345
 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
   346
 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
   347
 quit = new wxButton( panel, QUIT, _T("QUIT")); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   348
 mysizer->Add(quit, 0, wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   349
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   350
 panel = new wxPanel(book);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   351
 book->InsertPage(0, panel, wxT("Control"), true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   352
 mysizer = new wxBoxSizer( wxVERTICAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   353
 panel->SetSizer(mysizer);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   354
 myhsizer = new wxBoxSizer( wxHORIZONTAL );
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   355
 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
   356
 mysizer->Add(myhsizer, 0, wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   357
 start = new wxButton( panel, START, _T("START")); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   358
 stop = new wxButton( panel, STOP, _T("STOP")); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   359
 stop->Enable(false);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   360
 myhsizer->Add(start, 0, wxRIGHT, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   361
 myhsizer->Add(stop, 0, wxLEFT, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   362
 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
   363
 mysizer->Add(myhsizer, wxALL, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   364
 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
   365
 myhsizer->Add(textLog, wxALL, wxEXPAND | wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   366
 quit = new wxButton( panel, QUIT, _T("QUIT"));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   367
 mysizer->Add(quit, 0, wxALL, 5);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   368
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   369
 for (int i= 0; i < 28; i++)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   370
	for (int j = 0; j < 44; j++)					
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   371
		y[i][j] = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   372
 m_timer.Start(100);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   373
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   374
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   375
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   376
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   377
 Close(true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   378
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   379
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   380
void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   381
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   382
 wxString	s;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   383
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   384
 if (LibraryPath == NULL)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   385
 	{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   386
 		*textLog << wxT("No driver found!! ----------------------------------Initialization [KO]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   387
 		return;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   388
 	}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   389
 if (SlaveBoard.baudrate == NULL)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   390
 	{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   391
 		*textLog << wxT("No baudrate found!! ----------------------------------Initialization [KO]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   392
 		return;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   393
 	}	
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
 node_id_ext = node_id->GetValue();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   396
 s = busname->GetValue();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   397
 SlaveBoard.busname = wxstr_to_charbuf(s);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   398
 *textLog << wxT("-- Bus name: ------> ") << s << wxT("\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   399
 *textLog << wxT("-- Node ID: -------> ") << node_id->GetValue() << wxT("\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   400
 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   401
 if (main_can(SlaveBoard, LibraryPath))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   402
  {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   403
 	printf("[KO]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   404
 	*textLog << wxT("----------------------------------------------------Initialization [KO]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   405
  }
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   406
 else
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   407
  {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   408
 	printf("[OK]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   409
 	*textLog << wxT("----------------------------------------------------Initialization [OK]\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   410
 	stop->Enable(true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   411
 	start->Enable(false);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   412
  }
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   413
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   414
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   415
void MyFrame::OnStop(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   416
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   417
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   418
 	*textLog << wxT("----------------------------------------------------Slave [STOPPED]") << wxT("\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   419
	stop_slave();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   420
	stop->Enable(false);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   421
	start->Enable(true);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   422
	charbuf_free(SlaveBoard.busname);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   423
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   424
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   425
void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   426
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   427
    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
   428
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   429
    if(fd.ShowModal() == wxID_OK)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   430
    {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   431
    	drivername->Clear();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   432
        drivername->AppendText(fd.GetPath()); 
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   433
        *textLog << wxT("LibraryPath: ") << fd.GetPath() << wxT("\n");
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   434
        if (LibraryPath != NULL)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   435
        	charbuf_free(LibraryPath);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   436
        LibraryPath = wxstr_to_charbuf(fd.GetPath());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   437
        printf("path=%s",LibraryPath);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   438
    }
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   439
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   440
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   441
void MyFrame::OnInbt1(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   442
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   443
 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
   444
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   445
void MyFrame::OnInbt2(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   446
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   447
 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
   448
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   449
void MyFrame::OnInbt3(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   450
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   451
 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
   452
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   453
void MyFrame::OnInbt4(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   454
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   455
 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
   456
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   457
void MyFrame::OnInbt5(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   458
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   459
 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
   460
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   461
void MyFrame::OnInbt6(wxCommandEvent& WXUNUSED(event))
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
 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
   464
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   465
void MyFrame::OnInbt7(wxCommandEvent& WXUNUSED(event))
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
 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
   468
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   469
void MyFrame::OnInbt8(wxCommandEvent& WXUNUSED(event))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   470
{	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   471
 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
   472
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   473
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   474
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   475
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   476
void MyFrame::OnIns1(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   477
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   478
	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
   479
	inst1->SetValue(ins1->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   480
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   481
void MyFrame::OnIns2(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   482
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   483
	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
   484
	inst2->SetValue(ins2->GetValue());
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
void MyFrame::OnIns3(wxScrollEvent &event)
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
	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
   489
	inst3->SetValue(ins3->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   490
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   491
void MyFrame::OnIns4(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   492
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   493
	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
   494
	inst4->SetValue(ins4->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   495
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   496
void MyFrame::OnIns5(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   497
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   498
	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
   499
	inst5->SetValue(ins5->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   500
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   501
void MyFrame::OnIns6(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   502
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   503
	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
   504
	inst6->SetValue(ins6->GetValue());
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::OnIns7(wxScrollEvent &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
	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
   509
	inst7->SetValue(ins7->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   510
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   511
void MyFrame::OnIns8(wxScrollEvent &event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   512
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   513
	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
   514
	inst8->SetValue(ins8->GetValue());
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   515
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   516
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
void MyFrame::OnInst1 ( wxSpinEvent &ev )
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
	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
   521
	ins1->SetValue(inst1->GetValue());	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   522
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   523
void MyFrame::OnInst2 ( wxSpinEvent &ev )
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   524
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   525
	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
   526
	ins2->SetValue(inst2->GetValue());	
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::OnInst3 ( wxSpinEvent &ev )
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_Analogue_Input_16_Bit[2] = inst3->GetValue();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   531
	ins3->SetValue(inst3->GetValue());	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   532
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   533
void MyFrame::OnInst4 ( wxSpinEvent &ev )
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   534
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   535
	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
   536
	ins4->SetValue(inst4->GetValue());	
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
void MyFrame::OnInst5 ( wxSpinEvent &ev )
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
	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
   541
	ins5->SetValue(inst5->GetValue());	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   542
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   543
void MyFrame::OnInst6 ( wxSpinEvent &ev )
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   544
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   545
	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
   546
	ins6->SetValue(inst6->GetValue());	
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::OnInst7 ( wxSpinEvent &ev )
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_Analogue_Input_16_Bit[6] = inst7->GetValue();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   551
	ins7->SetValue(inst7->GetValue());	
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
void MyFrame::OnInst8 ( wxSpinEvent &ev )
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
	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
   556
	ins8->SetValue(inst8->GetValue());	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   557
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   558
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::OnAbout(wxCommandEvent& WXUNUSED(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
 wxString msg;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   563
 msg.Printf( _T("About.\n\n")
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   564
    _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
   565
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   566
 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
   567
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   568
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::OnFreqBoxClick( wxCommandEvent &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
	wxString	wxstr;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   573
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   574
 	wxstr = event.GetString();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   575
 	if (SlaveBoard.baudrate != NULL)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   576
 		charbuf_free(SlaveBoard.baudrate);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   577
 	SlaveBoard.baudrate = wxstr_to_charbuf(wxstr);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   578
 	*textLog << wxT("Baudrate:") << event.GetString() << wxT("\n");
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
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   581
static int	is_set(int			i,
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   582
					wxListBox	*inlist,
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   583
					wxArrayInt	in)
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
	inlist->GetSelections(in);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   586
	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
   587
		{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   588
			if (i == (in[j] + 1))
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
				return (i);
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
		}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   593
	return (0);
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
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
   597
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   598
	if (bit == 1)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   599
		return ((input & 0x1) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   600
	if (bit == 2)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   601
		return ((input & 0x2) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   602
	if (bit == 3)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   603
		return ((input & 0x4) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   604
	if (bit == 4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   605
		return ((input & 0x8) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   606
	if (bit == 5)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   607
		return ((input & 0x10) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   608
	if (bit == 6)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   609
		return ((input & 0x20) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   610
	if (bit == 7)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   611
		return ((input & 0x40) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   612
	if (bit == 8)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   613
		return ((input & 0x80) ? 1 : 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   614
	return 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   615
}
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::Paint()
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
	double		vmax = old_max;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   620
	double		vmin = old_min;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   621
	double		vdelta = vmax - vmin;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   622
	double		vech = ((float)vdelta) / 10.0;
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
	double		hmax = frame->echelle->GetValue();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   625
	double		hech = hdelta / 11;
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
	double 		d = 300 / vdelta;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   628
	double		g = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   629
	double		top = 5;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   630
	double		left = 50;
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
	double		tmpi = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   633
	wxString	tmps;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   634
	double		p = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   635
	double		q = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   636
	int			i = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   637
	int			j = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   638
	wxColor		col[8] = {wxColor("BLUE"), wxColor("RED"), wxColor("GREEN"), wxColor("GREY"),
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   639
						wxColor("ORANGE"), wxColor("YELLOW"), wxColor("PINK"), wxColor("BLACK")};
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   640
	hdelta = hmax - 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   641
	g = (Gtime / hdelta) * 44.00;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   642
						
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   643
	wxClientDC MonDc(mygraphpan);	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   644
	MonDc.Clear();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   645
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   646
    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
   647
    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
   648
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   649
    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
   650
    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
   651
    for (i=0; i < 11; i++)    
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
			tmpi = (vmin + (vech * i));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   654
			tmps.Printf(wxT("%d"), (int)tmpi);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   655
    		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
   656
    	}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   657
        for (i=0; i < 12; i++)    
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   658
    	{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   659
    		tmpi = (hech * i * 100);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   660
    		if (tmpi < 1000)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   661
				tmps.Printf(wxT("%ims"), (int)tmpi);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   662
    		if (tmpi > 1000)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   663
				tmps.Printf(wxT("%is"), (int)(tmpi / 1000));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   664
    		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
   665
    	}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   666
    for (j=1; j < 10; j++)    
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   667
		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
   668
    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
   669
    for (j=1; j < 22; j++)    
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   670
    		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
   671
	  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
   672
   	for (j=1; j < 22; j++)    
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   673
    	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
   674
    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
   675
    
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   676
    double m = (- vmin) * d;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   677
	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
   678
	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
   679
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   680
	wxClientDC MaLeg(mylegpan);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   681
	MaLeg.Clear();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   682
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   683
    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
   684
    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
   685
    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
   686
    {
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   687
    	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
   688
			{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   689
				if (k <= 4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   690
					tmps.Printf(wxT("Analogue Output %d"), k);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   691
				if ((k > 4) && (k <= 12))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   692
					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
   693
				if ((k > 12) && (k <= 20))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   694
					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
   695
				if ((k > 20) && (k <= 28))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   696
					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
   697
				
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   698
				MaLeg.DrawRotatedText(tmps, 0, 10 * tmpi , 0);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   699
				MaLeg.SetPen(wxPen(col[tmpi], 4, wxSOLID));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   700
				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
   701
	//////////////////////////////////////////DAW////////////////////////////////////////
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   702
				MonDc.SetPen(wxPen(col[tmpi], 4, wxSOLID));
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   703
				if (k <= 4)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   704
					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
   705
				if ((k > 4) && (k <= 12))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   706
					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
   707
				if ((k > 12) && (k <= 20))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   708
					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
   709
				if ((k > 20) && (k <= 28))
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   710
					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
   711
					
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   712
				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
   713
					old_max = y[k - 1][(int)g];
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   714
				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
   715
					old_min = y[k - 1][(int)g];
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   716
			    for (j=1; j < (g + 1) ; j++)    
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
					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
   719
					q = (y[k - 1][j    ] - vmin) * d;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   720
    				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
   721
    			}	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   722
	/////////////////////////////////////////////////////////////////////////////////////
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   723
				tmpi++;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   724
			}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   725
    }
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
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   728
void actu_output(void)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   729
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   730
	wxString	tmp;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   731
	
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   732
	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
   733
	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
   734
	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
   735
	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
   736
	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
   737
	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
   738
	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
   739
	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
   740
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   741
	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
   742
	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
   743
	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
   744
	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
   745
	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
   746
	frame->outst1->SetLabel(tmp);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   747
	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
   748
	frame->outst2->SetLabel(tmp);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   749
	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
   750
	frame->outst3->SetLabel(tmp);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   751
	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
   752
	frame->outst4->SetLabel(tmp);
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   753
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   754
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   755
void actu(void)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   756
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   757
	actu_output();
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
	Gtime++;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   760
	if (Gtime > hdelta)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   761
	{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   762
		old_max = 5;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   763
		old_min = -5;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   764
		Gtime = 0;
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   765
	}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   766
	frame->Paint();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   767
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   768
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   769
void MyFrame::OnTimer(wxTimerEvent& event)
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   770
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   771
    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
   772
}
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   773
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   774
void MyFrame::OnPaint( wxPaintEvent &event )
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   775
{
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   776
	//Paint();
d635cfc520ee Added contribution from Nicolas GRANDEMANGE. DS-401 slave GUI based on wxwidget.
etisserant
parents:
diff changeset
   777
}