1# MBDyn (C) is a multibody analysis code.
2# http://www.mbdyn.org
3#
4# Copyright (C) 1996-2017
5#
6# Pierangelo Masarati	<masarati@aero.polimi.it>
7# Paolo Mantegazza	<mantegazza@aero.polimi.it>
8#
9# Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
10# via La Masa, 34 - 20156 Milano, Italy
11# http://www.aero.polimi.it
12#
13# Changing this copyright notice is forbidden.
14#
15# This program is free software; you can redistribute it and/or modify
16# it under the terms of the GNU General Public License as published by
17# the Free Software Foundation (version 2 of the License).
18#
19#
20# This program is distributed in the hope that it will be useful,
21# but WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23# GNU General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with this program; if not, write to the Free Software
27# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28#
29
30begin: data;
31	problem: initial value;
32end: data;
33
34begin: initial value;
35	initial time: 0.;
36	final time: forever;
37	time step: 1.e-2;
38
39	real time: posix,
40		mode, period, time step, 10e6,
41		allow nonroot; # nanoseconds
42
43	# output: iterations;
44end: initial value;
45
46include: "hid.set";
47include: "hid_ms_sidewinder.set";
48
49begin: control data;
50	abstract nodes: JOYSTICK_N_LC + JOYSTICK_N_BUTTONS;
51	file drivers: 1;
52	genels: JOYSTICK_N_LC + JOYSTICK_N_BUTTONS;
53	forces: JOYSTICK_N_LC + JOYSTICK_N_BUTTONS;
54end: control data;
55
56module load: "libmodule-hid";
57
58set: const integer JOYSTICK_1 = 999;
59
60set: const integer TRIM_L = 5;
61set: const integer TRIM_F = 6;
62
63begin: nodes;
64	abstract: JOYSTICK_AILERONS;
65	abstract: JOYSTICK_ELEVATOR;
66	abstract: JOYSTICK_RUDDER;
67	abstract: JOYSTICK_THROTTLE;
68	abstract: TRIM_L;
69	abstract: TRIM_F;
70
71	abstract: JOYSTICK_TRIGGER;
72	abstract: JOYSTICK_BUTTON_2;
73	abstract: JOYSTICK_BUTTON_3;
74	abstract: JOYSTICK_BUTTON_4;
75	abstract: JOYSTICK_BUTTON_5;
76	abstract: JOYSTICK_BUTTON_6;
77	abstract: JOYSTICK_BUTTON_7;
78	abstract: JOYSTICK_BUTTON_8;
79end: nodes;
80
81begin: drivers;
82	file: JOYSTICK_1, joystick,
83		# help;
84		"/dev/input/js0",			# joystick device
85		JOYSTICK_N_BUTTONS,			# number of buttons
86		JOYSTICK_N_LC;				# number of linear controls
87		# scale, 1., 2., 3., 4., 5., 6.;	# scale factor for linear controls
88		# 8, 6; # Fabio's
89		# 26, 8; # Andrea's
90		# 12, 7; # Mine
91end: drivers;
92
93begin: elements;
94	genel: JOYSTICK_AILERONS, spring support, JOYSTICK_AILERONS, abstract, algebraic, linear elastic, 1.;
95	genel: JOYSTICK_ELEVATOR, spring support, JOYSTICK_ELEVATOR, abstract, algebraic, linear elastic, 1.;
96	genel: JOYSTICK_RUDDER, spring support, JOYSTICK_RUDDER, abstract, algebraic, linear elastic, 1.;
97	genel: JOYSTICK_THROTTLE, spring support, JOYSTICK_THROTTLE, abstract, algebraic, linear elastic, 1.;
98	genel: TRIM_L, spring support, TRIM_L, abstract, algebraic, linear elastic, 1.;
99	genel: TRIM_F, spring support, TRIM_F, abstract, algebraic, linear elastic, 1.;
100
101	genel: JOYSTICK_TRIGGER, spring support, JOYSTICK_TRIGGER, abstract, algebraic, linear elastic, 1.;
102	genel: JOYSTICK_BUTTON_2, spring support, JOYSTICK_BUTTON_2, abstract, algebraic, linear elastic, 1.;
103	genel: JOYSTICK_BUTTON_3, spring support, JOYSTICK_BUTTON_3, abstract, algebraic, linear elastic, 1.;
104	genel: JOYSTICK_BUTTON_4, spring support, JOYSTICK_BUTTON_4, abstract, algebraic, linear elastic, 1.;
105	genel: JOYSTICK_BUTTON_5, spring support, JOYSTICK_BUTTON_5, abstract, algebraic, linear elastic, 1.;
106	genel: JOYSTICK_BUTTON_6, spring support, JOYSTICK_BUTTON_6, abstract, algebraic, linear elastic, 1.;
107	genel: JOYSTICK_BUTTON_7, spring support, JOYSTICK_BUTTON_7, abstract, algebraic, linear elastic, 1.;
108	genel: JOYSTICK_BUTTON_8, spring support, JOYSTICK_BUTTON_8, abstract, algebraic, linear elastic, 1.;
109
110	force: JOYSTICK_AILERONS, abstract, JOYSTICK_AILERONS, abstract, file, JOYSTICK_1, JOYSTICK_AILERONS;
111	force: JOYSTICK_ELEVATOR, abstract, JOYSTICK_ELEVATOR, abstract, file, JOYSTICK_1, JOYSTICK_ELEVATOR;
112	force: JOYSTICK_RUDDER, abstract, JOYSTICK_RUDDER, abstract, file, JOYSTICK_1, JOYSTICK_RUDDER;
113	force: JOYSTICK_THROTTLE, abstract, JOYSTICK_THROTTLE, abstract, file, JOYSTICK_1, JOYSTICK_THROTTLE;
114	force: TRIM_L, abstract, TRIM_L, abstract, file, JOYSTICK_1, TRIM_L;
115	force: TRIM_F, abstract, TRIM_F, abstract, file, JOYSTICK_1, TRIM_F;
116
117	force: JOYSTICK_TRIGGER, abstract, JOYSTICK_TRIGGER, abstract, file, JOYSTICK_1, JOYSTICK_TRIGGER;
118	force: JOYSTICK_BUTTON_2, abstract, JOYSTICK_BUTTON_2, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_2;
119	force: JOYSTICK_BUTTON_3, abstract, JOYSTICK_BUTTON_3, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_3;
120	force: JOYSTICK_BUTTON_4, abstract, JOYSTICK_BUTTON_4, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_4;
121	force: JOYSTICK_BUTTON_5, abstract, JOYSTICK_BUTTON_5, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_5;
122	force: JOYSTICK_BUTTON_6, abstract, JOYSTICK_BUTTON_6, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_6;
123	force: JOYSTICK_BUTTON_7, abstract, JOYSTICK_BUTTON_7, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_7;
124	force: JOYSTICK_BUTTON_8, abstract, JOYSTICK_BUTTON_8, abstract, file, JOYSTICK_1, JOYSTICK_BUTTON_8;
125end: elements;
126
127