Globals.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. pragma Singleton
  2. import QtQuick 2.0
  3. Item {
  4. property string versionINFO: "S0-V002"
  5. // property color customer_color_base: "#FF00ADEF" // Basisfarbe Kundenabhängig
  6. property color customer_color_base: "#FF559F98" // Basisfarbe Kundenabhängig
  7. property string baseDir: "/opt/GfA-Browser"
  8. property string logoSplash: "/images/Logo_Gfa.svg"
  9. property bool logoSplashVisible:false
  10. property string logoMenu: "/images/Logo_Gfa_.svg"
  11. property string cam1Name: "---"
  12. property string cam1Model: "---"
  13. property string cam1Ver: "---"
  14. property string cam1MAC: "---"
  15. property string cam2Name: "---"
  16. property string cam2Model: "---"
  17. property string cam2Ver: "---"
  18. property string cam2MAC: "---"
  19. //: ID:active_user_role active user role shown in status line
  20. property string actUserRole: "admin"
  21. property string startTO: "" //"/HMI_SettingsContainer.qml"
  22. property string in1Status: "-" // Input 1 Status
  23. property string in2Status: "-" // Input 2 Status
  24. property string in3Status: "-" // Input 3 Status
  25. property string in4Status: "-" // Input 4 Status
  26. function getActUserRoleText(roleid){
  27. var ret;
  28. switch (roleid){
  29. default :
  30. actUserRole = "oper";
  31. case "oper":
  32. //: ID:user_role_oper USER Role Operator text shown in status line and pwd settings
  33. ret = qsTrId("user_role_oper") + transLoad.emptyString
  34. break;
  35. case "eng":
  36. //: ID:user_role_eng USER Role Engineer text shown in status line and pwd settings
  37. ret = qsTrId("user_role_eng") + transLoad.emptyString
  38. break;
  39. case "admin":
  40. //: ID:user_role_admin USER Role Administrator text shown in status line and pwd settings
  41. ret = qsTrId("user_role_admin") + transLoad.emptyString
  42. break;
  43. }
  44. return ret;
  45. }
  46. // Auslesen Kameranamen ....
  47. function jsonGetSystem(url, id) {
  48. var doc = new XMLHttpRequest();
  49. doc.onreadystatechange = function() {
  50. if (doc.readyState === XMLHttpRequest.DONE) {
  51. var linesSystem = doc.responseText.split(/[\r\n]+/g);
  52. if (id === 1)
  53. cam1Name = cam1Model = cam1Ver = cam1MAC = "--";
  54. else
  55. cam2Name = cam2Model = cam2Ver = cam2MAC = "--";
  56. for(var ii = 0; ii < linesSystem.length; ii++) {
  57. var sysitem = linesSystem[ii].split(" ");
  58. console.debug(JSON.stringify(sysitem));
  59. if(sysitem[0] === "name") {if ( id === 1) cam1Name = sysitem[2]; else cam2Name = sysitem[2];}
  60. if(sysitem[0] === "model") {if ( id === 1) cam1Model = sysitem[2]; else cam2Model = sysitem[2];}
  61. if(sysitem[0] === "ver") {if ( id === 1) cam1Ver = sysitem[2]; else cam2Ver = sysitem[2];}
  62. if(sysitem[0] === "mac") {if ( id === 1) cam1MAC = sysitem[2]; else cam2MAC = sysitem[2];}
  63. }
  64. }
  65. }
  66. doc.open("put", url);
  67. doc.setRequestHeader("Content-Type","text/plain");
  68. doc.setRequestHeader("Accept","text/plain");
  69. doc.send("get system");
  70. }
  71. }