Skip to content

Commit

Permalink
added improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
krios-fabteam committed Apr 21, 2017
1 parent 00c9fb2 commit 3e2a302
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 38 deletions.
77 changes: 43 additions & 34 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ public function make($fileID = '-1')
$data['type_label'] = 'Engraving';

// Safety check
$data['safety_check'] = safetyCheck("laser", false);
$data['safety_check']['url'] = 'std/safetyCheck/laser/no';
$data['safety_check']['content'] = $this->load->view( 'std/task_safety_check', $data, true );
if(!$task_is_running){

$data['safety_check'] = safetyCheck("laser", false);
$data['safety_check']['url'] = 'std/safetyCheck/laser/no';
$data['safety_check']['content'] = $this->load->view( 'std/task_safety_check', $data, true );
}



//~ $data['z_height_values'] = array('0.1' => '0.1', '0.01' => '0.01');
Expand Down Expand Up @@ -123,17 +127,17 @@ public function make($fileID = '-1')
$data['steps'] = array(
array('number' => 1,
'title' => 'Choose File',
'content' => $this->load->view( 'std/select_file', $data, true ),
'content' => !$task_is_running ? $this->load->view( 'std/select_file', $data, true ) : '',
'active' => !$file_is_ok && !$task_is_running
),
array('number' => 2,
'title' => 'Safety',
'content' => $this->load->view( plugin_url('make/wizard/safety'), $data, true ),
'content' => !$task_is_running ? $this->load->view( plugin_url('make/wizard/safety'), $data, true ) : '',
'active' => $file_is_ok && !$task_is_running
),
array('number' => 3,
'title' => 'Get Ready',
'content' => $this->load->view( 'std/jog_setup', $data, true ),
'content' => !$task_is_running ? $this->load->view( 'std/jog_setup', $data, true ) : '',
),
array('number' => 4,
'title' => 'Laser Engraving',
Expand All @@ -156,42 +160,46 @@ public function make($fileID = '-1')
$widget = $this->smart->create_widget($widgetOptions);
$widget->id = 'main-widget-make-laser';
$widget->header = array('icon' => 'fa-cube', "title" => "<h2>Laser Engraving</h2>");
$widget->body = array('content' => $this->load->view('std/task_wizard', $data, true ), 'class'=>'fuelux', 'footer'=>$widgeFooterButtons);

$this->addCssFile('/assets/css/std/select_file.css');
$this->addCssFile('/assets/css/std/jog_setup.css');
$this->addCssFile('/assets/css/std/jogtouch.css');
$this->addCssFile('/assets/css/std/jogcontrols.css');

$this->addJSFile('/assets/js/plugin/datatables/jquery.dataTables.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.colVis.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.tableTools.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.bootstrap.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatable-responsive/datatables.responsive.min.js'); //datatable */
$widget->body = array('content' => $this->load->view('std/task_wizard', $data, true ), 'class'=>'fuelux');

if(!$task_is_running){

$this->addCssFile('/assets/css/std/select_file.css');
$this->addCssFile('/assets/css/std/jog_setup.css');
$this->addCssFile('/assets/css/std/jogtouch.css');
$this->addCssFile('/assets/css/std/jogcontrols.css');

$this->addJSFile('/assets/js/plugin/datatables/jquery.dataTables.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.colVis.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.tableTools.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatables/dataTables.bootstrap.min.js'); //datatable
$this->addJSFile('/assets/js/plugin/datatable-responsive/datatables.responsive.min.js'); //datatable */

$this->addJSFile('/assets/js/std/raphael.min.js' ); //vector library
$this->addJSFile('/assets/js/std/modernizr-touch.js' ); //touch device detection
$this->addJSFile('/assets/js/std/jogcontrols.js' ); //jog controls
$this->addJSFile('/assets/js/std/jogtouch.js' ); //jog controls
$this->addJSFile('/assets/js/plugin/knob/jquery.knob.min.js');
}


$this->addJSFile('/assets/js/plugin/flot/jquery.flot.cust.min.js');
$this->addJSFile('/assets/js/plugin/flot/jquery.flot.resize.min.js');
$this->addJSFile('/assets/js/plugin/flot/jquery.flot.fillbetween.min.js');
$this->addJSFile('/assets/js/plugin/flot/jquery.flot.time.min.js');
$this->addJSFile('/assets/js/plugin/flot/jquery.flot.tooltip.min.js');

$this->addJsInLine($this->load->view( plugin_url('make/js'), $data, true));

$this->addJSFile('/assets/js/std/raphael.min.js' ); //vector library
$this->addJSFile('/assets/js/std/modernizr-touch.js' ); //touch device detection
$this->addJSFile('/assets/js/std/jogcontrols.js' ); //jog controls
$this->addJSFile('/assets/js/std/jogtouch.js' ); //jog controls

$this->addJsInLine($this->load->view( 'std/task_safety_check_js', $data, true));

$this->addJSFile('/assets/js/plugin/fuelux/wizard/wizard.min.old.js'); //wizard
$this->addJsInLine($this->load->view( 'std/task_wizard_js', $data, true));

$this->addJsInLine($this->load->view( 'std/select_file_js', $data, true));

$this->addJSFile('/assets/js/plugin/knob/jquery.knob.min.js');
$this->addJsInLine($this->load->view( 'std/jog_setup_js', $data, true));
$this->addJsInLine($this->load->view( plugin_url('make/js'), $data, true));

if(!$task_is_running){
$this->addJsInLine($this->load->view( 'std/task_safety_check_js', $data, true));
$this->addJsInLine($this->load->view( 'std/select_file_js', $data, true));
$this->addJsInLine($this->load->view( 'std/jog_setup_js', $data, true));
}

$this->addJsInLine($this->load->view( 'std/task_wizard_js', $data, true));
$this->addJsInLine($this->load->view( 'std/task_execute_js', $data, true));
$this->addJsInLine($this->load->view( 'std/task_finished_js', $data, true));

Expand Down Expand Up @@ -252,8 +260,9 @@ public function startTask()
);
$taskId = $this->tasks->add($taskData);

$response['start'] = true;
$response['id_task'] = $taskId;
$response['start'] = true;
$response['id_task'] = $taskId;
$response['file']['name'] = $fileToCreate['client_name'];

//start print
$params = array(
Expand Down
13 changes: 9 additions & 4 deletions views/make/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

<script type="text/javascript">

<?php if($runningTask): ?>
var idFile = <?php echo $runningTask['id_file']; ?>;
<?php else: ?>
var idFile <?php echo $file_id != '' ? ' = '.$file_id : ''; ?>; //file to create
<?php endif; ?>
var idTask <?php echo $runningTask ? ' = '.$runningTask['id'] : ''; ?>;


Expand All @@ -32,7 +36,7 @@ function handleStep()
cmd = 'M62';
fabApp.jogMdi(cmd);
startTask();
gotoWizardStep(4);
return false;
<?php endif; ?>
return false;
}
Expand Down Expand Up @@ -99,7 +103,7 @@ function understandSafety()
function startTask()
{
console.log('Starting task');
openWait('<i class="fa fa-spinner fa-spin "></i>' + "<?php echo _('Preparing {0}');?>".format("<?php echo _(ucfirst($type)); ?>"), _("Checking safety measures...") );
openWait('<i class="fa fa-spinner fa-spin "></i> ' + "<?php echo _('Preparing {0}');?>".format("<?php echo _(ucfirst($type)); ?>"), _("Checking safety measures...") );

var data = {
idFile:idFile
Expand All @@ -115,9 +119,10 @@ function startTask()
gotoWizardStep(2);
fabApp.showErrorAlert(response.message);
}else{

gotoWizardStep(4);
idTask = response.id_task;

updateFileInfo(response.file);
disableCompleteSteps();
initRunningTaskPage();
updateZOverride(0);

Expand Down

0 comments on commit 3e2a302

Please sign in to comment.