add new program 'cnc_editor'

git-svn-id: svn://kolibrios.org@7360 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2018-09-14 16:10:51 +00:00
parent 1972c7407b
commit 48ae125675
33 changed files with 5780 additions and 0 deletions

View File

@ -0,0 +1,9 @@
if not exist bin mkdir bin
@copy *.nc bin\*.nc
@erase lang.inc
@echo lang fix en >lang.inc
@fasm.exe -m 32768 cnc_editor.asm bin\cnc_editor.kex
@kpack bin\cnc_editor.kex
pause

View File

@ -0,0 +1,9 @@
if not exist bin mkdir bin
@copy *.nc bin\*.nc
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm.exe -m 32768 cnc_editor.asm bin\cnc_editor.kex
@kpack bin\cnc_editor.kex
pause

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,114 @@
<html>
<head>
<title>CNC_editor</title>
<meta http-equiv="content-type" content="text/html; charset=WINDOWS-1251">
<style>
body
{
font-size: 15px;
font-family: "Bookman Old Style";
color: black;
text-align: justify;
width: 750px;
}
h1 {
color: white;
background-color: 808080;
font-size: 25px;
text-align: center;
}
h2 { color: green; font-size: 21px; }
h3 { color: green; font-size: 19px; }
h4 { color: #803f00; font-size: 17px; }
i { color: #0099cc; }
b { color: #0099cc; }
p {
text-indent: 2em;
margin-top: 3px;
margin-bottom: 2px;
margin-left: 0px;
margin-right: 0px;
}
ol, ul, dl{
margin-top: 3px;
margin-bottom: 2px;
}
</style>
</head>
<body>
<h1>CNC_editor версия 14.09.18</h1>
<h2>Оглавление</h2>
<ul>
<li>О программе</li>
<li>Панель инструментов</li>
<li>Клавиатура</Li>
<li>Автор</li>
</ul>
<h2>О программе</h2>
<p><b>CNC_editor</b> - программа просмотра и редактирования файлов формата <b>*.nc</b>. Файлы <b>*.nc</b> содержат в себе код (<b>gcode</b>) для станков с ЧПУ (числовое программное управление или на английском CNC). К таким станкам относятся: лазерные граверы, фрезеровальные станки, сверлильные станки, плоттеры. На похожем принципе работают 3D принтеры только используют другой формат данных <b>*.stl</b>.</p>
<p><img src="cnc_01.png"></p>
<p>Рис. 1. Внешний вид программы с открытым файлом *.nc</p>
<p>Возможности программы:</p>
<p>Открытие файлов и просмотр траектории движения станка. Можно изменять координаты, добавлять точки в траекторию, удалять точки, менять порядок точек движения. Не все данные редактируются программой, например: установка скорости движения, поднятие/опускание шпинделя в программе изменить нельзя. Сохранение траектории движения в файл <b>*.png</b>. Код <b>gcode</b> имеет разновидности в зависимости от специфики станка, потому не все файлы *.nc могут корректно отображаться данной программой.</p>
<p><img src="cnc_02.png"></p>
<p>Рис. 2. Просмотр точек движения станка</p>
<h2>Панель инструментов</h2>
<p><img src="but_01.png"> новый файл. При создании нового файла можно выбрать фигуру окружность или прямоугольник. Которые потом можно редактировать.</p>
<p><img src="cnc_03.png"></p>
<p>Рис. 3. Окно создания нового файла</p>
<p>Параметры для создания окружности:</p>
<ul>
<li>X0, Y0 - координаты центра</li>
<li>R - радиус окружности</li>
<li>S - колличество граней</li>
<li>Z0 - минимальная (рабочая) высота инструмента</li>
<li>Z1 - максимальная (безопасная) высота инструмента</li>
</ul>
<p>Параметры для создания прямоугольника:</p>
<ul>
<li>X0, Y0, X1, Y1 - координаты углов прямоугольника</li>
<li>Z0 - минимальная (рабочая) высота инструмента</li>
<li>Z1 - максимальная (безопасная) высота инструмента</li>
</ul>
<p><img src="but_02.png"> открыть файл</p>
<p><img src="but_03.png"> сохранить файл</p>
<p><img src="but_04.png"> спрятать/показать номерацию точек</p>
<p><img src="but_05.png">, <img src="but_06.png"> перемещение выбраной команды в списке</p>
<p><img src="but_07.png"> вызвать диалог создания/редактирования точки. Если ни одна точка не выбрана, то вызывается диалог создания точки. Если выделена одна точка то вызывается диалог редактирования координат точки.</p>
<p><img src="cnc_04.png"></p>
<p>Рис. 4. Окно создания точки</p>
<p><img src="cnc_05.png"></p>
<p>Рис. 5. Окно редактирования точки</p>
<p><img src="but_08.png">, <img src="but_09.png"> перемещение выделенных точек вверх или вниз в пределах выбранной траэктории</p>
<p><img src="but_10.png"> копирование координат выделенных точек в буфера обмена</p>
<p><img src="but_11.png"> вставка точек из буфера обмена. Формат текста для вставки в буфере обмена: 'X_ Y_\n...\0'.</p>
<p><img src="but_12.png"> удаление выделенных точек</p>
<p><img src="but_13.png"> сброс масштаба и центровка текущей фигуры по центру окна просмотра</p>
<p><img src="but_14.png"> сохранение траектории в файл <b>*.png</b></p>
<p><img src="but_15.png"> настройки разрешения для сохранения файла <b>*.png</b>, указывается число пикселей на 1 мм. По умолчанию указано число 11.81102362204724 (для перевода в dpi: 11.81102362204724 * 25.4 = 300).</p>
<p><img src="cnc_06.png"></p>
<p>Рис. 6. Окно настроек разрешения</p>
<h2>Клавиатура</h2>
<p><b>Delete</b> - удаляет выделенные точки.</p>
<p>Если не удается мышей выделить одну какую-либо точку (например когда ее координаты совпадают с другими точками, тогда выделяются сразу все совпадающие точки а необходимо взять только одну), можно воспользоваться курсорами:</p>
<p><b>&uarr;</b>, <b>&larr;</b> - пермещает выделение точки вверх, выделяется предыдущая точка.</p>
<p><b>&darr;</b>, <b>&rarr;</b> - пермещает выделение точки вниз, выделяется следущая точка.</p>
<p><b>Ctrl+N</b> - создание нового файла.</p>
<p><b>Ctrl+O</b> - открытие файла.</p>
<p><b>Ctrl+S</b> - сохранение файла.</p>
<p><b>Ctrl+A</b> - выделение всех точек текущей фигуры.</p>
<h2>Автор</h2>
<p>IgorA</p>
</body>
</html>

View File

@ -0,0 +1,789 @@
;PCB graving
G0 M3 X0 Y0 Z5
G0 X40.28 Y38.95 Z5
G1 F100 Z0
X40.28 Y38.95
X39.46 Y38.44
X37.03 Y36.89
X35.56 Y35.99
X34.9 Y35.63
X34.41 Y35.35
X33.74 Y34.97
X32.97 Y34.52
X32.69 Y34.35
X32.38 Y34.35
X32.1 Y34.43
X31.82 Y34.51
X31.18 Y34.6
X30.54 Y34.7
X30.03 Y34.78
X29.52 Y34.85
X29.1 Y34.88
X28.68 Y34.9
X28.6 Y34.96
X28.37 Y34.96
X28.22 Y34.9
X28.27 Y34.81
X28.62 Y34.65
X28.96 Y34.49
X29.16 Y34.42
X29.72 Y34.17
X30.08 Y34.01
X30.7 Y33.81
X31.32 Y33.61
X30.98 Y33.43
X30.34 Y33.21
X30 Y33.08
X29.78 Y33.04
X29.77 Y32.87
X29.76 Y32.7
X29.89 Y32.58
X30.02 Y32.46
X30.12 Y32.46
X30.67 Y32.3
X30.03 Y31.51
X29.8 Y31.16
X29.41 Y30.53
X29.19 Y30.13
X29.19 Y30.08
X29.22 Y30.06
X29.24 Y30.06
X29.69 Y30.24
X29.36 Y29.88
X29.03 Y29.52
X28.49 Y28.91
X27.95 Y28.29
X27.54 Y27.8
X27.46 Y27.71
X27.08 Y27.34
X26.7 Y26.96
X26.61 Y26.89
X26.04 Y26.5
X25.56 Y26.31
X25.07 Y26.13
X24.8 Y26.06
X24.54 Y25.76
X24.43 Y25.76
X24.32 Y25.76
X24.06 Y25.63
X23.8 Y25.5
X23.69 Y25.42
X23.59 Y25.33
X23.43 Y25.1
X23.27 Y24.87
X23.08 Y24.69
X22.89 Y24.51
X22.74 Y24.21
X22.58 Y23.9
X22.51 Y23.7
X22.43 Y23.49
X22.37 Y23.23
X22.31 Y22.98
X22.22 Y22.96
X22.13 Y23.01
X21.93 Y23.2
X21.72 Y23.37
X21.28 Y23.85
X20.83 Y24.29
X20.45 Y24.58
X20.13 Y24.78
X19.81 Y24.93
X19.65 Y24.97
X19.49 Y25
X19.36 Y24.95
X19.24 Y24.9
X19.15 Y24.82
X19.07 Y24.73
X19.07 Y24.55
X19.07 Y24.36
X19.32 Y23.59
X19.43 Y23.26
X19.53 Y22.93
X19.59 Y22.64
X19.83 Y22.38
X19.99 Y21.8
X20.12 Y21.45
X20.24 Y21.18
X20.24 Y21.09
X20.6 Y20.69
X21.04 Y19.79
X21.19 Y19.54
X21.33 Y19.49
X21.47 Y19.36
X21.8 Y18.84
X21.89 Y18.74
X21.98 Y18.56
X22.3 Y18.17
X22.34 Y18.07
X22.38 Y17.97
X22.28 Y17.79
X22.05 Y17.71
X21.85 Y17.73
X21.26 Y18.02
X20.68 Y18.31
X20.45 Y18.4
X20.22 Y18.5
X19.4 Y18.9
X18.91 Y19.07
X18.43 Y19.24
X18.29 Y19.33
X18.16 Y19.42
X18.13 Y19.42
X18.1 Y19.42
X17.85 Y19.57
X17.61 Y19.72
X16.99 Y19.92
X16.38 Y20.13
X16 Y20.19
X15.62 Y20.25
X15.26 Y20.33
X14.9 Y20.41
X14.57 Y20.45
X14.24 Y20.48
X13.83 Y20.6
X13.42 Y20.71
X12.65 Y20.91
X11.88 Y21.12
X11.63 Y21.16
X11.37 Y21.21
X11.04 Y21.28
X10.71 Y21.36
X10.3 Y21.44
X9.89 Y21.52
X9.1 Y21.65
X8.3 Y21.77
X7.79 Y21.83
X7.28 Y21.88
X6.43 Y21.88
X5.57 Y21.88
X4.68 Y21.77
X3.86 Y21.58
X2.94 Y21.25
X2.71 Y21.1
X2.48 Y20.94
X2.41 Y20.87
X2.34 Y20.8
X2.36 Y20.69
X2.38 Y20.58
X2.58 Y20.44
X2.79 Y20.3
X3.09 Y20.22
X3.4 Y20.14
X3.68 Y20.14
X3.96 Y20.14
X4.2 Y19.89
X4.44 Y19.65
X4.77 Y19.44
X5.11 Y19.23
X5.12 Y19.29
X5.14 Y19.34
X5.36 Y19.05
X5.57 Y18.77
X5.76 Y18.62
X5.96 Y18.48
X5.98 Y18.45
X6.01 Y18.43
X6.11 Y18.36
X6.21 Y18.3
X6.39 Y18.22
X6.57 Y18.14
X6.64 Y18.08
X6.71 Y18.02
X6.84 Y18.01
X6.98 Y18
X7.07 Y18
X7.16 Y17.99
X7.35 Y17.79
X7.54 Y17.58
X7.6 Y17.58
X7.66 Y17.58
X7.68 Y17.51
X7.71 Y17.44
X7.86 Y17.36
X8 Y17.29
X8.25 Y17.15
X8.51 Y17.02
X8.57 Y17.04
X8.63 Y17.07
X8.66 Y16.99
X8.69 Y16.92
X8.8 Y16.93
X8.92 Y16.95
X8.92 Y16.82
X8.92 Y16.7
X9.15 Y16.53
X9.38 Y16.36
X9.58 Y16.25
X9.79 Y16.14
X9.89 Y16.05
X9.99 Y15.96
X10.24 Y15.9
X10.49 Y15.83
X10.64 Y15.84
X10.79 Y15.84
X10.84 Y15.74
X10.89 Y15.64
X10.95 Y15.64
X11.02 Y15.64
X11.4 Y15.39
X11.77 Y15.13
X12.04 Y15.05
X12.31 Y14.97
X12.5 Y15.01
X12.68 Y15.04
X12.67 Y15
X12.67 Y14.95
X12.67 Y14.9
X12.68 Y14.84
X13.21 Y14.57
X13.74 Y14.3
X14.02 Y14.29
X14.3 Y14.28
X14.37 Y14.23
X14.44 Y14.17
X14.59 Y14.1
X14.75 Y14.02
X15.07 Y13.91
X15.4 Y13.79
X15.68 Y13.79
X15.95 Y13.8
X15.98 Y13.73
X16.01 Y13.65
X16.29 Y13.55
X16.57 Y13.44
X16.66 Y13.44
X16.74 Y13.44
X16.8 Y13.29
X16.86 Y13.14
X17.02 Y13.1
X17.18 Y13.07
X17.18 Y13.03
X17.18 Y12.99
X17.4 Y12.93
X17.63 Y12.87
X17.72 Y12.77
X17.8 Y12.68
X17.86 Y12.68
X17.92 Y12.68
X18.07 Y12.52
X18.22 Y12.37
X18.43 Y12.27
X18.64 Y12.17
X18.97 Y12.17
X19.25 Y12.36
X19.32 Y12.46
X19.43 Y12.55
X19.54 Y12.65
X19.62 Y12.8
X19.7 Y12.96
X19.7 Y12.86
X19.54 Y12.36
X19.37 Y11.86
X19.3 Y11.44
X19.23 Y11.02
X19.25 Y9.53
X19.27 Y8.05
X19.33 Y7.69
X19.38 Y7.34
X19.48 Y6.93
X19.57 Y6.52
X19.63 Y6.21
X19.68 Y5.9
X19.74 Y5.7
X19.79 Y5.5
X19.84 Y5.11
X19.89 Y4.73
X19.97 Y4.5
X20.04 Y4.27
X20.09 Y2.58
X20.13 Y0.88
X20.21 Y0.74
X20.28 Y0.59
X20.39 Y0.49
X20.5 Y0.39
X20.5 Y0.5
X20.5 Y0.6
X20.69 Y0.64
X20.88 Y0.67
X20.97 Y0.76
X21.07 Y0.84
X21.27 Y0.83
X21.47 Y0.82
X21.8 Y0.94
X22.12 Y1.06
X22.31 Y1.21
X22.49 Y1.35
X22.49 Y1.4
X22.49 Y1.44
X22.59 Y1.58
X22.69 Y1.71
X22.75 Y1.94
X22.81 Y2.17
X22.81 Y2.29
X22.8 Y2.41
X22.78 Y2.54
X23.56 Y3.07
X23.67 Y3.27
X23.77 Y3.82
X23.87 Y4.37
X23.91 Y5.38
X23.94 Y6.39
X24.07 Y6.99
X24.27 Y7
X24.4 Y6.85
X24.47 Y6.85
X24.75 Y6.98
X25.02 Y7.03
X25.04 Y7.05
X25.26 Y7.35
X25.71 Y8
X26.06 Y8.49
X26.04 Y8.87
X25.87 Y9.12
X25.87 Y9.28
X26.14 Y9.69
X26.41 Y10.1
X26.81 Y10.71
X27.1 Y11.22
X27.75 Y12.55
X28.17 Y13.72
X28.21 Y14.08
X28.33 Y15.16
X28.3 Y16
X28.25 Y16.92
X28.16 Y17.66
X28 Y18.5
X27.85 Y19.35
X27.99 Y20.78
X27.98 Y21.52
X27.97 Y22.26
X27.86 Y23.13
X27.76 Y24
X27.71 Y24.61
X27.63 Y25.73
X27.62 Y26.44
X27.91 Y27.07
X28.33 Y27.68
X29.15 Y28.78
X29.44 Y29.15
X30.03 Y29.78
X30.59 Y30.35
X31.15 Y30.92
X31.27 Y30.83
X31.84 Y30.76
X32.21 Y31.09
X32.58 Y31.41
X32.7 Y31.51
X32.81 Y31.59
X32.89 Y31.41
X32.9 Y30.9
X32.9 Y30.39
X32.95 Y29.52
X33 Y28.65
X33.04 Y28.59
X33.08 Y28.52
X33.15 Y28.6
X33.23 Y28.67
X33.23 Y28.88
X33.23 Y29.09
X33.3 Y29.46
X33.38 Y29.83
X33.43 Y30.26
X33.48 Y30.69
X33.48 Y30.83
X33.66 Y30.73
X34.1 Y30.65
X34.53 Y30.58
X34.86 Y30.52
X35.19 Y30.47
X35.76 Y30.41
X36.32 Y30.35
X36.36 Y30.31
X36.4 Y30.28
X36.05 Y29.96
X35.71 Y29.64
X35.48 Y29.55
X35.37 Y29.31
X35.26 Y29.07
X35.4 Y28.95
X35.53 Y28.83
X35.67 Y28.82
X35.81 Y28.82
X36 Y28.84
X35.93 Y28.62
X35.64 Y28.19
X35.41 Y27.68
X35.19 Y27.09
X34.98 Y26.5
X34.94 Y26.42
X34.9 Y26.33
X35.04 Y26.35
X35.18 Y26.36
X35.23 Y26.45
X35.28 Y26.53
X35.59 Y26.74
X35.91 Y26.96
X36.63 Y27.59
X36.85 Y27.8
X37.07 Y28.02
X37.21 Y28.17
X37.26 Y27.99
X37.47 Y27.58
X37.75 Y27.42
X37.88 Y27.42
X38.01 Y27.43
X38.13 Y27.5
X38.24 Y27.85
X38.35 Y28.19
X38.53 Y28.6
X38.6 Y28.89
X39.1 Y27.86
X38.99 Y27.65
X38.87 Y27.44
X38.53 Y26.79
X38.19 Y26.15
X37.65 Y25.05
X37.11 Y23.95
X36.84 Y23.41
X35.69 Y22.3
X34.97 Y21.83
X34.75 Y21.62
X34.53 Y21.42
X34.45 Y21.31
X34.45 Y21.21
X34.52 Y21.18
X34.59 Y21.16
X34.81 Y21.29
X35.04 Y21.42
X35.12 Y21.42
X35.19 Y21.42
X35.26 Y21.37
X35.33 Y21.33
X35.15 Y21.07
X34.97 Y20.81
X34.85 Y20.56
X34.68 Y20.27
X34.57 Y20.11
X34.45 Y19.95
X34.45 Y19.86
X34.51 Y19.78
X34.56 Y19.78
X34.7 Y19.87
X34.84 Y19.96
X35.19 Y20.26
X35.54 Y20.57
X36.26 Y21.22
X36.66 Y21.54
X36.7 Y21.51
X36.7 Y21.2
X36.7 Y20.89
X36.83 Y20.78
X36.96 Y20.66
X36.87 Y20.5
X36.78 Y20.34
X36.92 Y20.25
X37.05 Y20.3
X37.09 Y20.11
X37.14 Y19.77
X37.27 Y19.67
X37.41 Y19.57
X37.51 Y19.62
X37.61 Y19.67
X37.78 Y20.37
X37.92 Y20.79
X38.11 Y21.01
X38.14 Y21.01
X38.18 Y20.91
X38.36 Y20.54
X38.64 Y19.9
X38.76 Y19.63
X38.95 Y19.19
X39.06 Y18.92
X39.18 Y18.66
X39.26 Y18.67
X39.33 Y18.69
X39.31 Y18.94
X39.3 Y19.12
X39.3 Y19.3
X39.3 Y19.63
X39.31 Y19.96
X39.26 Y20.32
X39.2 Y20.73
X39.51 Y20.38
X39.83 Y20.04
X39.95 Y20.04
X40.08 Y20.04
X40.08 Y20.09
X40.08 Y20.14
X39.97 Y20.32
X39.87 Y20.5
X39.87 Y20.64
X39.64 Y20.98
X39.4 Y21.32
X39.3 Y21.66
X39.15 Y22.06
X39.05 Y22.56
X39 Y23.02
X39.16 Y24.05
X39.47 Y25.64
X39.63 Y26.5
X39.67 Y26.73
X39.72 Y26.76
X39.77 Y26.79
X39.8 Y26.66
X39.92 Y26.53
X40.01 Y26.53
X40.01 Y26.71
X39.97 Y26.89
X39.94 Y26.96
X39.88 Y27.11
X39.84 Y27.25
X40.02 Y27.62
X40.18 Y28.02
X40.47 Y28.69
X40.76 Y29.37
X40.91 Y29.67
X41.27 Y30.39
X41.57 Y30.97
X41.86 Y31.55
X41.89 Y31.43
X41.91 Y31.31
X41.96 Y30.97
X42.02 Y30.64
X42.27 Y30.13
X42.4 Y29.98
X42.52 Y29.83
X42.62 Y29.88
X42.71 Y29.94
X42.81 Y30.14
X42.91 Y30.34
X42.92 Y28.45
X42.93 Y26.56
X42.81 Y25.1
X42.68 Y23.65
X42.58 Y23.28
X42.58 Y22.69
X42.74 Y21.92
X42.98 Y21.09
X43.2 Y20.63
X43.42 Y20.26
X43.67 Y19.95
X43.92 Y19.64
X44.03 Y19.61
X44.13 Y19.58
X44.17 Y19.6
X44.2 Y19.63
X44.29 Y19.92
X44.38 Y20.22
X44.57 Y20.68
X44.67 Y21.14
X44.7 Y21.57
X44.74 Y22.01
X44.83 Y22.57
X44.86 Y22.91
X44.81 Y23.44
X44.7 Y23.9
X44.67 Y24.15
X44.63 Y24.26
X44.58 Y24.36
X44.53 Y24.61
X44.42 Y25.12
X44.29 Y25.71
X44.17 Y26.3
X44.07 Y26.86
X43.99 Y27.45
X43.92 Y28.04
X43.88 Y28.68
X43.85 Y29.32
X44.09 Y29
X44.17 Y28.93
X44.37 Y28.76
X44.49 Y28.68
X44.61 Y28.68
X44.72 Y28.68
X44.75 Y28.72
X44.77 Y28.75
X44.8 Y29.06
X44.84 Y29.36
X44.86 Y29.4
X44.88 Y30.01
X44.89 Y30.59
X44.85 Y30.95
X44.78 Y31.31
X44.59 Y31.68
X44.4 Y32.06
X44.05 Y32.89
X43.95 Y33.56
X43.87 Y34.53
X43.84 Y35.19
X43.98 Y35.81
X44.23 Y36
X44.43 Y36.22
X44.61 Y36.57
X44.78 Y36.92
X44.78 Y37.24
X44.96 Y37.43
X45.16 Y37.62
X45.63 Y37.98
X46.08 Y38.34
X46.88 Y38.7
X47.3 Y38.7
X47.72 Y38.7
X47.89 Y38.65
X48.06 Y38.6
X48.2 Y38.45
X48.35 Y38.3
X48.32 Y38.17
X48.29 Y38.03
X48.42 Y38.03
X48.54 Y38.03
X48.73 Y38.09
X48.92 Y38.14
X48.92 Y38.22
X48.92 Y38.3
X49.18 Y38.26
X49.43 Y38.23
X49.7 Y38.16
X49.96 Y38.09
X50.04 Y38
X50.12 Y37.92
X50.06 Y37.89
X50 Y37.87
X49.8 Y37.7
X49.55 Y37.52
X49.48 Y37.44
X49.48 Y37.37
X49.56 Y37.37
X49.83 Y37.49
X50.02 Y37.61
X50.18 Y37.66
X50.35 Y37.72
X50.37 Y37.73
X50.38 Y37.79
X50.53 Y37.84
X50.68 Y37.88
X50.91 Y37.85
X51.14 Y37.82
X51.7 Y37.7
X52.26 Y37.57
X52.3 Y37.57
X52.34 Y37.57
X52.34 Y38.33
X51.96 Y38.4
X51.04 Y38.7
X50.71 Y39.02
X50.57 Y38.84
X49.91 Y38.88
X49.35 Y39.26
X45.25 Y39.26
X44.85 Y39.18
X44.45 Y39.1
X44.24 Y39.1
X44.03 Y39.1
X43.91 Y39.02
X43.76 Y38.9
X43.48 Y38.76
X43.23 Y38.64
X43.08 Y38.53
X42.94 Y38.41
X42.67 Y38.15
X42.41 Y37.88
X42.3 Y37.88
X42.3 Y37.88
X42.02 Y37.72
X41.74 Y37.59
X41.64 Y37.59
X41.52 Y37.62
X41.34 Y37.75
X41.15 Y37.87
X41.12 Y37.82
X41.25 Y37.62
X41.42 Y37.47
X41.59 Y37.42
X41.86 Y37.42
X41.94 Y37.44
X41.87 Y37.35
X41.71 Y37.12
X41.46 Y36.61
X41.2 Y36
X41.03 Y35.19
X40.85 Y34.48
X40.69 Y34.12
X40.19 Y33.63
X39.69 Y33.14
X38.77 Y32.38
X38.71 Y32.33
X38.64 Y32.28
X38.47 Y32.13
X38.17 Y31.92
X38.03 Y31.81
X37.82 Y31.64
X37.61 Y31.48
X37.07 Y31.43
X36.52 Y31.39
X35.63 Y31.31
X34.73 Y31.2
X34.5 Y31.17
X33.9 Y31.1
X33.52 Y31.06
X33.55 Y31.44
X33.64 Y32.01
X33.7 Y32.51
X33.71 Y32.82
X34.08 Y33.19
X34.44 Y33.56
X34.94 Y34.01
X35.42 Y34.45
X35.9 Y34.89
X36.23 Y35.19
X36.83 Y35.72
X37.34 Y36.08
X37.85 Y36.45
X38.34 Y36.78
X38.83 Y37.11
X39.61 Y37.62
X40.12 Y37.93
X41.02 Y38.47
X41.38 Y38.66
X42.4 Y39.26
X40.76 Y39.26
X40.28 Y38.95
G0 Z5
G0 X44.02 Y38.18 Z5
G1 F100 Z0
X44.02 Y38.18
X43.93 Y38.01
X43.7 Y37.43
X43.45 Y37.2
X43.45 Y37.55
X43.65 Y37.95
X43.65 Y38.12
X43.82 Y38.26
X44.04 Y38.38
X44.11 Y38.36
X44.02 Y38.18
G0 Z5
G0 X40.52 Y32.28 Z5
G1 F100 Z0
X40.52 Y32.28
X40.54 Y32.12
X40.7 Y31.9
X40.93 Y31.9
X41.22 Y32.12
X41.19 Y32.07
X41.17 Y32.03
X39.57 Y28.78
X39.52 Y28.78
X39.41 Y29.21
X39.37 Y29.62
X39.32 Y29.88
X39.15 Y30.37
X40.43 Y32.36
X40.49 Y32.36
X40.52 Y32.28
G0 Z5
G0 M5 X0 Y0 Z5

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,587 @@
;
; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 ­ã¦­ë¥ ¤«ï ᮧ¤ ­¨ï ¨
; à ¡®âë ®ª­  ᮧ¤ ­¨ï ­®¢®£® ä ©« 
;
wnd_n_file_width equ 300 ;è¨à¨­  ®ª­  ᮧ¤ ­¨ï ­®¢®£® ä ©« 
wnd_n_file_height equ 200 ;¢ëá®â  ®ª­  ᮧ¤ ­¨ï ­®¢®£® ä ©« 
align 4
wnd_n_file db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮧ¤ ­¨ï ­®¢®£® ä ©« 
align 4
NOptCoordX0 dq 35.0
NOptCoordY0 dq 25.0
NOptCoordX1 dq 20.0 ;for circle Radius
NOptCoordY1 dq 16.0 ;S
NOptCoordZ0 dq 1.0
NOptCoordZ1 dq 5.0
;¤ ­®¥ ®ª­® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï ä㭪樥© but_wnd_coords
align 4
start_n_file:
pushad
mcall SF_SET_EVENTS_MASK,0x27 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
inc byte[wnd_n_file]
edit_boxes_set_sys_color edit4,editboxes_end_nf,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
option_boxes_set_sys_color sc,opt_grlist1
call get_n_file_opt
popad
call red_win_n_file
;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
align 4
still_n_file:
pushad
mcall SF_WAIT_EVENT_TIMEOUT,10
or eax,eax
jnz @f
call timer_funct_n_file
jmp .end
@@:
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jne @f
call red_win_n_file
jmp .end
@@:
cmp al,2
jne @f
call key_n_file
jmp .end
@@:
cmp al,3
jz button_n_file
cmp al,6
jne @f
call mouse_n_file
@@:
.end:
popad
jmp still_n_file
align 4
red_win_n_file:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
mov edi,capt_n_file ;children window caption
mov bx,word[procinfo.box.left]
add bx,word[buf_0.l]
add bx,5 ;è¨à¨­  ¡®ª®¢®© à ¬ª¨
shl ebx,16
mov bx,wnd_n_file_width
mov cx,word[procinfo.box.top]
add cx,ax ;add skin height
add cx,word[buf_0.t]
shl ecx,16
mov cx,wnd_n_file_height
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
int 0x40
mov esi,[sc.work_button]
;ebx = (l<:)+w, ecx = (t<:)+h
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (145 shl 16)+20, 3
mcall , (75 shl 16)+59, (145 shl 16)+20, 4
mov ecx,[sc.work_text]
bts ecx,31 ;à¨á㥬 ï áâப  § ª ­ç¨¢ ¥âáï ­ã«ñ¬
mcall SF_DRAW_TEXT, (5 shl 16)+5,, capt_sel_fig
mcall , (5 shl 16)+32,, capt_coord_x0
mcall , (5 shl 16)+50,, capt_coord_y0
cmp [opt_gr1],opt1
jne @f
;circle
mcall , (5 shl 16)+68,, capt_coord_r
mcall , (5 shl 16)+86,, capt_coord_s
jmp .end0
@@:
;rect
mcall , (5 shl 16)+68,, capt_coord_x1
mcall , (5 shl 16)+86,, capt_coord_y1
.end0:
mcall , (5 shl 16)+104,,capt_coord_z0
mcall , (5 shl 16)+122,,capt_coord_z1
mov ecx,[sc.work_button_text]
bts ecx,31
mcall , (9 shl 16)+151,, txt_but_cancel
mcall ,(79 shl 16)+151,, txt_but_create
stdcall [option_box_draw], opt_grlist1
stdcall [edit_box_draw], edit4
stdcall [edit_box_draw], edit5
stdcall [edit_box_draw], edit6
stdcall [edit_box_draw], edit7
stdcall [edit_box_draw], edit8
stdcall [edit_box_draw], edit9
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
proc key_n_file uses eax ebx
mcall SF_GET_KEY
test word [edit4.flags],10b ;ed_focus
je @f
stdcall [edit_box_key], edit4
jmp .end
@@:
test word [edit5.flags],10b
je @f
stdcall [edit_box_key], edit5
jmp .end
@@:
test word [edit6.flags],10b
je @f
stdcall [edit_box_key], edit6
jmp .end
@@:
test word [edit7.flags],10b
je @f
stdcall [edit_box_key], edit7
jmp .end
@@:
test word [edit8.flags],10b
je @f
stdcall [edit_box_key], edit8
jmp .end
@@:
test word [edit9.flags],10b
je @f
stdcall [edit_box_key], edit9
;jmp .end
@@:
.end:
ret
endp
align 4
mouse_n_file:
stdcall [option_box_mouse], opt_grlist1
stdcall [edit_box_mouse], edit4
stdcall [edit_box_mouse], edit5
stdcall [edit_box_mouse], edit6
stdcall [edit_box_mouse], edit7
stdcall [edit_box_mouse], edit8
stdcall [edit_box_mouse], edit9
ret
align 4
button_n_file:
mcall SF_GET_BUTTON
cmp ah,3
je .exit
cmp ah,4
jne .end_save
push eax ecx edi esi
finit
mov esi,string4
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp qword[NOptCoordX0] ;á®å࠭塞 ª ª double
mov esi,string5
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[NOptCoordY0]
mov esi,string6
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[NOptCoordX1]
mov esi,string7
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[NOptCoordY1]
mov esi,string8
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[NOptCoordZ0]
mov esi,string9
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[NOptCoordZ1]
mov word[NumberSymbolsAD],3
;fld qword[NOptCoordZ1]
;fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
mov dword[txt_01.z],0
mov dword[txt_05.z],0
mov dword[txt_06.z],0
stdcall str_cat, txt_01.z, Data_String
stdcall str_cat, txt_01.z, txt_nl
stdcall str_cat, txt_01.z, txt_nl
stdcall str_cat, txt_05.z, Data_String
stdcall str_cat, txt_05.z, txt_nl
stdcall str_cat, txt_05.z, txt_nl
stdcall str_cat, txt_06.z, Data_String
fld qword[NOptCoordZ0]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
mov dword[txt_03.z],0
stdcall str_cat, txt_03.z, Data_String
fld qword[NOptCoordX0]
cmp [opt_gr1],opt1
jne @f
;circle
fadd qword[NOptCoordX1]
@@:
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
mov dword[txt_04.x],0
stdcall str_cat, txt_04.x, Data_String
stdcall str_cat, txt_04.x, txt_s_poi_Y
fld qword[NOptCoordY0]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall str_cat, txt_04.x, Data_String
mov dword[txt_02.x],0
stdcall str_cat, txt_02.x, txt_04.x
stdcall str_cat, txt_02.x, txt_s_poi_Z
fld qword[NOptCoordZ1]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall str_cat, txt_02.x, Data_String
;clear old file
stdcall [tl_node_poi_get_info], tree1,0
or eax,eax
jz @f
mov ebx,eax
stdcall [tl_node_poi_get_data], tree1,ebx
stdcall clear_object_in_list, eax
@@:
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ ᯨ᪠ ®¡ê¥ªâ®¢
mov dword[offs_last_timer],0
stdcall ObjectCreate,ObjData
stdcall [tl_cur_beg], tree1
mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¡«®ª  ¢ â ©¬¥à¥
pop esi edi ecx eax
jmp .exit
.end_save:
cmp ah,1
jne still_n_file.end
.exit:
mov byte[wnd_n_file],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
align 4
proc ObjectCreate, pobj:dword
pushad
mov ebx,[pobj]
mov [ebx+Object.OType],'Obj'
mov edi,ebx
add edi,Object.Caption
mov dword[edi],'CNC'
mov eax,7 ;max lines
mov [ebx+Object.FigCount],eax
mov ecx,eax
shl eax,2
stdcall mem.Alloc,eax
mov [ebx+Object.FigData],eax
push ecx
mov edi,eax
xor eax,eax
rep stosd ;clear memory
pop ecx
stdcall add_object_in_list,0,0,ebx,0
;eax -> pointer to object node
mov edi,[ebx+Object.FigData]
mov esi,txt_00
stdcall FigureInit,FigData,edi
add edi,4
mov esi,txt_01
stdcall FigureInit,FigData,edi
add edi,4
mov esi,txt_02
stdcall FigureInit,FigData,edi
add edi,4
mov esi,txt_03
stdcall FigureInit,FigData,edi
add edi,4
mov esi,txt_04 ;X__ Y__
stdcall FigureInit,FigData,edi
; *** create new points ***
mov edx,[edi]
cmp [opt_gr1],opt1
jne .rect
;circle
fld qword[NOptCoordY1]
fistp dword[edx+Figure.PoiCount]
inc dword[edx+Figure.PoiCount]
mov eax,[edx+Figure.PoiCount]
imul eax,sizeof.Point
stdcall mem.ReAlloc,[edx+Figure.PoiData],eax
mov [edx+Figure.PoiData],eax
;init points
fldpi
fadd st0,st0
fdiv qword[NOptCoordY1]
fldz
;st0 - angle (=0)
;st1 - delta angle (=pi/slices)
mov ecx,[edx+Figure.PoiCount]
cmp ecx,3
jge @f
mov ecx,3
@@:
mov edx,[edx+Figure.PoiData]
add edx,Point.CoordX
.cycle0:
add edx,sizeof.Point
fadd st0,st1 ;angle += delta angle
fld st0
fcos
fmul qword[NOptCoordX1] ;st0 = cos(angle) * radius
fadd qword[NOptCoordX0]
fstp qword[edx]
fld st0
fsin
fmul qword[NOptCoordX1] ;st0 = sin(angle) * radius
fadd qword[NOptCoordY0]
fstp qword[edx+8]
loop .cycle0
ffree st0
fincstp
ffree st0
fincstp
jmp .end0
.rect:
;rect
mov eax,5
mov dword[edx+Figure.PoiCount],eax
imul eax,sizeof.Point
stdcall mem.ReAlloc,[edx+Figure.PoiData],eax
mov [edx+Figure.PoiData],eax
;init points
push edi
mov ecx,[edx+Figure.PoiData]
;p1
add ecx,sizeof.Point
lea edi,[ecx+Point.CoordX]
mov esi,NOptCoordX1
movsd
movsd
mov esi,NOptCoordY0
movsd
movsd
;p2
add ecx,sizeof.Point
lea edi,[ecx+Point.CoordX]
mov esi,NOptCoordX1
movsd
movsd
mov esi,NOptCoordY1
movsd
movsd
;p3
add ecx,sizeof.Point
lea edi,[ecx+Point.CoordX]
mov esi,NOptCoordX0
movsd
movsd
mov esi,NOptCoordY1
movsd
movsd
;p4
add ecx,sizeof.Point
lea edi,[ecx+Point.CoordX]
mov esi,NOptCoordX0
movsd
movsd
mov esi,NOptCoordY0
movsd
movsd
pop edi
.end0:
stdcall found_parent_obj,[edi] ;get figure number in ecx
stdcall figure_update_coords,ObjData,ecx
add edi,4
mov esi,txt_05
stdcall FigureInit,FigData,edi
add edi,4
mov esi,txt_06
stdcall FigureInit,FigData,edi
stdcall ObjCalculateScale,ebx
popad
ret
endp
align 4
proc get_n_file_opt uses eax
;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
mov word[NumberSymbolsAD],3
finit
fld qword[NOptCoordX0]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit4, Data_String
fld qword[NOptCoordY0]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit5, Data_String
fld qword[NOptCoordX1]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit6, Data_String
fld qword[NOptCoordY1]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit7, Data_String
fld qword[NOptCoordZ0]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit8, Data_String
fld qword[NOptCoordZ1]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit9, Data_String
;
;stdcall [edit_box_draw], edit4
;stdcall [edit_box_draw], edit5
ret
endp
align 4
proc timer_funct_n_file uses eax
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ãî ª®®à¤¨­ âã
mov eax,[opt_gr1]
cmp eax,[last_opt]
je @f
mov eax,[opt_gr1]
mov [last_opt],eax
call red_win_n_file
@@:
ret
endp
capt_coord_x0 db 'X0:',0
capt_coord_y0 db 'Y0:',0
capt_coord_z0 db 'Z0:',0
capt_coord_x1 db 'X1:',0
capt_coord_y1 db 'Y1:',0
capt_coord_z1 db 'Z1:',0
capt_coord_r db 'R:',0
capt_coord_s db 'S:',0
edit4 edit_box 80, 24, 28, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string4, mouse_dd, 0
edit5 edit_box 80, 24, 46, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string5, mouse_dd, 0
edit6 edit_box 80, 24, 64, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string6, mouse_dd, 0
edit7 edit_box 80, 24, 82, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string7, mouse_dd, 0
edit8 edit_box 80, 24, 100, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string8, mouse_dd, 0
edit9 edit_box 80, 24, 118, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string9, mouse_dd, 0
editboxes_end_nf:
string4 rb 34
string5 rb 34
string6 rb 34
string7 rb 34
string8 rb 34
string9 rb 34
align 4
last_opt dd opt1 ;for timer
opt_gr1 dd opt1
opt1 option_box opt_gr1, 115,28,6,12,0xd0d0ff, 0xff, 0x80ff,txt_circle,txt_circle.end-txt_circle
opt2 option_box opt_gr1, 115,46,6,12,0xd0d0ff, 0xff, 0x80ff,txt_rect,txt_rect.end-txt_rect
align 4
opt_grlist1 dd opt1,opt2,0 ;end option group
txt_00 db ';PCB graving',0
txt_01: db 'G0 M3 X0 Y0 Z'
.z: rb 12
txt_02: db 'G0 X'
.x: rb 50 ;X__ Y__ Z__
txt_03: db 'G1 F100 Z'
.z: rb 12
txt_04: db 'X'
.x: rb 30 ;X__ Y__
txt_05: db 'G0 Z'
.z: rb 12
txt_06: db 'G0 M5 X0 Y0 Z'
.z: rb 12
if lang eq ru
capt_n_file db '‘®§¤ âì ­®¢ë© ä ©«',0
capt_sel_fig db '‚ë¡¥à¨â¥ 䨣ãàã:',0
txt_circle: db 'Žªà㦭®áâì'
.end: db 0
txt_rect: db '<27>àאַ㣮«ì­¨ª'
.end: db 0
else
capt_n_file db 'Create new file',0
capt_sel_fig db 'Select figure:',0
txt_circle: db 'Circle'
.end: db 0
txt_rect: db 'Rectangle'
.end: db 0
end if

View File

@ -0,0 +1,302 @@
;
; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 ­ã¦­ë¥ ¤«ï ᮧ¤ ­¨ï ¨
; à ¡®âë ®ª­  á ª®®à¤¨­ â ¬¨ ¢¥à設
;
wnd_prop_width equ 320 ;è¨à¨­  ®ª­  ᮠ᢮©á⢠¬¨ ®¡ê¥ªâ 
wnd_prop_height equ 150 ;¢ëá®â  ®ª­  ᮠ᢮©á⢠¬¨ ®¡ê¥ªâ 
align 4
wnd_run_prop db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮠ᢮©á⢠¬¨ ®¤­®¢à¥¬¥­­®
txt_p db '.',0
align 4
wnd_pObj dd 0 ;obj
wnd_pFig dd 0 ;䨣ãà 
wnd_FigN dd 0 ;fig number
wnd_pPoi dd 0 ;select point
wnd_PoiN dd 0 ;select point number
;¤ ­®¥ ®ª­® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï ä㭪樥© but_wnd_coords
align 4
start_prop:
pushad
mcall SF_SET_EVENTS_MASK,0x27 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
inc byte[wnd_run_prop]
;¨¬ï ®¡ê¥ªâ 
stdcall mem_copy,capt_p,txt_obj,1+txt_obj.end-txt_obj
mov edi,capt_p+txt_obj.end-txt_obj
mov eax,[wnd_pObj]
or eax,eax
jz @f
add eax,Object.Caption
stdcall str_cat,edi,eax
@@:
stdcall str_cat,edi,txt_39
;¨¬ï 䨣ãàë
mov edi,capt_fig.name
mov byte[edi],0 ;clear pervios name
mov eax,[wnd_pFig]
or eax,eax
jz @f
add eax,Figure.Caption
stdcall str_cat,edi,eax
@@:
stdcall str_cat,edi,txt_39
;­®¬¥à â®çª¨
mov edi,capt_poi.numb
mov byte[edi],0
mov eax,[wnd_PoiN]
stdcall convert_int_to_str, 20
edit_boxes_set_sys_color edit1,editboxes_end,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
init_checkboxes2 check_boxes,check_boxes_end
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
call get_point_coords
popad
call red_win_prop
;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
align 4
still_prop:
pushad
mcall SF_WAIT_EVENT_TIMEOUT,10
or eax,eax
jnz @f
call timer_funct_prop
jmp .end
@@:
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jne @f
call red_win_prop
jmp .end
@@:
cmp al,2
jne @f
call key_prop
jmp .end
@@:
cmp al,3
jz button_prop
cmp al,6
jne @f
call mouse_prop
@@:
.end:
popad
jmp still_prop
align 4
red_win_prop:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
mov edi,capt_p ;children window caption
mov bx,word[procinfo.box.left]
add bx,word[buf_0.l]
add bx,5 ;è¨à¨­  ¡®ª®¢®© à ¬ª¨
shl ebx,16
mov bx,wnd_prop_width
mov cx,word[procinfo.box.top]
add cx,ax ;add skin height
add cx,word[buf_0.t]
shl ecx,16
mov cx,wnd_prop_height
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
int 0x40
mov esi,[sc.work_button]
;ebx = (l<:)+w, ecx = (t<:)+h
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
mcall , (75 shl 16)+59, (95 shl 16)+20, 4
mov ecx,[sc.work_text]
bts ecx,31 ;à¨á㥬 ï áâப  § ª ­ç¨¢ ¥âáï ­ã«ñ¬
mcall SF_DRAW_TEXT, (5 shl 16)+5,, capt_fig
mcall , (5 shl 16)+15,, capt_poi
mcall , (5 shl 16)+32,, capt_coord_x
mcall , (5 shl 16)+50,, capt_coord_y
mov ecx,[sc.work_button_text]
bts ecx,31
mcall , (9 shl 16)+101,, txt_but_cancel
mov edx,txt_but_apply
cmp dword[wnd_pPoi],0
jne @f
mov edx,txt_but_create
@@:
mcall ,(79 shl 16)+101
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
checkboxes_draw2 check_boxes,check_boxes_end
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
proc key_prop uses eax ebx
mcall SF_GET_KEY
test word [edit1.flags],10b ;ed_focus
je @f
stdcall [edit_box_key], edit1
jmp .end
@@:
test word [edit2.flags],10b
je @f
stdcall [edit_box_key], edit2
;jmp .end
@@:
.end:
ret
endp
align 4
mouse_prop:
stdcall [edit_box_mouse], edit1
stdcall [edit_box_mouse], edit2
checkboxes_mouse2 check_boxes,check_boxes_end
ret
align 4
button_prop:
mcall SF_GET_BUTTON
cmp ah,3
je .exit
cmp ah,4
jne .end_save
push eax ebx ecx edi esi
mov ebx,[wnd_pPoi]
or ebx,ebx
jnz .select_1
; *** create new point ***
mov ebx,[wnd_pFig]
mov eax,[ebx+Figure.PoiCount]
inc eax
imul eax,sizeof.Point
stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
mov [ebx+Figure.PoiData],eax
inc dword[ebx+Figure.PoiCount]
mov ebx,[ebx+Figure.PoiCount]
dec ebx
imul ebx,sizeof.Point
add ebx,eax
.select_1:
finit
mov esi,string1
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp qword[ebx+Point.CoordX] ;á®å࠭塞 ª ª double
mov esi,string2
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double]
fstp qword[ebx+Point.CoordY]
stdcall figure_update_coords,[wnd_pObj],[wnd_FigN]
;¢ëáâ ¢«ï¥¬ ᢮©á⢠
and dword[ebx+Point.Prop], not 7 ;7 = 2^PROP_BIT_START +2^PROP_BIT_LINE +2^PROP_BIT_LINE_CLOSE)
mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¡«®ª  ¢ â ©¬¥à¥
pop esi edi ecx ebx eax
jmp .exit
.end_save:
cmp ah,1
jne still_prop.end
.exit:
mov byte[wnd_run_prop],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
align 4
proc get_point_coords uses eax ebx
;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
mov ebx,[wnd_pPoi]
btr dword[ch1.flags],1
btr dword[ch2.flags],1
btr dword[ch3.flags],1
or ebx,ebx
jz .end0
mov word[NumberSymbolsAD],8
finit
fld qword[ebx+Point.CoordX]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit1, Data_String
fld qword[ebx+Point.CoordY]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit2, Data_String
;
jmp .end1
.end0:
stdcall [edit_box_set_text], edit1, txt_p
stdcall [edit_box_set_text], edit2, txt_p
.end1:
;stdcall [edit_box_draw], edit1
;stdcall [edit_box_draw], edit2
ret
endp
align 4
proc timer_funct_prop
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ãî ª®®à¤¨­ âã
ret
endp
align 4
capt_p rb 64
if lang eq ru
capt_fig: db 'Š®¬ ­¤ : ',39
.name: rb 55
capt_poi: db '’®çª : '
.numb: rb 25
else
capt_fig: db 'Command: ',39
.name: rb 55
capt_poi: db 'Point: '
.numb: rb 25
end if
capt_coord_x db 'X:',0
capt_coord_y db 'Y:',0
edit1 edit_box 80, 18, 28, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string1, mouse_dd, 0
edit2 edit_box 80, 18, 46, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string2, mouse_dd, 0
editboxes_end:
string1 rb 34
string2 rb 34
check_boxes:
ch1 check_box2 (115 shl 16+15),(28 shl 16 +11),5,0xffffff,0,0x80000000,ch_text.1,ch_flag_en+ch_flag_middle
ch2 check_box2 (115 shl 16+15),(43 shl 16 +11),5,0xffffff,0,0x80000000,ch_text.2,ch_flag_en+ch_flag_middle
ch3 check_box2 (115 shl 16+15),(58 shl 16 +11),5,0xffffff,0,0x80000000,ch_text.3,ch_flag_en+ch_flag_middle
check_boxes_end:
ch_text:
.1 db 'X',0
.2 db 'Y',0
.3 db 'Z',0

View File

@ -0,0 +1,181 @@
;
; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 ­ã¦­ë¥ ¤«ï ᮧ¤ ­¨ï ¨
; à ¡®âë ®ª­  á ­ áâனª ¬¨
;
wnd_scale_width equ 320 ;è¨à¨­  ®ª­  á ­ áâனª ¬¨
wnd_scale_height equ 150 ;¢ëá®â  ®ª­  á ­ áâனª ¬¨
align 4
wnd_run_scale db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮠ᢮©á⢠¬¨ ®¤­®¢à¥¬¥­­®
;¤ ­®¥ ®ª­® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï ä㭪樥© but_wnd_coords
align 4
start_scale:
pushad
mcall SF_SET_EVENTS_MASK,0x27 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
inc byte[wnd_run_scale]
edit_boxes_set_sys_color edit3,editboxes_end_sc,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
call get_scale
popad
call red_win_scale
;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
align 4
still_scale:
pushad
mcall SF_WAIT_EVENT_TIMEOUT,10
or eax,eax
jnz @f
call timer_funct_scale
jmp .end
@@:
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jne @f
call red_win_scale
jmp .end
@@:
cmp al,2
jne @f
call key_scale
jmp .end
@@:
cmp al,3
jz button_scale
cmp al,6
jne @f
call mouse_scale
@@:
.end:
popad
jmp still_scale
align 4
red_win_scale:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
mov edi,capt_opt ;children window caption
mov bx,word[procinfo.box.left]
add bx,word[buf_0.l]
add bx,5 ;è¨à¨­  ¡®ª®¢®© à ¬ª¨
shl ebx,16
mov bx,wnd_scale_width
mov cx,word[procinfo.box.top]
add cx,ax ;add skin height
add cx,word[buf_0.t]
shl ecx,16
mov cx,wnd_scale_height
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
int 0x40
mov esi,[sc.work_button]
;ebx = (l<:)+w, ecx = (t<:)+h
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
mcall , (75 shl 16)+59, (95 shl 16)+20, 4
mov ecx,[sc.work_text]
bts ecx,31 ;à¨á㥬 ï áâப  § ª ­ç¨¢ ¥âáï ­ã«ñ¬
mcall SF_DRAW_TEXT, (5 shl 16)+15,, capt_sc
mov ecx,[sc.work_button_text]
bts ecx,31
mcall , (9 shl 16)+101,, txt_but_cancel
mov edx,txt_but_apply
mcall ,(79 shl 16)+101
stdcall [edit_box_draw], edit3
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
proc key_scale uses eax ebx
mcall SF_GET_KEY
test word [edit3.flags],10b ;ed_focus
je @f
stdcall [edit_box_key], edit3
;jmp .end
@@:
.end:
ret
endp
align 4
mouse_scale:
stdcall [edit_box_mouse], edit3
ret
align 4
button_scale:
mcall SF_GET_BUTTON
cmp ah,3
je .exit
cmp ah,4
jne .end_save
push eax ecx edi esi
finit
mov esi,string3
mov edi,Data_String
cld
mov ecx,8
rep movsd
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp qword[Scale1mm] ;á®å࠭塞 ª ª double
pop esi edi ecx eax
jmp .exit
.end_save:
cmp ah,1
jne still_scale.end
.exit:
mov byte[wnd_run_scale],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
align 4
get_scale:
;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
push eax
mov word[NumberSymbolsAD],8
finit
fld qword[Scale1mm]
fstp qword[Data_Double]
call DoubleFloat_to_String
call String_crop_0
stdcall [edit_box_set_text], edit3, Data_String
;stdcall [edit_box_draw], edit3
pop eax
ret
align 4
proc timer_funct_scale
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ãî ª®®à¤¨­ âã
ret
endp
align 4
if lang eq ru
capt_opt db '<27> áâனª¨',0
capt_sc db 'Œ áèâ ¡:',0
else
capt_opt db 'Options',0
capt_sc db 'Scale:',0
end if
edit3 edit_box 80, 54, 11, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
editboxes_end_sc:
string3 rb 34