fix function calculate scale,

add new buttons to align select points

git-svn-id: svn://kolibrios.org@7415 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2018-09-24 16:42:54 +00:00
parent d32b6605d0
commit f1c476beb9
5 changed files with 371 additions and 43 deletions

View File

@ -14,7 +14,7 @@ include 'cnc_editor.inc'
include '../../develop/info3ds/info_fun_float.inc' include '../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db 'CNC editor 14.09.18',0 ;¯®¤¯¨áì ®ª­  caption db 'CNC editor 24.09.18',0 ;¯®¤¯¨áì ®ª­ 
run_file_70 FileInfoBlock run_file_70 FileInfoBlock
@ -380,7 +380,6 @@ pushad
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,7 mov edx,7
int 0x40 ;figure move up int 0x40 ;figure move up
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,8 mov edx,8
int 0x40 ;figure move down int 0x40 ;figure move down
@ -392,33 +391,44 @@ pushad
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,10 mov edx,10
int 0x40 ;sel points move up int 0x40 ;sel points move up
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,11 mov edx,11
int 0x40 ;sel points move down int 0x40 ;sel points move down
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,12 mov edx,12
int 0x40 ;copy to clipboard int 0x40 ;align sel points left
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,13 mov edx,13
int 0x40 ;align sel points right
add ebx,25 shl 16
mov edx,14
int 0x40 ;align sel points top
add ebx,25 shl 16
mov edx,15
int 0x40 ;align sel points bottom
add ebx,25 shl 16
mov edx,16
int 0x40 ;copy to clipboard
add ebx,25 shl 16
mov edx,17
int 0x40 ;paste from clipboard int 0x40 ;paste from clipboard
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,14 mov edx,18
int 0x40 ;sel points del int 0x40 ;sel points del
add ebx,30 shl 16 add ebx,30 shl 16
mov edx,15 mov edx,19
int 0x40 ;restore zoom int 0x40 ;restore zoom
add ebx,30 shl 16 add ebx,30 shl 16
mov edx,16 mov edx,20
int 0x40 ;.png int 0x40 ;.png
add ebx,25 shl 16 add ebx,25 shl 16
mov edx,17 mov edx,21
int 0x40 ;options scale int 0x40 ;options scale
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å *** ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
@ -450,6 +460,18 @@ pushad
add edx,(25 shl 16) ;sel points move down add edx,(25 shl 16) ;sel points move down
int 0x40 int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;aling sel points left
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;aling sel points right
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;aling sel points top
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;aling sel points bottom
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;copy to clipboard add edx,(25 shl 16) ;copy to clipboard
int 0x40 int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE add ebx,IMAGE_TOOLBAR_ICON_SIZE
@ -589,36 +611,55 @@ button:
@@: @@:
cmp ah,12 cmp ah,12
jne @f jne @f
call but_clipboard_copy_points call but_sel_points_align_coord_xmin
jmp still jmp still
@@: @@:
cmp ah,13 cmp ah,13
jne @f jne @f
call but_clipboard_paste_points call but_sel_points_align_coord_xmax
jmp still jmp still
@@: @@:
cmp ah,14 cmp ah,14
jne @f jne @f
call but_sel_points_del call but_sel_points_align_coord_ymax
jmp still jmp still
@@: @@:
cmp ah,15 cmp ah,15
jne @f
call but_sel_points_align_coord_ymin
@@:
cmp ah,16
jne @f
call but_clipboard_copy_points
jmp still
@@:
cmp ah,17
jne @f
call but_clipboard_paste_points
jmp still
@@:
cmp ah,18
jne @f
call but_sel_points_del
jmp still
@@:
cmp ah,19
jne @f jne @f
call but_restore_zoom call but_restore_zoom
jmp still jmp still
@@: @@:
cmp ah,16 cmp ah,20
jne @f jne @f
call but_save_png call but_save_png
jmp still jmp still
@@: @@:
cmp ah,17 cmp ah,21
jne @f jne @f
call but_dlg_opt_scale call but_dlg_opt_scale
jmp still jmp still
@@: @@:
;cmp ah,18 ;cmp ah,22
;jne @f ;jne @f
;call but_... ;call but_...
;jmp still ;jmp still
@ -665,11 +706,6 @@ but_open_file:
mov dword[run_file_70.FileName], openfile_path mov dword[run_file_70.FileName], openfile_path
mcall SF_FILE,run_file_70 mcall SF_FILE,run_file_70
;mov eax,dword[open_b+32]
;mov edi,txt_buf
;stdcall convert_int_to_str,20
;notify_window_run txt_buf
mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
inc ecx ;for text files inc ecx ;for text files
stdcall mem.ReAlloc,[open_file_data],ecx stdcall mem.ReAlloc,[open_file_data],ecx
@ -1456,12 +1492,11 @@ proc but_sel_points_all uses eax ecx
cmp [eax+Figure.OType],'Fig' cmp [eax+Figure.OType],'Fig'
jne .no_point jne .no_point
;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
mov ecx,[eax+Figure.PoiCount] mov ecx,[eax+Figure.PoiCount]
or ecx,ecx or ecx,ecx
jz .no_point jz .no_point
mov eax,[eax+Figure.PoiData] mov eax,[eax+Figure.PoiData]
.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª  .cycle0: ;横« ¤«ï ¢ë¤¥«¥­­¨ï â®ç¥ª
bts dword[eax+Point.Prop],PROP_BIT_SELECT bts dword[eax+Point.Prop],PROP_BIT_SELECT
add eax,sizeof.Point add eax,sizeof.Point
loop .cycle0 loop .cycle0
@ -1471,6 +1506,298 @@ proc but_sel_points_all uses eax ecx
ret ret
endp endp
align 4
proc but_sel_points_align_coord_xmin
pushad
stdcall [tl_node_get_data],tree1
or eax,eax
jz .no_point
cmp [eax+Figure.OType],'Fig'
jne .no_point
mov ebx,eax
stdcall sel_points_get_count,eax
cmp eax,1
jle .no_point
mov ecx,[ebx+Figure.PoiCount]
or ecx,ecx
jz .no_point
cmp eax,ecx
je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
mov edx,ecx
imul edx,sizeof.Point
mov ebx,[ebx+Figure.PoiData]
add edx,ebx
align 4
.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
cmp ebx,edx
jge .no_point
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jc .cycle0end
add ebx,sizeof.Point
jmp .cycle0
.cycle0end:
lea esi,[ebx+Point.CoordX]
mov edi,Data_Double
movsd
movsd
finit
fld qword[Data_Double]
align 4
.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordX)
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jnc .no_sel
fcom qword[ebx+Point.CoordX]
fstsw ax
sahf
jbe .no_sel
;if (st0>Point.CoordX)
ffree st0
fincstp
fld qword[ebx+Point.CoordX]
.no_sel:
add ebx,sizeof.Point
cmp ebx,edx
jl .cycle1
fstp qword[Data_Double]
align 4
.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = min(Point.CoordX)
sub edx,sizeof.Point
bt dword[edx+Point.Prop],PROP_BIT_SELECT
jnc @f
mov esi,Data_Double
lea edi,[edx+Point.CoordX]
movsd
movsd
@@:
loop .cycle2
;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
mov dword[offs_last_timer],0
.no_point:
popad
ret
endp
align 4
proc but_sel_points_align_coord_ymin
pushad
stdcall [tl_node_get_data],tree1
or eax,eax
jz .no_point
cmp [eax+Figure.OType],'Fig'
jne .no_point
mov ebx,eax
stdcall sel_points_get_count,eax
cmp eax,1
jle .no_point
mov ecx,[ebx+Figure.PoiCount]
or ecx,ecx
jz .no_point
cmp eax,ecx
je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
mov edx,ecx
imul edx,sizeof.Point
mov ebx,[ebx+Figure.PoiData]
add edx,ebx
align 4
.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
cmp ebx,edx
jge .no_point
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jc .cycle0end
add ebx,sizeof.Point
jmp .cycle0
.cycle0end:
lea esi,[ebx+Point.CoordY]
mov edi,Data_Double
movsd
movsd
finit
fld qword[Data_Double]
align 4
.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordY)
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jnc .no_sel
fcom qword[ebx+Point.CoordY]
fstsw ax
sahf
jbe .no_sel
;if (st0>Point.CoordY)
ffree st0
fincstp
fld qword[ebx+Point.CoordY]
.no_sel:
add ebx,sizeof.Point
cmp ebx,edx
jl .cycle1
fstp qword[Data_Double]
align 4
.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = min(Point.CoordY)
sub edx,sizeof.Point
bt dword[edx+Point.Prop],PROP_BIT_SELECT
jnc @f
mov esi,Data_Double
lea edi,[edx+Point.CoordY]
movsd
movsd
@@:
loop .cycle2
;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
mov dword[offs_last_timer],0
.no_point:
popad
ret
endp
align 4
proc but_sel_points_align_coord_xmax
pushad
stdcall [tl_node_get_data],tree1
or eax,eax
jz .no_point
cmp [eax+Figure.OType],'Fig'
jne .no_point
mov ebx,eax
stdcall sel_points_get_count,eax
cmp eax,1
jle .no_point
mov ecx,[ebx+Figure.PoiCount]
or ecx,ecx
jz .no_point
cmp eax,ecx
je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
mov edx,ecx
imul edx,sizeof.Point
mov ebx,[ebx+Figure.PoiData]
add edx,ebx
align 4
.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
cmp ebx,edx
jge .no_point
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jc .cycle0end
add ebx,sizeof.Point
jmp .cycle0
.cycle0end:
lea esi,[ebx+Point.CoordX]
mov edi,Data_Double
movsd
movsd
finit
fld qword[Data_Double]
align 4
.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordX)
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jnc .no_sel
fcom qword[ebx+Point.CoordX]
fstsw ax
sahf
jae .no_sel
;if (st0<Point.CoordX)
ffree st0
fincstp
fld qword[ebx+Point.CoordX]
.no_sel:
add ebx,sizeof.Point
cmp ebx,edx
jl .cycle1
fstp qword[Data_Double]
align 4
.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = max(Point.CoordX)
sub edx,sizeof.Point
bt dword[edx+Point.Prop],PROP_BIT_SELECT
jnc @f
mov esi,Data_Double
lea edi,[edx+Point.CoordX]
movsd
movsd
@@:
loop .cycle2
;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
mov dword[offs_last_timer],0
.no_point:
popad
ret
endp
align 4
proc but_sel_points_align_coord_ymax
pushad
stdcall [tl_node_get_data],tree1
or eax,eax
jz .no_point
cmp [eax+Figure.OType],'Fig'
jne .no_point
mov ebx,eax
stdcall sel_points_get_count,eax
cmp eax,1
jle .no_point
mov ecx,[ebx+Figure.PoiCount]
or ecx,ecx
jz .no_point
cmp eax,ecx
je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
mov edx,ecx
imul edx,sizeof.Point
mov ebx,[ebx+Figure.PoiData]
add edx,ebx
align 4
.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
cmp ebx,edx
jge .no_point
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jc .cycle0end
add ebx,sizeof.Point
jmp .cycle0
.cycle0end:
lea esi,[ebx+Point.CoordY]
mov edi,Data_Double
movsd
movsd
finit
fld qword[Data_Double]
align 4
.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordY)
bt dword[ebx+Point.Prop],PROP_BIT_SELECT
jnc .no_sel
fcom qword[ebx+Point.CoordY]
fstsw ax
sahf
jae .no_sel
;if (st0<Point.CoordY)
ffree st0
fincstp
fld qword[ebx+Point.CoordY]
.no_sel:
add ebx,sizeof.Point
cmp ebx,edx
jl .cycle1
fstp qword[Data_Double]
align 4
.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = max(Point.CoordY)
sub edx,sizeof.Point
bt dword[edx+Point.Prop],PROP_BIT_SELECT
jnc @f
mov esi,Data_Double
lea edi,[edx+Point.CoordY]
movsd
movsd
@@:
loop .cycle2
;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
mov dword[offs_last_timer],0
.no_point:
popad
ret
endp
align 4 align 4
proc but_restore_zoom uses eax proc but_restore_zoom uses eax
stdcall [tl_node_get_data],tree1 stdcall [tl_node_get_data],tree1

