dc8flightdeck
08-02-2011, 04:12 PM
Is there some update to this seat project?
Ive not had the time to finish it. But it does work. Ill give you the code I have here at work, the script im using in the sim has been refined a bit. Its for a jet fighter sim.
// *****************************************************************************
// * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : Seat cushion.txt
// * Date : 2/22/2011
Var 0001, name fs_eng_1_n2, Link FSUIPC_INOUT, Offset $0896, Length 2 // Afterburner seat motor one
{
IF &fs_eng_1_n2 >= 1
{
IF &fs_eng_1_n2 <= 14500
{
&motor_one = 0
}
IF &fs_eng_1_n2 >= 14501
{
IF &fs_eng_1_n2 <= 16484
{
&motor_one = 1
}
}
}
}
Var 0002, name motor_one, Link IOCARD_OUT, Output 0 // Afterburner - motor 1
Var 0003, name fs_eng_2_n2, Link FSUIPC_INOUT, Offset $092E, Length 2 // Afterburner seat motor two
{
IF &fs_eng_2_n2 >= 1
{
IF &fs_eng_2_n2 <= 14500
{
&motor_two = 0
}
IF &fs_eng_2_n2 >= 14501
{
IF &fs_eng_2_n2 <= 16484
{
&motor_two = 1
}
}
}
}
Var 0004, name motor_two, Link IOCARD_OUT, Output 1 // Afterburner - motor 2
// -----------------------------------------------LOWSPEED BURNER------------------------------------------------------------------
Var 0005, name Eng2, Link FSUIPC_IN, Offset $092E, Length 2 // (eng2 offset) lowspeed Afterburner Effec
{
CALL &Control
}
Var 0006, name ldgGear, Link FSUIPC_IN, Offset $0BEC, Length 4 // (nose gear offset) lowspeed Afterburner
{
CALL &Control
}
Var 0007, name Eng1, Link FSUIPC_IN, Offset $0896, Length 2 // (eng1 offset) lowspeed Afterburner Effec
{
CALL &Control
}
Var 0008, name Control, Link SUBRUTINE
{
C0 = &Eng1 >= 15001
C1 = &Eng2 >= 15001
IF C0 AND C1
{
IF &ldgGear = 16383
{
&burner_on = 1
}
ELSE
{
&burner_on = 0
}
}
}
Var 0009, name burner_on, Link IOCARD_OUT, Output 10 // Low speed afterburner effect - motor 22
// -----------------------------------STALL WARNING--------------------------------------------------------------------------
Var 0010, name stall, Link FSUIPC_INOUT, Offset $036C, Length 1 // Stall Warning
{
IF &stall = 0
{
&stall_a = 0
&stall_b = 0
}
IF &stall = 1
{
&stall_a = 1
&stall_b = 1
}
}
Var 0011, name stall_a, Link IOCARD_OUT, Output 2 // Motor 4 // Stall stick - motor 10
Var 0012, name stall_b, Link IOCARD_OUT, Output 3 // Motor 3 // Stall throttle - motor 11
//----------------------------------------Speed brake rumble---------------------------------------------------------------
Var 0013, name spoilers, Link FSUIPC_INOUT, Offset $0BD4, Length 4 // Speed brake rumble
{
CALL &Control2
}
Var 0014, name ldgGear2, Link FSUIPC_IN, Offset $0BEC, Length 4 // (nose gear offset) nose gear is down for
{
CALL &Control2
}
Var 0015, name Control2, Link SUBRUTINE
{
C0 = &spoilers = 16382
IF C0
{
IF &ldgGear2 = 0
{
&Speed_BrakeR = 1
&Speed_BrakeR = DELAY 0 ,600
&Speed_BrakeL = 1
&Speed_BrakeL = DELAY 0 ,600
}
ELSE
{
&Speed_BrakeR = 0
&Speed_BrakeL = 0
}
}
}
Var 0016, name Speed_BrakeR, Link IOCARD_OUT, Output 4 // Speed_Brake rumble motor 6
Var 0017, name Speed_BrakeL, Link IOCARD_OUT, Output 5 // Speed_Brake rumble motor 7
// -------------------------------------------G Forces----------------------------------------------------------------------------------
Var 0018, name Gforce, Link FSUIPC_INOUT, Offset $11BA, Length 2 // pilot harness G Force - 5000 is aprox 8
{
IF &Gforce >= 101
{
IF &Gforce <= 2000
{
&G1 = 0
&G2 = 0
}
IF &Gforce >= 0
{
IF &Gforce <= 5000
{
&G3 = 0
&G4 = 0
}
IF &Gforce >= 2001
{
IF &Gforce <= 7240
{
&G1 = 1
&G2 = 1
}
IF &Gforce >= 5001
{
IF &Gforce <= 7240
{
&G3 = 1
&G4 = 1
}
}
}
}
}
}
Var 0019, name G1, Link IOCARD_OUT, Output 6 // Harness low G Left, motor 8
Var 0020, name G2, Link IOCARD_OUT, Output 7 // Harness low G Right, motor 9
Var 0021, name G3, Link IOCARD_OUT, Output 12 // Harness high G Left, motor 13
Var 0022, name G4, Link IOCARD_OUT, Output 13 // Harness high G Right, motor 14
Var 0023, name G5, Link IOCARD_OUT, Output 14 // lower leg G Left, motor 15
Var 0024, name G6, Link IOCARD_OUT, Output 15 // Upper leg G Left motor 16
Var 0025, name G7, Link IOCARD_OUT, Output 16 // Lower G Right, motor 17
Var 0026, name G8, Link IOCARD_OUT, Output 17 // Upper G Right, motor 18
// -------------------------------------------NEG G FORCE--------------------------------------
Var 0027, name Neg_G, Link FSUIPC_INOUT, Offset $11BA, Length 2 // pilot harness Neg G Force
{
IF &Gforce >= 0
{
IF &Gforce <= 250
{
&G9 = 1
&G10 = 1
}
IF &Gforce >= 251
{
IF &Gforce <= 7240
{
&G9 = 0
&G10 = 0
}
}
}
}
Var 0028, name G9, Link IOCARD_OUT, Output 18 // Upper G Right, motor 19
Var 0029, name G10, Link IOCARD_OUT, Output 19 // Upper G Right, motor 20
// -------------------------------------------------------NOSE GEAR RUMBLE
Var 0030, name fs_ldg_nose, Link FSUIPC_INOUT, Offset $0BEC, Length 4 // nose gear rumble
{
IF &fs_ldg_nose = 0
{
&nose_a = 0
&nose_b = 0
&nose_c = 0
}
IF &fs_ldg_nose >= 1
{
IF &fs_ldg_nose <= 16382
{
&nose_a = 1
&nose_b = 1
&nose_c = 1
}
}
IF &fs_ldg_nose = 16383
{
&nose_a = 0
&nose_b = 0
&nose_c = 0
}
}
Var 0031, name nose_a, Link IOCARD_OUT, Output 8 // seat nose gear rumble - Motor 3
Var 0032, name nose_b, Link IOCARD_OUT, Output 9 // seat nose gear rumble - Motor 4
Var 0033, name nose_c, Link IOCARD_OUT, Output 11 // seat nose gear rumble - Motor 12
Var 0034, name Angle_of_attac, Link FSUIPC_INOUT, Offset $11BE, Length 2 // For buffeting motors (number run backwar
{
IF &Angle_of_attac >= 0
{
IF &Angle_of_attac <= 20000
{
&buffetting = 1
&buffetting2 = 1
}
IF &Angle_of_attac >= 0
{
IF &Angle_of_attac <= 15000
{
&buffetting3 = 1
&buffetting4 = 1
}
IF &Angle_of_attac >= 20001
{
IF &Angle_of_attac <= 65536
{
&buffetting = 0
&buffetting2 = 0
}
IF &Angle_of_attac >= 15001
{
IF &Angle_of_attac <= 65536
{
&buffetting3 = 0
&buffetting4 = 0
}
}
}
}
}
}
Var 0035, name buffetting, Link IOCARD_OUT, Output 8 // Buffetting output - Motor 3
Var 0036, name buffetting2, Link IOCARD_OUT, Output 9 // Buffetting output - Motor 4
Var 0037, name buffetting3, Link IOCARD_OUT, Output 4 // Buffetting output - Motor 6
Var 0038, name buffetting4, Link IOCARD_OUT, Output 5 // Buffetting output - Motor 7
Var 0039, name flapsmotor, Link FSUIPC_INOUT, Offset $0BE0, Length 4 // flaps motor
{
IF &flapsmotor >= 0
{
IF &flapsmotor <= 3
{
&flapeffect = 0
}
IF &flapsmotor >= 4
{
IF &flapsmotor <= 16381
{
&flapeffect = 1
}
IF &flapsmotor >= 16382
{
IF &flapsmotor <= 16383
{
&flapeffect = 0
}
}
}
}
}
Var 0040, name flapeffect, Link IOCARD_OUT, Output 11 // flap rumble - Motor 12
// -------------------------------------------START CART--------------------------------------------------------------------------------------------
Var 0041, name StartCart, Link FSUIPC_INOUT, Offset $3103, Length 1 // Battery offset for start cart electrical power
{
IF &StartCart = 0 // Start cart off (battery off)
{
&CartRelay = 0 // startcart off
}
IF &StartCart = 1 // Start cart on (battery on)
{
&CartRelay = 1 // Master relay is on
}
}
Var 0042, name CartRelay, Link IOCARD_OUT, Output 35 // Start cart Relay electrical controller
// ------------------------------------------------Generator ONE -------------------------------------------------------------------------------------
Var 0043, name gen1, Link FSUIPC_INOUT, Offset $3B7C, Length 4 // GENERATOR 1 STATUS
{
IF &gen1 = 0 // Generator one off
{
&GEN_1_lght = 1
&Gen_1_CAUTION = 1
&GEN_1_Relay = 0
}
IF &gen1 = 1 // Generator one on
{
&GEN_1_lght = 0
&Gen_1_CAUTION = 0
&GEN_1_Relay = 1
}
}
Var 0044, name GEN_1_lght, Link IOCARD_OUT, Output 45 // GEN 1 LIGHT ON
Var 0045, name Gen_1_CAUTION, Link IOCARD_OUT, Output 60 // GEN Causes MASTER CAUTION LIGHT ON
Var 0046, name GEN_1_Relay, Link IOCARD_OUT, Output 36 // GEN 1 Relay electrical controller
// ---------------------------------------------------------------------Generator two-----------------------------------------------
Var 0047, name gen2, Link FSUIPC_INOUT, Offset $3ABC, Length 4 // GENERATOR 2 Status
{
IF &gen2 = 0 // Generator two off
{
&GEN_2_lght = 1
&Gen_2_CAUTION = 1
&GEN_2_Relay = 0
}
IF &gen2 = 1 // Generator two on
{
&GEN_2_lght = 0
&Gen_2_CAUTION = 0
&GEN_2_Relay = 1
}
}
Var 0048, name GEN_2_lght, Link IOCARD_OUT, Output 44 // GEN 2 LIGHT ON
Var 0049, name Gen_2_CAUTION, Link IOCARD_OUT, Output 60 // GEN Causes MASTER CAUTION LIGHT ON
Var 0050, name GEN_2_Relay, Link IOCARD_OUT, Output 37 // GEN 2 Relay electrical controller
// -----------------------------------------------------BUS TIE Eng 1----------------------------------------------------------
Var 0051, name BusGen1, Link FSUIPC_INOUT, Offset $3B7C, Length 4 // GENERATOR 1 OFFSET
{
IF &BusGen1 = 0
{
&BusTie1 = 1
}
IF &BusGen1 = 1
{
&BusTie1 = 0
}
}
Var 0052, name BusTie1, Link IOCARD_OUT, Output 33 // Bus Tie Light on
// -----------------------------------------------------BUS TIE Eng 2----------------------------------------------------------
Var 0053, name BusGen2, Link FSUIPC_INOUT, Offset $3ABC, Length 4 // GENERATOR 2 OFFSET
{
IF &BusGen2 = 0
{
&BusTie2 = 1
}
IF &BusGen2 = 1
{
&BusTie2 = 0
}
}
Var 0054, name BusTie2, Link IOCARD_OUT, Output 34 // Bus Tie Light on
// -----------------------------------Avionics master--------------------------------------------------------------
Var 0055, name AvGen1, Link FSUIPC_INOUT, Offset $3B7C, Length 4 // GENERATOR 1 OFFSET
{
CALL &Control3
}
Var 0056, name AvGen2, Link FSUIPC_INOUT, Offset $3ABC, Length 4 // GENERATOR 2 OFFSET
{
CALL &Control3
}
Var 0057, name Control3, Link SUBRUTINE
{
C0 = &AvGen1 = 0
IF C0
{
IF &AvGen1 = 0
{
&AvMaster = 0
}
ELSE
{
&AvMaster = 1
}
}
}
Var 0058, name AvMaster, Link FSUIPC_INOUT, Offset $3103, Length 4 // Master AVIONICS offset
// --------------------------------------------TAILHOOK-------------------------------------------------------------------------
Var 0059 name tailhook, Link FSUIPC_INOUT, Offset $3BA0, Length 8, Numbers 0 // Tailhook position light
{
IF &tailhook = 0
{
&hook_lght = 0
}
IF &tailhook = 1
{
&hook_lght = 1
}
}
Var 0060, name hook_lght, Link IOCARD_OUT, Output 43 // Tailhook position light
// --------------------------------------------------------SPEEDBRAKE POSITION LIGHT--------------------------------------
Var 0061, name brake, Link FSUIPC_INOUT, Offset $0BD8, Length 4 // Speed brake position indicator
{
IF &brake >= 0
{
}
IF &brake <= 381
{
&BrakeLIGHT = 0
}
IF &brake >= 382
{
}
IF &brake >= 16382
{
&BrakeLIGHT = 1
}
}
Var 0062, name BrakeLIGHT, Link IOCARD_OUT, Output 61 // Speed_Brake LIGHT