Леонид писал(а):
andrewproffi, главами "Война и мир" Льва Николаевича делитесь Или команды такие длинные Да и схему выложить не мешало бы.
да гребанный форум, писал сообщение в итоге он вышел из аакаунта и удалил его.
пакет из 10 команд: 20 байт +пауза 5мс + 20 байт +пауза...
приходится дробить строку и делать паузы иначе хайасм ее обрежет сам и разобьет
программа терминал все принимает без проблем
>
Make(delphi)
ver(4.05 build 186)
Add(VisualShape,9619313,1453,669)
{
Left=520
Top=670
Width=490
Height=35
Color=-16777204
Color2=-16777204
}
Add(VisualShape,8992484,1502,718)
{
Left=520
Top=630
Width=490
Height=35
Color=65280
Color2=65280
}
Add(VisualShape,6621327,1488,634)
{
Left=520
Top=590
Width=490
Height=35
Color=255
Color2=255
}
Add(VisualShape,9461506,1484,679)
{
Left=520
Top=550
Width=490
Height=35
Color=0
Color2=0
}
Add(VisualShape,5432128,1435,182)
{
Left=15
Top=170
Width=120
Height=145
Ctl3D=0
}
Add(Image,3179763,1442,35)
{
Left=425
Top=5
Width=868
Height=533
Color=0
Visible=1
Point(doVisible)
}
Add(Hub,1978584,553,112)
{
OutCount=4
link(onEvent3,3673227:doEvent1,[(630,132)(630,167)])
link(onEvent4,16668560:doAdd,[(579,139)(579,265)(443,265)(443,391)])
}
Add(Label,3946155,427,63)
{
Left=45
Top=25
Width=0
Height=17
Color=-16777194
Caption="COM порт"
Alignment=2
}
Add(StyleXP,11046345,266,91)
{
}
Add(MainForm,14372191,91,238)
{
Left=200
Top=150
Width=1527
Height=737
Color=-16777194
Font=[Arial,8,0,0,1]
Ctl3D=0
Caption="test AKB"
BorderStyle=1
Point(doBringToFront)
Point(onSetFocus)
Point(onDblClick)
link(onActivate,15162287:doEvent1,[])
}
Add(Button,1842072,224,196)
{
Left=15
Top=110
Width=120
Height=30
Hint="Закрыть порт"
Caption="Закрыть порт"
Data=Real(0)
link(onClick,2365950:doClose,[(310,202)(310,223)])
}
Add(Button,13336586,224,238)
{
Left=15
Top=75
Width=120
Height=30
Hint="Открыть порт"
Caption="Открыть порт"
Data=Real(0)
link(onClick,2365950:doOpen,[(265,244)(265,216)])
}
Add(ComboBox,8670476,357,126)
{
Left=15
Top=47
Width=120
Height=21
Strings=#1:1|1:2|1:3|1:4|1:5|1:6|1:7|1:8|1:9|2:10|0:|0:|
AddType=1
Text="Выберите порт"
ReadOnly=0
}
Add(COMEX,2365950,364,210)
{
BaudRate=18
link(onSyncRead,1978584:doEvent1,[(471,230)(471,118)])
link(Port,8670476:String,[])
}
Add(Button,1574390,147,133)
{
Left=15
Top=5
Width=120
Height=35
Hint="Открыть порта"
Caption="Поиск порт"
Data=Real(0)
link(onClick,8070816:doEvent1,[])
}
Add(EnumCOM,2173630,238,140)
{
OutType=0
link(onEnumPorts,8670476:doAdd,[(300,146)(300,132)])
}
Add(Hub,8070816,203,133)
{
InCount=2
OutCount=3
link(onEvent1,8670476:doClear,[])
link(onEvent2,2173630:doEnumPorts,[])
}
Add(Hub,15162287,147,238)
{
link(onEvent1,8070816:doEvent2,[(182,244)(182,146)])
}
Add(Button,7184611,1141,35)
{
Left=20
Top=180
Width=108
Height=40
Caption="Скриншот"
link(onClick,16364808:doCapture,[])
}
Add(Hub,2186279,1302,35)
{
link(onEvent1,3179763:doLoad,[])
link(onEvent2,3535410:doData,[(1326,48)(1326,55)])
}
Add(InlineCode,16364808,1253,35)
{
WorkPoints=#9:doCapture|
EventPoints=#5:onScr|
Code=#25:// autor andrestudio 2021|15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,windows,Share,Debug;|0:|5:const|12: PSIZE = 2;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|27: f1,f2,f3,f4: PControl;|16: t1: PTimer;|9: public|22: onScr: THI_Event;|51: procedure doCapture(var dt: TData; idx: word);|73: procedure onMouseDown(Sender: PControl; var Mouse: TMouseEventData);|71: procedure onMouseUp(Sender: PControl; var Mouse: TMouseEventData);|31: procedure Timer(Obj:PObj);|22: procedure GetBMP;|5: end;|0:|14:implementation|0:|29:procedure THiAsmClass.GetBMP;|3:var|10: dc: HDC;|19: Bmp: Kol.PBitmap;|19: w,h,x,y: integer;|14: pos: TPoint;|5:begin|18: dc := GetDC(0);|21: GetCursorPos(pos);|59: w := Max(f2.Left,f4.Left) - Min(f2.Left,f4.Left) -PSIZE;|55: h := Max(f1.Top,f3.Top) - Min(f1.Top,f3.Top) -PSIZE;|35: x := Min(f2.Left,f4.Left)+PSIZE;|33: y := Min(f1.Top,f3.Top)+PSIZE;|3: |25: Bmp := NewBitmap(w,h);|69: BitBlt(Bmp.Canvas.Handle,0,0,Bmp.Width,Bmp.Height,DC,x,y,SRCCOPY);|26: _hi_OnEvent(onScr,bmp);|23: bmp.CopyToClipboard;|12: bmp.Free;|54: // пришлось отказатся от пересоздания из за FPC |40: //f1.Free; f2.Free; f3.Free; f4.Free;|13: //t1.Free;|4:end;|0:|34:procedure THiAsmClass.onMouseDown;|5:begin|38: if Mouse.Button <> mbLeft then Exit;|14: t1.Tag := 2;|20: f3.Show; f4.Show; |4:end;|0:|32:procedure THiAsmClass.onMouseUp;|5:begin|38: if Mouse.Button <> mbLeft then Exit;|33: if f2.Left = f4.Left then Exit;|31: if f1.Top = f3.Top then Exit;|22: t1.Enabled := False;|37: f1.Hide; f2.Hide; f3.Hide; f4.Hide;|9: GetBMP;|4:end;|0:|38:procedure THiAsmClass.Timer(Obj:PObj);|3:var|14: pos: TPoint;|5:begin|20: GetCursorPos(pos);|21: if Obj.Tag = 1 then|7: begin|20: f1.Top := Pos.y;|21: f2.Left := Pos.x;|6: end;|21: if Obj.Tag = 2 then|7: begin|20: f3.Top := Pos.y;|21: f4.Left := Pos.x;|8: end; |4:end;|0:|32:procedure THiAsmClass.doCapture;|6:begin |34: if not Assigned(f1) then begin |28: f1 := NewForm(Applet,'');|22: f1.GetWindowHandle;|25: f1.Style := 101187584;|23: f1.ExStyle := 65536;|27: f1.Width := ScreenWidth;|22: f1.Height := PSIZE;|19: f1.Color := 255;|16: f1.Left := 0;|13: //f1.Show;|38: f1.onMouseDown := onMouseDown; end;|0:|34: if not Assigned(f2) then begin |28: f2 := NewForm(Applet,'');|22: f2.GetWindowHandle;|25: f2.Style := 101187584;|23: f2.ExStyle := 65536;|29: f2.Height := ScreenHeight;|21: f2.Width := PSIZE;|19: f2.Color := 255;|15: f2.Top := 0;|13: //f2.Show;|38: f2.onMouseDown := onMouseDown; end;|3: |35: if not Assigned(f3) then begin |28: f3 := NewForm(Applet,'');|22: f3.GetWindowHandle;|25: f3.Style := 101187584;|23: f3.ExStyle := 65536;|27: f3.Width := ScreenWidth;|22: f3.Height := PSIZE;|19: f3.Color := 255;|16: f3.Left := 0;|11: f3.Hide;|34: f3.onMouseUp := onMouseUp; end;|0:|34: if not Assigned(f4) then begin |28: f4 := NewForm(Applet,'');|22: f4.GetWindowHandle;|25: f4.Style := 101187584;|23: f4.ExStyle := 65536;|29: f4.Height := ScreenHeight;|21: f4.Width := PSIZE;|19: f4.Color := 255;|15: f4.Top := 0;|11: f4.Hide;|42: f4.onMouseUp := onMouseUp; end; |3: |34: if not Assigned(t1) then begin |22: t1 := NewTimer(25);|28: t1.OnTimer := Timer; end;|15: t1.Tag := 1;|23: t1.Enabled := True; |11: f1.Show;|16: f2.Show; |4:end;|0:|4:end.|
link(onScr,2186279:doEvent1,[])
}
Add(SDialog,12843375,1183,119)
{
Filter=".jpeg"
FileName=""
Point(doFileName)
link(onExecute,6649720:doEvent1,[])
}
Add(Button,2096136,1141,119)
{
Left=20
Top=225
Width=110
Height=40
Caption="Сохранить картинку"
Point(doVisible)
link(onClick,12843375:doExecute,[])
}
Add(StrCat,864988,1253,126)
{
Str2=".jpeg"
link(onStrCat,3599384:doEvent1,[])
link(Str1,15696856:GetData,[])
}
Add(EventFromData,15696856,1253,77)
{
}
Add(Hub,6649720,1225,119)
{
link(onEvent1,15696856:doData,[(1246,125)(1246,83)])
link(onEvent2,864988:doStrCat,[])
}
Add(PictureStream,8303435,1435,119)
{
link(Bitmap,3179763:ImageBitmap,[])
}
Add(DoData,3535410,1337,49)
{
Data=Integer(1)
link(onEventData,15356796:doEvent1,[])
}
Add(Hub,3599384,1302,126)
{
link(onEvent1,8303435:doSave,[])
link(onEvent2,2824840:doData,[])
}
Add(DoData,2824840,1337,133)
{
Data=Integer(0)
link(onEventData,15356796:doEvent2,[(1385,139)(1385,62)])
}
Add(Hub,15356796,1407,49)
{
InCount=3
OutCount=1
link(onEvent1,3179763:doVisible,[])
}
Add(Button,5182486,1141,175)
{
Left=20
Top=270
Width=110
Height=35
Caption="Отмена"
Data=Integer(0)
Point(doVisible)
link(onClick,15356796:doEvent3,[(1395,181)(1395,69)])
}
Add(Edit,11229754,1358,259)
{
Left=390
Width=960
Height=30
Font=[GOST type B,14,1,0,204]
Visible=1
Text=""
Alignment=2
ClearAfterEnter=1
Point(doVisible)
}
Add(CheckBox,3004579,1309,259)
{
Left=20
Top=360
Width=110
Color=-16777194
Caption="Добавить подпись"
link(onCheck,11229754:doVisible,[(1349,265)(1349,279)])
}
Add(BlockFind,9088038,749,161)
{
IncludeBlock=1
StartBlock="N1="
EndBlock="n"
link(onSearch,5789015:doText,[])
}
Add(Edit,5789015,798,161)
{
Left=910
Top=550
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="n1"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,15662643,749,217)
{
IncludeBlock=1
StartBlock="N2="
EndBlock="n"
Point(doStop)
link(onSearch,12165363:doText,[])
}
Add(Edit,12165363,798,217)
{
Left=910
Top=590
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="n2"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,2182903,749,273)
{
IncludeBlock=1
StartBlock="N3="
EndBlock="n"
Point(doStop)
link(onSearch,10962526:doText,[])
}
Add(Edit,10962526,798,273)
{
Left=910
Top=630
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="n3"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,5390850,749,329)
{
IncludeBlock=1
StartBlock="N4="
EndBlock="n"
Point(doStop)
link(onSearch,16219502:doText,[])
}
Add(Edit,16219502,798,329)
{
Left=910
Top=670
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="n4"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(Hub,3673227,693,161)
{
OutCount=8
link(onEvent1,9088038:doSearch,[])
link(onEvent2,15662643:doSearch,[(728,174)(728,223)])
link(onEvent3,2182903:doSearch,[(728,181)(728,279)])
link(onEvent4,5390850:doSearch,[(728,188)(728,335)])
link(onEvent5,10450601:doSearch,[(728,195)(728,384)])
link(onEvent6,9198612:doSearch,[(728,202)(728,440)])
link(onEvent7,3078973:doSearch,[(728,209)(728,496)])
link(onEvent8,12154479:doSearch,[(728,216)(728,552)])
}
Add(Label,819423,252,581)
{
Left=540
Top=530
Width=68
Height=17
Color=-16777194
Caption="Напряжение"
}
Add(Label,33608,249,578)
{
Left=660
Top=530
Width=23
Height=17
Color=-16777194
Caption="Ток"
}
Add(Label,11948939,242,571)
{
Left=740
Top=530
Width=48
Height=17
Color=-16777194
Caption="Емкость"
}
Add(Label,13044191,235,564)
{
Left=841
Top=531
Width=37
Height=17
Color=-16777194
Caption="Время"
}
Add(Label,14869141,228,557)
{
Left=915
Top=530
Width=77
Height=17
Color=-16777194
Caption="Кол-во циклов"
}
Add(Label,10869640,247,652)
{
Left=505
Top=555
Width=12
Height=25
Color=-16777194
Font=[GOST type B,14,1,0,204]
Caption="1"
}
Add(Label,5438268,246,650)
{
Left=505
Top=595
Width=14
Height=25
Color=-16777194
Font=[GOST type B,14,1,0,204]
Caption="2"
}
Add(Label,3258498,239,643)
{
Left=505
Top=635
Width=14
Height=25
Color=-16777194
Font=[GOST type B,14,1,0,204]
Caption="3"
}
Add(Label,16389299,232,636)
{
Left=505
Top=675
Width=15
Height=25
Color=-16777194
Font=[GOST type B,14,1,0,204]
Caption="4"
}
Add(BlockFind,10450601,749,378)
{
IncludeBlock=1
StartBlock="R1="
EndBlock="m"
link(onSearch,8061186:doText,[])
}
Add(Edit,8061186,798,378)
{
Left=1005
Top=550
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="R1"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,9198612,749,434)
{
IncludeBlock=1
StartBlock="R2="
EndBlock="m"
Point(doStop)
link(onSearch,11581458:doText,[])
}
Add(Edit,11581458,798,434)
{
Left=1005
Top=590
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="R2"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,3078973,749,490)
{
IncludeBlock=1
StartBlock="R3="
EndBlock="m"
Point(doStop)
link(onSearch,10972951:doText,[])
}
Add(Edit,10972951,798,490)
{
Left=1005
Top=630
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="R3"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(BlockFind,12154479,749,546)
{
IncludeBlock=1
StartBlock="R4="
EndBlock="m"
Point(doStop)
link(onSearch,6602635:doText,[])
}
Add(Edit,6602635,798,546)
{
Left=1005
Top=670
Width=90
Height=35
Font=[MS Sans Serif,14,1,0,1]
Enabled=1
Name="R4"
Text=""
Alignment=2
DataType=4
ReadOnly=0
}
Add(Label,3568395,222,551)
{
Left=1010
Top=530
Width=82
Height=17
Color=-16777194
Caption="Сопротивление"
}
Add(SDialog,11161239,301,413)
{
Filter=".txt"
FileName=""
Point(doFileName)
link(onExecute,11114417:doEvent1,[])
}
Add(Button,12598604,259,413)
{
Left=15
Top=400
Width=120
Height=40
Caption="Сохранить текст"
Point(doVisible)
link(onClick,11161239:doExecute,[])
}
Add(StrCat,11940027,371,420)
{
Str2=".txt"
link(onStrCat,16668560:doSave,[])
link(Str1,6746969:GetData,[])
}
Add(EventFromData,6746969,371,371)
{
}
Add(Hub,11114417,343,413)
{
link(onEvent1,6746969:doData,[(364,419)(364,377)])
link(onEvent2,11940027:doStrCat,[])
}
Add(Memo,16668560,455,385)
{
Left=5
Top=515
Width=495
Height=190
ScrollBars=2
Point(doSave)
}
Add(Edit,13831158,133,553)
{
Left=1305
Top=590
Width=120
Height=30
Font=[MS Sans Serif,10,1,0,1]
Name="n1"
Text=""
Alignment=2
DataType=4
link(onEnter,2147313:doEvent6,[(181,566)(181,412)])
}
Add(Button,1428091,140,336)
{
Left=1305
Top=550
Width=120
Height=30
Hint="Открыть порт"
Caption="Режим тестирования"
Data=Integer(252)
link(onClick,2147313:doEvent1,[(184,342)(184,377)])
}
Add(Button,14506433,140,378)
{
Left=1165
Top=655
Width=120
Height=30
Hint="Открыть порт"
Caption="пропустить паузу"
Data=Integer(131)
link(onClick,2147313:doEvent2,[])
}
Add(Button,10368005,140,420)
{
Left=1165
Top=620
Width=120
Height=30
Hint="Открыть порт"
Caption="режим разряда"
Data=Integer(132)
link(onClick,2147313:doEvent3,[(184,426)(184,391)])
}
Add(Button,15944908,140,462)
{
Left=1165
Top=585
Width=120
Height=30
Hint="режим заряда"
Caption="режим заряда"
Data=Integer(133)
link(onClick,2147313:doEvent4,[(184,468)(184,398)])
}
Add(Hub,2147313,196,371)
{
InCount=6
OutCount=1
link(onEvent1,2365950:doWrite,[(287,377)(287,230)])
}
Add(Button,13074427,137,508)
{
Left=1165
Top=550
Width=120
Height=30
Hint="Открыть порт"
Caption="тест полной емкости"
Data=Integer(123)
link(onClick,2147313:doEvent5,[(183,514)(183,405)])
}