View File

@ -294,7 +294,6 @@ proc ObjCalculateScale uses eax ebx ecx edi, pobj:dword
mov ecx,[ebx+Object.FigCount] mov ecx,[ebx+Object.FigCount]
jecxz .cycle2end jecxz .cycle2end
mov edi,[ebx+Object.FigData] mov edi,[ebx+Object.FigData]
push edi esi ;copy first min X
@@: @@:
mov eax,[edi] mov eax,[edi]
dec ecx dec ecx
@ -304,6 +303,7 @@ proc ObjCalculateScale uses eax ebx ecx edi, pobj:dword
jz @b jz @b
cmp [eax+Figure.PoiCount],0 cmp [eax+Figure.PoiCount],0
je @b je @b
push edi esi ;copy first min X
lea esi,[eax+Figure.MinX] lea esi,[eax+Figure.MinX]
lea edi,[ebx+Object.MinX] lea edi,[ebx+Object.MinX]
movsd movsd
@ -320,7 +320,7 @@ align 4
fcomp qword[ebx+Object.MinX] fcomp qword[ebx+Object.MinX]
fstsw ax fstsw ax
sahf sahf
ja @f jae @f
push edi esi push edi esi
mov eax,[edi] mov eax,[edi]
lea esi,[eax+Figure.MinX] lea esi,[eax+Figure.MinX]
@ -337,7 +337,6 @@ align 4
mov ecx,[ebx+Object.FigCount] mov ecx,[ebx+Object.FigCount]
jecxz .cycle3end jecxz .cycle3end
mov edi,[ebx+Object.FigData] mov edi,[ebx+Object.FigData]
push edi esi ;copy first min Y
@@: @@:
mov eax,[edi] mov eax,[edi]
dec ecx dec ecx
@ -347,6 +346,7 @@ align 4
jz @b jz @b
cmp [eax+Figure.PoiCount],0 cmp [eax+Figure.PoiCount],0
je @b je @b
push edi esi ;copy first min Y
lea esi,[eax+Figure.MinY] lea esi,[eax+Figure.MinY]
lea edi,[ebx+Object.MinY] lea edi,[ebx+Object.MinY]
movsd movsd
@ -363,7 +363,7 @@ align 4
fcomp qword[ebx+Object.MinY] fcomp qword[ebx+Object.MinY]
fstsw ax fstsw ax
sahf sahf
ja @f jae @f
push edi esi push edi esi
mov eax,[edi] mov eax,[edi]
lea esi,[eax+Figure.MinY] lea esi,[eax+Figure.MinY]

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View File

