Skip to content

Commit e8da96e

Browse files
committed
Many changes to add EV3 support
1 parent ee46016 commit e8da96e

File tree

147 files changed

+22693
-7532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+22693
-7532
lines changed

BrickTool.dpr

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var
7272
memFree : Cardinal;
7373
pressed : boolean;
7474
btncount : byte;
75-
Msg : NXTMessage;
75+
Msg : PBRMessage;
7676

7777

7878

@@ -184,12 +184,12 @@ begin
184184
Writeln(' -btreset : reset the NXT bluetooth to factory settings (usb only)');
185185
Writeln(' -defrag : defragment the NXT filesystem');
186186
{
187-
SetNXTOutputState
188-
SetNXTInputMode
189-
NXTPollCommandLen
190-
NXTPollCommand
191-
NXTWriteIOMap
192-
NXTReadIOMap
187+
DCSetOutputState
188+
DCSetInputMode
189+
SCPollCommandLen
190+
SCPollCommand
191+
SCWriteIOMap
192+
SCReadIOMap
193193
NXTLowSpeed[port : byte]
194194
}
195195
Writeln('General:');
@@ -308,7 +308,7 @@ begin
308308
end;
309309
if ParamSwitch('-clear') then
310310
if IsNXT then
311-
BrickComm.NXTDeleteUserFlash(True)
311+
BrickComm.SCDeleteUserFlash(True)
312312
else
313313
BrickComm.ClearMemory;
314314
if ParamSwitch('-near') and NotNXT then
@@ -326,7 +326,7 @@ begin
326326
if ParamSwitch('-run') then begin
327327
// run with filename for NXT
328328
if IsNXT then
329-
BrickComm.NXTStartProgram(ParamValue('-run'))
329+
BrickComm.DCStartProgram(ParamValue('-run'))
330330
else
331331
BrickComm.StartTask(ParamIntValue('-run', 0));
332332
end;
@@ -335,7 +335,7 @@ begin
335335
if ParamSwitch('-msg') then
336336
begin
337337
if IsNXT then
338-
BrickComm.NXTMessageWrite(ParamIntValue('/Inbox', 0), ParamValue('-msg'))
338+
BrickComm.DCMessageWrite(ParamIntValue('/Inbox', 0), ParamValue('-msg'))
339339
else
340340
BrickComm.SendMessage(ParamIntValue('-msg', 0));
341341
end;
@@ -352,7 +352,7 @@ begin
352352
if IsNXT then
353353
begin
354354
port := ParamIntValue('-input', 0);
355-
if BrickComm.GetNXTInputValues(port, valid,
355+
if BrickComm.DCGetInputValues(port, valid,
356356
calibrated, stype, smode, raw, normalized, scaled, calvalue) then
357357
begin
358358
Writeln(Format('Port: %d'#13#10 +
@@ -379,7 +379,7 @@ begin
379379
if IsNXT then
380380
begin
381381
port := ParamIntValue('-output', 0);
382-
if BrickComm.GetNXTOutputState(port, power, mode,
382+
if BrickComm.DCGetOutputState(port, power, mode,
383383
regmode, turnratio, runstate, tacholimit, tachocount, blocktachocount, rotationcount) then
384384
begin
385385
Writeln(Format('Port: %d'#13#10 +
@@ -419,33 +419,33 @@ begin
419419
BrickComm.PlayTone(ParamIntValue('-playtone', 440), ParamIntValue('/Duration', 500));
420420
// NXT actions
421421
if ParamSwitch('-stop') and IsNXT then
422-
BrickComm.NXTStopProgram;
422+
BrickComm.DCStopProgram;
423423
if ParamSwitch('-playfile') and IsNXT then
424-
BrickComm.NXTPlaySoundFile(ParamValue('-playfile'), ParamSwitch('/L'));
424+
BrickComm.DCPlaySoundFile(ParamValue('-playfile'), ParamSwitch('/L'));
425425
if ParamSwitch('-keepalive') and IsNXT then
426426
begin
427-
if BrickComm.NXTKeepAlive(cvalue) then
427+
if BrickComm.DCKeepAlive(cvalue) then
428428
OutputValue(cvalue);
429429
end;
430430
if ParamSwitch('-resetoutputposition') and IsNXT then
431-
BrickComm.NXTResetOutputPosition(ParamIntValue('-resetoutputposition', 0), ParamSwitch('/Relative'));
431+
BrickComm.DCResetOutputPosition(ParamIntValue('-resetoutputposition', 0), ParamSwitch('/Relative'));
432432
if ParamSwitch('-resetinputsv') and IsNXT then
433-
BrickComm.NXTResetInputScaledValue(ParamIntValue('-resetinputsv', 0));
433+
BrickComm.DCResetInputScaledValue(ParamIntValue('-resetinputsv', 0));
434434
if ParamSwitch('-upload') and IsNXT then
435-
BrickComm.NXTUploadFile(ParamValue('-upload'));
435+
BrickComm.UploadFile(ParamValue('-upload'));
436436
if ParamSwitch('-download') and IsNXT then
437437
begin
438438
pattern := ParamValue('-download');
439-
BrickComm.NXTDownloadFile(pattern, NameToNXTFileType(pattern));
439+
BrickComm.DownloadFile(pattern, NXTNameToPBRFileType(pattern));
440440
end;
441441
if ParamSwitch('-delete') and IsNXT then
442442
begin
443443
pattern := ParamValue('-delete');
444-
BrickComm.NXTDeleteFile(pattern, True);
444+
BrickComm.SCDeleteFile(pattern, True);
445445
end;
446446
if ParamSwitch('-defrag') then
447447
begin
448-
if not BrickComm.NXTDefragmentFlash then
448+
if not BrickComm.SCDefragmentFlash then
449449
WriteLn('Defragmentation failed');
450450
end;
451451
if ParamSwitch('-listfiles') and IsNXT then
@@ -454,7 +454,7 @@ begin
454454
if pattern = '' then
455455
pattern := '*.*';
456456
SL.Clear;
457-
BrickComm.NXTListFiles(pattern, SL);
457+
BrickComm.ListFiles(pattern, SL);
458458
for i := 0 to SL.Count - 1 do
459459
WriteLn(SL[i]);
460460
end;
@@ -464,32 +464,32 @@ begin
464464
if pattern = '' then
465465
pattern := '*.*';
466466
SL.Clear;
467-
BrickComm.NXTListModules(pattern, SL);
467+
BrickComm.ListModules(pattern, SL);
468468
for i := 0 to SL.Count - 1 do
469469
WriteLn(SL[i]);
470470
end;
471471
if ParamSwitch('-runningprogram') and IsNXT then
472472
begin
473-
if BrickComm.NXTGetCurrentProgramName(pattern) then
473+
if BrickComm.DCGetCurrentProgramName(pattern) then
474474
Writeln(pattern);
475475
end;
476476
if ParamSwitch('-setname') and IsNXT then
477-
BrickComm.NXTSetBrickName(ParamValue('-setname'), True);
477+
BrickComm.SCSetBrickName(ParamValue('-setname'), True);
478478
if ParamSwitch('-boot') and IsNXT then
479-
BrickComm.NXTBootCommand(True);
479+
BrickComm.SCBootCommand(True);
480480
if ParamSwitch('-btreset') and IsNXT then
481-
BrickComm.NXTBTFactoryReset(True);
481+
BrickComm.SCBTFactoryReset(True);
482482
if ParamSwitch('-versions') and IsNXT then
483483
begin
484-
if BrickComm.NXTGetVersions(pmin, pmaj, fmin, fmaj) then
484+
if BrickComm.SCGetVersions(pmin, pmaj, fmin, fmaj) then
485485
begin
486486
Writeln(Format('Protocol version = %d.%d', [pmaj, pmin]));
487487
Writeln(Format('Firmware version = %d.%d', [fmaj, fmin]));
488488
end;
489489
end;
490490
if ParamSwitch('-deviceinfo') and IsNXT then
491491
begin
492-
if BrickComm.NXTGetDeviceInfo(pattern, btaddr, btsig, memFree) then
492+
if BrickComm.SCGetDeviceInfo(pattern, btaddr, btsig, memFree) then
493493
begin
494494
Writeln(Format('Brick name = %s', [pattern]));
495495
Writeln(Format('Bluetooth Address = %s', [btaddr]));
@@ -499,35 +499,35 @@ begin
499499
end;
500500
if ParamSwitch('-getname') and IsNXT then
501501
begin
502-
if BrickComm.NXTGetDeviceInfo(pattern, btaddr, btsig, memFree) then
502+
if BrickComm.SCGetDeviceInfo(pattern, btaddr, btsig, memFree) then
503503
Writeln(pattern);
504504
end;
505505
if ParamSwitch('-freemem') and IsNXT then
506506
begin
507-
if BrickComm.NXTGetDeviceInfo(pattern, btaddr, btsig, memFree) then
507+
if BrickComm.SCGetDeviceInfo(pattern, btaddr, btsig, memFree) then
508508
OutputValue(memFree);
509509
end;
510510
if ParamSwitch('-lsstatus') and IsNXT then
511511
begin
512512
port := ParamIntValue('-lsstatus', 0);
513-
if BrickComm.NXTLSGetStatus(port, bytesReady, lsstate) then
513+
if BrickComm.DCLSGetStatus(port, bytesReady, lsstate) then
514514
OutputValue(bytesReady);
515515
end;
516516
if ParamSwitch('-btnstate') and IsNXT then
517517
begin
518518
port := ParamIntValue('-btnstate', 0);
519-
if BrickComm.NXTGetButtonState(port, False, pressed, btncount) then
519+
if BrickComm.DCGetButtonState(port, False, pressed, btncount) then
520520
Writeln(Format('Button %d: pressed = %s, count = %d', [port, BoolToStr(pressed, True), btncount]));
521521
end;
522522
if ParamSwitch('-resetbtnstate') and IsNXT then
523523
begin
524524
port := ParamIntValue('-resetbtnstate', 0);
525-
BrickComm.NXTGetButtonState(port, True, pressed, btncount);
525+
BrickComm.DCGetButtonState(port, True, pressed, btncount);
526526
end;
527527
if ParamSwitch('-readmsg') and IsNXT then
528528
begin
529529
port := ParamIntValue('-readmsg', 0);
530-
if BrickComm.NXTMessageRead(port, ParamIntValue('/Inbox', 0), ParamSwitch('/Empty'), Msg) then
530+
if BrickComm.DCMessageRead(port, ParamIntValue('/Inbox', 0), ParamSwitch('/Empty'), Msg) then
531531
begin
532532
for i := 0 to Msg.Size - 1 do
533533
OutputValue(Msg.Data[i]);

BricxCC.cfg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
-M
3232
-$M16384,1048576
3333
-K$00400000
34-
-LE"c:\winapps\borland\delphi7\Projects\Bpl"
35-
-LN"c:\winapps\borland\delphi7\Projects\Bpl"
36-
-U"bricktools;NXT;samplerate;png;grep;pbr"
37-
-O"bricktools;NXT;samplerate;png;grep;pbr"
38-
-I"bricktools;NXT;samplerate;png;grep;pbr"
39-
-R"bricktools;NXT;samplerate;png;grep;pbr"
34+
-LE"c:\win32apps\borland\delphi7\Projects\Bpl"
35+
-LN"c:\win32apps\borland\delphi7\Projects\Bpl"
36+
-U"c:\win32apps\borland\delphi7\Lib\Debug;bricktools;NXT;samplerate;png;grep;pbr"
37+
-O"c:\win32apps\borland\delphi7\Lib\Debug;bricktools;NXT;samplerate;png;grep;pbr"
38+
-I"c:\win32apps\borland\delphi7\Lib\Debug;bricktools;NXT;samplerate;png;grep;pbr"
39+
-R"c:\win32apps\borland\delphi7\Lib\Debug;bricktools;NXT;samplerate;png;grep;pbr"
4040
-DFAST_MM, CAN_DOWNLOAD
4141
-w-UNSAFE_TYPE
4242
-w-UNSAFE_CODE

BricxCC.dof

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ OutputDir=
9494
UnitOutputDir=
9595
PackageDLLOutputDir=
9696
PackageDCPOutputDir=
97-
SearchPath=bricktools;NXT;samplerate;png;grep;pbr
97+
SearchPath=$(DELPHI)\Lib\Debug;bricktools;NXT;samplerate;png;grep;pbr
9898
Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;TeeUI50;TeeDB50;Tee50;Dss50;TeeQR50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;O217_R50;O217BR50;TCSComp_50
9999
Conditionals=FAST_MM, CAN_DOWNLOAD
100-
DebugSourceDirs=D:\BricxCC\NXT\;D:\bricxcc\bricktools\
100+
DebugSourceDirs=D:\BricxCC\NXT\;D:\bricxcc\bricktools\;D:\bricxcc_new\bricktools\;D:\bricxcc_new\grep\
101101
UsePackages=0
102102
[Parameters]
103103
RunParams=
@@ -122,7 +122,7 @@ AutoIncBuild=0
122122
MajorVer=3
123123
MinorVer=3
124124
Release=8
125-
Build=10
125+
Build=11
126126
Debug=0
127127
PreRelease=0
128128
Special=0
@@ -133,24 +133,14 @@ CodePage=1252
133133
[Version Info Keys]
134134
CompanyName=JoCar Consulting
135135
FileDescription=Programmable Brick IDE
136-
FileVersion=3.3.8.10
136+
FileVersion=3.3.8.11
137137
InternalName=Bricx Command Center
138138
LegalCopyright=Copyright (c) 1998-2013 John Hansen
139139
LegalTrademarks=
140140
OriginalFilename=bricxcc.exe
141141
ProductName=Bricx Command Center
142142
ProductVersion=3.3
143143
Comments=NQC (c) 1998-2013 David Baum, John Hansen
144-
[Excluded Packages]
145-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dcldxCoreD7.bpl=ExpressCoreLibrary by Developer Express Inc.
146-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dclcxLibraryD7.bpl=Express Cross Platform Library by Developer Express Inc.
147-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dclcxPageControlD7.bpl=ExpressPageControl by Developer Express Inc.
148-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dclcxEditorsD7.bpl=ExpressEditors Library by Developer Express Inc.
149-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dclcxEditorFieldLinkD7.bpl=ExpressEditors FieldLink by Developer Express Inc.
150-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dcldxLayoutControlD7.bpl=ExpressLayout Control by Developer Express Inc.
151-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dclcxGridD7.bpl=ExpressQuantumGrid by Developer Express Inc.
152-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dcldxmdsD7.bpl=ExpressMemData by Developer Express Inc.
153-
C:\Program Files (x86)\Dev Express.VCL\Library\Delphi7\dcldxNavBarD7.bpl=ExpressNavBar by Developer Express Inc.
154144
[HistoryLists\hlDebugSourcePath]
155145
Count=1
156146
Item0=G:\nxt\BricxCC\source\NXT\

BricxCC.dpr

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,15 @@ uses
122122
uTextViewer in 'uTextViewer.pas' {frmTextView},
123123
uNXTWatchList in 'uNXTWatchList.pas' {frmNXTWatchList},
124124
uSimpleTerm in 'uSimpleTerm.pas' {frmSimpleTerm},
125-
uNXTImage in 'uNXTImage.pas' {frmNXTImage};
125+
uNXTImage in 'uNXTImage.pas' {frmNXTImage},
126+
uBrickImage in 'uBrickImage.pas' {frmBrickImage},
127+
uLiveSensors in 'uLiveSensors.pas' {frmLiveSensors},
128+
ev3RGFedit_MainForm in 'ev3RGFedit_MainForm.pas' {frmEV3RGFEDIT},
129+
ev3RGFedit_AddText in 'ev3RGFedit_AddText.pas' {frmAddText},
130+
ev3RGFedit_Basis in 'ev3RGFedit_Basis.pas',
131+
ev3RGFedit_FileImport in 'ev3RGFedit_FileImport.pas' {frmImageImport},
132+
ev3RGFEdit_FileOpen in 'ev3RGFEdit_FileOpen.pas' {frmFileOpen},
133+
ev3RGFedit_FileSave in 'ev3RGFedit_FileSave.pas' {frmFileSave};
126134

127135
{$IFNDEF FPC}
128136
{.$R *.TLB}
@@ -184,8 +192,13 @@ begin
184192
Application.CreateForm(TfrmNXTExplorer, frmNXTExplorer);
185193
Application.CreateForm(TfrmNXTController, frmNXTController);
186194
Application.CreateForm(TfrmNXTImage, frmNXTImage);
195+
Application.CreateForm(TfrmBrickImage, frmBrickImage);
187196
Application.CreateForm(TfrmNXTWatchList, frmNXTWatchList);
197+
Application.CreateForm(TfrmLiveSensors, frmLiveSensors);
188198
Application.CreateForm(TfrmSimpleTerm, frmSimpleTerm);
199+
Application.CreateForm(TfrmEV3RGFEDIT, frmEV3RGFEDIT);
200+
Application.CreateForm(TfrmAddText, frmAddText);
201+
Application.CreateForm(TfrmFileSave, frmFileSave);
189202
if not ParamSwitch('/RESET') then
190203
UpgradeRegistry(nil, nil, nil, nil, nil, nil); // must be done before creating preferences form
191204
if ParamSwitch('-EMBEDDING') or ParamSwitch('-AUTOMATION') then

BricxCC.res

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)