Beispiel #1
0
        /// <summary>
        /// recupere la reference du premier placement selectionné dans les placements a copuper
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AfterSend_Click_1(object sender, EventArgs e)
        {
            AF_JOHN_DEERE.JohnDeere_DoOnAction_AfterSendToWorkshop doonaction = new JohnDeere_DoOnAction_AfterSendToWorkshop();
            string stage = "_TO_CUT_NESTING";

            JohnDeere_Param.GetlistParam(_Context);
            IEntitySelector nestingselector = null;

            nestingselector = new EntitySelector();

            //entity type pointe sur la list d'objet du model
            nestingselector.Init(_Context, _Context.Kernel.GetEntityType(stage));
            nestingselector.MultiSelect = true;

            if (nestingselector.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                foreach (IEntity selection in nestingselector.SelectedEntity)
                {
                    string filename = selection.GetFieldValueAsString("_REFERENCE");
                    string material = selection.GetFieldValueAsEntity("_MATERIAL").GetFieldValueAsString("_NAME");

                    IEntityList nestinglist = _Context.EntityManager.GetEntityList(stage, "_REFERENCE", ConditionOperator.Equal, filename);
                    nestinglist.Fill(false);
                    doonaction.execute(nestinglist);
                }
            }
        }
Beispiel #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            JohnDeere_Param.GetlistParam(_Context);

            string           csvImportPath = JohnDeere_Param.GetPath("IMPORT_CDA");
            ProcessStartInfo start         = new ProcessStartInfo();
            ProcessStartInfo start_ca      = new ProcessStartInfo();

            start_ca.Arguments = "OF " + csvImportPath;
            //start.FileName = @"C:\AlmaCAM\Bin\Clipper_Import.exe";
            start_ca.FileName = JohnDeere_Param.get_application1();
            //start.WindowStyle = ProcessWindowStyle.Normal;
            start_ca.CreateNoWindow  = false;
            start_ca.UseShellExecute = true;
            string  exename = JohnDeere_Param.get_application1();
            Process p       = Process.Start(exename, "OF " + csvImportPath);
        }
Beispiel #3
0
        //private void button4_Click(object sender, EventArgs e)
        private void ImportOF_Click(object sender, EventArgs e)
        {
            //import of
            //chargement de sparamètres
            // bool SansDt=false;

            JohnDeere_Param.GetlistParam(_Context);
            string csvImportPath = JohnDeere_Param.GetPath("IMPORT_CDA");
            //recuperation du nom de fichier
            string csvFileName     = Path.GetFileNameWithoutExtension(csvImportPath);
            string csvDirectory    = Path.GetDirectoryName(csvImportPath);
            string csvImportSandDt = csvDirectory + "\\" + csvFileName + "_SANSDT.csv";


            string dataModelstring = JohnDeere_Param.GetModelCA();


            using (JohnDeere_OF Import_OF = new JohnDeere_OF())
            {
                Import_OF.Import(_Context, csvImportPath, dataModelstring);
                //CahierAffaire.Import(_Context, csvImportSandDt, dataModelstring, true);
                //}
            }
        }
Beispiel #4
0
        private void AfterClose_Click(object sender, EventArgs e)
        {
            //IEntity TO_CUT_nesting;
            AF_JOHN_DEERE.JohnDeere_DoOnAction_After_Cutting_end doonaction = new JohnDeere_DoOnAction_After_Cutting_end();

            //string stage = "_CLOSED_NESTING";
            string stage = "_CUT_SHEET";

            //creation du fichier de sortie
            //recupere les path
            JohnDeere_Param.GetlistParam(_Context);
            IEntitySelector Entityselector = null;

            Entityselector = new EntitySelector();

            //entity type pointe sur la list d'objet du model
            Entityselector.Init(_Context, _Context.Kernel.GetEntityType(stage));
            Entityselector.MultiSelect = true;

            if (Entityselector.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                doonaction.execute(Entityselector.SelectedEntity);
            }
        }
Beispiel #5
0
        //initialisation des listes
        /// <summary>
        /// aucun log dans ce programme, seulement des messages informels
        /// Si pas de fichier detecté   , alors on annule l'import
        /// Si pas de type detecté      , alors on annule l'import
        /// </summary>
        /// <param name="args">arg  0 : type d'import, arg 1 chemin vers le fichier d'import
        /// il n'y a pas d'obligation a envoyer le chemin car ce dernier peut etre fourni par l'application almacam
        /// </param>
        static void Main(string[] args)
        {
            IContext _clipper_Context = null;

            string TypeImport = "";
            //string fulpathname = "";
            string DbName = AF_JOHN_DEERE.Alma_RegitryInfos.GetLastDataBase();

            AF_JOHN_DEERE.Alma_Log.Create_Log();



            using (EventLog eventLog = new EventLog("Application"))
            {
                ModelsRepository clipper_modelsRepository = new ModelsRepository();
                string           csvImportPath            = null;
                _clipper_Context = clipper_modelsRepository.GetModelContext(DbName);  //nom de la base;
                int i = _clipper_Context.ModelsRepository.ModelList.Count();
                JohnDeere_Param.GetlistParam(_clipper_Context);
                if (args.Length == 0)
                {
                    /* dans ce cas on recupere les arguments de la base directement*/
                    /* on force l'import of*/
                    TypeImport = "OF";
                    /**/
                }
                else  //sinon on recupere le paramètre du type d'import
                {
                    TypeImport = args[0].ToUpper().ToString();
                }


                {
                    switch (TypeImport)
                    {
                    //fullpath name
                    case "STOCK":
                        //import stock


                        break;

                    case "STOCK_PURGE":
                        //puge de tous les elements du stock


                        break;

                    case "OF":

                        clipper_modelsRepository = new ModelsRepository();
                        //import of


                        if (args.Length == 0 || args.Length == 1)
                        {
                            csvImportPath = JohnDeere_Param.GetPath("IMPORT_CDA");
                        }
                        else
                        {
                            csvImportPath = args[1].ToUpper().ToString();
                        }

                        string of_dataModelstring = JohnDeere_Param.GetModelCA();


                        using (JohnDeere_OF CahierAffaire = new JohnDeere_OF())
                        {
                            CahierAffaire.Import(_clipper_Context, csvImportPath, of_dataModelstring);
                        }



                        break;
                    }
                }
            }
        }