@ -36,7 +36,7 @@ ol, ul, dl{
</style> </style>
</head> </head>
<body> <body>
<h1>CNC_editor âĺđńč˙ 14.09.18</h1> <h1>CNC_editor версия 24.09.18</h1>
<h2>Оглавление</h2> <h2>Оглавление</h2>
<ul> <ul>
@ -88,6 +88,7 @@ ol, ul, dl{
<p>Рис. 5. Окно редактирования точки</p> <p>Рис. 5. Окно редактирования точки</p>
<p><img src="but_08.png">, <img src="but_09.png"> перемещение выделенных точек вверх или вниз в пределах выбранной траэктории</p> <p><img src="but_08.png">, <img src="but_09.png"> перемещение выделенных точек вверх или вниз в пределах выбранной траэктории</p>
<p><img src="but_16.png"> выравнивание выделенных точек по левому, правому, верхнему и нижнему краю</p>
<p><img src="but_10.png"> копирование координат выделенных точек в буфера обмена</p> <p><img src="but_10.png"> копирование координат выделенных точек в буфера обмена</p>
<p><img src="but_11.png"> вставка точек из буфера обмена. Формат текста для вставки в буфере обмена: 'X_ Y_\n...\0'.</p> <p><img src="but_11.png"> вставка точек из буфера обмена. Формат текста для вставки в буфере обмена: 'X_ Y_\n...\0'.</p>
<p><img src="but_12.png"> удаление выделенных точек</p> <p><img src="but_12.png"> удаление выделенных точек</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB