SingleSrvAutoGenEditorWindow.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. © Siemens AG, 2019
  3. Author: Sifan Ye (sifan.ye@siemens.com)
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. <http://www.apache.org/licenses/LICENSE-2.0>.
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. using System.Collections.Generic;
  15. using UnityEditor;
  16. using UnityEngine;
  17. namespace RosSharp.RosBridgeClient.MessageGeneration
  18. {
  19. public class SingleSrvAutoGenEditorWindow : SingleAutoGenEditorWindow
  20. {
  21. protected override string GenerationType
  22. {
  23. get { return "service"; }
  24. }
  25. protected override string FileExtension
  26. {
  27. get { return "srv"; }
  28. }
  29. [MenuItem("RosBridgeClient/Auto Generate Services/Single Service...", false, 10)]
  30. public static void OpenWindow()
  31. {
  32. SingleSrvAutoGenEditorWindow window = GetWindow<SingleSrvAutoGenEditorWindow>(false, "Service Auto Generation", true);
  33. window.minSize = new Vector2(750, 100);
  34. window.maxSize = new Vector2(750, 100);
  35. window.Show();
  36. }
  37. protected override List<string> Generate(string inPath, string outPath, string rosPackageName = "")
  38. {
  39. return ServiceAutoGen.GenerateSingleService(inPath, outPath, rosPackageName);
  40. }
  41. }
  42. }