login.py 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. from ui.own.palette_theme import set_my_palette, set_sure_background
  4. from utils.globalvar import SD
  5. from utils.qt import QWidget, QComboBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QSize, QRect, QCoreApplication, QMetaObject
  6. class UiBmsLoginPage(object):
  7. def setupUi(self, bms_login):
  8. bms_login.resize(400, 500)
  9. bms_login.setMinimumSize(QSize(400, 500))
  10. bms_login.setMaximumSize(QSize(400, 500))
  11. set_my_palette(bms_login)
  12. self.layoutWidget = QWidget(bms_login)
  13. self.layoutWidget.setGeometry(QRect(70, 90, 261, 351))
  14. self.verticalLayout = QVBoxLayout(self.layoutWidget)
  15. self.verticalLayout.setContentsMargins(0, 0, 0, 0)
  16. self.h_layout_role = QHBoxLayout()
  17. self.lb_role = QLabel()
  18. self.h_layout_role.addWidget(self.lb_role)
  19. self.cb_role = QComboBox()
  20. self.cb_role.setObjectName("cb_role")
  21. for i in range(5):
  22. self.cb_role.addItem("")
  23. self.cb_role.setItemText(0, "普通用户")
  24. self.cb_role.setItemText(1, "调试工程师")
  25. self.cb_role.setItemText(2, "BMS产线操作员")
  26. self.cb_role.setItemText(3, "PACK产线操作")
  27. self.cb_role.setItemText(4, "系统管理员")
  28. self.h_layout_role.addWidget(self.cb_role)
  29. self.verticalLayout.addLayout(self.h_layout_role)
  30. self.h_layout_password = QHBoxLayout()
  31. self.lb_password = QLabel()
  32. self.h_layout_password.addWidget(self.lb_password)
  33. self.edt_password = QLineEdit()
  34. self.edt_password.setEchoMode(QLineEdit.Password)
  35. self.edt_password.setObjectName("edt_password")
  36. self.h_layout_password.addWidget(self.edt_password)
  37. self.verticalLayout.addLayout(self.h_layout_password)
  38. self.h_layout_prj = QHBoxLayout()
  39. self.lb_prj = QLabel()
  40. self.h_layout_prj.addWidget(self.lb_prj)
  41. self.cb_prj = QComboBox()
  42. self.cb_prj.setObjectName("cb_prj")
  43. for i in range(2):
  44. self.cb_prj.addItem("")
  45. self.cb_prj.setItemText(0, "户储")
  46. self.cb_prj.setItemText(1, "工商业")
  47. self.cb_prj.setCurrentIndex(1)
  48. self.h_layout_prj.addWidget(self.cb_prj)
  49. self.verticalLayout.addLayout(self.h_layout_prj)
  50. self.h_layout_con_type = QHBoxLayout()
  51. self.lb_con_type = QLabel()
  52. self.h_layout_con_type.addWidget(self.lb_con_type)
  53. self.cb_con_type = QComboBox()
  54. self.cb_con_type.setObjectName("cb_con_type")
  55. self.cb_con_type.addItem("")
  56. self.cb_con_type.addItem("")
  57. self.cb_con_type.setItemText(0, "ZLGCAN")
  58. self.cb_con_type.setItemText(1, "PCAN")
  59. self.h_layout_con_type.addWidget(self.cb_con_type)
  60. self.verticalLayout.addLayout(self.h_layout_con_type)
  61. self.h_layout_channel = QHBoxLayout()
  62. self.lb_channel = QLabel()
  63. self.h_layout_channel.addWidget(self.lb_channel)
  64. self.cb_channel = QComboBox()
  65. self.cb_channel.setObjectName("cb_channel")
  66. for i in range(9):
  67. self.cb_channel.addItem("")
  68. self.cb_channel.setItemText(0, "0")
  69. self.cb_channel.setItemText(1, "1")
  70. self.cb_channel.setItemText(2, "2")
  71. self.cb_channel.setItemText(3, "3")
  72. self.cb_channel.setItemText(4, "4")
  73. self.cb_channel.setItemText(5, "5")
  74. self.cb_channel.setItemText(6, "6")
  75. self.cb_channel.setItemText(7, "7")
  76. self.cb_channel.setItemText(8, "8")
  77. self.h_layout_channel.addWidget(self.cb_channel)
  78. self.verticalLayout.addLayout(self.h_layout_channel)
  79. self.h_layout_index = QHBoxLayout()
  80. self.lb_index = QLabel()
  81. self.h_layout_index.addWidget(self.lb_index)
  82. self.cb_index = QComboBox()
  83. self.cb_index.setObjectName("cb_index")
  84. for i in range(2):
  85. self.cb_index.addItem("")
  86. self.cb_index.setItemText(0, "0")
  87. self.cb_index.setItemText(1, "1")
  88. self.h_layout_index.addWidget(self.cb_index)
  89. self.verticalLayout.addLayout(self.h_layout_index)
  90. self.h_layout_baudrate = QHBoxLayout()
  91. self.lb_baudrate = QLabel()
  92. self.h_layout_baudrate.addWidget(self.lb_baudrate)
  93. self.cb_baudrate = QComboBox()
  94. self.cb_baudrate.setObjectName("cb_baudrate")
  95. for i in range(3):
  96. self.cb_baudrate.addItem("")
  97. self.cb_baudrate.setItemText(0, "125Kbps")
  98. self.cb_baudrate.setItemText(1, "250Kbps")
  99. self.cb_baudrate.setItemText(2, "500Kbps")
  100. self.h_layout_baudrate.addWidget(self.cb_baudrate)
  101. self.verticalLayout.addLayout(self.h_layout_baudrate)
  102. self.cb_change_languqge = QComboBox(bms_login)
  103. self.cb_change_languqge.setObjectName("language")
  104. self.cb_change_languqge.addItem("")
  105. self.cb_change_languqge.addItem("")
  106. self.cb_change_languqge.setItemText(0, "中文")
  107. self.cb_change_languqge.setItemText(1, "English")
  108. self.verticalLayout.addWidget(self.cb_change_languqge)
  109. self.horizontalLayout = QHBoxLayout()
  110. self.btn_login = QPushButton(self.layoutWidget)
  111. self.btn_login.setObjectName("btn_login")
  112. set_sure_background(self.btn_login)
  113. self.horizontalLayout.addWidget(self.btn_login)
  114. self.btn_cancel = QPushButton(self.layoutWidget)
  115. self.btn_cancel.setObjectName("btn_cancel")
  116. self.horizontalLayout.addWidget(self.btn_cancel)
  117. self.verticalLayout.addLayout(self.horizontalLayout)
  118. self.retranslateUi(bms_login)
  119. QMetaObject.connectSlotsByName(bms_login)
  120. def retranslateUi(self, bms_login):
  121. _translate = QCoreApplication.translate
  122. bms_login.setWindowTitle(_translate("bms_login", "用户登录" if SD.SYSTEM_LANGUAGE == 0 else "Login"))
  123. self.lb_role.setText("登录角色" if SD.SYSTEM_LANGUAGE == 0 else "Role")
  124. self.lb_password.setText("登录密码" if SD.SYSTEM_LANGUAGE == 0 else "PassWord")
  125. self.lb_prj.setText("登录项目" if SD.SYSTEM_LANGUAGE == 0 else "Project")
  126. self.lb_con_type.setText("通讯类型" if SD.SYSTEM_LANGUAGE == 0 else "Conn Type")
  127. self.lb_channel.setText("索引号" if SD.SYSTEM_LANGUAGE == 0 else "Index")
  128. self.lb_index.setText("通道号" if SD.SYSTEM_LANGUAGE == 0 else "Channel")
  129. self.lb_baudrate.setText("波特率" if SD.SYSTEM_LANGUAGE == 0 else "BPS")
  130. self.edt_password.setPlaceholderText("密码" if SD.SYSTEM_LANGUAGE == 0 else "PassWord")
  131. self.btn_login.setText(_translate("bms_login", "登录" if SD.SYSTEM_LANGUAGE == 0 else "Login"))
  132. self.btn_cancel.setText(_translate("bms_login", "取消" if SD.SYSTEM_LANGUAGE == 0 else "Cancel"))