Пример #1
0
		private void Init()
		{
			// check files	
			if (!File.Exists(_previewProject))
			{
				throw new Exception("Preview project not found:" + Environment.NewLine + _previewProject);
			}
			if (!File.Exists(_macroPath))
			{
				throw new Exception("Macro not found:" + Environment.NewLine + _macroPath);
			}

			// start eplan
		   _eplanOffline = new EplanOffline(Starter.GetBinPathLastVersion());

			// Needed if its an OfflineApplication
			_eplanOffline.StartWpf(this);
			if (!_eplanOffline.IsRunning)
			{
				throw new Exception("EPLAN not running");
			}

			// Init preview
			_preview = new Sepla.Gui.Preview(previewBorder, _previewProject);

			// display
			_preview.Display(_macroPath, PreviewType.WindowMacro);
		}
Пример #2
0
      private void Init()
      {
         // check files	
         if (!File.Exists(_previewProject))
         {
            throw new Exception("Preview project not found:" + Environment.NewLine + _previewProject);
         }
         if (!File.Exists(_macroPath))
         {
            throw new Exception("Macro not found:" + Environment.NewLine + _macroPath);
         }

         // start eplan			
         string binPath = @"C:\Program Files\EPLAN\Electric P8\2.5.4\Bin";
         Starter.PinToEplan(binPath);
         _eplanOffline = new EplanOffline(binPath);
         _eplanOffline.StartWpf(this);
         if (!_eplanOffline.IsRunning)
         {
            throw new Exception("EPLAN not running");
         }

         // setup preview
         _preview = new Sepla.Gui.Preview(previewBorder, _previewProject);

         // display
         _preview.Display(_macroPath, PreviewType.PageMacro);
      }
Пример #3
0
        private void Init()
        {
            // check files
            if (!File.Exists(_previewProject))
            {
                throw new Exception("Preview project not found:" + Environment.NewLine + _previewProject);
            }
            if (!File.Exists(_macroPath))
            {
                throw new Exception("Macro not found:" + Environment.NewLine + _macroPath);
            }

            // start eplan
            _eplanOffline = new EplanOffline(Starter.GetBinPathLastVersion());

            // Needed if its an OfflineApplication
            _eplanOffline.StartWpf(this);
            if (!_eplanOffline.IsRunning)
            {
                throw new Exception("EPLAN not running");
            }

            // Init preview
            _preview = new Sepla.Gui.Preview(previewBorder, _previewProject);

            // display
            _preview.Display(_macroPath, PreviewType.WindowMacro);
        }
Пример #4
0
        private void Init()
        {
            // check files
            if (!File.Exists(_previewProject))
            {
                throw new Exception("Preview project not found:" + Environment.NewLine + _previewProject);
            }
            if (!File.Exists(_macroPath))
            {
                throw new Exception("Macro not found:" + Environment.NewLine + _macroPath);
            }

            // start eplan
            string binPath = @"C:\Program Files\EPLAN\Electric P8\2.7.3\Bin";

            Starter.PinToEplan(binPath);
            _eplanOffline = new EplanOffline(binPath, "API");
            _eplanOffline.StartWpf(this);
            if (!_eplanOffline.IsRunning)
            {
                throw new Exception("EPLAN not running");
            }

            // setup preview
            _preview = new Sepla.Gui.Preview(previewBorder, _previewProject);

            // display
            _preview.Display(_macroPath, PreviewType.PageMacro);
        }
