Refactor, add extensive README.md, add future planning
This commit is contained in:
15
bin/app.php
15
bin/app.php
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Automata\NC;
|
||||
use Automata\ToolData;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$nc = new NC();
|
||||
$nc->TM->write(new ToolData(1, 5500, 2));
|
||||
$nc->TM->write(new ToolData(2, 3000, 61379));
|
||||
(new ProgramLoader)->loadPrograms($nc);
|
||||
|
||||
$nc->loadProgram(9002);
|
||||
$nc->run();
|
||||
|
||||
18
bin/bootstrap.php
Normal file
18
bin/bootstrap.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Loader\ProgramLoader;
|
||||
use Loader\ToolLoader;
|
||||
use Machine\CNC6600;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$CNC6600 = new CNC6600();
|
||||
|
||||
$programLoader = new ProgramLoader();
|
||||
$programLoader->load($CNC6600->PPM, __DIR__ . '/../config/part_programs/*');
|
||||
$programLoader->load($CNC6600->SPM, __DIR__ . '/../config/sub_programs/*');
|
||||
|
||||
$toolLoader = new ToolLoader();
|
||||
$toolLoader->load($CNC6600->TM, __DIR__ . '/../config/tools.yaml');
|
||||
|
||||
return $CNC6600;
|
||||
13
bin/run_program
Executable file
13
bin/run_program
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env php7.4
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
if (!isset($argv[1])) {
|
||||
print("Usage: bin/run_program <program number>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$CNC6600 = require_once __DIR__ . '/bootstrap.php';
|
||||
$CNC6600->loadProgram($argv[1]);
|
||||
$CNC6600->execute();
|
||||
Reference in New Issue
Block a user