1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Added support for multiple apply/save buttons.

Added a few useful signals.
This commit is contained in:
zedamota 2012-02-08 20:15:14 +00:00
parent 5cfd763f2a
commit 4cdf223bff
5 changed files with 526 additions and 73 deletions

View File

@ -1140,6 +1140,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:default</string>
<string>buttongroup:1</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>
@ -1188,7 +1194,13 @@ border-radius: 4;
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Stabilization+panel</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>51</width>
@ -3389,6 +3401,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3420,6 +3433,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3463,6 +3477,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3494,6 +3509,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3537,6 +3553,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3568,6 +3585,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3630,6 +3648,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3661,6 +3680,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3704,6 +3724,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3735,6 +3756,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3778,6 +3800,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -3809,6 +3832,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
@ -4458,6 +4482,12 @@ border-radius: 5;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:default</string>
<string>buttongroup:2</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>
@ -6652,7 +6682,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6684,7 +6714,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6728,7 +6758,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6760,7 +6790,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6804,7 +6834,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6836,7 +6866,7 @@ border-radius: 5;</string>
<string>element:Kp</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6899,7 +6929,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6931,7 +6961,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -6975,7 +7005,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -7007,7 +7037,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -7051,7 +7081,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -7083,7 +7113,7 @@ border-radius: 5;</string>
<string>element:Ki</string>
<string>scale:0.1</string>
<string>haslimits:yes</string>
<string>buttongroup:2</string>
<string>buttongroup:2,10</string>
</stringlist>
</property>
</widget>
@ -7099,6 +7129,12 @@ border-radius: 5;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Stabilization+panel</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>51</width>
@ -7779,6 +7815,12 @@ border-radius: 4;
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Stabilization+panel</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>51</width>
@ -7825,6 +7867,12 @@ border-radius: 4;
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:default</string>
<string>buttongroup:3</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>
@ -10021,6 +10069,15 @@ Angle</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10043,6 +10100,15 @@ Angle</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10077,6 +10143,15 @@ Angle</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10099,6 +10174,15 @@ Angle</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10133,6 +10217,15 @@ Angle</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10155,6 +10248,15 @@ Angle</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawMax</string>
<string>haslimits:yes</string>
<string>scale:1.8</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10209,6 +10311,16 @@ Rate</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Roll</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10231,6 +10343,16 @@ Rate</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Roll</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10265,6 +10387,16 @@ Rate</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Pitch</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10287,6 +10419,16 @@ Rate</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Pitch</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10321,6 +10463,16 @@ Rate</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Yaw</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10343,6 +10495,16 @@ Rate</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Yaw</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10397,6 +10559,16 @@ Attitude</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Roll</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10419,6 +10591,16 @@ Attitude</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Roll</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10453,6 +10635,16 @@ Attitude</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Pitch</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10475,6 +10667,16 @@ Attitude</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Pitch</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10509,6 +10711,16 @@ Attitude</string>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Yaw</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -10531,6 +10743,16 @@ Attitude</string>
</property>
<property name="text">
<string>50</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:MaximumRate</string>
<string>element:Yaw</string>
<string>haslimits:yes</string>
<string>scale:5</string>
<string>buttongroup:3,10</string>
</stringlist>
</property>
</widget>
</item>
@ -11155,6 +11377,12 @@ Attitude</string>
<property name="text">
<string>Zero the integral when throttle is low</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:LowThrottleZeroIntegral</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="0">
@ -11211,6 +11439,12 @@ automatically every 300ms, which will help for fast tuning.</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Stabilization+panel</string>
</stringlist>
</property>
<property name="maximumSize">
<size>
<width>32</width>
@ -11243,6 +11477,12 @@ automatically every 300ms, which will help for fast tuning.</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:reload</string>
<string>buttongroup:10</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>120</width>
@ -12075,6 +12315,13 @@ border-radius: 4;
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>button:default</string>
<string>buttongroup:4</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>
@ -14253,6 +14500,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollRatePID</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14287,6 +14544,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14318,6 +14585,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawRatePID</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14390,6 +14667,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollRatePID</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14441,6 +14728,16 @@ value as YawRate Kp.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14488,6 +14785,16 @@ value as YawRate Kp.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawRatePID</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14556,6 +14863,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollRatePID</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14590,6 +14907,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -14621,6 +14948,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawRatePID</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:4,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -15325,6 +15662,13 @@ You can usually go for higher values for Yaw factors.</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>button:default</string>
<string>buttongroup:5</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>
@ -17503,6 +17847,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollPI</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17537,6 +17891,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchPI</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17568,6 +17932,16 @@ border-radius: 5;</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawPI</string>
<string>element:Kp</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17640,6 +18014,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollPI</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17691,6 +18075,16 @@ value as YawRate Kp.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchPI</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17738,6 +18132,16 @@ value as YawRate Kp.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawPI</string>
<string>element:Ki</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17806,6 +18210,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollPI</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17840,6 +18254,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchPI</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -17871,6 +18295,16 @@ You can usually go for higher values for Yaw factors.</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:YawPI</string>
<string>element:ILimit</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:5,20</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
@ -18530,6 +18964,13 @@ You can usually go for higher values for Yaw factors.</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>button:default</string>
<string>buttongroup:6</string>
</stringlist>
</property>
<property name="minimumSize">
<size>
<width>81</width>

View File

@ -35,6 +35,8 @@ ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnecte
TelemetryManager* telMngr = pm->getObject<TelemetryManager>();
connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()));
connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()));
connect(telMngr, SIGNAL(connected()), this, SIGNAL(autoPilotConnected()));
connect(telMngr, SIGNAL(disconnected()), this, SIGNAL(autoPilotDisconnected()));
UAVSettingsImportExportFactory * importexportplugin = pm->getObject<UAVSettingsImportExportFactory>();
connect(importexportplugin,SIGNAL(importAboutToBegin()),this,SLOT(invalidateObjects()));
}
@ -65,7 +67,8 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
if(!field.isEmpty() && obj)
{
_field = obj->getField(QString(field));
index=_field->getElementNames().indexOf(QString(element));
if(!element.isEmpty())
index=_field->getElementNames().indexOf(QString(element));
}
addUAVObjectToWidgetRelation(object, field, widget,index,scale,isLimited,defaultReloadGroups);
}
@ -99,7 +102,6 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
if(smartsave)
{
smartsave->addObject((UAVDataObject*)obj);
emit objectAdded(obj);
}
}
if(widget==NULL)
@ -180,6 +182,7 @@ void ConfigTaskWidget::onAutopilotConnect()
void ConfigTaskWidget::populateWidgets()
{
bool dirtyBack=dirty;
emit populateWidgetsRequested();
foreach(objectToWidget * ow,objOfInterest)
{
if(ow->object==NULL || ow->field==NULL || ow->widget==NULL)
@ -195,6 +198,7 @@ void ConfigTaskWidget::populateWidgets()
void ConfigTaskWidget::refreshWidgetsValues()
{
bool dirtyBack=dirty;
emit refreshWidgetsValuesRequested();
foreach(objectToWidget * ow,objOfInterest)
{
if(ow->object==NULL || ow->field==NULL || ow->widget==NULL)
@ -212,6 +216,7 @@ void ConfigTaskWidget::refreshWidgetsValues()
void ConfigTaskWidget::updateObjectsFromWidgets()
{
emit updateObjectsFromWidgetsRequested();
foreach(objectToWidget * ow,objOfInterest)
{
if(ow->object==NULL || ow->field==NULL)
@ -233,17 +238,21 @@ void ConfigTaskWidget::helpButtonPressed()
void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save)
{
smartsave=new smartSaveButton(update,save);
connect(smartsave,SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets()));
connect(smartsave,SIGNAL(saveSuccessfull()),this,SLOT(clearDirty()));
connect(smartsave,SIGNAL(beginOp()),this,SLOT(disableObjUpdates()));
connect(smartsave,SIGNAL(endOp()),this,SLOT(enableObjUpdates()));
if(!smartsave)
{
smartsave=new smartSaveButton();
smartsave->addButtons(save,update);
connect(smartsave,SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets()));
connect(smartsave,SIGNAL(saveSuccessfull()),this,SLOT(clearDirty()));
connect(smartsave,SIGNAL(beginOp()),this,SLOT(disableObjUpdates()));
connect(smartsave,SIGNAL(endOp()),this,SLOT(enableObjUpdates()));
}
smartsave->addButtons(save,update);
if(objOfInterest.count()>0)
{
foreach(objectToWidget * oTw,objOfInterest)
{
smartsave->addObject((UAVDataObject*)oTw->object);
emit objectAdded(oTw->object);
}
}
enableControls(false);
@ -253,10 +262,14 @@ void ConfigTaskWidget::enableControls(bool enable)
{
if(smartsave)
smartsave->enableControls(enable);
foreach (QPushButton * button, reloadButtonList) {
button->setEnabled(enable);
}
}
void ConfigTaskWidget::widgetsContentsChanged()
{
emit widgetContentsChanged((QWidget*)sender());
double scale;
objectToWidget * oTw= shadowsList.value((QWidget*)sender(),NULL);
@ -289,17 +302,19 @@ void ConfigTaskWidget::widgetsContentsChanged()
}
if(oTw->widget!=(QWidget *)sender())
{
disconnectWidgetUpdatesToSlot((QWidget*)oTw->widget,SLOT(widgetsContentsChanged()));
checkWidgetsLimits(oTw->widget,oTw->field,oTw->index,oTw->isLimited,getVariantFromWidget((QWidget*)sender(),scale),oTw->scale);
setWidgetFromVariant(oTw->widget,getVariantFromWidget((QWidget*)sender(),scale),oTw->scale);
connectWidgetUpdatesToSlot((QWidget*)oTw->widget,SLOT(widgetsContentsChanged()));
}
foreach (shadow * sh, oTw->shadowsList)
{
if(sh->widget!=(QWidget*)sender())
{
checkWidgetsLimits(sh->widget,oTw->field,oTw->index,sh->isLimited,getVariantFromWidget((QWidget*)sender(),scale),oTw->scale);
disconnectWidgetUpdatesToSlot((QWidget*)sender(),SLOT(widgetsContentsChanged()));
disconnectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged()));
checkWidgetsLimits(sh->widget,oTw->field,oTw->index,sh->isLimited,getVariantFromWidget((QWidget*)sender(),scale),sh->scale);
setWidgetFromVariant(sh->widget,getVariantFromWidget((QWidget*)sender(),scale),sh->scale);
connectWidgetUpdatesToSlot((QWidget*)sender(),SLOT(widgetsContentsChanged()));
connectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged()));
}
}
}
@ -345,34 +360,6 @@ void ConfigTaskWidget::objectUpdated(UAVObject *obj)
objectUpdates[obj]=true;
}
void ConfigTaskWidget::removeObject(UAVObject * obj)
{
emit objectRemoved(obj);
QList<objectToWidget*> toRemove;
foreach(objectToWidget * oTw,objOfInterest)
{
if(oTw->object==obj)
{
toRemove.append(oTw);
}
}
foreach(objectToWidget * oTw,toRemove)
{
objOfInterest.removeAll(oTw);
smartsave->removeObject((UAVDataObject*)oTw->object);
}
}
void ConfigTaskWidget::removeAllObjects()
{
foreach(objectToWidget * oTw,objOfInterest)
{
emit objectRemoved(oTw->object);
}
objOfInterest.clear();
smartsave->removeAllObjects();
}
bool ConfigTaskWidget::allObjectsUpdated()
{
bool ret=true;
@ -450,6 +437,8 @@ void ConfigTaskWidget::autoLoadWidgets()
uiRelationAutomation uiRelation;
uiRelation.buttonType=none;
uiRelation.scale=1;
uiRelation.element=QString();
uiRelation.haslimits=false;
foreach(QString str, info.toStringList())
{
QString prop=str.split(":").at(0);
@ -497,7 +486,7 @@ void ConfigTaskWidget::autoLoadWidgets()
}
else if(prop=="url")
uiRelation.url=value;
uiRelation.url=str.mid(str.indexOf(":")+1);
}
if(!uiRelation.buttonType==none)
{
@ -520,6 +509,12 @@ void ConfigTaskWidget::autoLoadWidgets()
if(button)
addReloadButton(button,uiRelation.buttonGroup.at(0));
break;
case help_button:
button=qobject_cast<QPushButton *>(widget);
if(button)
addHelpButton(button,uiRelation.url);
break;
default:
break;
}
@ -528,6 +523,10 @@ void ConfigTaskWidget::autoLoadWidgets()
{
QWidget * wid=qobject_cast<QWidget *>(widget);
qDebug()<<"adding widget"<<(quint32)wid;
if(uiRelation.element.isEmpty())
{
qDebug()<<"empty element";
}
if(wid)
addUAVObjectToWidgetRelation(uiRelation.objname,uiRelation.fieldname,wid,uiRelation.element,uiRelation.scale,uiRelation.haslimits,&uiRelation.buttonGroup);
}
@ -578,6 +577,7 @@ void ConfigTaskWidget::addDefaultButton(QPushButton *button, int buttonGroup)
void ConfigTaskWidget::addReloadButton(QPushButton *button, int buttonGroup)
{
button->setProperty("group",buttonGroup);
reloadButtonList.append(button);
connect(button,SIGNAL(clicked()),this,SLOT(reloadButtonClicked()));
}
void ConfigTaskWidget::defaultButtonClicked()
@ -596,7 +596,9 @@ void ConfigTaskWidget::defaultButtonClicked()
void ConfigTaskWidget::reloadButtonClicked()
{
int group=sender()->property("group").toInt();
QList<objectToWidget*> * list=defaultReloadGroups.value(group);
QList<objectToWidget*> * list=defaultReloadGroups.value(group,NULL);
if(!list)
return;
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) );
QTimer * timeOut=new QTimer(this);
QEventLoop * eventLoop=new QEventLoop(this);
@ -741,7 +743,7 @@ QVariant ConfigTaskWidget::getVariantFromWidget(QWidget * widget,double scale)
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget))
{
return (bool)(cb->isChecked()?"TRUE":"FALSE");
return (QString)(cb->isChecked()?"TRUE":"FALSE");
}
else
return QVariant();
@ -781,7 +783,8 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget))
{
cb->setChecked(value.toBool());
bool bvalue=value.toString()=="TRUE";
cb->setChecked(bvalue);
return true;
}
else

View File

@ -119,11 +119,13 @@ public slots:
void onAutopilotDisconnect();
void onAutopilotConnect();
void invalidateObjects();
void removeObject(UAVObject*);
void removeAllObjects();
signals:
void objectAdded(UAVObject*);
void objectRemoved(UAVObject*);
void widgetContentsChanged(QWidget * widget);
void populateWidgetsRequested();
void refreshWidgetsValuesRequested();
void updateObjectsFromWidgetsRequested();
void autoPilotConnected();
void autoPilotDisconnected();
private slots:
void objectUpdated(UAVObject*);
void defaultButtonClicked();
@ -139,6 +141,7 @@ private:
QMap<int,QList<objectToWidget*> *> defaultReloadGroups;
QMap<QWidget *,objectToWidget*> shadowsList;
QMap<QPushButton *,QString> helpButtonList;
QList<QPushButton *> reloadButtonList;
bool dirty;
bool setFieldFromWidget(QWidget *widget, UAVObjectField *field, int index, double scale);
bool setWidgetFromField(QWidget *widget, UAVObjectField *field, int index, double scale, bool hasLimits);

View File

@ -26,22 +26,27 @@
*/
#include "smartsavebutton.h"
smartSaveButton::smartSaveButton(QPushButton * update, QPushButton * save):bupdate(update),bsave(save)
smartSaveButton::smartSaveButton()
{
connect(bsave,SIGNAL(clicked()),this,SLOT(processClick()));
connect(bupdate,SIGNAL(clicked()),this,SLOT(processClick()));
}
void smartSaveButton::addButtons(QPushButton *save, QPushButton *apply)
{
buttonList.insert(save,save_button);
buttonList.insert(apply,apply_button);
connect(save,SIGNAL(clicked()),this,SLOT(processClick()));
connect(apply,SIGNAL(clicked()),this,SLOT(processClick()));
}
void smartSaveButton::processClick()
{
emit beginOp();
bool save=false;
QPushButton *button=bupdate;
if(sender()==bsave)
{
QPushButton *button=qobject_cast<QPushButton *>(sender());
if(!button)
return;
if(buttonList.value(button)==save_button)
save=true;
button=bsave;
}
emit preProcessOperations();
button->setEnabled(false);
button->setIcon(QIcon(":/uploader/images/system-run.svg"));
@ -161,6 +166,6 @@ void smartSaveButton::saving_finished(int id, bool result)
void smartSaveButton::enableControls(bool value)
{
bupdate->setEnabled(value);
bsave->setEnabled(value);
foreach(QPushButton * button,buttonList.keys())
button->setEnabled(value);
}

View File

@ -39,10 +39,12 @@
#include <QDebug>
class smartSaveButton:public QObject
{
enum buttonTypeEnum {save_button,apply_button};
public:
Q_OBJECT
public:
smartSaveButton(QPushButton * update,QPushButton * save);
smartSaveButton();
void addButtons(QPushButton * save,QPushButton * apply);
void setObjects(QList<UAVDataObject *>);
void addObject(UAVDataObject *);
void clearObjects();
@ -59,14 +61,13 @@ private slots:
void saving_finished(int,bool);
private:
QPushButton *bupdate;
QPushButton *bsave;
quint32 current_objectID;
UAVDataObject * current_object;
bool up_result;
bool sv_result;
QEventLoop loop;
QList<UAVDataObject *> objects;
QMap<QPushButton *,buttonTypeEnum> buttonList;
protected:
public slots:
void enableControls(bool value);