Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

868 lines
24 KiB

​
​
​
​
4 years ago
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['CID'] );
  5. $QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name`, `no`.`id` as `node_id` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`) WHERE `sen`.`id`={$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. $CR['ack_mask_type'] = intval( $CR['ack_mask_type'] );
  10. $CR['ack_mask_size'] = intval( $CR['ack_mask_size'] );
  11. $TTPL=<<<JOJOKA
  12. {
  13. xtype: 'panel',
  14. border: false,
  15. frame: false,
  16. items:[%%%ITEMS%%%]
  17. }
  18. JOJOKA;
  19. $ITEMS = array();
  20. switch( $CR['type'] ){
  21. case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break;
  22. case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LFS ' . $Labels->getLabel('SENSOR'); break;
  23. case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break;
  24. case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break;
  25. default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor';
  26. };
  27. $NAME .='<br/>communication errors per minute: '.$CR['com_epm'];
  28. $INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_SERIAL_').':</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
  29. $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['enable']==1)?'A':'N')."\"><tr><td width=\"200px\"><div class=\"node_".$CR['type']."_img_sset\"></div></td><td valign=\"middle\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
  30. $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
  31. $RR=$DATABASE->Query( $QS );
  32. if( count( $RR ) ){
  33. $RE=array();
  34. foreach( $RR as $R ){
  35. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  36. };
  37. $UARTS = implode( ',', $RE );
  38. } else {
  39. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  40. };
  41. $QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}";
  42. $RRR = $DATABASE->Query( $QS );
  43. if( count( $RRR ) ){
  44. $INI_S = $RRR[0];
  45. } else {
  46. $INI_S = array();
  47. $INI_S['AUTORESET_ENABLE'] = 0;
  48. $INI_S['AUTORESET_INTERLEAVE'] = 2000;
  49. $INI_S['AUTORESET_TIMEOUT'] = 60000;
  50. $INI_S['BOARD_TEMPERATURE'] = 1;
  51. $INI_S['BOARD_ZEROSHIFT'] = 0;
  52. $INI_S['BOARD_SPEED'] = 4;
  53. $INI_S['RUN_DIR'] = 2;
  54. $INI_S['NO_BLACK_TARGETS'] = 1;
  55. $INI_S['JUST_MOVING_TARGETS'] = 0;
  56. $INI_S['JUST_MOVING_RADIAL'] = 0;
  57. $INI_S['JUST_MOVING_DISTANCE'] = 0;
  58. if( stripos( $CR['version'], 'FF' )!== false ) {
  59. $INI_S['FREEZ_FIRST_TH'] = 1;
  60. $INI_S['SAVE_FIRST_TH'] = 1;
  61. } else if( stripos( $CR['version'], 'FS' )!== false ){
  62. $INI_S['FREEZ_FIRST_TH'] = 1;
  63. $INI_S['SAVE_FIRST_TH'] = 1;
  64. } else if( stripos( $CR['version'], 'FD' )!== false ){
  65. $INI_S['FREEZ_FIRST_TH'] = 0;
  66. $INI_S['SAVE_FIRST_TH'] = 0;
  67. } else {
  68. $INI_S['FREEZ_FIRST_TH'] = 0;
  69. $INI_S['SAVE_FIRST_TH'] = 0;
  70. };
  71. $QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,{$INI_S['FREEZ_FIRST_TH']},{$INI_S['SAVE_FIRST_TH']})";
  72. $DATABASE->Query( $QS );
  73. };
  74. if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){
  75. //Frozen TH
  76. if( stripos( $CR['version'], 'FD' )!== false ){
  77. $THF_OPERATION = ",{
  78. xtype: 'button',
  79. text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}',
  80. width: '100%',
  81. iconCls: 'srv_op_fth_ble',
  82. scale: 'large',
  83. handler: function(){
  84. doSensorOperation( {$CR['id']}, 21, 0, true );
  85. }
  86. }";
  87. } else {
  88. if( stripos( $CR['version'], 'FS' )!== false ){
  89. $THF_OPERATION = ",{
  90. xtype: 'button',
  91. text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}',
  92. width: '100%',
  93. iconCls: 'srv_op_fth_study',
  94. scale: 'large',
  95. handler: function(){
  96. doSensorOperation( {$CR['id']}, 24, 0, true );
  97. }
  98. }";
  99. };
  100. if( stripos( $CR['version'], 'FF' )!== false ){
  101. $THF_OPERATION = ",{
  102. xtype: 'button',
  103. text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}',
  104. width: '100%',
  105. iconCls: 'srv_op_fth_frozen',
  106. scale: 'large',
  107. handler: function(){
  108. doSensorOperation( {$CR['id']}, 23, 0, true );
  109. }
  110. }";
  111. };
  112. $THF_OPERATION .= ",{
  113. xtype: 'button',
  114. text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}',
  115. width: '100%',
  116. iconCls: 'srv_op_fth_ble',
  117. scale: 'large',
  118. handler: function(){
  119. doSensorOperation( {$CR['id']}, 22, 0, true );
  120. }
  121. }";
  122. };
  123. } else {
  124. $THF_OPERATION = '';
  125. }
  126. $ED =<<<kokakskhkajhskr
  127. {
  128. xtype: 'tabpanel',
  129. activeTab: 0,
  130. items:[{
  131. xtype: 'form',
  132. title: '{$Labels->GetLabel('_GENERAL_')}',
  133. labelWidth: 200,
  134. border: false,
  135. frame: false,
  136. labelAlign: 'right',
  137. height: PanelH - 283,
  138. items:[{
  139. xtype: 'combo',
  140. id: 'sens_se',
  141. fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}",
  142. lazyRender: true,
  143. mode: 'local',
  144. forceSelection: true,
  145. triggerAction: 'all',
  146. editable: false,
  147. disableKeyFilter: true,
  148. store: new Ext.data.ArrayStore({
  149. fields: ['mode','mode_txt'],
  150. data: [
  151. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  152. [1,'{$Labels->GetLabel('___ENABLED__')}']
  153. ]
  154. }),
  155. valueField: 'mode',
  156. displayField: 'mode_txt',
  157. value: {$CR['enable']},
  158. width: 200,
  159. listeners:{
  160. select: function( a, c, b ){
  161. doSensorOperation( {$CR['id']}, 1, b, true );
  162. }
  163. }
  164. },{
  165. xtype: 'combo',
  166. id: 'sens_range',
  167. fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}",
  168. lazyRender: true,
  169. mode: 'local',
  170. forceSelection: true,
  171. triggerAction: 'all',
  172. editable: false,
  173. disableKeyFilter: true,
  174. store: new Ext.data.ArrayStore({
  175. fields: ['range','range_txt'],
  176. data: [
  177. [15,'15 {$Labels->GetLabel('_METERS_')}'],
  178. [35,'35 {$Labels->GetLabel('_METERS_')}'],
  179. [45,'45 {$Labels->GetLabel('_METERS_')}'],
  180. [65,'65 {$Labels->GetLabel('_METERS_')}'],
  181. [75,'75 {$Labels->GetLabel('_METERS_')}'],
  182. [150,'150 {$Labels->GetLabel('_METERS_')}'],
  183. [200,'200 {$Labels->GetLabel('_METERS_')}'],
  184. [300,'300 {$Labels->GetLabel('_METERS_')}'],
  185. [350,'350 {$Labels->GetLabel('_METERS_')}']
  186. ]
  187. }),
  188. valueField: 'range',
  189. displayField: 'range_txt',
  190. value: {$CR['max_range']},
  191. width: 200,
  192. listeners:{
  193. select: function( a, c, b ){
  194. doSensorOperation( {$CR['id']}, 2, b, true );
  195. }
  196. }
  197. },{
  198. xtype: 'numberfield',
  199. id: 'sens_id',
  200. fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}',
  201. width: 200,
  202. value: {$CR['device_id']},
  203. listeners:{
  204. change: function( a, c, b ){
  205. doSensorOperation( {$CR['id']}, 3, c, true );
  206. }
  207. }
  208. },{
  209. xtype: 'combo',
  210. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  211. lazyRender: true,
  212. id: 'uart_id',
  213. mode: 'local',
  214. disabled: false,
  215. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  216. store: new Ext.data.ArrayStore({
  217. fields: ['uart','uart_txt'],
  218. data: [{$UARTS}]
  219. }),
  220. valueField: 'uart',
  221. displayField: 'uart_txt',
  222. value: {$CR['uart_id']},
  223. width: 200,
  224. listeners:{
  225. select: function( a, c, b ){
  226. doSensorOperation( {$CR['id']}, 4, c.data.uart, true );
  227. }
  228. }
  229. },{
  230. xtype: 'combo',
  231. id: 'ad_se',
  232. fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}",
  233. lazyRender: true,
  234. mode: 'local',
  235. forceSelection: true,
  236. triggerAction: 'all',
  237. editable: false,
  238. disableKeyFilter: true,
  239. store: new Ext.data.ArrayStore({
  240. fields: ['ad','ad_txt'],
  241. data: [
  242. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  243. [10,'Each 10 Flips'],
  244. [20,'Each 20 Flips'],
  245. [30,'Each 30 Flips'],
  246. [40,'Each 40 Flips'],
  247. [50,'Each 50 Flips'],
  248. [100,'Each 100 Flips'],
  249. [200,'Each 200 Flips']
  250. ]
  251. }),
  252. valueField: 'ad',
  253. displayField: 'ad_txt',
  254. value: {$CR['auto_draw']},
  255. width: 200,
  256. listeners:{
  257. select: function( a, c, b ){
  258. doSensorOperation( {$CR['id']}, 5, b, true );
  259. }
  260. }
  261. },{
  262. xtype: 'numberfield',
  263. id: 'basesh_id',
  264. fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}',
  265. width: 200,
  266. value: {$CR['base_shift']},
  267. listeners:{
  268. change: function( a, c, b ){
  269. doSensorOperation( {$CR['id']}, 6, c, true );
  270. }
  271. }
  272. },{
  273. xtype: 'combo',
  274. id: 'sens_at',
  275. fieldLabel: "{$Labels->GetLabel('_SENS_ACKT_')}",
  276. lazyRender: true,
  277. mode: 'local',
  278. forceSelection: true,
  279. triggerAction: 'all',
  280. editable: false,
  281. disableKeyFilter: true,
  282. store: new Ext.data.ArrayStore({
  283. fields: ['mode','mode_txt'],
  284. data: [
  285. [0,'{$Labels->GetLabel('_MA_ROUND_')}'],
  286. [1,'{$Labels->GetLabel('_MA_CIRCLE__')}']
  287. ]
  288. }),
  289. valueField: 'mode',
  290. displayField: 'mode_txt',
  291. value: {$CR['ack_mask_type']},
  292. width: 200,
  293. listeners:{
  294. select: function( a, c, b ){
  295. doSensorOperation( {$CR['id']}, 25, b, true );
  296. }
  297. }
  298. },{
  299. xtype: 'combo',
  300. id: 'sens_as',
  301. fieldLabel: "{$Labels->GetLabel('_SENS_ACKS_')}",
  302. lazyRender: true,
  303. mode: 'local',
  304. forceSelection: true,
  305. triggerAction: 'all',
  306. editable: false,
  307. disableKeyFilter: true,
  308. store: new Ext.data.ArrayStore({
  309. fields: ['size','size_txt'],
  310. data: [
  311. [10,'10 {$Labels->GetLabel('_METERS_')}'],
  312. [20,'20 {$Labels->GetLabel('_METERS_')}'],
  313. [30,'30 {$Labels->GetLabel('_METERS_')}'],
  314. [40,'40 {$Labels->GetLabel('_METERS_')}'],
  315. [50,'50 {$Labels->GetLabel('_METERS_')}'],
  316. [60,'60 {$Labels->GetLabel('_METERS_')}'],
  317. [70,'70 {$Labels->GetLabel('_METERS_')}']
  318. ]
  319. }),
  320. valueField: 'size',
  321. displayField: 'size_txt',
  322. value: {$CR['ack_mask_size']},
  323. width: 200,
  324. listeners:{
  325. select: function( a, c, b ){
  326. doSensorOperation( {$CR['id']}, 26, b, true );
  327. }
  328. }
  329. }]
  330. },{
  331. xtype: 'form',
  332. title: '{$Labels->GetLabel('_HARDWARE_')}',
  333. labelWidth: 200,
  334. border: false,
  335. frame: false,
  336. labelAlign: 'right',
  337. height: PanelH - 283,
  338. items:[{
  339. xtype: 'checkbox',
  340. id: 'autores_ena',
  341. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}',
  342. width: 200,
  343. checked: {$INI_S['AUTORESET_ENABLE']},
  344. listeners:{
  345. check: function( a, c ){
  346. if( c ){
  347. doSensorOperation( {$CR['id']}, 7, 1, false );
  348. } else {
  349. doSensorOperation( {$CR['id']}, 7, 0, false );
  350. };
  351. }
  352. }
  353. },{
  354. xtype: 'numberfield',
  355. id: 'autores_il',
  356. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}',
  357. width: 200,
  358. value: {$INI_S['AUTORESET_INTERLEAVE']},
  359. listeners:{
  360. change: function( a, c, b ){
  361. doSensorOperation( {$CR['id']}, 8, c, false );
  362. }
  363. }
  364. },{
  365. xtype: 'numberfield',
  366. id: 'autores_to',
  367. fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}',
  368. width: 200,
  369. value: {$INI_S['AUTORESET_TIMEOUT']},
  370. listeners:{
  371. change: function( a, c, b ){
  372. doSensorOperation( {$CR['id']}, 9, c, false );
  373. }
  374. }
  375. },{
  376. xtype: 'numberfield',
  377. id: 'board_zsh',
  378. fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}',
  379. width: 200,
  380. value: {$INI_S['BOARD_ZEROSHIFT']},
  381. listeners:{
  382. change: function( a, c, b ){
  383. doSensorOperation( {$CR['id']}, 10, c, false );
  384. }
  385. }
  386. },{
  387. xtype: 'numberfield',
  388. id: 'board_temp',
  389. fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}',
  390. width: 200,
  391. value: {$INI_S['BOARD_TEMPERATURE']},
  392. listeners:{
  393. change: function( a, c, b ){
  394. doSensorOperation( {$CR['id']}, 11, c, false );
  395. }
  396. }
  397. },{
  398. xtype: 'combo',
  399. id: 'board_spd',
  400. fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}",
  401. lazyRender: true,
  402. mode: 'local',
  403. forceSelection: true,
  404. triggerAction: 'all',
  405. editable: false,
  406. disableKeyFilter: true,
  407. store: new Ext.data.ArrayStore({
  408. fields: ['sd','sd_txt'],
  409. data: [
  410. [2,'2 Scans per second'],
  411. [4,'4 Scans per second'],
  412. [6,'6 Scans per second'],
  413. [8,'8 Scans per second'],
  414. [10,'10 Scans per second'],
  415. [12,'12 Scans per second']
  416. ]
  417. }),
  418. valueField: 'sd',
  419. displayField: 'sd_txt',
  420. value: {$INI_S['BOARD_SPEED']},
  421. width: 200,
  422. listeners:{
  423. select: function( a, c, b ){
  424. doSensorOperation( {$CR['id']}, 12, b, false );
  425. }
  426. }
  427. },{
  428. xtype: 'checkbox',
  429. id: 'nbt_ena',
  430. fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}',
  431. width: 200,
  432. checked: {$INI_S['NO_BLACK_TARGETS']},
  433. listeners:{
  434. check: function( a, c ){
  435. if( c ){
  436. doSensorOperation( {$CR['id']}, 13, 1, false );
  437. } else {
  438. doSensorOperation( {$CR['id']}, 13, 0, false );
  439. };
  440. }
  441. }
  442. },{
  443. xtype: 'checkbox',
  444. id: 'jmt_ena',
  445. fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}',
  446. width: 200,
  447. checked: {$INI_S['JUST_MOVING_TARGETS']},
  448. listeners:{
  449. check: function( a, c ){
  450. if( c ){
  451. doSensorOperation( {$CR['id']}, 14, 1, false );
  452. } else {
  453. doSensorOperation( {$CR['id']}, 14, 0, false );
  454. };
  455. }
  456. }
  457. },{
  458. xtype: 'checkbox',
  459. id: 'jmt_rad',
  460. fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}',
  461. width: 200,
  462. checked: {$INI_S['JUST_MOVING_RADIAL']},
  463. listeners:{
  464. check: function( a, c ){
  465. if( c ){
  466. doSensorOperation( {$CR['id']}, 15, 1, false );
  467. } else {
  468. doSensorOperation( {$CR['id']}, 15, 0, false );
  469. };
  470. }
  471. }
  472. },{
  473. xtype: 'checkbox',
  474. id: 'jmt_range',
  475. fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}',
  476. width: 200,
  477. checked: {$INI_S['JUST_MOVING_DISTANCE']},
  478. listeners:{
  479. check: function( a, c ){
  480. if( c ){
  481. doSensorOperation( {$CR['id']}, 16, 1, false );
  482. } else {
  483. doSensorOperation( {$CR['id']}, 16, 0, false );
  484. };
  485. }
  486. }
  487. },{
  488. xtype: 'checkbox',
  489. id: 'fth_freeze',
  490. fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}',
  491. width: 200,
  492. checked: {$INI_S['FREEZ_FIRST_TH']},
  493. listeners:{
  494. check: function( a, c ){
  495. if( c ){
  496. doSensorOperation( {$CR['id']}, 17, 1, false );
  497. } else {
  498. doSensorOperation( {$CR['id']}, 17, 0, false );
  499. };
  500. }
  501. }
  502. },{
  503. xtype: 'checkbox',
  504. id: 'fth_save',
  505. fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}',
  506. width: 200,
  507. checked: {$INI_S['SAVE_FIRST_TH']},
  508. listeners:{
  509. check: function( a, c ){
  510. if( c ){
  511. doSensorOperation( {$CR['id']}, 18, 1, false );
  512. } else {
  513. doSensorOperation( {$CR['id']}, 18, 0, false );
  514. };
  515. }
  516. }
  517. },{
  518. xtype: 'button',
  519. text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}',
  520. width: '100%',
  521. iconCls: 'srv_op_download',
  522. scale: 'large',
  523. handler: function(){
  524. doSensorOperation( {$CR['id']}, 20, 0, true );
  525. }
  526. }]
  527. },{
  528. xtype: 'panel',
  529. title: '{$Labels->GetLabel('_POSITION_')}',
  530. height: PanelH - 283,
  531. items:[{
  532. xtype: 'panel',
  533. id: 'sens_posrot',
  534. height: PanelH - 283,
  535. layout: 'table',
  536. frame: false,
  537. border: false,
  538. layoutConfig: {
  539. columns: 3
  540. },
  541. defaults: {
  542. frame: false,
  543. bodyStyle: 'padding:10px',
  544. border: false
  545. },
  546. items:[{
  547. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  548. },{
  549. xtype: 'numberfield',
  550. decimalPrecision: 3,
  551. value: {$CR['x_rot']},
  552. listeners:{
  553. change: function( a, c, b ){
  554. doSensorOperation( {$CR['id']}, 30, c );
  555. }
  556. }
  557. },{
  558. html: '&nbsp;'
  559. },{
  560. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  561. },{
  562. xtype: 'numberfield',
  563. decimalPrecision: 3,
  564. value: {$CR['y_rot']},
  565. listeners:{
  566. change: function( a, c, b ){
  567. doSensorOperation( {$CR['id']}, 31, c );
  568. }
  569. }
  570. },{
  571. html: '&nbsp;'
  572. },{
  573. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  574. },{
  575. xtype: 'numberfield',
  576. decimalPrecision: 3,
  577. value: {$CR['z_rot']},
  578. listeners:{
  579. change: function( a, c, b ){
  580. doSensorOperation( {$CR['id']}, 32, c );
  581. }
  582. }
  583. },{
  584. html: '&nbsp;'
  585. },{
  586. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  587. },{
  588. xtype: 'numberfield',
  589. decimalPrecision: 3,
  590. value: {$CR['x']},
  591. listeners:{
  592. change: function( a, c, b ){
  593. doSensorOperation( {$CR['id']}, 33, c );
  594. }
  595. }
  596. },{
  597. html: '&nbsp;'
  598. },{
  599. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  600. },{
  601. xtype: 'numberfield',
  602. decimalPrecision: 3,
  603. value: {$CR['y']},
  604. listeners:{
  605. change: function( a, c, b ){
  606. doSensorOperation( {$CR['id']}, 34, c );
  607. }
  608. }
  609. },{
  610. html: '&nbsp;'
  611. },{
  612. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
  613. },{
  614. xtype: 'numberfield',
  615. decimalPrecision: 3,
  616. value: {$CR['z']},
  617. listeners:{
  618. change: function( a, c, b ){
  619. doSensorOperation( {$CR['id']}, 35, c );
  620. }
  621. }
  622. },{
  623. html: '&nbsp;'
  624. }]
  625. }]
  626. },{
  627. xtype: 'panel',
  628. title: '{$Labels->GetLabel('_MAINTENENCE_')}',
  629. height: PanelH - 283,
  630. items:[{
  631. xtype: 'button',
  632. text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}',
  633. width: '100%',
  634. iconCls: 'srv_op_restart',
  635. scale: 'large',
  636. handler: function(){
  637. doDeviceOperation( {$CR['node_id']}, 1,'', true );
  638. }
  639. },{
  640. xtype: 'button',
  641. text: '{$Labels->GetLabel('_SENS_DO_READALL_')}',
  642. width: '100%',
  643. iconCls: 'srv_op_upload',
  644. scale: 'large',
  645. handler: function(){
  646. doDeviceOperation( {$CR['node_id']}, 128,'', true );
  647. }
  648. },{
  649. xtype: 'button',
  650. text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}',
  651. width: '100%',
  652. iconCls: 'srv_op_download',
  653. scale: 'large',
  654. handler: function(){
  655. doDeviceOperation( {$CR['node_id']}, 129,'', true );
  656. }
  657. }{$THF_OPERATION}]
  658. },{
  659. xtype: 'panel',
  660. title: '{$Labels->getLabel('_SND_FILES2_DEV__')}',
  661. height: PanelH - 283,
  662. items:[{
  663. title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}',
  664. xtype: 'panel',
  665. //height: 300,
  666. //flex: 1,
  667. frame: true,
  668. border: false,
  669. //layout: 'vbox',
  670. items:[{
  671. xtype:'button',
  672. id: 'pickfiles_3',
  673. width: '100%',
  674. text: '{$Labels->GetLabel('_CHOOSEF_')}',
  675. listeners:{
  676. afterrender: function(){
  677. muploader = new plupload.Uploader({
  678. runtimes : 'html5,html4',
  679. browse_button : Ext.getDom('pickfiles_3'),
  680. max_file_size : '1000mb',
  681. chunk_size: '200kb',
  682. max_retries: 3,
  683. multi_selection: false,
  684. max_file_count: 1,
  685. url: '/lib/controller/uploadToDevice.php?DID={$EID}',
  686. init: {
  687. PostInit: function() {
  688. },
  689. FilesAdded: function( up, files ) {
  690. Ext.getCmp('upload_files_btn').enable();
  691. Ext.getCmp('uploads_clr_btn').enable();
  692. plupload.each( files, function(file) {
  693. uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
  694. uploads_store_id++;
  695. Ext.getCmp('upload_grid').doLayout();
  696. });
  697. },
  698. UploadProgress: function(up, file) {
  699. var pb = Ext.getCmp( 'progress_'+file.id );
  700. if( file.percent < 100 ){
  701. pb.updateProgress( file.percent / 100, file.percent + '%', false );
  702. } else {
  703. pb.updateProgress( 1.0, 'Uploaded', false );
  704. uploads_store.removeAll();
  705. loadModuleFiles( {$EID} );
  706. };
  707. },
  708. Error: function(up, err) {
  709. Ext.Msg.show({
  710. title:'Upload Status',
  711. msg: "Error #" + err.code + ": " + err.message,
  712. buttons: Ext.Msg.OK,
  713. icon: Ext.MessageBox.ERROR
  714. });
  715. }
  716. }
  717. });
  718. muploader.init();
  719. //Ext.getCmp('uploaded_grid').hide();
  720. //Ext.getCmp('upload_progres_panel').show();
  721. devUploadID = {$CR['id']};
  722. fetchDeviceUploadStatus();
  723. //loadModuleFiles( {$EID} );
  724. }
  725. }
  726. },{
  727. height: 200,
  728. xtype: 'grid',
  729. id: 'upload_grid',
  730. border: false,
  731. frame: false,
  732. mode: 'local',
  733. lazyRender: true,
  734. width: '100%',
  735. autoScroll: true,
  736. ds: uploads_store,
  737. cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
  738. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  739. viewConfig: {
  740. forceFit: true
  741. },
  742. bbar: [{
  743. text: '{$Labels->GetLabel('_CLEAR_')}',
  744. id: 'uploads_clr_btn',
  745. disabled: true,
  746. handler: function(){
  747. muploader.splice();
  748. uploads_store.removeAll();
  749. uploads_store_id = 0;
  750. Ext.getCmp('uploads_clr_btn').disable();
  751. Ext.getCmp('upload_files_btn').disable();
  752. }
  753. },{
  754. xtype:'button',
  755. id: 'upload_files_btn',
  756. disabled: true,
  757. text: '{$Labels->GetLabel('_UPLOA2MODULE_')}',
  758. handler: function(){
  759. if( muploader!= null ){
  760. muploader.start();
  761. Ext.getCmp('upload_files_btn').disable();
  762. };
  763. }
  764. }]
  765. },{
  766. xtype: 'panel',
  767. height: 20
  768. },{
  769. title: '{$Labels->GetLabel('_FISONMODULE_')}',
  770. height: 200,
  771. xtype: 'grid',
  772. id: 'uploaded_grid',
  773. border: false,
  774. hidden: true,
  775. frame: false,
  776. mode: 'local',
  777. lazyRender: true,
  778. width: '100%',
  779. autoScroll: true,
  780. ds: uploaded_store,
  781. cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ),
  782. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  783. viewConfig: {
  784. forceFit: true
  785. },
  786. bbar: [{
  787. text: '{$Labels->GetLabel('_CLEAR_')}',
  788. id: 'oploaded_clr_btn',
  789. disabled: false,
  790. handler: function(){
  791. //muploader.splice();
  792. uploaded_store.removeAll();
  793. uploaded_store_id = 0;
  794. }
  795. },{
  796. text: '{$Labels->GetLabel('_RESETSTATUS_')}',
  797. id: 'oploaded_rst_btn',
  798. disabled: true,
  799. handler: function(){
  800. //muploader.splice();
  801. //uploaded_store.removeAll();
  802. //uploaded_store_id = 0;
  803. }
  804. },{
  805. text: '{$Labels->GetLabel('_ISSURES_')}',
  806. id: 'oploaded_sres_btn',
  807. disabled: true,
  808. handler: function(){
  809. //muploader.splice();
  810. //uploaded_store.removeAll();
  811. //uploaded_store_id = 0;
  812. }
  813. },{
  814. xtype:'button',
  815. //disabled: true,
  816. id: 'oploaded_snd_btn',
  817. text: '{$Labels->GetLabel('_SENDTOSENS_')}',
  818. handler: function(){
  819. doDeviceOperation( {$CR['node_id']}, 120,'', true );
  820. Ext.getCmp('uploaded_grid').hide();
  821. Ext.getCmp('upload_progres_panel').show();
  822. devUploadID = {$CR['id']};
  823. fetchDeviceUploadStatus();
  824. }
  825. }]
  826. },{
  827. xtype: 'panel',
  828. id: 'upload_progres_panel',
  829. hidden: false,
  830. items:[{
  831. id: 'upp_ttext',
  832. html: 'Sending 3 file(s) to the device'
  833. },{
  834. id: 'upp_ctext_',
  835. html: '<table width="100%" height="50" border=0><tr><td width="100">&nbsp;</td><td width="50" align="right" height="50"><svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"><circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/><circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" ><animateTransform attributeName="transform" dur="2s" type="rotate" from="0 50 48" to="360 50 52" repeatCount="indefinite" /></circle></svg></td><td align="left" id="upp_ctext"></td></tr></table>'
  836. },{
  837. xtype: 'progress',
  838. id: 'upp_pbar',
  839. width: '100%',
  840. value: 0.0
  841. }]
  842. }]
  843. }]
  844. }],
  845. bbar:[{
  846. text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}',
  847. handler: function(){
  848. doSensorOperation( {$CR['id']}, 255,'', true );
  849. }
  850. }]
  851. }
  852. kokakskhkajhskr;
  853. $ITEMS[1] = $ED;
  854. $CONTENT = implode(',',$ITEMS);
  855. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  856. echo $TTPL;
  857. } else {
  858. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  859. };
  860. } else {
  861. header('location: /');
  862. };
  863. ?>