-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrAVR.h
422 lines (333 loc) · 11.1 KB
/
rAVR.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
//
// rAVR.h
// USBInterface
//
// Created by Sysadmin on 01.02.08.
// Copyright 2008 Ruedi Heimlicher. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "rProfil_DS.h"
#import "rDump_DS.h"
#import "rProfilGraph.h"
#import "rCNC.h"
#import "rUtils.h"
#import "datum.c"
#import "version.c"
#import "rEinstellungen.h"
#define USBTASTE 1
#define NEUTASTE 2
#define OBERKANTEANFAHREN 3
#define HOMETASTE 4
#define USBATTACHED 5
#define USBREMOVED 6
#define ANDERESEITEANFAHREN 10
#define CNC_STOP 1
#define VERSIONSLAVE "SLAVE.12.502"
//#define VERSIONSLAVE "USB.405"
/*
@interface rPfeiltasteCell : NSButtonCell
{
int richtung;
}
- (void)setRichtung:(int)dieRichtung;
@end
*/
@interface rProfildruckView : rProfilGraph
{
NSView* Druckfeld;
NSTextField* Titelfeld;
NSString* titel;
}
- (void)setTitel:(NSString*)titel;
- (void)drawRect:(NSRect)dirtyRect;
@end
@interface rPfeiltaste : NSButton
{
int richtung;
IBOutlet id Taste;
}
- (IBAction)reportPfeiltaste:(id)sender;
- (void)setRichtung:(int)dieRichtung;
- (int)Richtung;
- (int)Tastestatus;
@end
@interface rAVR : NSWindowController <NSTableViewDataSource,NSTableViewDelegate>
{
NSMutableDictionary* CNC_PList;
IBOutlet id StepperTab;
IBOutlet id ProfilFeld;
IBOutlet id ProfilTiefeFeldA;
IBOutlet id ProfilTiefeFeldB;
IBOutlet id Einlauflaenge;
IBOutlet id Einlauftiefe;
IBOutlet id Auslauflaenge;
IBOutlet id Auslauftiefe;
IBOutlet id ProfilBOffsetYFeld;
IBOutlet id ProfilBOffsetXFeld;
IBOutlet id ProfilWrenchFeld;// Schränkung
IBOutlet id ProfilWrenchEinheitRadio;
IBOutlet id HorizontalSchieberFeld;
IBOutlet id VertikalSchieberFeld;
IBOutlet id HorizontalSchieber;
IBOutlet id VertikalSchieber;
IBOutlet id SpeedStepper;
IBOutlet id SpeedFeld;
NSTableView* ProfilTable;
NSMutableArray* ProfilDaten;
NSArray* ProfilDatenOA;
NSArray* ProfilDatenUA;
IBOutlet id ProfilNameFeldA;
NSArray* ProfilDatenOB;
NSArray* ProfilDatenUB;
IBOutlet id ProfilNameFeldB;
IBOutlet id StopKoordinate;
IBOutlet id StartKoordinate;
IBOutlet id Adresse;
IBOutlet id Cmd;
IBOutlet id Drehgeber;
IBOutlet id DrehgeberFeld;
// IBOutlet id StartKnopf;
// IBOutlet id StopKnopf;
IBOutlet id CNCKnopf;
IBOutlet id OberseiteCheckbox;
IBOutlet id UnterseiteCheckbox;
IBOutlet id OberseiteTaste;
IBOutlet id UnterseiteTaste;
IBOutlet id EinlaufCheckbox;
IBOutlet id AuslaufCheckbox;
IBOutlet id AbbrandCheckbox;
IBOutlet id ScalePop;
IBOutlet id ProfilPop;
IBOutlet id CNCPositionFeld;
IBOutlet id CNCStepXFeld;
IBOutlet id CNCStepYFeld;
int Scale;
int cncposition;
int cncstatus;
//rProfil_DS* Profil_DS;
//rDump_DS* Dump_DS;
NSString* CNCdataPfad;
NSMutableArray* EEPROMArray;
NSMutableArray* KoordinatenTabelle;
NSMutableArray* UndoKoordinatenTabelle;
NSMutableIndexSet* UndoSet;
NSMutableArray* BlockKoordinatenTabelle;
NSMutableArray* BlockrahmenArray;
NSPoint oldMauspunkt;
rProfilGraph* ProfilGraph;
int GraphEnd;
IBOutlet NSTableView* CNCTable;
IBOutlet NSScrollView* CNCScroller;
rCNC* CNC;
int CNC_busy;
NSTimer* CNCTimer;
int ProfilTiefe;
float ProfilZoom;
NSPoint ProfilNullpunkt;
int mitOberseite;
int mitUnterseite;
int mitEinlauf;
int mitAuslauf;
int flipH;
int flipV;
int reverse;
int einlauflaenge;
int einlauftiefe;
int einlaufrand;
int auslauflaenge;
int auslauftiefe;
int auslaufrand;
NSMutableArray* CNCDatenArray;
NSMutableArray* SchnittdatenArray;
NSTimer* IOWTimer;
int AnzahlDaten;
int n;
int aktuellerTag;
int IOW_busy;
int aktuelleMark;
NSMutableDictionary* StepperDic;
rUtils* Utils;
NSMutableArray* Eingangsdaten;
// TWI
IBOutlet id TWI_Statustaste;
IBOutlet id TWI_Sendtaste;
// CNC
IBOutlet id CNC_Preparetaste;
IBOutlet id CNC_Starttaste;
IBOutlet id CNC_Stoptaste;
IBOutlet id CNC_Sendtaste;
IBOutlet id CNC_Terminatetaste;
IBOutlet id CNC_Neutaste;
IBOutlet id CNC_Halttaste;
IBOutlet id DC_Taste;
IBOutlet id DC_Stepper;
IBOutlet id DC_PWM;
IBOutlet id CNC_Uptaste;
IBOutlet id CNC_Downtaste;
IBOutlet id CNC_Lefttaste;
IBOutlet id CNC_busySpinner;
IBOutlet id CNC_Linkstaste;
IBOutlet id CNC_Righttaste;
IBOutlet id CNC_Seite1Check;
IBOutlet id CNC_Seite2Check;
IBOutlet id CNC_BlockKonfigurierenTaste;
IBOutlet id CNC_BlockAnfuegenTaste;
IBOutlet rPfeiltaste* TestPfeiltaste;
IBOutlet id IndexFeld;
IBOutlet id IndexStepper;
IBOutlet id WertAXFeld;
IBOutlet id WertAXStepper;
IBOutlet id WertAYFeld;
IBOutlet id WertAYStepper;
IBOutlet id WertBXFeld;
IBOutlet id WertBXStepper;
IBOutlet id WertBYFeld;
IBOutlet id WertBYStepper;
IBOutlet id ABBindCheck;
IBOutlet id LagePop;
IBOutlet id WinkelFeld;
IBOutlet id WinkelStepper;
IBOutlet id PWMFeld;
IBOutlet id PWMStepper;
IBOutlet id AbbrandFeld;
IBOutlet id GleichesProfilRadioKnopf;
IBOutlet id WertFeld;
IBOutlet id PositionFeld;
IBOutlet id PositionXFeld;
IBOutlet id PositionYFeld;
IBOutlet id SaveChangeTaste;
IBOutlet id ShiftAllTaste;
IBOutlet id Blockoberkante;
IBOutlet id OberkantenStepper;
IBOutlet id Blockbreite;
IBOutlet id Blockdicke;
IBOutlet id Einlaufrand;
IBOutlet id Auslaufrand;
IBOutlet id AnschlagLinksIndikator;
IBOutlet id AnschlagUntenIndikator;
IBOutlet id Basisabstand; // Abstand CNC zu Block
IBOutlet id Portalabstand;
IBOutlet id Spannweite; //
IBOutlet id USBKontrolle;
IBOutlet id HomeTaste;
IBOutlet id SeitenVertauschenTaste;
IBOutlet id NeuesElementTaste;
IBOutlet id AbmessungX;
IBOutlet id AbmessungY;
IBOutlet id red_pwmFeld;
IBOutlet id RechtsLinksRadio;
NSMutableDictionary* AnschlagDic;
IBOutlet id VersionFeld;
IBOutlet id DatumFeld;
IBOutlet id SlaveVersionFeld;
int startwert;
NSWindow* window;
int mausistdown;
int quelle;
rEinstellungen* CNC_Eingabe;
int AVR_USBStatus;
IBOutlet id ManufactorerFeld;
IBOutlet id ProductFeld;
IBOutlet id MinimaldistanzFeld;
float minimaldistanz; // minimaler abstand zwischen 2 Punkten, um in den Array aufgenommen zu werden
IBOutlet id KoteFeld;
IBOutlet id KoteStepper;
//int _kote;
int KoteWert;
IBOutlet id Schalendickefeld;
rProfildruckView* Profilfeld;
}
@property (nonatomic) int Kote;
- (NSMutableDictionary*)readCNC_PList;
- (NSArray*)readProfilLib;
- (IBAction)reportUSB:(id)sender;
- (void)setUSB_Device_Status:(int)status;
- (IBAction)reportHorizontalSchieber:(id)sender;
- (IBAction)reportVertikalSchieber:(id)sender;
- (IBAction)reportDrehgeber:(id)sender;
- (IBAction)reportStartKnopf:(id)sender;
- (IBAction)reportStopKnopf:(id)sender;
- (NSDictionary*)RahmenDic;
- (void)DC_ON:(int)pwm;
- (int)pwm;
- (int)pwm2save;
- (void)setStepperstrom:(int)ein;
- (void)setBusy:(int)busy;
- (int)speed;
- (int)saveSpeed;
- (int)saveProfileinstellungen;
- (void)setUSBDaten:(NSDictionary*)datendic;
- (IBAction)reportSpeedStepper:(id)sender;
- (IBAction)reportCNCKnopf:(id)sender;
- (IBAction)reportOberseiteTaste:(id)sender;
- (IBAction)reportUnterseiteTaste:(id)sender;
- (IBAction)reportProfil:(id)sender;
- (IBAction)reportClearProfilTabelle:(id)sender;
- (IBAction)reportScalePop:(id)sender;
- (IBAction)reportHaltTaste:(id)sender;
- (IBAction)reportResetTaste:(id)sender;
- (IBAction)reportIndexStepper:(id)sender;
- (IBAction)reportWertAXStepper:(id)sender;
- (IBAction)reportWertAYStepper:(id)sender;
- (IBAction)reportWertBXStepper:(id)sender;
- (IBAction)reportWertBYStepper:(id)sender;
- (IBAction)reportPWMStepper:(id)sender;
- (IBAction)reportNewElement:(id)sender;
- (IBAction)reportManLeft:(id)sender;
- (IBAction)reportManRight:(id)sender;
- (IBAction)reportManUp:(id)sender;
- (IBAction)reportManDown:(id)sender;
- (void)updateIndex;
- (IBAction)reportDauerpfeilTaste:(id)sender;
- (IBAction)reportOberkanteAnfahren:(id)sender;
- (IBAction)reportHome:(id)sender;
- (void)sendDelayedArrayWithDic:(NSDictionary*) schnittdatendic;
- (IBAction)reportElementSichern:(id)sender;
- (int)mausistdown;
- (int)PfeiltasteStatus;
- (IBAction)reportQuadrat:(id)sender;
- (IBAction)reportKreis:(id)sender;
- (IBAction)reportEllipse:(id)sender;
- (IBAction)reportHolm:(id)sender;
- (NSArray*)KoordinatenTabelle;
- (IBAction)reportSaveStepperDic:(id)sender;
- (IBAction)reportZeileWeg:(id)sender;
- (IBAction)reportNeueZeile:(id)sender;
- (void)setDatenVonZeile:(int)dieZeile;
- (void)shiftX:(float)x Y:(float)y Schritt:(int)schritt;
- (IBAction)reportShiftLeft:(id)sender;
- (IBAction)reportShiftRight:(id)sender;
- (IBAction)reportShiftUp:(id)sender;
- (IBAction)reportShiftDown:(id)sender;
- (void)shiftX:(float)x Y:(float)y Schritt:(int)schritt;
- (IBAction)reportSeiteVertauschen:(id)sender;
- (IBAction)reportLinkeRechteSeite:(id)sender;
- (IBAction)reportLinkeRechteSeiteOffset:(id)sender;
- (IBAction)reportAndereSeiteAnfahren:(id)sender;
- (IBAction)reportProfilTask:(id)sender;
- (IBAction)reportProfilOberseiteTask:(id)sender;
- (IBAction)reportProfilUnterseiteTask:(id)sender;
- (IBAction)reportEdgeTask:(id)sender;
// SPI
// TWI
//- (void)writeAVR:(int)i2cAdresse mitDaten:(NSArray*)dieDaten;
- (IBAction)reportUSB_sendArray:(id)sender;
- (IBAction)reportPrepareTaste:(id)sender;
- (IBAction)reportNeuTaste:(id)sender;
- (IBAction)terminateTransfer:(id)sender;
- (IBAction)reportPrint:(id)sender;
- (IBAction)ok:(id)sender;
- (void)HomebusAnlegen;
- (void)saveLabel:(NSString*)dasLabel forRaum:(int)derRaum forSegment:(int)dasSegment;
- (void)checkHomebus;
- (int)saveStepperDic;
- (int)sendData:(NSArray*)dieDaten;
- (int)sendReport:(NSString*)derReport mitDaten:(NSArray*)dieDaten;
- (NSString*)IntToBin:(int)dieZahl;
- (int)halt;
- (NSArray*)readLib;
- (void)Blockeinfuegen;
- (IBAction)reportBlockkonfigurieren:(id)sender;
- (IBAction)reportBlockanfuegen:(id)sender;
- (int)saveStepperDic:(id)sender;
@end