internal static bool openJobfile(string path) { bool result = false; try { if (m_scriptFile != null) { m_scriptFile.Close(); } m_scriptFile = new StreamReader(path); m_settingStace = SettingStace.globalSpace; initGloballStettingStyle(); m_globalStyle = m_cs.style1; m_isPreambuleFinish = false; startPosition = 0; endPosition = 0; addCommandAtEnd(Command.Nop, 0, 0, 0, 0); Array.Clear(actualArgs, 0, 3); m_layerReaded = 0; isValidFile = 1; m_fileName = path; result = true; } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Error: " + ex.Message + " " + path); } return(result); }
private static void openList() { if (!fileLoader.m_isPreambuleFinish) { return; } if (m_currentList == ListNumber.list1) { NativeMethods.PCI_Set_Start_List_1(); } else { NativeMethods.PCI_Set_Start_List_2(); } styles st1 = fileLoader.m_cs.style1; st1.lMarkSize = fileLoader.m_globalStyle.lMarkSize; st1.lPower = fileLoader.m_globalStyle.lPower; //if (m_isNeedRestoreStyleOnProlog) { if (m_lastedStyle.lPower != long.MaxValue) { st1.lPower = m_lastedStyle.lPower; } if (m_lastedStyle.lMarkSize != long.MaxValue) { st1.lMarkSize = m_lastedStyle.lMarkSize; } } NativeMethods.PCI_Set_Delays((UInt16)st1.lStep, (UInt16)st1.lJampDelay, (UInt16)st1.lMarkDelay, (UInt16)st1.lPolygon, (UInt16)st1.lLaserOff, (UInt16)st1.lLaserOn, (UInt16)st1.lQt1, (UInt16)st1.lQt2, 0); NativeMethods.PCI_Set_Mark_Parameters_List((UInt16)st1.lStep, (UInt16)st1.lMarkSize); NativeMethods.PCI_Long_Delay(10); NativeMethods.PCI_Write_DA_List((UInt16)st1.lPower); NativeMethods.PCI_Write_Port_List(0xC, 0x010); m_layerNumber++; m_l[(Int32)m_currentList].exListNumber = m_layerNumber; m_l[(Int32)m_currentList].filling = ListStateFill.prolog; m_l[(Int32)m_currentList].size = 0; m_l[(Int32)m_currentList].finishid = false; }