|
|
<?php require_once('../ajax_asm.php'); if( $CUser->Data['id'] > 1 ){ $EID = intval( $_POST['CID'] ); $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}"; $Result = $DATABASE->Query( $QS, false ); if( count( $Result ) ){ $CR = $Result[0]; $CR['ack_mask_type'] = intval( $CR['ack_mask_type'] ); $CR['ack_mask_size'] = intval( $CR['ack_mask_size'] ); $TTPL=<<<JOJOKA { xtype: 'panel', border: false, frame: false, items:[%%%ITEMS%%%] }JOJOKA; $ITEMS = array(); switch( $CR['type'] ){ case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break; case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LFS ' . $Labels->getLabel('SENSOR'); break; case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break; case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break; default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor'; }; $NAME .='<br/>communication errors per minute: '.$CR['com_epm']; $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>'; $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/>'}"; $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )"; $RR=$DATABASE->Query( $QS ); if( count( $RR ) ){ $RE=array(); foreach( $RR as $R ){ $RE[] = "[ {$R['aux_id']}, '{$R['device']}']"; }; $UARTS = implode( ',', $RE ); } else { $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]"; }; $QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}"; $RRR = $DATABASE->Query( $QS ); if( count( $RRR ) ){ $INI_S = $RRR[0]; } else { $INI_S = array(); $INI_S['AUTORESET_ENABLE'] = 0; $INI_S['AUTORESET_INTERLEAVE'] = 2000; $INI_S['AUTORESET_TIMEOUT'] = 60000; $INI_S['BOARD_TEMPERATURE'] = 1; $INI_S['BOARD_ZEROSHIFT'] = 0; $INI_S['BOARD_SPEED'] = 4; $INI_S['RUN_DIR'] = 2; $INI_S['NO_BLACK_TARGETS'] = 1; $INI_S['JUST_MOVING_TARGETS'] = 0; $INI_S['JUST_MOVING_RADIAL'] = 0; $INI_S['JUST_MOVING_DISTANCE'] = 0; if( stripos( $CR['version'], ' FF ' )!== false ) { $INI_S['FREEZ_FIRST_TH'] = 1; $INI_S['SAVE_FIRST_TH'] = 1; } else if( stripos( $CR['version'], ' FS ' )!== false ){ $INI_S['FREEZ_FIRST_TH'] = 1; $INI_S['SAVE_FIRST_TH'] = 1; } else if( stripos( $CR['version'], ' FD ' )!== false ){ $INI_S['FREEZ_FIRST_TH'] = 0; $INI_S['SAVE_FIRST_TH'] = 0; } else { $INI_S['FREEZ_FIRST_TH'] = 0; $INI_S['SAVE_FIRST_TH'] = 0; }; $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']})"; $DATABASE->Query( $QS ); }; $QS = "SELECT `id`, `name` FROM `nodes` WHERE `type` IN (10,11,12,13,14,15)"; $KD = $DATABASE->Query( $QS ); if( count( $KD ) ){ $CO = array(); $CO[] = "[0,'{$Labels->GetLabel('__DISABLED__')}']"; foreach( $KD as $CK ){ $CO[] = "[{$CK['id']},'{$CK['name']}']"; }; $SYSTEM_CAMERAS = '['.implode( ',', $CO ).']'; } else { $SYSTEM_CAMERAS = "[[0,'{$Labels->GetLabel('__DISABLED__')}']]"; }; if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){ //Frozen TH
if( stripos( $CR['version'], 'FD' )!== false ){ $THF_OPERATION = ",{
xtype: 'button', text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}', width: '100%', iconCls: 'srv_op_fth_ble', scale: 'large', handler: function(){ doSensorOperation( {$CR['id']}, 21, 0, true ); } }";
} else { if( stripos( $CR['version'], 'FS' )!== false ){ $THF_OPERATION = ",{
xtype: 'button', text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}', width: '100%', iconCls: 'srv_op_fth_study', scale: 'large', handler: function(){ doSensorOperation( {$CR['id']}, 24, 0, true ); } }";
}; if( stripos( $CR['version'], 'FF' )!== false ){ $THF_OPERATION = ",{
xtype: 'button', text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}', width: '100%', iconCls: 'srv_op_fth_frozen', scale: 'large', handler: function(){ doSensorOperation( {$CR['id']}, 23, 0, true ); } }";
}; $THF_OPERATION .= ",{
xtype: 'button', text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}', width: '100%', iconCls: 'srv_op_fth_ble', scale: 'large', handler: function(){ doSensorOperation( {$CR['id']}, 22, 0, true ); } }";
}; } else { $THF_OPERATION = ''; } $ED =<<<kokakskhkajhskr{ xtype: 'tabpanel', activeTab: 0, items:[{ xtype: 'form', title: '{$Labels->GetLabel('_GENERAL_')}', labelWidth: 200, border: false, frame: false, labelAlign: 'right', height: PanelH - 283, items:[{ xtype: 'combo', id: 'sens_se', fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [0,'{$Labels->GetLabel('__DISABLED__')}'], [1,'{$Labels->GetLabel('___ENABLED__')}'] ] }), valueField: 'mode', displayField: 'mode_txt', value: {$CR['enable']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 1, b, true ); } } },{ xtype: 'combo', id: 'sens_range', fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['range','range_txt'], data: [ [15,'15 {$Labels->GetLabel('_METERS_')}'], [35,'35 {$Labels->GetLabel('_METERS_')}'], [45,'45 {$Labels->GetLabel('_METERS_')}'], [65,'65 {$Labels->GetLabel('_METERS_')}'], [75,'75 {$Labels->GetLabel('_METERS_')}'], [150,'150 {$Labels->GetLabel('_METERS_')}'], [200,'200 {$Labels->GetLabel('_METERS_')}'], [300,'300 {$Labels->GetLabel('_METERS_')}'], [350,'350 {$Labels->GetLabel('_METERS_')}'] ] }), valueField: 'range', displayField: 'range_txt', value: {$CR['max_range']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 2, b, true ); } } },{ xtype: 'numberfield', id: 'sens_id', fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}', width: 200, value: {$CR['device_id']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 3, c, true ); } } },{ xtype: 'combo', fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}', lazyRender: true, id: 'uart_id', mode: 'local', disabled: false, forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['uart','uart_txt'], data: [{$UARTS}] }), valueField: 'uart', displayField: 'uart_txt', value: {$CR['uart_id']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 4, c.data.uart, true ); } } },{ xtype: 'combo', id: 'ad_se', fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['ad','ad_txt'], data: [ [0,'{$Labels->GetLabel('__DISABLED__')}'], [10,'Each 10 Flips'], [20,'Each 20 Flips'], [30,'Each 30 Flips'], [40,'Each 40 Flips'], [50,'Each 50 Flips'], [100,'Each 100 Flips'], [200,'Each 200 Flips'] ] }), valueField: 'ad', displayField: 'ad_txt', value: {$CR['auto_draw']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 5, b, true ); } } },{ xtype: 'numberfield', id: 'basesh_id', fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}', width: 200, value: {$CR['base_shift']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 6, c, true ); } } },{ xtype: 'combo', id: 'sens_at', fieldLabel: "{$Labels->GetLabel('_SENS_ACKT_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [0,'{$Labels->GetLabel('_MA_ROUND_')}'], [1,'{$Labels->GetLabel('_MA_CIRCLE__')}'] ] }), valueField: 'mode', displayField: 'mode_txt', value: {$CR['ack_mask_type']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 25, b, true ); } } },{ xtype: 'combo', id: 'sens_as', fieldLabel: "{$Labels->GetLabel('_SENS_ACKS_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['size','size_txt'], data: [ [10,'10 {$Labels->GetLabel('_METERS_')}'], [20,'20 {$Labels->GetLabel('_METERS_')}'], [30,'30 {$Labels->GetLabel('_METERS_')}'], [40,'40 {$Labels->GetLabel('_METERS_')}'], [50,'50 {$Labels->GetLabel('_METERS_')}'], [60,'60 {$Labels->GetLabel('_METERS_')}'], [70,'70 {$Labels->GetLabel('_METERS_')}'] ] }), valueField: 'size', displayField: 'size_txt', value: {$CR['ack_mask_size']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 26, b, true ); } } },{ xtype: 'combo', id: 'sens_bindcam', fieldLabel: "{$Labels->GetLabel('_SENS_BOCAM_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: {$SYSTEM_CAMERAS} }), valueField: 'mode', displayField: 'mode_txt', value: {$CR['prefered_camera_id']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 36, c.data.mode, true ); } } }] },{ xtype: 'form', title: '{$Labels->GetLabel('_HARDWARE_')}', labelWidth: 200, border: false, frame: false, labelAlign: 'right', height: PanelH - 283, items:[{ xtype: 'checkbox', id: 'autores_ena', fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}', width: 200, checked: {$INI_S['AUTORESET_ENABLE']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 7, 1, false ); } else { doSensorOperation( {$CR['id']}, 7, 0, false ); }; } } },{ xtype: 'numberfield', id: 'autores_il', fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}', width: 200, value: {$INI_S['AUTORESET_INTERLEAVE']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 8, c, false ); } } },{ xtype: 'numberfield', id: 'autores_to', fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}', width: 200, value: {$INI_S['AUTORESET_TIMEOUT']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 9, c, false ); } } },{ xtype: 'numberfield', id: 'board_zsh', fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}', width: 200, value: {$INI_S['BOARD_ZEROSHIFT']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 10, c, false ); } } },{ xtype: 'numberfield', id: 'board_temp', fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}', width: 200, value: {$INI_S['BOARD_TEMPERATURE']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 11, c, false ); } } },{ xtype: 'combo', id: 'board_spd', fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['sd','sd_txt'], data: [ [2,'2 Scans per second'], [4,'4 Scans per second'], [6,'6 Scans per second'], [8,'8 Scans per second'], [10,'10 Scans per second'], [12,'12 Scans per second'] ] }), valueField: 'sd', displayField: 'sd_txt', value: {$INI_S['BOARD_SPEED']}, width: 200, listeners:{ select: function( a, c, b ){ doSensorOperation( {$CR['id']}, 12, b, false ); } } },{ xtype: 'checkbox', id: 'nbt_ena', fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}', width: 200, checked: {$INI_S['NO_BLACK_TARGETS']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 13, 1, false ); } else { doSensorOperation( {$CR['id']}, 13, 0, false ); }; } } },{ xtype: 'checkbox', id: 'jmt_ena', fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}', width: 200, checked: {$INI_S['JUST_MOVING_TARGETS']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 14, 1, false ); } else { doSensorOperation( {$CR['id']}, 14, 0, false ); }; } } },{ xtype: 'checkbox', id: 'jmt_rad', fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}', width: 200, checked: {$INI_S['JUST_MOVING_RADIAL']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 15, 1, false ); } else { doSensorOperation( {$CR['id']}, 15, 0, false ); }; } } },{ xtype: 'checkbox', id: 'jmt_range', fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}', width: 200, checked: {$INI_S['JUST_MOVING_DISTANCE']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 16, 1, false ); } else { doSensorOperation( {$CR['id']}, 16, 0, false ); }; } } },{ xtype: 'checkbox', id: 'fth_freeze', fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}', width: 200, checked: {$INI_S['FREEZ_FIRST_TH']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 17, 1, false ); } else { doSensorOperation( {$CR['id']}, 17, 0, false ); }; } } },{ xtype: 'checkbox', id: 'fth_save', fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}', width: 200, checked: {$INI_S['SAVE_FIRST_TH']}, listeners:{ check: function( a, c ){ if( c ){ doSensorOperation( {$CR['id']}, 18, 1, false ); } else { doSensorOperation( {$CR['id']}, 18, 0, false ); }; } } },{ xtype: 'button', text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}', width: '100%', iconCls: 'srv_op_download', scale: 'large', handler: function(){ doSensorOperation( {$CR['id']}, 20, 0, true ); } }] },{ xtype: 'panel', title: '{$Labels->GetLabel('_POSITION_')}', height: PanelH - 283, items:[{ xtype: 'panel', id: 'sens_posrot', height: PanelH - 283, layout: 'table', frame: false, border: false, layoutConfig: { columns: 3 }, defaults: { frame: false, bodyStyle: 'padding:10px', border: false }, items:[{ html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['x_rot']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 30, c ); } } },{ html: ' ' },{ html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['y_rot']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 31, c ); } } },{ html: ' ' },{ html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['z_rot']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 32, c ); } } },{ html: ' ' },{ html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['x']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 33, c ); } } },{ html: ' ' },{ html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['y']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 34, c ); } } },{ html: ' ' },{ html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>' },{ xtype: 'numberfield', decimalPrecision: 3, value: {$CR['z']}, listeners:{ change: function( a, c, b ){ doSensorOperation( {$CR['id']}, 35, c ); } } },{ html: ' ' }] }] },{ xtype: 'panel', title: '{$Labels->GetLabel('_MAINTENENCE_')}', height: PanelH - 283, items:[{ xtype: 'button', text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}', width: '100%', iconCls: 'srv_op_restart', scale: 'large', handler: function(){ doDeviceOperation( {$CR['node_id']}, 1,'', true ); } },{ xtype: 'button', text: '{$Labels->GetLabel('_SENS_DO_FULLDRAW_')}', width: '100%', iconCls: 'srv_op_fth_frozen', scale: 'large', handler: function(){ doDeviceOperation( {$CR['node_id']}, 5,'', true ); } },{ xtype: 'button', text: '{$Labels->GetLabel('_SENS_DO_READALL_')}', width: '100%', iconCls: 'srv_op_upload', scale: 'large', handler: function(){ doDeviceOperation( {$CR['node_id']}, 128,'', true ); } },{ xtype: 'button', text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}', width: '100%', iconCls: 'srv_op_download', scale: 'large', handler: function(){ doDeviceOperation( {$CR['node_id']}, 129,'', true ); } }{$THF_OPERATION}] },{ xtype: 'panel', title: '{$Labels->getLabel('_SND_FILES2_DEV__')}', height: PanelH - 283, items:[{ title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}', xtype: 'panel', //height: 300,
//flex: 1,
frame: true, border: false, //layout: 'vbox',
items:[{ xtype:'button', id: 'pickfiles_3', width: '100%', text: '{$Labels->GetLabel('_CHOOSEF_')}', listeners:{ afterrender: function(){ muploader = new plupload.Uploader({ runtimes : 'html5,html4', browse_button : Ext.getDom('pickfiles_3'), max_file_size : '1000mb', chunk_size: '200kb', max_retries: 3, multi_selection: false, max_file_count: 1, url: '/lib/controller/uploadToDevice.php?DID={$EID}', init: { PostInit: function() { },
FilesAdded: function( up, files ) { Ext.getCmp('upload_files_btn').enable(); Ext.getCmp('uploads_clr_btn').enable(); plupload.each( files, function(file) { uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true ); uploads_store_id++; Ext.getCmp('upload_grid').doLayout(); }); },
UploadProgress: function(up, file) { var pb = Ext.getCmp( 'progress_'+file.id ); if( file.percent < 100 ){ pb.updateProgress( file.percent / 100, file.percent + '%', false ); } else { pb.updateProgress( 1.0, 'Uploaded', false ); uploads_store.removeAll(); loadModuleFiles( {$EID} ); }; },
Error: function(up, err) { Ext.Msg.show({ title:'Upload Status', msg: "Error #" + err.code + ": " + err.message, buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR }); } } }); muploader.init(); //Ext.getCmp('uploaded_grid').hide();
//Ext.getCmp('upload_progres_panel').show();
devUploadID = {$CR['id']}; fetchDeviceUploadStatus(); //loadModuleFiles( {$EID} );
} } },{ height: 200, xtype: 'grid', id: 'upload_grid', border: false, frame: false, mode: 'local', lazyRender: true, width: '100%', autoScroll: true, ds: uploads_store, cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ), sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), viewConfig: { forceFit: true }, bbar: [{ text: '{$Labels->GetLabel('_CLEAR_')}', id: 'uploads_clr_btn', disabled: true, handler: function(){ muploader.splice(); uploads_store.removeAll(); uploads_store_id = 0; Ext.getCmp('uploads_clr_btn').disable(); Ext.getCmp('upload_files_btn').disable(); } },{ xtype:'button', id: 'upload_files_btn', disabled: true, text: '{$Labels->GetLabel('_UPLOA2MODULE_')}', handler: function(){ if( muploader!= null ){ muploader.start(); Ext.getCmp('upload_files_btn').disable(); }; } }] },{ xtype: 'panel', height: 20 },{ title: '{$Labels->GetLabel('_FISONMODULE_')}', height: 200, xtype: 'grid', id: 'uploaded_grid', border: false, hidden: true, frame: false, mode: 'local', lazyRender: true, width: '100%', autoScroll: true, ds: uploaded_store, cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ), sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), viewConfig: { forceFit: true }, bbar: [{ text: '{$Labels->GetLabel('_CLEAR_')}', id: 'oploaded_clr_btn', disabled: false, handler: function(){ //muploader.splice();
uploaded_store.removeAll(); uploaded_store_id = 0; } },{ text: '{$Labels->GetLabel('_RESETSTATUS_')}', id: 'oploaded_rst_btn', disabled: true, handler: function(){ //muploader.splice();
//uploaded_store.removeAll();
//uploaded_store_id = 0;
} },{ text: '{$Labels->GetLabel('_ISSURES_')}', id: 'oploaded_sres_btn', disabled: true, handler: function(){ //muploader.splice();
//uploaded_store.removeAll();
//uploaded_store_id = 0;
} },{ xtype:'button', //disabled: true,
id: 'oploaded_snd_btn', text: '{$Labels->GetLabel('_SENDTOSENS_')}', handler: function(){ doDeviceOperation( {$CR['node_id']}, 120,'', true ); Ext.getCmp('uploaded_grid').hide(); Ext.getCmp('upload_progres_panel').show(); devUploadID = {$CR['id']}; fetchDeviceUploadStatus(); } }] },{ xtype: 'panel', id: 'upload_progres_panel', hidden: false, items:[{ id: 'upp_ttext', html: 'Sending 3 file(s) to the device' },{ id: 'upp_ctext_', html: '<table width="100%" height="50" border=0><tr><td width="100"> </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>' },{ xtype: 'progress', id: 'upp_pbar', width: '100%', value: 0.0 }] }] }] }], bbar:[{ text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}', handler: function(){ doSensorOperation( {$CR['id']}, 255,'', true ); } }]}kokakskhkajhskr; $ITEMS[1] = $ED; $CONTENT = implode(',',$ITEMS); $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL ); echo $TTPL; } else { echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}'; }; } else { header('location: /'); };?>
|