Пример #1
0
Option::~Option()
{
    for (int i = 0; i < ReportCount(); i++)
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[i]);
        delete r;
    }
}
Пример #2
0
bool Option::BudgetReport(int report)
{
    bool budget = false;
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        budget = r->type;
    }
    return budget;
}
Пример #3
0
wxString Option::ReportName(int report)
{
    wxString name = "";
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        name = r->name;
    }
    return name;
}
Пример #4
0
wxString Option::ReportGroup(int report)
{
    wxString group = "";
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        group = r->group;
    }
    return group;
}
Пример #5
0
bool Option::HideReport(int report)
{
    bool hideReport = false;
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        int bitField = 1 << static_cast<int>(r->id);
        hideReport = ((m_hideReport & bitField) != 0);
    }
    return hideReport;
}
Пример #6
0
wxString Option::ReportFullName(int report)
{
    wxString name = "";
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        name = r->group;
        if (name.IsEmpty())
            name = r->name;
        else
            name += wxString(" (") + r->name + wxString(")");
    }
    return name;
}
Пример #7
0
void Option::HideReport(int report, bool value)
{
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        int bitField = 1 << static_cast<int>(r->id);
        if (value)
            m_hideReport |= bitField;
        else
            m_hideReport &= ~bitField;

        Model_Setting::instance().Set("HIDE_REPORT", m_hideReport);
    }
}
        Collection(USB_HID_PHYSICAL),

            //
            // The buttons.
            //
            UsagePage(USB_HID_BUTTONS),
            UsageMinimum(1),
            UsageMaximum(3),
            LogicalMinimum(0),
            LogicalMaximum(1),

            //
            // 3 - 1 bit values for the buttons.
            //
            ReportSize(1),
            ReportCount(3),
            Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE |
                  USB_HID_INPUT_ABS),

            //
            // 1 - 5 bit unused constant value to fill the 8 bits.
            //
            ReportSize(5),
            ReportCount(1),
            Input(USB_HID_INPUT_CONSTANT | USB_HID_INPUT_ARRAY |
                  USB_HID_INPUT_ABS),

            //
            // The X and Y axis.
            //
            UsagePage(USB_HID_GENERIC_DESKTOP),
Пример #9
0
// The following is the HID report structure definition that is passed back
// to the host.
//
//*****************************************************************************
static const uint8_t g_pui8KeybReportDescriptor[] =
{
    UsagePage(USB_HID_GENERIC_DESKTOP),
    Usage(USB_HID_KEYBOARD),
    Collection(USB_HID_APPLICATION),

        //
        // Modifier keys.
        // 8 - 1 bit values indicating the modifier keys (ctrl, shift...)
        //
        ReportSize(1),
        ReportCount(8),
        UsagePage(USB_HID_USAGE_KEYCODES),
        UsageMinimum(224),
        UsageMaximum(231),
        LogicalMinimum(0),
        LogicalMaximum(1),
        Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE | USB_HID_INPUT_ABS),

        //
        // One byte of rsvd data required by HID spec.
        //
        ReportCount(1),
        ReportSize(8),
        Input(USB_HID_INPUT_CONSTANT),

        //
Пример #10
0
        Collection(USB_HID_PHYSICAL),

            //
            // The buttons.
            //
            UsagePage(USB_HID_BUTTONS),
            UsageMinimum(1),
            UsageMaximum(3),
            LogicalMinimum(0),
            LogicalMaximum(1),

            //
            // 3 - 1 bit values for the buttons.
            //
            ReportSize(1),
            ReportCount(3),
            Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE |
                  USB_HID_INPUT_ABS),

            //
            // 1 - 5 bit unused constant value to fill the 8 bits.
            //
            ReportSize(5),
            ReportCount(1),
            Input(USB_HID_INPUT_CONSTANT | USB_HID_INPUT_ARRAY |
                  USB_HID_INPUT_ABS),

            //
            // The X and Y axis.
            //
            UsagePage(USB_HID_GENERIC_DESKTOP),
Пример #11
0
		UsagePage(USB_HID_GENERIC_DESKTOP),
		    Usage(USB_HID_GAMEPAD),
		    Collection(USB_HID_APPLICATION),
		        Collection(USB_HID_PHYSICAL),

		    	ReportID(1),
				//
				// The X and Y (Will appear as two thumb controls).
				//
				UsagePage(USB_HID_GENERIC_DESKTOP),
				Usage(USB_HID_X),
				Usage(USB_HID_Y),
				LogicalMinimum(-1),
				LogicalMaximum(1),
				ReportSize(2),
				ReportCount(2),
				Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE | USB_HID_INPUT_ABS | USB_HID_INPUT_NONULL),

				ReportCount(4),
				ReportSize(1),
				Input(USB_HID_INPUT_CONSTANT | USB_HID_INPUT_ARRAY | USB_HID_INPUT_ABS),

				//
				// 12 - 1 bit values for the first set of buttons.
				//
				UsagePage(USB_HID_BUTTONS),
				UsageMinimum(1),
				UsageMaximum(12),
				LogicalMinimum(0),
				LogicalMaximum(1),
				ReportSize(1),
Пример #12
0
    // 0x06, 0x00, 0xff,
    // HUT chap 3 table 1
    // Vendor specific value 0xff00
    UsagePageVendor(0xff00),
    // 0x09, 0x01,
    // Arbitrary number as we are vendor specific
    Usage(0x01),
    // 0xa1, 0x01,
    Collection(USB_HID_APPLICATION),
        // 0x85, 0x3f,
        // Vendor specific. Appears arbitrary.
        // ID can be left undefined if only one report type is created

		// 0x95, 0x3f,
		// The number of items in the report
		ReportCount(HID_PACKET_SIZE),
		// 0x75, 0x08,
		// As this is just generic data, 8 bits in a byte
		ReportSize(0x08),
		0x26, 0xff, 0x00,
