예제 #1
0
from oxsConfig import ttk, W, E, Spinbox, fVario, varioTypeVar, secondBaroExist, varioSourceVar, varioHysteresisVar
from oxsConfig import analogVarioChanged, fAnalogVario, analogVarioExist, varioAnalogPinVar, varioAnalogMaxVar, varioAnalogMinVar

#here start the definition of the vario tab
ttk.Label(fVario, text="Type of sensor").grid(row=1, pady=(20, 2))
varioTypeBox = ttk.Combobox(fVario,
                            textvariable=varioTypeVar,
                            values=('MS5611', "GY86", "BMP085", "BMP180",
                                    "GY87", "BMP280"),
                            state="readonly")
#varioBox.bind('<<ComboboxSelected>>', varioChanged)
#protocolBox['state']='readonly'
varioTypeBox.grid(row=2, padx=10)
ttk.Checkbutton(fVario,
                text='a MS5611 is added as second sensor',
                variable=secondBaroExist,
                onvalue='On',
                offvalue='Off').grid(row=3,
                                     sticky=(W, E),
                                     padx=20,
                                     pady=(20, 2))

ttk.Label(fVario, text="Source of Vspeed field").grid(row=4, pady=(20, 2))
varioSourceBox = ttk.Combobox(fVario,
                              textvariable=varioSourceVar,
                              values=('FIRST_BARO', 'BARO_AND_IMU',
                                      'SECOND_BARO', 'AVERAGE_FIRST_SECOND',
                                      'AIRSPEED_COMPENSATED', 'PPM_SELECTION'),
                              state="readonly")
#varioBox.bind('<<ComboboxSelected>>', varioChanged)
#protocolBox['state']='readonly'
예제 #2
0
from oxsConfig import ttk , W , E , fFrsky , frskyVfasVar , frskyFuelVar , frskyA3Var , frskyA4Var , \
  frskyAccxVar , frskyAccyVar , frskyAcczVar , frskyT1Var , frskyT2Var

#here start the definition of the FRSKY tab
ttk.Label(fFrsky, text="VFAS").grid(column=0,
                                    row=1,
                                    padx=(15, 5),
                                    pady=(25, 5),
                                    sticky=(E))
frskyVfasBox = ttk.Combobox(fFrsky,
                            textvariable=frskyVfasVar,
                            values=('Not sent', 'VOLT_1', 'VOLT_2', 'VOLT_3',
                                    'VOLT_4', 'VOLT_5', 'VOLT_6', 'ADS_VOLT_1',
                                    'ADS_VOLT_2', 'ADS_VOLT_3', 'ADS_VOLT_4'),
                            state="readonly")
frskyVfasBox.grid(column=1, row=1, pady=(25, 5), sticky=(W))
ttk.Label(fFrsky, text="Fuel").grid(column=0,
                                    row=2,
                                    padx=(15, 5),
                                    pady=5,
                                    sticky=(E))
frskyFuelBox = ttk.Combobox(fFrsky,
                            textvariable=frskyFuelVar,
                            values=('Not sent', 'VOLT_1', 'VOLT_2', 'VOLT_3',
                                    'VOLT_4', 'VOLT_5', 'VOLT_6', 'ADS_VOLT_1',
                                    'ADS_VOLT_2', 'ADS_VOLT_3', 'ADS_VOLT_4'),
                            state="readonly")