Пример #5
0
		static void Main(string[] args)
		{
			// Demo data
			Console.WriteLine("Get Demodata...");
			string projectLinkPath = @"\\Mac\Home\Desktop\Test.elk";
			string projectTemplatePath = @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Templates\IEC_bas001.zw9";

			List<GeneratablePageMacro> generatablePageMacros = new List<GeneratablePageMacro>();
			generatablePageMacros.Add(new GeneratablePageMacro(
				@"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Axis-X.emp",
				new LocationIdentifierIdentifier
				{
					FunctionAssignment = "TEST1",
					Plant = "TEST11",
					PlaceOfInstallation = "TEST111",
					Location = "TEST1111",
					UserDefinied = "TEST11111",
				}));

			generatablePageMacros.Add(new GeneratablePageMacro(
				@"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Supply.emp",
				new LocationIdentifierIdentifier
				{
					FunctionAssignment = "TEST2",
					Plant = "TEST22",
					PlaceOfInstallation = "TEST222",
					Location = "TEST2222",
					UserDefinied = "TEST22222",
				}));

			// check overwrite
			generatablePageMacros.Add(new GeneratablePageMacro(
				@"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Axis-X.emp",
				new LocationIdentifierIdentifier
				{
					FunctionAssignment = "TEST1",
					Plant = "TEST11",
					PlaceOfInstallation = "TEST111",
					Location = "TEST1111",
					UserDefinied = "TEST11111",
				}));

			generatablePageMacros.Add(new GeneratablePageMacro(
				@"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Supply.emp",
				new LocationIdentifierIdentifier
				{
					FunctionAssignment = "TEST2",
					Plant = "TEST22",
					PlaceOfInstallation = "TEST222",
					Location = "TEST2222",
					UserDefinied = "TEST22222",
				}));


			// Start EPLAN
			Console.WriteLine("Start EPLAN...");
			var eplanOffline = new EplanOffline(Starter.GetBinPathLastVersion());
			eplanOffline.StartWithoutGui();
			if (!eplanOffline.IsRunning)
			{
				throw new Exception("EPLAN not running");
			}

			// Generate
			Console.WriteLine("Generate...");

			ProjectUtility.Generate(projectLinkPath, projectTemplatePath, generatablePageMacros);

			// Close EPLAN
			Console.WriteLine("Closing EPLAN...");
			eplanOffline.Close();

			// Finish
			Console.WriteLine("Finished :^) ");
			Console.ReadKey();
		}
Пример #6
0
        static void Main(string[] args)
        {
            // Demo data
            Console.WriteLine("Get Demodata...");
            string projectLinkPath     = @"\\Mac\Home\Desktop\Test.elk";
            string projectTemplatePath = @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Templates\IEC_bas001.zw9";

            List <GeneratablePageMacro> generatablePageMacros = new List <GeneratablePageMacro>();

            generatablePageMacros.Add(new GeneratablePageMacro(
                                          @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Axis-X.emp",
                                          new LocationIdentifierIdentifier
            {
                FunctionAssignment = "TEST1",
                Plant = "TEST11",
                PlaceOfInstallation = "TEST111",
                Location            = "TEST1111",
                UserDefinied        = "TEST11111",
            }));

            generatablePageMacros.Add(new GeneratablePageMacro(
                                          @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Supply.emp",
                                          new LocationIdentifierIdentifier
            {
                FunctionAssignment = "TEST2",
                Plant = "TEST22",
                PlaceOfInstallation = "TEST222",
                Location            = "TEST2222",
                UserDefinied        = "TEST22222",
            }));

            // check overwrite
            generatablePageMacros.Add(new GeneratablePageMacro(
                                          @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Axis-X.emp",
                                          new LocationIdentifierIdentifier
            {
                FunctionAssignment = "TEST1",
                Plant = "TEST11",
                PlaceOfInstallation = "TEST111",
                Location            = "TEST1111",
                UserDefinied        = "TEST11111",
            }));

            generatablePageMacros.Add(new GeneratablePageMacro(
                                          @"\\Mac\Home\Documents\GitHub\ibKastl.MechatronicsConfigurator\DemoData\Macros\PageMacro_Supply.emp",
                                          new LocationIdentifierIdentifier
            {
                FunctionAssignment = "TEST2",
                Plant = "TEST22",
                PlaceOfInstallation = "TEST222",
                Location            = "TEST2222",
                UserDefinied        = "TEST22222",
            }));


            // Start EPLAN
            Console.WriteLine("Start EPLAN...");
            var eplanOffline = new EplanOffline(Starter.GetBinPathLastVersion());

            eplanOffline.StartWithoutGui();
            if (!eplanOffline.IsRunning)
            {
                throw new Exception("EPLAN not running");
            }

            // Generate
            Console.WriteLine("Generate...");

            ProjectUtility.Generate(projectLinkPath, projectTemplatePath, generatablePageMacros);

            // Close EPLAN
            Console.WriteLine("Closing EPLAN...");
            eplanOffline.Close();

            // Finish
            Console.WriteLine("Finished :^) ");
            Console.ReadKey();
        }