//		LogicalMaximum(0xff00),
		// 0x15, 0x01,
		LogicalMinimum(0),
		// 0x09, 0x80,
		// Arbitrary number as we are vendor specific
		Usage(0x01),
		// 0x81, 0x02, Input (Data,Var,Abs)
		// This shows we are describing the report that goes to the host
		Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE | USB_HID_INPUT_ABS),
		// Second report, same except it's output
		ReportCount(HID_PACKET_SIZE),
Пример #13
0
        Usage (USB_HID_POINTER),
        Collection (USB_HID_PHYSICAL),

            //
            // The X, Y and Z values which are specified as 8-bit absolute
            // position values.
            //
            Usage (USB_HID_X),
            Usage (USB_HID_Y),
            Usage (USB_HID_Z),

            //
            // 3 8-bit absolute values.
            //
            ReportSize(8),
            ReportCount(3),
            Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE |
                  USB_HID_INPUT_ABS),

            //
            // The 8 buttons.
            //
            UsagePage(USB_HID_BUTTONS),
            UsageMinimum(1),
            UsageMaximum(8),
            LogicalMinimum(0),
            LogicalMaximum(1),
            PhysicalMinimum(0),
            PhysicalMaximum(1),

            //
        //
        UsagePage(USB_HID_GENERIC_DESKTOP),
        Usage (USB_HID_POINTER),
        Collection (USB_HID_PHYSICAL),

            //
            // The X, Y, RX, and RY values which are specified as 8-bit
            // absolute position values.
            //
            Usage(USB_HID_X),

            //
            // 4 8-bit absolute values.
            //
            ReportSize(10),
            ReportCount(1),
            Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE |
                  USB_HID_INPUT_ABS),

            ReportCount(1),
            ReportSize(6),
            Input(USB_HID_INPUT_CONSTANT),

            Usage (USB_HID_Y),
            ReportSize(10),
            ReportCount(1),
            Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE |
                  USB_HID_INPUT_ABS),

            ReportCount(1),
            ReportSize(6),
Пример #15
0
//*****************************************************************************
//
// The report descriptor for the volume class device. (Built off CustomHid example)
//
//*****************************************************************************
static const uint8_t g_pui8CustomHidReportDescriptor[] =
{
	    UsagePage(USB_HID_CONSUMER_DEVICE),
		Usage(USB_HID_USAGE_CONSUMER_CONTROL),
			Collection(USB_HID_APPLICATION),
				LogicalMinimum(0),
				LogicalMaximum(1),
				Usage(USB_HID_VOLUME_UP),
				Usage(USB_HID_VOLUME_DOWN),
				ReportSize(1),
				ReportCount(2),
				Input(USB_HID_INPUT_DATA | USB_HID_INPUT_VARIABLE | USB_HID_INPUT_RELATIVE),
				ReportCount(6),
				Input(USB_HID_INPUT_CONSTANT | USB_HID_INPUT_ARRAY | USB_HID_INPUT_ABS),
			EndCollection,
};

//*****************************************************************************
//
// The HID descriptor for the customhid device.
//
//*****************************************************************************
static const tHIDDescriptor g_sCustomHidHIDDescriptor =
{
    9,                              // bLength
    USB_HID_DTYPE_HID,              // bDescriptorType
Пример #16
0
mmPrintableBase* Option::ReportFunction(int report)
{
    mmPrintableBase* function = nullptr;
    if ((report >= 0) && (report < ReportCount()))
    {
        ReportInfo* r = reinterpret_cast<ReportInfo*>(m_reports[report]);
        switch (r->id)
        {
        case ReportInfo::MyUsage:
            function = new mmReportMyUsage();
            break;
        case ReportInfo::MonthlySummaryofAccounts:
            function = new mmReportSummaryByDate(0);
            break;
        case ReportInfo::YearlySummaryofAccounts:
            function = new mmReportSummaryByDate(1);
            break;
        case ReportInfo::WheretheMoneyGoes:
            function = new mmReportCategoryExpensesGoes();
            break;
        case ReportInfo::WheretheMoneyComesFrom:
            function = new mmReportCategoryExpensesComes();
            break;
        case ReportInfo::CategoriesSummary:
            function = new mmReportCategoryExpensesCategories();
            break;
        case ReportInfo::CategoriesMonthly:
            function = new mmReportCategoryOverTimePerformance();
            break;
        case ReportInfo::Payees:
            function = new mmReportPayeeExpenses();
            break;
        case ReportInfo::IncomevsExpensesSummary:
            function = new mmReportIncomeExpenses();
            break;
        case ReportInfo::IncomevsExpensesMonthly:
            function = new mmReportIncomeExpensesMonthly();
            break;
        case ReportInfo::BudgetPerformance:
            function = new mmReportBudgetingPerformance();
            break;
        case ReportInfo::BudgetCategorySummary:
            function = new mmReportBudgetCategorySummary();
            break;
        case ReportInfo::MonthlyCashFlow:
            function = new mmReportCashFlow(mmReportCashFlow::MONTHLY);
            break;
        case ReportInfo::DailyCashFlow:
            function = new mmReportCashFlow(mmReportCashFlow::DAILY);
            break;
        case ReportInfo::StocksReportPerformance:
            function = new mmReportChartStocks();
            break;
        case ReportInfo::StocksReportSummary:
            function = new mmReportSummaryStocks();
            break;
        case ReportInfo::ForecastReport:
            function = new mmReportForecast();
            break;
        default:
            break;
        }
        if (function != nullptr)
            function->setSettings(ReportSettings(r->id));
    }
    return function;
}