frskyFuelBox.grid(column=1, row=2, sticky=(W))
ttk.Label(fFrsky, text="A3").grid(column=0,
                                  row=3,
                                  padx=(15, 5),
예제 #3
0
#from tkinter import StringVar
from oxsConfig import ttk, W, E, fMagnet

#define GENERATE_MAG_CALIBRATION_DATA   // uncomment this line when HMC5883 calibration has to be performed. Set back as comment once calibration parameters have been introduced

#define    XMAG_OFFSET 2.4683     // must be an integer
#define    YMAG_OFFSET -1.3694     // must be an integer
#define    ZMAG_OFFSET 138.9683     // must be an integer
#define    XXMAG_CORRECTION  0.122082   // can have decimals
#define    XYMAG_CORRECTION  -0.00204026
#define    XZMAG_CORRECTION  0.00377534
#define    YXMAG_CORRECTION  -0.00204026
#define    YYMAG_CORRECTION  0.130413
#define    YZMAG_CORRECTION  -0.00491189
#define    ZXMAG_CORRECTION  0.00377534
#define    ZYMAG_CORRECTION  -0.00491189
#define    ZZMAG_CORRECTION  0.138038

ttk.Label(
    fMagnet,
    text="Not yet implemented (so you have to edit manually the config files)"
).grid(column=0, row=4, padx=1, pady=20)
#dummyMagnetVar = StringVar(value='-')
#dummyBox = ttk.Combobox(fMagnet, textvariable=dummyMagnetVar,
#                values=( "-"  ),
#                state="readonly")
예제 #4
0
from oxsConfig import ttk , W , E , fMultiplex , multiplexLine1Var , multiplexLine2Var , multiplexLine3Var , multiplexLine4Var , multiplexLine5Var ,\
    multiplexLine6Var , multiplexLine7Var , multiplexLine8Var , multiplexLine9Var

#define SETUP_MULTIPLEX_DATA_TO_SEND    \
#                        5 , REL_ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
#                        6 , VERTICAL_SPEED , 1 , 1 , 0, -500 , 500  , \
#                        7 , ALTIMETER_MAX , 1 , 1 , 0 , -16384 , 16383
#                        // 8 , VOLT_1 , 1, 1 , 0 , -16384 , 16383
#                       // 6 , CURRENTMA , 1 , 1, 0 , -16384 , 16383 ,\
#                        // 7 , MILLIAH  , 1 , 1, 0 , -16384 , 16383
#                        // 7 , CELL_TOT , 1 , 1 , 0 , -16384 , 16383 , \
#                        // 4 , VOLT_4 , 1 , 1 , 0 , -16384 , 16383 , \
#                        // 9 , PPM , 1 , 1 , 0 , -16384 , 16383
#                        // 3 , ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
ttk.Label(
    fMultiplex,
    text="For one or several display line number, select the data to be sent"
).grid(column=0, row=1, columnspan=2, padx=(15, 5), pady=(25, 5), sticky=(E))
ttk.Label(fMultiplex, text="1").grid(column=0,
                                     row=2,
                                     padx=(15, 5),
                                     pady=(10, 5),
                                     sticky=('E'))
ttk.Label(fMultiplex, text="2").grid(column=0,
                                     row=3,
                                     padx=(15, 5),
                                     pady=(10, 5),
                                     sticky=('E'))
ttk.Label(fMultiplex, text="3").grid(column=0,
                                     row=4,
                                     padx=(15, 5),
                                     pady=(10, 5),
예제 #5
0
from oxsConfig import ttk, W, E, Spinbox
from oxsConfig import fPpm, fPpmType, ppmTypeVar, ppmTypeChanged, ppmPinVar, ppmForMin100Var, ppmForPlus100Var

#define PIN_PPM           2     // Uncomment this line in order to use a Rx channel to control oXs; default is 2 but my own device use 3
#define PPM_MIN_100       988     // default 1500 - 512 ; // pulse width (usec) when TX sends a channel = -100
#define PPM_PLUS_100      2012    // default 1500 + 512 ; // pulse width (usec) when TX sends a channel = +100

#define PPM_VIA_SPORT             // uncomment this line to get ppm data over SPORT protocol instead of from a PWM channel (it requires a Tx with openTx running LUA script)

#fPpmType = ttk.Frame(fPpm)
fPpmType.grid(column=1, row=8)  #by default make it visible

ttk.Label(fPpm, text="Ppm type").grid(column=0,
                                      row=1,
                                      padx=5,
                                      pady=10,
                                      sticky=W)
ppmTypeBox = ttk.Combobox(fPpm,
                          textvariable=ppmTypeVar,
                          values=('Rx chanel', "Sport"),
                          state="readonly",
                          width=12)
ppmTypeBox.bind('<<ComboboxSelected>>', ppmTypeChanged)
ppmTypeBox.grid(column=1, row=1, padx=10)

ttk.Label(fPpmType, text="Pin").grid(column=0, row=0, padx=5, pady=10)

ppmPinBox = ttk.Combobox(fPpmType,
                         textvariable=ppmPinVar,
                         values=('2', '3'),
                         state="readonly",
예제 #6
0
from oxsConfig import ttk, W, E, Spinbox, fRpm, pulsesPerRotationVar

#define PULSES_PER_ROTATION 2

ttk.Label(fRpm, text="Number of pulses per rotation").grid(row=1,
                                                           padx=5,
                                                           pady=(20, 2))

pulsesPerRotationBox = Spinbox(fRpm,
                               from_=1,
                               to=1000,
                               width=5,
                               textvariable=pulsesPerRotationVar)
pulsesPerRotationBox.grid(column=1, row=1, padx=5, pady=(20, 2))
예제 #7
0
from oxsConfig import ttk , W , E ,fVoltage  , volt1Exist , volt2Exist , volt3Exist ,volt4Exist , volt5Exist , volt6Exist ,\
    volt1PinVar , volt2PinVar , volt3PinVar , volt4PinVar , volt5PinVar , volt6PinVar , \
    volt1RgVar , volt2RgVar , volt3RgVar , volt4RgVar , volt5RgVar , volt6RgVar ,\
    volt1RvVar , volt2RvVar , volt3RvVar , volt4RvVar , volt5RvVar , volt6RvVar ,\
    volt1ScaleVar , volt2ScaleVar , volt3ScaleVar , volt4ScaleVar , volt5ScaleVar , volt6ScaleVar ,\
    volt1OffsetVar , volt2OffsetVar , volt3OffsetVar , volt4OffsetVar , volt5OffsetVar , volt6OffsetVar , \
    voltNumberOfCellsVar , voltReferenceVar , voltRefValueVar

from oxsCurrent import voltRefValueCurrentBox, voltRefValueCurrentLabel

# here start the definition of the Voltages tab
ttk.Label(fVoltage, text="Volt 1").grid(column=1, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Volt 2").grid(column=2, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Volt 3").grid(column=3, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Volt 4").grid(column=4, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Volt 5").grid(column=5, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Volt 6").grid(column=6, row=2, padx=5, pady=5)
ttk.Label(fVoltage, text="Actif").grid(column=0, row=3, padx=5)
ttk.Label(fVoltage, text="Analog pin").grid(column=0, row=4, padx=5)
ttk.Label(fVoltage, text="R to ground (0=No)").grid(column=0, row=5, padx=5)
ttk.Label(fVoltage, text="R to voltage (0=No)").grid(column=0, row=6, padx=5)
ttk.Label(fVoltage, text="Scale").grid(column=0, row=7, padx=5)
ttk.Label(fVoltage, text="Offset").grid(column=0, row=8, padx=5)

ttk.Checkbutton(fVoltage, variable=volt1Exist, onvalue='On',
                offvalue='Off').grid(column=1, row=3, sticky=(W, E), padx=20)
ttk.Checkbutton(fVoltage, variable=volt2Exist, onvalue='On',
                offvalue='Off').grid(column=2, row=3, sticky=(W, E), padx=20)
ttk.Checkbutton(fVoltage, variable=volt3Exist, onvalue='On',
                offvalue='Off').grid(column=3, row=3, sticky=(W, E), padx=20)
ttk.Checkbutton(fVoltage, variable=volt4Exist, onvalue='On',
예제 #8
0
       #self.pack()
#       
        
        fileName = r"oXs_config_advanced.h"
        try:
            f = open(fileName, "r")
            oxsDoc.insert(END, f.read() )
        #    st.settext( text = f.read() )
        except:
            oxsDoc.insert(END, "File oXs_config_advanced.h not found")
        #    st.settext(text = "File with docs not found")
        oxsDoc.config(state=DISABLED)



ttk.Label(fMain,  text="Components (details to be filled in tabs)").grid( row=0 , pady=(10,2)) #column=0 , sticky=(N,W,E,S)
ttk.Checkbutton(fMain, text='Ppm',  command=ppmChanged, variable=ppmExist,
        onvalue='On', offvalue='Off').grid(row=1, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Vario', command=varioChanged, variable=varioExist,
        onvalue='On', offvalue='Off').grid(row=2, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Voltages',  command=voltageChanged, variable=voltageExist,
        onvalue='On', offvalue='Off').grid(row=3, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Current',  command=currentChanged, variable=currentExist,
        onvalue='On', offvalue='Off').grid(row=4, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='GPS',  command=gpsChanged, variable=gpsExist,
        onvalue='On', offvalue='Off').grid(row=5, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Airspeed',  command=airspeedChanged, variable=airspeedExist,
        onvalue='On', offvalue='Off').grid(row=6, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Rpm',  command=rpmChanged, variable=rpmExist,
        onvalue='On', offvalue='Off').grid(row=7, sticky=(W,E), padx=20 , pady=5)
ttk.Checkbutton(fMain, text='Acc/Gyro (IMU6050)',  command=imuChanged, variable=imuExist,
예제 #9
0
from oxsConfig import ttk , W , E , Spinbox , fAirspeed , airspeedTypeVar , airspeedAtSea15CVar , airspeedInKmhVar , \
    airspeedResetAtPpmVar , airspeedCompMinAtPpmVar , airspeedCompMaxAtPpmVar , airspeedCompMinVar , airspeedCompMaxVar

#define AIRSPEED_SENSOR_USE       NO_AIRSPEED       // select between NO_AIRSPEED , MS4525 , MPXV7002

#define AIRSPEED_AT_SEA_LEVEL_AND_15C // if this line is commented, airspeed is calculated using baro pressure and temperature (so being "true" airspeed instead of normalised airspeed)      
#define AIRSPEED_IN_KMH  // uncomment this line if airspeed has to be in km/h instead of knot/h ( except some old versions, openTx expects knot/h) 

#define AIRSPEED_RESET_AT_PPM   100

#define COMPENSATION_MIN_AT_PPM 60
#define COMPENSATION_MAX_AT_PPM 90
#define COMPENSATION_PPM_MIN  80
#define COMPENSATION_PPM_MAX 140

ttk.Label(fAirspeed, text="Type of sensor").grid(row=1, sticky=E , pady=(20,2))
airspeedTypeBox = ttk.Combobox(fAirspeed, textvariable=airspeedTypeVar, 
                values=( "MS4525" , "MPXV7002" ),
                state="readonly")
airspeedTypeBox.grid(column=1 , sticky=W , row=1, padx=5)
ttk.Checkbutton(fAirspeed, text='Airspeed at sea level and 15 degree Celsius',  variable=airspeedAtSea15CVar,
	    onvalue='On', offvalue='Off').grid(row=2, sticky=(W), padx=10 , pady=(20,2))
ttk.Checkbutton(fAirspeed, text='Airspeed in km/h (otherwise in knot/h as expected by openTx)',  variable=airspeedInKmhVar,
	    onvalue='On', offvalue='Off').grid(row=3, sticky=(W,E), padx=10 , pady=(20,2))

ttk.Label(fAirspeed, text="Reset airspeed when ppm is (%)").grid(row=4, sticky=(E), pady=(20,2))
airspeedResetAtPpmBox = Spinbox(fAirspeed , from_=0, to=100, width = 5 , textvariable=airspeedResetAtPpmVar ) 
airspeedResetAtPpmBox.grid(column=1, row=4 , sticky=W,  padx=5, pady=(20,2))

ttk.Label(fAirspeed, text="Min Compensation when ppm is (%)").grid(row=5, sticky=(E), pady=(20,2))
airspeedCompMinAtPpmBox = Spinbox(fAirspeed , from_=0, to=100, width = 5 , textvariable=airspeedCompMinAtPpmVar ) 
예제 #10
0
from oxsConfig import ttk, W, E, fGps, gps3dExist, gpsRateVar

#here start the definition of the GPS tab
#define GPS_SPEED_3D      // uncomment this line if GPS speed has to be the 3d speed instead of the 2d speed (note: 3d is probably less accurate - to test)
#define GPS_REFRESH_RATE  5       // rate at which GPS sent new data; select between 1, 5 or 10 (Hz). Default = 5 Hz; Ublox NEO6 does not support 10 hz
ttk.Label(fGps, text="3D speed").grid(column=0,
                                      row=1,
                                      padx=(15, 5),
                                      pady=25,
                                      sticky=(E))
ttk.Checkbutton(fGps, variable=gps3dExist, onvalue='On',
                offvalue='Off').grid(column=1, row=1, sticky=('W', 'E'))
ttk.Label(fGps, text="Refresh rate (Hz)").grid(column=0,
                                               row=2,
                                               padx=(15, 5),
                                               pady=5,
                                               sticky=(E))
gpsRateBox = ttk.Combobox(fGps,
                          textvariable=gpsRateVar,
                          values=('1', "5", "10"),
                          state="readonly",
                          width=2)
gpsRateBox.grid(column=1, row=2, sticky=(W))
예제 #11
0
from oxsConfig import ttk, W, E, fJeti, jetiTemperatureSourceVar, jetiVoltageSourceVar

#define VOLTAGE_SOURCE   VOLT_1                     // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
#define TEMPERATURE_SOURCE NTC                   // select between MS5611 and NTC

ttk.Label(fJeti, text="Voltage source").grid(column=0,
                                             row=1,
                                             padx=(15, 5),
                                             pady=(10, 5),
                                             sticky=('E'))
ttk.Label(fJeti, text="Temperature source").grid(column=0,
                                                 row=2,
                                                 pady=(15, 5),
                                                 sticky=('WE'))
jetiVoltageSourceBox = ttk.Combobox(fJeti,
                                    textvariable=jetiVoltageSourceVar,
                                    values=('Not sent', 'VOLT_1', 'VOLT_2',
                                            'VOLT_3', 'VOLT_4', 'VOLT_5',
                                            'VOLT_6'),
                                    state="readonly")
jetiVoltageSourceBox.grid(column=1, row=1, pady=(15, 5), sticky=('W'))
jetiTemperatureSourceBox = ttk.Combobox(fJeti,
                                        textvariable=jetiTemperatureSourceVar,
                                        values=('Not sent', 'MS5611', 'NTC'),
                                        state="readonly")
jetiTemperatureSourceBox.grid(column=1, row=2, pady=(15, 5), sticky=('W'))
예제 #12
0
from oxsConfig import ttk , W , E , fCurrent , currentPinVar , currentExist , currentMvoltAt0Var , currentMvoltPerAmpVar ,\
     currentRcVar , currentRgVar , voltReferenceVar , voltRefValueVar

#from oxsVoltage import voltReferenceChangedInCurrent

#here start the definition of the current tab
#define PIN_CURRENTSENSOR      2
#define MVOLT_AT_ZERO_AMP        600
#define MVOLT_PER_AMP            60
#define RESISTOR_TO_GROUND_FOR_CURRENT  10
#define RESISTOR_TO_CURRENT_SENSOR      40
ttk.Label(fCurrent, text="Analog pin").grid(column=0,
                                            row=1,
                                            padx=(15, 5),
                                            pady=25,
                                            sticky=(E))
ttk.Label(fCurrent, text="mVolt at 0 Amp").grid(column=0,
                                                row=2,
                                                padx=(15, 5),
                                                pady=5,
                                                sticky=(E))
ttk.Label(fCurrent, text="mVolt per Amp").grid(column=0,
                                               row=3,
                                               padx=(15, 5),
                                               pady=5,
                                               sticky=(E))
ttk.Label(fCurrent, text="R to ground").grid(column=0,
                                             row=4,
                                             padx=(15, 5),
                                             pady=5,
                                             sticky=(E))
예제 #13
0
#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT                      // uncomment to activate this option; note: when there is a GPS fix 3D (or higher), then number of sat is increased by 100

#define FILL_TEST2_WITH_GPS_HDOP                               // uncomment to activate this option

ttk.Checkbutton(fAddFields,
                text='Fill Test_3 with expected altitude',
                variable=fillTest3ExpectedAltitudeVar,
                command=fillTest3ExpectedAltitudeChanged,
                onvalue='On',
                offvalue='Off').grid(row=3,
                                     sticky=(W, E),
                                     padx=20,
                                     pady=(20, 2))

ttk.Label(fFillTest3ExpectedAltitude,
          text="Exp.Alt to be calculated for").grid(column=0, row=4, padx=1)
expAltTimeBox = Spinbox(fFillTest3ExpectedAltitude,
                        from_=0.2,
                        to=5.0,
                        textvariable=expAltTimeVar,
                        increment='0.1',
                        width=4)
expAltTimeBox.grid(column=1, row=4, padx=10)
ttk.Label(fFillTest3ExpectedAltitude, text="sec in the future").grid(column=2,
                                                                     row=4,
                                                                     padx=1)

ttk.Checkbutton(fAddFields,
                text='Fill Test_1 2 3 with linear Acc',
                variable=fillTest123LinearAccVar,
                onvalue='On',
예제 #14
0
from oxsConfig import ttk , W , E ,  fHott , hottBattery1SourceVar , hottBattery2SourceVar , hottCellUndervoltageVar ,\
    hottMainBatterySourceVar , hottT1SourceVar , hottT2SourceVar

#define CELL_UNDERVOLTAGE_WARNING 3300            // Warning threshold in mV;
#define BATTERY_1_SOURCE          ADS_VOLT_1      // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define BATTERY_2_SOURCE          ADS_VOLT_2      // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define MAIN_BATTERY_SOURCE       ADS_VOLT_3      // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define TEMPERATURE_1_SOURCE      VOLT_1          //  select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY , PPM
#define TEMPERATURE_2_SOURCE      PPM             //  select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY, PPM

ttk.Label(fHott, text="Undervoltage warning (in mVolt)").grid(column=0,
                                                              row=1,
                                                              padx=(15, 5),
                                                              pady=(10, 5),
                                                              sticky=('E'))
ttk.Label(fHott, text="Based on").grid(column=1,
                                       row=2,
                                       pady=(30, 5),
                                       sticky=('WE'))
ttk.Label(fHott, text="Battery 1").grid(column=0,
                                        row=3,
                                        padx=(15, 5),
                                        pady=(10, 5),
                                        sticky=('E'))
ttk.Label(fHott, text="Battery 2").grid(column=0,
                                        row=4,
                                        padx=(15, 5),
                                        pady=(10, 5),
                                        sticky=('E'))
ttk.Label(fHott, text="Main battery").grid(column=0,
                                           row=5,