Detailed Preview: Team A vs. Team B
This fixture pits two contrasting styles against each other: Team A’s defensive rigidity versus Team B’s attacking flair. Historically, matches between these two have been tightly contested affairs with minimal goals scored. However, recent performances suggest that both teams are capable of breaking down stubborn defenses when necessary.
- Last Five Meetings:
- Tie: Three times – showcasing their evenly matched nature over recent encounters.
- Tactical Battle:scottsc/oscilloscope<|file_sep|>/source/oscilloscope.cpp
#include "oscilloscope.h"
#include "widgets.h"
#include "calibration.h"
#include "channel_selector.h"
#include "channel_display.h"
#include "status_bar.h"
#include "oscilloscope_settings.h"
#include "trace_generator.h"
#include "trace_generator_settings.h"
#include "trigger_selector.h"
#include "event_log.h"
#include "capture_buffer.h"
#include "sampling_rate_selector.h"
#include "waveform_view.h"
#include "waveform_view_settings.h"
// Local macros
#define LEFT_PANE_WIDTH (200)
#define TOP_BAR_HEIGHT (30)
#define BOTTOM_BAR_HEIGHT (30)
// Use this macro when you want an object to be destroyed when its parent is destroyed
#define autoDeleteChild(child)
{
QObject::connect(this,SIGNAL(destroyed()),child,SLOT(deleteLater()));
}
Oscilloscope::Oscilloscope(QWidget *parent)
: QWidget(parent)
{
// Store pointer so we can access our children from within event handlers
m_mainLayout = new QVBoxLayout(this);
m_mainLayout->setMargin(0);
m_mainLayout->setSpacing(0);
// Create main window panes
m_topBar = new TopBar(this);
m_waveformView = new WaveformView(this);
m_bottomBar = new BottomBar(this);
// Add main window panes to layout
m_mainLayout->addWidget(m_topBar);
m_mainLayout->addWidget(m_waveformView);
m_mainLayout->addWidget(m_bottomBar);
// Initialize the oscilloscope settings object
OscilloscopeSettings::getInstance()->initialize();
// Initialize channel selectors
ChannelSelector *channelSelector0 = new ChannelSelector(Channel::CH0,this);
ChannelSelector *channelSelector1 = new ChannelSelector(Channel::CH1,this);
ChannelSelector *channelSelector2 = new ChannelSelector(Channel::CH2,this);
ChannelSelector *channelSelector3 = new Channel::ChannelSelector(Channel::CH3,this);
// Add channel selectors to top bar
m_topBar->addChannelSelector(channelSelector0);
m_topBar->addChannelSelector(channelSelector1);
m_topBar->addChannelSelector(channelSelector2);
m_topBar->addChannelSelector(channelSelector3);
// Initialize channel displays
ChannelDisplay *channelDisplay0 = new ChannelDisplay(Channel::CH0,m_waveformView,this);
ChannelDisplay *channelDisplay1 = new ChannelDisplay(Channel::CH1,m_waveformView,this);
ChannelDisplay *channelDisplay2 = new ChannelDisplay(Channel::CH2,m_waveformView,this);
ChannelDisplay *channelDisplay3 = new ChannelDisplay(Channel::CH3,m_waveformView,this);
// autoDeleteChild(channelDisplay0);
// autoDeleteChild(channelDisplay1);
// autoDeleteChild(channelDisplay2);
// autoDeleteChild(channelDisplay3);
// Connect channel selector signal/slots
connect(channelSelector0,SIGNAL(toggled(bool)),channelDisplay0,SLOT(setEnabled(bool)));
connect(channelSelector1,SIGNAL(toggled(bool)),channelDisplay1,SLOT(setEnabled(bool)));
connect(channelSelector2,SIGNAL(toggled(bool)),channelDisplay2,SLOT(setEnabled(bool)));
connect(channelSelector3,SIGNAL(toggled(bool)),channelDisplay3,SLOT(setEnabled(bool)));
// Connect channel display signal/slots
connect(channelDisplay0,SIGNAL(colorChanged(const QColor &)),this,SLOT(onChannelColorChanged(Channel*,const QColor &)));
connect(channelDisplay1,SIGNAL(colorChanged(const QColor &)),this,SLOT(onChannelColorChanged(Channel*,const QColor &)));
connect(channelDisplay2,SIGNAL(colorChanged(const QColor &)),this,SLOT(onChannelColorChanged(Channel*,const QColor &)));
connect(channelDisplay3,SIGNAL(colorChanged(const QColor &)),this,SLOT(onChannelColorChanged(Channel*,const QColor &)));
// Initialize status bar
//m_statusBar = new StatusBar(this);
m_statusBar = StatusBar::getInstance();
m_statusBar->setParent(this);
// Add status bar to bottom bar
m_bottomBar->addStatusBar(m_statusBar);
// Create waveform view settings widget
m_waveformViewSettingsWidget = new WaveformViewSettingsWidget(m_waveformView,m_statusBar,this);
// Add waveform view settings widget to bottom bar
m_bottomBar->addWidget(m_waveformViewSettingsWidget);
// Create sampling rate selector widget
SamplingRateSelectorWidget *samplingRateSelectorWidget = new SamplingRateSelectorWidget(m_waveformView,this);
// Add sampling rate selector widget to bottom bar
m_bottomBar->addWidget(samplingRateSelectorWidget);
// Create trigger selector widget
TriggerSelectorWidget *triggerSelectorWidget = new TriggerSelectorWidget(m_waveformView,this);
// Add trigger selector widget to bottom bar
m_bottomBar->addWidget(triggerSelectorWidget);
// Create capture buffer widget
CaptureBufferWidget* captureBufferWidget = new CaptureBufferWidget(this);
autoDeleteChild(captureBufferWidget);
m_bottomBar->addWidget(captureBufferWidget);
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#else
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#else
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#else
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#else
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#else
#endif
}
void Oscilloscope::onCaptureBufferSizeChanged(int size)
{
Q_UNUSED(size)
m_waveformView->setCaptureBufferSize(size);
}
void Oscilloscope::onTraceGeneratorModeChanged(TraceGeneratorSettings::Mode mode)
{
switch(mode)
{
case TraceGeneratorSettings::MODE_SINGLE:
m_waveformView->setCaptureMode(CaptureModeSingleShot);
break;
case TraceGeneratorSettings::MODE_CONTINUOUS:
m_waveformView->setCaptureMode(CaptureModeContinuous);
break;
default:
break;
}
}
void Oscilloscope::onTriggerModeChanged(WaveformViewSettings::TriggerMode mode)
{
switch(mode)
{
case WaveformViewSettings::TRIGGER_MODE_AUTO:
m_waveformView->setTriggerMode(TriggerModeAuto);
break;
case WaveformViewSettings::TRIGGER_MODE_NORMAL:
m_waveformView->setTriggerMode(TriggerModeNormal);
break;
default:
break;
}
}
void Oscilloscope::onTimebaseChanged(double timebase)
{
m_waveformView->setTimebase(timebase);
}
void Oscilloscope::onVerticalScaleChanged(double scale)
{
m_waveformView->setVerticalScale(scale);
}
void Oscilloscope::onVerticalOffsetChanged(double offset)
{
m_waveformView->setVerticalOffset(offset);
}
void Oscilloscope::onHorizontalPositionChanged(double position)
{
m_waveformView->setHorizontalPosition(position);
}
void Oscilloscope::onWaveFormColorChanged(const QColor& color)
{
m_waveformView->setColor(color.rgb());
}
void Oscilloscope::onBackgroundColorChanged(const QColor& color)
{
m_waveformView->setBackground(color.rgb());
}
void Oscilloscope::onChannelColorChanged(Channel* channel,const QColor& color)
{
channel->setColor(color.rgb());
}
<|repo_name|>scottsc/oscilloscope<|file_sep|>/source/widgets.cpp
#include "widgets.h"
#include "calibration.h"
#include "event_log.h"
#include "capture_buffer_widget.h"
TopBar::~TopBar()
{
}
TopBar::TopBar(QWidget *parent):QFrame(parent),m_channelSelectors(CHANNEL_COUNT){}
void TopBar::addChannelSelector(ChannelSelector* channel_selector){
if (m_channelSelectors.contains(channel_selector)){
return;
}
int index=static_cast
(channel_selector->getChannelId()); Q_ASSERT(index>=0 && index addWidget(new QLabel("Channel "+QString("%1").arg(index+1))); layout->addWidget(new QLabel("Input Range")); autoDeleteChild(layout); connect(layout,SIGNAL(layoutAboutToBeChanged()),this,SLOT(onLayoutAboutToBeChanged())); layout->addWidget(new QLabel("Input Coupling")); layout->addWidget(new QLabel("Input Offset")); connect(layout,SIGNAL(layoutAboutToBeChanged()),this,SLOT(onLayoutAboutToBeChanged())); layout->addWidget(channel_selector); connect(channel_selector,SIGNAL(stateChanged(int)),this,SLOT(onStateChanged(int))); connect(channel_selector,SIGNAL(stateButtonClicked()),this,SLOT(onStateButtonClicked())); connect(channel_selector,SIGNAL(rangeButtonClicked()),this,SLOT(onRangeButtonClicked())); connect(channel_selector,SIGNAL(couplingButtonClicked()),this,SLOT(onCouplingButtonClicked())); connect(channel_selector,SIGNAL(offsetButtonClicked()),this,SLOT(onOffsetButtonClicked())); QHBoxLayout* main_layout=new QHBoxLayout(); main_layout->addLayout(layout); main_layout->addStretch(); autoDeleteChild(main_layout); setLayout(main_layout); } BottomBar::~BottomBar() { } BottomBar::BottomBar(QWidget* parent):QFrame(parent),m_widgets(0){ setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Preferred)); setMaximumWidth(LEFT_PANE_WIDTH+TOP_BAR_HEIGHT+BOTTOM_BAR_HEIGHT+10);//QWIDGETSIZE_MAX);//parent?parent?parent?parent?parent?parent?parent?parent?parent?parent?parent?parent?parent?parent?width():width()); } void BottomBar::addWidget(QWidget* widget){ if (widget==0){ return; } int count=m_widgets.count(); if (count>=MAX_WIDGETS){ return; } for (int i=0;i addWidget(widget); autoDeleteChild(layout); QVBoxLayout* main_layout=new QVBoxLayout(); main_layout->addLayout(layout); main_layout->addStretch(); setLayout(main_layout); } void BottomBar::addStatusBar(StatusBar* status_bar){ if (status_bar==0){ return; } int count=m_widgets.count(); if (count>=MAX_WIDGETS){ return; } for (int i=0;i addWidget(status_bar); autoDeleteChild(layout); QVBoxLayout* main_layout=new QVBoxLayout(); main_layout->addStretch(); main_layout->addLayout(layout); main_layout->addStretch(); setLayout(main_layout); } WaveformView