Version 8 (modified by 14 years ago) ( diff ) | ,
---|
Weighing Functions
This is an example of a very simple weight indicator program to display the gross weight. "Zero" and "Quit" buttons are provided. This is a minimal program for demonstration purposes.
simple_ind.h
#pragma once EVENT(MainScreenShow); EVENT(MainScreenProcess); EVENT(Zero); EVENT(Quit);
simple_ind.cpp
#include "cardinal825.h" #include "simple_ind.h" int main(int ac,char **av) { InitLCD(); ReadTouchCal(); OpenBeeper(); OpenTouch(); MnBdStartup(); FORM_INIT(Main, EventMainScreenShow, EventMainScreenProcess, NULL, NULL, nFormFlgNone); FORM_ADD_BUTTON(Main, Zero, 0, 120, "Zero", 'Z', EventZero, FORM_BUTTON_OUTLINE); FORM_ADD_BUTTON(Main, Quit, 0, 200, "Quit", 'Q', EventQuit, FORM_BUTTON_OUTLINE); FORM_SHOW(Main); FORM_RUN(Main); FORM_HIDE(Main); MnBdShutdown(); return 0; } EVENT(MainScreenShow) { ClearLCD(); DisplayText(0, 0, "Simple Weight Indicator"); return 0; } EVENT(MainScreenProcess) { int n = MnBdProcess(); if(n == mnbdProcWtRcv) { if(IsGrossWtChanged(1)) { DisplayText(0, 40, GetChangedGrossWt(1), 0, BIG_FONT); } } return 0; } EVENT(Zero) { ZeroScale(1); return 0; } EVENT(Quit) { // Return non-zero to exit the form return 1; }
- CheckWIM * DEPRECATED - New apps should use MnBdSetWIM *
- DLCRepeatMultiIncludeCellWts
- FormatGrossWt
- FormatNetWt
- FormatTareWt
- FormatWt
- GetBelowZero
- GetCapacity
- GetCenterZero
- GetCurUnitsLabel
- GetDecimal
- GetGrossWt
- GetInterval
- GetMotion
- GetNetWt
- GetNumScales
- GetOverCap
- GetProcessScale
- GetSecUnitsLabel
- GetTareWt
- GetUnitsLabel
- GetWtError
- IsGrossWtChanged
- IsNetWtChanged
- IsTareWtChanged
- IsWtStatusChanged
- IsWtUnitsChanged
- MnBdClearEvent
- MnBdClose
- MnBdGetErr
- MnBdGetErrMsg
- MnBdGetErrMsgStr
- MnBdOpen
- MnBdProcess * DEPRECATED - New apps should use StartRepeatMulti *
- MnBdRead
- MnBdRequest
- MnBdSetEvent
- MnBdSetWIM
- MnBdShutdown
- MnBdStartup
- RequestWt * DEPRECATED - New apps should use StartRepeatMulti *
- ResetPrevGrossWt
- ResetPrevNetWt
- ResetPrevTareWt
- ResetPrevWtStatus
- ResetPrevWtUnits
- SetTareCurrent
- SetTareValue
- SetWIM * DEPRECATED - New apps should use MnBdSetWIM *
- StartRepeatMulti
- StartRepeatWt * DEPRECATED - New apps should use StartRepeatMulti *
- StopRepeatMulti
- StopRepeatWt * DEPRECATED - New apps should use StopRepeatMulti *
- ZeroScale
Attachments (1)
-
simple_ind.png
(12.6 KB
) - added by 14 years ago.
Screen image of simple_ind program
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.