📄 zones.cc
字号:
#include "HWRawDataC.hh"#include <assert.h>#include <stdlib.h>#include <fstream.h>int main(int argc, char *argv[]){ if (argc < 2 || argc > 3) { cout << "Usage: " << argv[0] << " <Threshold> [<EventBase>]\n"; cout << "Where <Threshold> is the horizontal line over which the stylus must pass\n"; cout << " for an event to be recognized, and\n"; cout << " <EventBase> is the event number for a downward crossing of the\n"; cout << " threshold line and <EventBase>+1 is an upward crossing.\n"; cout << " The default value for EventBase is 50.\n"; return 1; } const long Threshold = atoi(argv[1]); int EventBase = 6; if (argc == 3) EventBase = atoi(argv[2]); long LastY = -1; long PenUp = 1; HWHeaderC Header; cin >> Header; cout << Header; while (1) { HWRawDataC Rec; cin >> Rec; if (!cin) break; cout << Rec; if (PenUp) LastY = -1; if (Rec.Type == PEN_UP) PenUp = 1; if (Rec.Type == PEN_DOWN) PenUp = 0; if (Rec.Type != 0) continue; if (LastY != -1 && LastY <= Threshold && Rec.DataPoint.YPos > Threshold) { Rec.Type = EventBase; cout << Rec; } else if (LastY != -1 && LastY > Threshold && Rec.DataPoint.YPos <= Threshold) { Rec.Type = EventBase+1; cout << Rec; } LastY = Rec.DataPoint.YPos; } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -