EditorGrid

/**
 * Created by IntelliJ IDEA.
 * User: Sartner
 * Date: 11-10-12
 * Time: 上午11:18
 * To change this template use File | Settings | File Templates.
 */
Ext.onReady(function() {
    Ext.BLANK_IMAGE_URL = '${pageContext.request.contextPath}/images/default/s.gif';
    Ext.QuickTips.init();
    Ext.form.Field.prototype.msgTarget = 'side';

    // --------------------  params  --------------------
    var _baseParams = {};

    var _paramPropertyArchivesId = GridInitUtil.getParamByName('propertyArchive_propertyArchivesId_EQUAL_Int');
    if (_paramPropertyArchivesId) {
        _baseParams['propertyArchive_propertyArchivesId_EQUAL_Int'] = _paramPropertyArchivesId;
    }
    var _stockNumber_GT_Double = GridInitUtil.getParamByName('stockNumber_GT_Double');
    if (_stockNumber_GT_Double) {
        _baseParams['stockNumber_GT_Double'] = _stockNumber_GT_Double;
    }

    var _stockNumber_LT_Double = GridInitUtil.getParamByName('stockNumber_LT_Double');
    if (_stockNumber_LT_Double) {
        _baseParams['stockNumber_LT_Double'] = _stockNumber_LT_Double;
    }


    //-----------------------------------------------------

    var stockJsonReader = new Ext.data.JsonReader({
        idProperty:'stockId',
        totalProperty : 'total',
        root : 'datas'
    }, [
        {name:'stock.stockId',mapping:'stockId'},
        {name:'stock.propertyArchive.propertyArchivesId',mapping:'propertyArchive_propertyArchivesId'},
        {name:'stock.propertyArchive.propertyName',mapping:'propertyArchive_propertyName'},
        {name:'stock.stockDate',mapping:'stockDate'},
        {name:'stock.stockNumber',mapping:'stockNumber'},
        {name:'stock.remainderStockNumber',mapping:'remainderStockNumber'},
        {name:'stock.receiverId',mapping:'receiverId'},
        {name:'stock.receiverName',mapping:'receiverName'},
        {name:'stock.remarks',mapping:'remarks'},
        {name:'storeType',mapping:'storeType'},
        {name:'stock.contractPrice',mapping:'contractPrice'},
        {name:'outStockAmount',mapping:'outStockAmount'},
        {name:'stock.propertyButStockId',mapping:'propertyButStockId'}
    ]);

    var stockStore = new Ext.data.Store({
        proxy : new Ext.data.HttpProxy({
            url : rootPath + '/stockAction!findAll.hx',
            method:'post'
        }),
        //remoteSort :true,
        reader : stockJsonReader
    });
    stockStore.baseParams=_baseParams;
    stockStore.on('load', function(_store, options) {
        setOutStockAmountTitle();
    });
    stockStore.load();

    var stockCM = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer,
        {
            header : '库存记录ID',
            dataIndex : 'stock.stockId',
            hidden:true
        },{
            header : '资产档案ID',
            dataIndex : 'stock.propertyArchive.propertyArchivesId',
            hidden:true
        },{
            header : '资产名称',
            dataIndex : 'stock.propertyArchive.propertyName'
        },{
            header : '出入库时间',
            width:60,
            dataIndex : 'stock.stockDate'
        },{
            header : '合同分项价',
            width:60,
            hidden:true,
            dataIndex : 'stock.contractPrice'
        },{
            header : '出入库数量',
            width:60,
            dataIndex : 'stock.stockNumber',
            renderer:function(value) {
                return Math.abs(value);
            }
        },{
            header : '剩余库存量',
            width:60,
            dataIndex : 'stock.remainderStockNumber'
        },{
            header : '出入库人ID',
            dataIndex : 'stock.receiverId',
            hidden:true
        },{
            header : '出入库人',
            dataIndex : 'stock.receiverName'
        },{
            header : '备注',
            dataIndex : 'stock.remarks',
            hidden:true
        },{
            header : '注明',
            width:30,
            dataIndex : 'storeType',
            hidden:true,
            renderer:function(value, metadata, record) {
                var stockNum = record.get('stock.stockNumber');
                if (stockNum < 0)
                    return '出库';
                else
                    return '入库';
            }
        }, {
            header : '采购审批ID',
            hidden:true,
            dataIndex : 'stock.propertyButStockId'
        }, {
            header : '<span id="outAmountSpan" style="color: red;">出库数量 (总计:0) </span>',
            dataIndex : 'outStockAmount',
            editor:{
                xtype:'numberfield',
                minValue:0,
                allowNegative :false,
                allowDecimals :false
            }
        }
    ]);

    stock_grid = new Ext.grid.EditorGridPanel({
        viewConfig : {
            forceFit : true
        },
        region:'center',
        cm:stockCM,
        store:stockStore,
        clicksToEdit :1,
        bbar : new Ext.PagingToolbar({
            pageSize : 20,
            store : stockStore,
            displayInfo : true,
            displayMsg : '显示第 {0} 条到第 {1} 条, 共 {2} 条记录 ',
            emptyMsg : '没有记录'
        })
    });

    var setOutStockAmountTitle = function() {
        outCount = 0;
        stockStore.each(function(record) {
            var _temp = record.get('outStockAmount');
            if (_temp) {
                outCount += (record.get('outStockAmount') - 0);
            }
        });
        document.getElementById('outAmountSpan').innerHTML = '出库数量 (总计:' + outCount + ')';
    }

    stock_grid.on('afteredit', function(e) {
        var _value = e.value;
        var _editRecord = e.record;
        var _remainderStockNumber = _editRecord.get('stock.remainderStockNumber');
        if (_value > _remainderStockNumber) {
            _value = _remainderStockNumber;
        }
        _editRecord.set('outStockAmount', _value);
        setOutStockAmountTitle();
    });

    // --------------------  view  --------------------

    var viewport = new Ext.Viewport({
        layout:'border',
        items:[stock_grid]
    });

})

 
内容概要:本文详细介绍了使用COMSOL进行三相电力变压器温度场与流体场耦合计算的具体步骤和技术要点。首先讨论了变压器温升问题的重要性和现有仿真与实测数据之间的偏差,接着阐述了电磁-热-流三场耦合建模的难点及其解决方法。文中提供了关键的材料属性设置代码,如变压器油的密度和粘度随温度变化的关系表达式,并强调了网格划分、求解器配置以及后处理阶段需要注意的技术细节。此外,还分享了一些实用的经验和技巧,例如采用分离式步进求解策略、优化网格划分方式等,确保模型能够顺利收敛并获得精确的结果。最后,作者推荐了几种常用的湍流模型,并给出了具体的参数设置建议。 适用人群:从事电力系统设计、变压器制造及相关领域的工程师和技术人员,特别是那些希望深入了解COMSOL软件在复杂多物理场耦合计算方面应用的人群。 使用场景及目标:适用于需要对变压器内部温度分布和油流情况进行精确模拟的研究或工程项目。主要目的是提高仿真精度,使仿真结果更加贴近实际情况,从而指导产品设计和优化运行参数。 其他说明:文中不仅包含了详细的理论解释和技术指导,还提供了一些实际案例供读者参考。对于初学者来说,可以从简单的单相变压器开始练习,逐步掌握复杂的三相变压器建模技能。同时,作者提醒读者要注意单位的一致性和材料属性的准确性,这是避免许多常见错误的关键所在。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值