fog
26th August 2008, 01:36 PM
Hi!
Setting up to yokes (js1 and js2) to work one one PC, but only one active at the time (similar controls)
my Script:
// CMS Script File
//
script
// Wait for cms button 25 press and
// flip b2 when that happens. The b2 bit will control whether the
// first or second yoke is used.
//
sequence
wait( cms.b25 );
b2 = NOT b2;
endSequence
// Now set up to switch one set of axes/buttons or the other into
// a single set of CMS axes/buttons. This looks backwards, but the
// script will start with b2 OFF and doing it this way makes it
// come up with the first yoke active.
//
if( b2 ) then
// Assign the Yoke 2 X and Y to a1 and a2
//
a1 = js2.a1;
a2 = js2.a2;
// Assign the other Yoke 2 axes to the cms axes
//
cms.a3 = js2.a3;
cms.a4 = js2.a4;
cms.a5 = js2.a5;
// Now switch the rest of the Yoke 2 buttons
//
cms.b2 = js2.b1;
cms.b2 = js2.b2;
cms.b3 = js2.b3;
cms.b4 = js2.b4;
cms.b5 = js2.b5;
cms.b6 = js2.b6;
cms.b7 = js2.b7;
cms.b8 = js2.b8;
cms.b9 = js2.b9;
cms.b10 = js2.b10;
cms.b11 = js2.b11;
cms.b12 = js2.b12;
else
// Assign the Yoke 1 X and Y to a1 and a2
//
a1 = js1.a1;
a2 = js1.a2;
// Assign the other Yoke 1 axes to the cms axes
//
cms.a3 = js1.a3;
cms.a4 = js1.a4;
cms.a5 = js1.a5;
// Now switch the rest of the Yoke 1 buttons
//
cms.b1 = js1.b1;
cms.b2 = js1.b2;
cms.b3 = js1.b3;
cms.b4 = js1.b4;
cms.b5 = js1.b5;
cms.b6 = js1.b6;
cms.b7 = js1.b7;
cms.b8 = js1.b8;
cms.b9 = js1.b9;
cms.b10 = js1.b10;
cms.b11 = js1.b11;
cms.b12 = js1.b12;
endIf
endScriptMy question: is it possible to execute the script from e.g a keyboard button press in this section: ?
wait( cms.b25 );
If i assign e.g "w NULL" to the cms.b25 in CH manager, will pressing the "w" execute the script ?, ore must the input come from a CH device (eg js1.b2 etc..) ?
Freddy
Setting up to yokes (js1 and js2) to work one one PC, but only one active at the time (similar controls)
my Script:
// CMS Script File
//
script
// Wait for cms button 25 press and
// flip b2 when that happens. The b2 bit will control whether the
// first or second yoke is used.
//
sequence
wait( cms.b25 );
b2 = NOT b2;
endSequence
// Now set up to switch one set of axes/buttons or the other into
// a single set of CMS axes/buttons. This looks backwards, but the
// script will start with b2 OFF and doing it this way makes it
// come up with the first yoke active.
//
if( b2 ) then
// Assign the Yoke 2 X and Y to a1 and a2
//
a1 = js2.a1;
a2 = js2.a2;
// Assign the other Yoke 2 axes to the cms axes
//
cms.a3 = js2.a3;
cms.a4 = js2.a4;
cms.a5 = js2.a5;
// Now switch the rest of the Yoke 2 buttons
//
cms.b2 = js2.b1;
cms.b2 = js2.b2;
cms.b3 = js2.b3;
cms.b4 = js2.b4;
cms.b5 = js2.b5;
cms.b6 = js2.b6;
cms.b7 = js2.b7;
cms.b8 = js2.b8;
cms.b9 = js2.b9;
cms.b10 = js2.b10;
cms.b11 = js2.b11;
cms.b12 = js2.b12;
else
// Assign the Yoke 1 X and Y to a1 and a2
//
a1 = js1.a1;
a2 = js1.a2;
// Assign the other Yoke 1 axes to the cms axes
//
cms.a3 = js1.a3;
cms.a4 = js1.a4;
cms.a5 = js1.a5;
// Now switch the rest of the Yoke 1 buttons
//
cms.b1 = js1.b1;
cms.b2 = js1.b2;
cms.b3 = js1.b3;
cms.b4 = js1.b4;
cms.b5 = js1.b5;
cms.b6 = js1.b6;
cms.b7 = js1.b7;
cms.b8 = js1.b8;
cms.b9 = js1.b9;
cms.b10 = js1.b10;
cms.b11 = js1.b11;
cms.b12 = js1.b12;
endIf
endScriptMy question: is it possible to execute the script from e.g a keyboard button press in this section: ?
wait( cms.b25 );
If i assign e.g "w NULL" to the cms.b25 in CH manager, will pressing the "w" execute the script ?, ore must the input come from a CH device (eg js1.b2 etc..) ?
Freddy