kopia lustrzana https://github.com/f4exb/sdrangel
				
				
				
			Fixed a long lasting bug where channels are movable from the spectrum display based on the color (blue) so that WFM could not move. Set a dedicared boolean instead
							rodzic
							
								
									c7c2aa1fa7
								
							
						
					
					
						commit
						76a0dc3e2d
					
				| 
						 | 
				
			
			@ -230,6 +230,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI,
 | 
			
		|||
 | 
			
		||||
    //m_objPluginAPI->addThreadedSink(m_objThreadedChannelizer);
 | 
			
		||||
    m_objChannelMarker.setColor(Qt::white);
 | 
			
		||||
    m_objChannelMarker.setMovable(false);
 | 
			
		||||
    m_objChannelMarker.setBandwidth(6000000);
 | 
			
		||||
    m_objChannelMarker.setCenterFrequency(0);
 | 
			
		||||
    m_objChannelMarker.setVisible(true);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,7 +33,8 @@ ChannelMarker::ChannelMarker(QObject* parent) :
 | 
			
		|||
	m_sidebands(dsb),
 | 
			
		||||
	m_visible(false),
 | 
			
		||||
	m_highlighted(false),
 | 
			
		||||
	m_color(m_colorTable[m_nextColor])
 | 
			
		||||
	m_color(m_colorTable[m_nextColor]),
 | 
			
		||||
	m_movable(true)
 | 
			
		||||
{
 | 
			
		||||
	++m_nextColor;
 | 
			
		||||
	if(m_colorTable[m_nextColor] == 0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,9 @@ public:
 | 
			
		|||
	void setColor(const QColor& color);
 | 
			
		||||
	const QColor& getColor() const { return m_color; }
 | 
			
		||||
 | 
			
		||||
	void setMovable(bool movable) { m_movable = movable; }
 | 
			
		||||
	bool getMovable() const { return m_movable; }
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	static QRgb m_colorTable[];
 | 
			
		||||
	static int m_nextColor;
 | 
			
		||||
| 
						 | 
				
			
			@ -54,6 +57,7 @@ protected:
 | 
			
		|||
	bool m_visible;
 | 
			
		||||
	bool m_highlighted;
 | 
			
		||||
	QColor m_color;
 | 
			
		||||
	bool m_movable;
 | 
			
		||||
 | 
			
		||||
signals:
 | 
			
		||||
	void changed();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1574,7 +1574,7 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
 | 
			
		|||
		return;
 | 
			
		||||
	} else if(m_cursorState == CSChannelMoving) {
 | 
			
		||||
		Real freq = m_frequencyScale.getValueFromPos(event->x() - m_leftMarginPixmap.width() - 1) - m_centerFrequency;
 | 
			
		||||
		if(m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getColor()!=Qt::blue)
 | 
			
		||||
		if(m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable())
 | 
			
		||||
			m_channelMarkerStates[m_cursorChannel]->m_channelMarker->setCenterFrequency(freq);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1621,7 +1621,7 @@ void GLSpectrum::mousePressEvent(QMouseEvent* event)
 | 
			
		|||
		m_cursorState = CSChannelMoving;
 | 
			
		||||
		m_cursorChannel = 0;
 | 
			
		||||
		Real freq = m_frequencyScale.getValueFromPos(event->x() - m_leftMarginPixmap.width() - 1) - m_centerFrequency;
 | 
			
		||||
		if(m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getColor()!=Qt::blue)
 | 
			
		||||
		if(m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable())
 | 
			
		||||
			m_channelMarkerStates[m_cursorChannel]->m_channelMarker->setCenterFrequency(freq);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue