@@ -240,30 +240,30 @@ public FlightData()
240
240
string desc = MainV2 . comPort . MAV . cs . GetNameandUnit ( name ) ;
241
241
using ( var cb = new CheckBox { Name = name , Checked = true , Text = desc } )
242
242
{
243
- chk_box_CheckedChanged ( cb , EventArgs . Empty ) ;
243
+ chk_box_tunningCheckedChanged ( cb , EventArgs . Empty ) ;
244
244
}
245
245
}
246
246
}
247
247
else
248
248
{
249
249
using ( var cb = new CheckBox { Name = "roll" , Checked = true } )
250
250
{
251
- chk_box_CheckedChanged ( cb , EventArgs . Empty ) ;
251
+ chk_box_tunningCheckedChanged ( cb , EventArgs . Empty ) ;
252
252
}
253
253
254
254
using ( var cb = new CheckBox { Name = "pitch" , Checked = true } )
255
255
{
256
- chk_box_CheckedChanged ( cb , EventArgs . Empty ) ;
256
+ chk_box_tunningCheckedChanged ( cb , EventArgs . Empty ) ;
257
257
}
258
258
259
259
using ( var cb = new CheckBox { Name = "nav_roll" , Checked = true } )
260
260
{
261
- chk_box_CheckedChanged ( cb , EventArgs . Empty ) ;
261
+ chk_box_tunningCheckedChanged ( cb , EventArgs . Empty ) ;
262
262
}
263
263
264
264
using ( var cb = new CheckBox { Name = "nav_pitch" , Checked = true } )
265
265
{
266
- chk_box_CheckedChanged ( cb , EventArgs . Empty ) ;
266
+ chk_box_tunningCheckedChanged ( cb , EventArgs . Empty ) ;
267
267
}
268
268
}
269
269
@@ -542,7 +542,7 @@ public void CreateChart(ZedGraphControl zgc)
542
542
GraphPane myPane = zgc . GraphPane ;
543
543
544
544
// Set the titles and axis labels
545
- myPane . Title . Text = "Tuning" ;
545
+ myPane . Title . Text = "Tuning - Double click to change items " ;
546
546
myPane . XAxis . Title . Text = "Time (s)" ;
547
547
myPane . YAxis . Title . Text = "Unit" ;
548
548
@@ -1681,7 +1681,7 @@ private void CHK_autopan_CheckedChanged(object sender, EventArgs e)
1681
1681
//GCSViews.FlightPlanner.instance.autopan = CHK_autopan.Checked;
1682
1682
}
1683
1683
1684
- void chk_box_CheckedChanged ( object sender , EventArgs e )
1684
+ void chk_box_tunningCheckedChanged ( object sender , EventArgs e )
1685
1685
{
1686
1686
ThemeManager . ApplyThemeTo ( ( Control ) sender ) ;
1687
1687
@@ -1697,6 +1697,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1697
1697
list1curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list1 , Color . Red ,
1698
1698
SymbolType . None ) ;
1699
1699
list1curve . Tag = ( ( CheckBox ) sender ) . Name ;
1700
+ if ( tuningwasrightclick )
1701
+ {
1702
+ list1curve . Label . Text += " R" ;
1703
+ list1curve . IsY2Axis = true ;
1704
+ list1curve . YAxisIndex = 0 ;
1705
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1706
+ }
1700
1707
}
1701
1708
}
1702
1709
else if ( list2item == null )
@@ -1707,6 +1714,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1707
1714
list2curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list2 , Color . Blue ,
1708
1715
SymbolType . None ) ;
1709
1716
list2curve . Tag = ( ( CheckBox ) sender ) . Name ;
1717
+ if ( tuningwasrightclick )
1718
+ {
1719
+ list2curve . Label . Text += " R" ;
1720
+ list2curve . IsY2Axis = true ;
1721
+ list2curve . YAxisIndex = 0 ;
1722
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1723
+ }
1710
1724
}
1711
1725
}
1712
1726
else if ( list3item == null )
@@ -1717,6 +1731,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1717
1731
list3curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list3 , Color . Green ,
1718
1732
SymbolType . None ) ;
1719
1733
list3curve . Tag = ( ( CheckBox ) sender ) . Name ;
1734
+ if ( tuningwasrightclick )
1735
+ {
1736
+ list3curve . Label . Text += " R" ;
1737
+ list3curve . IsY2Axis = true ;
1738
+ list3curve . YAxisIndex = 0 ;
1739
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1740
+ }
1720
1741
}
1721
1742
}
1722
1743
else if ( list4item == null )
@@ -1727,6 +1748,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1727
1748
list4curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list4 , Color . Orange ,
1728
1749
SymbolType . None ) ;
1729
1750
list4curve . Tag = ( ( CheckBox ) sender ) . Name ;
1751
+ if ( tuningwasrightclick )
1752
+ {
1753
+ list4curve . Label . Text += " R" ;
1754
+ list4curve . IsY2Axis = true ;
1755
+ list4curve . YAxisIndex = 0 ;
1756
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1757
+ }
1730
1758
}
1731
1759
}
1732
1760
else if ( list5item == null )
@@ -1737,6 +1765,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1737
1765
list5curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list5 , Color . Yellow ,
1738
1766
SymbolType . None ) ;
1739
1767
list5curve . Tag = ( ( CheckBox ) sender ) . Name ;
1768
+ if ( tuningwasrightclick )
1769
+ {
1770
+ list5curve . Label . Text += " R" ;
1771
+ list5curve . IsY2Axis = true ;
1772
+ list5curve . YAxisIndex = 0 ;
1773
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1774
+ }
1740
1775
}
1741
1776
}
1742
1777
else if ( list6item == null )
@@ -1747,6 +1782,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1747
1782
list6curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list6 , Color . Magenta ,
1748
1783
SymbolType . None ) ;
1749
1784
list6curve . Tag = ( ( CheckBox ) sender ) . Name ;
1785
+ if ( tuningwasrightclick )
1786
+ {
1787
+ list6curve . Label . Text += " R" ;
1788
+ list6curve . IsY2Axis = true ;
1789
+ list6curve . YAxisIndex = 0 ;
1790
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1791
+ }
1750
1792
}
1751
1793
}
1752
1794
else if ( list7item == null )
@@ -1757,6 +1799,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1757
1799
list7curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list7 , Color . Purple ,
1758
1800
SymbolType . None ) ;
1759
1801
list7curve . Tag = ( ( CheckBox ) sender ) . Name ;
1802
+ if ( tuningwasrightclick )
1803
+ {
1804
+ list7curve . Label . Text += " R" ;
1805
+ list7curve . IsY2Axis = true ;
1806
+ list7curve . YAxisIndex = 0 ;
1807
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1808
+ }
1760
1809
}
1761
1810
}
1762
1811
else if ( list8item == null )
@@ -1767,6 +1816,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1767
1816
list8curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list8 , Color . LimeGreen ,
1768
1817
SymbolType . None ) ;
1769
1818
list8curve . Tag = ( ( CheckBox ) sender ) . Name ;
1819
+ if ( tuningwasrightclick )
1820
+ {
1821
+ list8curve . Label . Text += " R" ;
1822
+ list8curve . IsY2Axis = true ;
1823
+ list8curve . YAxisIndex = 0 ;
1824
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1825
+ }
1770
1826
}
1771
1827
}
1772
1828
else if ( list9item == null )
@@ -1777,6 +1833,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1777
1833
list9curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list9 , Color . Cyan ,
1778
1834
SymbolType . None ) ;
1779
1835
list9curve . Tag = ( ( CheckBox ) sender ) . Name ;
1836
+ if ( tuningwasrightclick )
1837
+ {
1838
+ list9curve . Label . Text += " R" ;
1839
+ list9curve . IsY2Axis = true ;
1840
+ list9curve . YAxisIndex = 0 ;
1841
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1842
+ }
1780
1843
}
1781
1844
}
1782
1845
else if ( list10item == null )
@@ -1787,6 +1850,13 @@ void chk_box_CheckedChanged(object sender, EventArgs e)
1787
1850
list10curve = zg1 . GraphPane . AddCurve ( ( ( CheckBox ) sender ) . Text , list10 , Color . Violet ,
1788
1851
SymbolType . None ) ;
1789
1852
list10curve . Tag = ( ( CheckBox ) sender ) . Name ;
1853
+ if ( tuningwasrightclick )
1854
+ {
1855
+ list10curve . Label . Text += " R" ;
1856
+ list10curve . IsY2Axis = true ;
1857
+ list10curve . YAxisIndex = 0 ;
1858
+ zg1 . GraphPane . Y2Axis . IsVisible = true ;
1859
+ }
1790
1860
}
1791
1861
}
1792
1862
else
@@ -4576,7 +4646,7 @@ void tfr_GotTFRs(object sender, EventArgs e)
4576
4646
} ) ;
4577
4647
}
4578
4648
4579
- private void timer1_Tick ( object sender , EventArgs e )
4649
+ private void ZedGraphTimer_Tick ( object sender , EventArgs e )
4580
4650
{
4581
4651
try
4582
4652
{
@@ -5060,7 +5130,8 @@ private void zg1_DoubleClick(object sender, EventArgs e)
5060
5130
chk_box . Tag = "custom" ;
5061
5131
chk_box . Location = new Point ( 5 + ( i / row_count ) * ( max_length + 5 ) , 2 + ( i % row_count ) * row_height ) ;
5062
5132
chk_box . Size = new Size ( 120 , 20 ) ;
5063
- chk_box . CheckedChanged += chk_box_CheckedChanged ;
5133
+ chk_box . CheckedChanged += chk_box_tunningCheckedChanged ;
5134
+ chk_box . MouseDown += Chk_box_tunningMouseDown ;
5064
5135
chk_box . AutoSize = true ;
5065
5136
5066
5137
selectform . Controls . Add ( chk_box ) ;
@@ -5081,6 +5152,17 @@ private void zg1_DoubleClick(object sender, EventArgs e)
5081
5152
selectform . Show ( ) ;
5082
5153
}
5083
5154
5155
+ private void Chk_box_tunningMouseDown ( object sender , MouseEventArgs e )
5156
+ {
5157
+ tuningwasrightclick = e . Button == MouseButtons . Right ;
5158
+ if ( tuningwasrightclick )
5159
+ {
5160
+ var chk = sender as CheckBox ;
5161
+ if ( chk != null )
5162
+ chk . Checked = ! chk . Checked ;
5163
+ }
5164
+ }
5165
+
5084
5166
private void Zoomlevel_ValueChanged ( object sender , EventArgs e )
5085
5167
{
5086
5168
try
@@ -5296,6 +5378,7 @@ private void setBatteryCellCountToolStripMenuItem_Click(object sender, EventArgs
5296
5378
hud1 . batterycellcount = iCellCount ;
5297
5379
}
5298
5380
private bool tabQuickDetached = false ;
5381
+ private bool tuningwasrightclick ;
5299
5382
5300
5383
private void undockDockToolStripMenuItem_Click ( object sender , EventArgs e )
5301
5384
{
0 commit comments