mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Update to 2018_v4 image and new build system. (#598)
* Revert "Force OpenCV to 3.1.0 (#602)"
This reverts commit 50ed55e8e2.
* Removes Simulation
* Removes old build system
* Removes old gtest
* Adds new gmock and gtest
* Updates to new ni-libraries
* removes MyRobot (to be replaced)
* moves files to new location
* Adds new sim backend and new test executables
* updates .styleguide and .gitignore
* Changes cpp WPILibVersion to a function
MSVC throws an AV with the old version.
* Disables USBCamera on all systems except for linux
* 2018 NI Libraries
* New build system
This commit is contained in:
committed by
Peter Johnson
parent
50ed55e8e2
commit
e1195e8b9d
64
wpilibc/src/main/native/include/DigitalOutput.h
Normal file
64
wpilibc/src/main/native/include/DigitalOutput.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2008-2017. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "DigitalSource.h"
|
||||
#include "HAL/Types.h"
|
||||
#include "LiveWindow/LiveWindowSendable.h"
|
||||
#include "tables/ITableListener.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* Class to write to digital outputs.
|
||||
* Write values to the digital output channels. Other devices implemented
|
||||
* elsewhere will allocate channels automatically so for those devices it
|
||||
* shouldn't be done here.
|
||||
*/
|
||||
class DigitalOutput : public DigitalSource,
|
||||
public ITableListener,
|
||||
public LiveWindowSendable {
|
||||
public:
|
||||
explicit DigitalOutput(int channel);
|
||||
virtual ~DigitalOutput();
|
||||
void Set(bool value);
|
||||
bool Get() const;
|
||||
int GetChannel() const override;
|
||||
void Pulse(double length);
|
||||
bool IsPulsing() const;
|
||||
void SetPWMRate(double rate);
|
||||
void EnablePWM(double initialDutyCycle);
|
||||
void DisablePWM();
|
||||
void UpdateDutyCycle(double dutyCycle);
|
||||
|
||||
// Digital Source Interface
|
||||
HAL_Handle GetPortHandleForRouting() const override;
|
||||
AnalogTriggerType GetAnalogTriggerTypeForRouting() const override;
|
||||
bool IsAnalogTrigger() const override;
|
||||
|
||||
void ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value, bool isNew) override;
|
||||
void UpdateTable();
|
||||
void StartLiveWindowMode();
|
||||
void StopLiveWindowMode();
|
||||
std::string GetSmartDashboardType() const;
|
||||
void InitTable(std::shared_ptr<ITable> subTable);
|
||||
std::shared_ptr<ITable> GetTable() const;
|
||||
|
||||
private:
|
||||
int m_channel;
|
||||
HAL_DigitalHandle m_handle;
|
||||
HAL_DigitalPWMHandle m_pwmGenerator;
|
||||
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user