示例#1
0
function Slicer_checkOnline($restart = TRUE)
{
    $CI =& get_instance();
    $ret_val = Slicer__requestSlicer('');
    if ($ret_val == SLICER_RESPONSE_OK) {
        return TRUE;
    }
    $CI->load->helper('printerlog');
    PrinterLog_logDebug('slicer return code: ' . $ret_val, __FILE__, __LINE__);
    if ($restart == TRUE) {
        Slicer_restart();
    }
    return FALSE;
}
示例#2
0
 function restart_ajax()
 {
     $ret_val = 0;
     $display = NULL;
     $action = $this->input->get('action');
     $this->load->helper('slicer');
     if (Slicer_checkOnline(FALSE)) {
         $this->output->set_status_header(202, 'Opened');
         return;
     } else {
         if ($action) {
             $this->load->helper('printerlog');
             PrinterLog_logDebug('restarting slicer', __FILE__, __LINE__);
             Slicer_restart();
         }
     }
     $display = 200 . " " . t(MyERRMSG(200));
     $this->output->set_status_header(200, $display);
     return;
 }