コード例 #1
0
ファイル: system_set.py プロジェクト: cygnushan/measurement
 def read_conf(self):
     ai518p_port = read_config(SYS_CONF_PATH, 'AI518P', 'port')
     self.com_518p.setCurrentIndex(int(ai518p_port[-1])-1)
     self.s48_port = read_config(SYS_CONF_PATH, 'HMTS48', 'port')
     self.com_flowmeter.setCurrentIndex(int(self.s48_port[-1])-1)
     pcb_port = read_config(SYS_CONF_PATH, 'PCB', 'port')
     self.com_pcb.setCurrentIndex(int(pcb_port[-1])-1)
     inst2400_port = Keithley2400.get_gpibport()
     if inst2400_port:
         self.com_2400.setItemText(0,inst2400_port)
     else:
         self.com_2400.setItemText(0,'NA')
     
     ai518p_baud = read_config(SYS_CONF_PATH, 'AI518P', 'baud')
     self.baud_518p.setCurrentIndex(int(ai518p_baud)/9600/2)
     s48_baud = read_config(SYS_CONF_PATH, 'HMTS48', 'baud')
     self.baud_flowmeter.setCurrentIndex(int(s48_baud)/9600/2)
     pcb_baud = read_config(SYS_CONF_PATH, 'PCB', 'baud')
     self.baud_pcb.setCurrentIndex(int(pcb_baud)/9600/2)
     
     self.addr_518p = self.ai518p_addr.currentIndex()+1
     self.addr_flowmeter = self.flowmeter_addr.currentIndex()+1
     
     flow1 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow1_range')
     self.range1.setCurrentIndex(flow_index[flow1])
     flow2 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow2_range')
     self.range2.setCurrentIndex(flow_index[flow2])
     flow3 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow3_range')
     self.range3.setCurrentIndex(flow_index[flow3])
     
     flow_addr = self.flowmeter_addr.currentIndex() + 1
     self.flowapi = C_S48(self.s48_port, flow_addr)
コード例 #2
0
    def read_conf(self):
        ai518p_port = read_config(SYS_CONF_PATH, 'AI518P', 'port')
        self.com_518p.setCurrentIndex(int(ai518p_port[-1]) - 1)
        self.s48_port = read_config(SYS_CONF_PATH, 'HMTS48', 'port')
        self.com_flowmeter.setCurrentIndex(int(self.s48_port[-1]) - 1)
        pcb_port = read_config(SYS_CONF_PATH, 'PCB', 'port')
        self.com_pcb.setCurrentIndex(int(pcb_port[-1]) - 1)
        inst2400_port = Keithley2400.get_gpibport()
        if inst2400_port:
            self.com_2400.setItemText(0, inst2400_port)
        else:
            self.com_2400.setItemText(0, 'NA')

        ai518p_baud = read_config(SYS_CONF_PATH, 'AI518P', 'baud')
        self.baud_518p.setCurrentIndex(int(ai518p_baud) / 9600 / 2)
        s48_baud = read_config(SYS_CONF_PATH, 'HMTS48', 'baud')
        self.baud_flowmeter.setCurrentIndex(int(s48_baud) / 9600 / 2)
        pcb_baud = read_config(SYS_CONF_PATH, 'PCB', 'baud')
        self.baud_pcb.setCurrentIndex(int(pcb_baud) / 9600 / 2)

        self.addr_518p = self.ai518p_addr.currentIndex() + 1
        self.addr_flowmeter = self.flowmeter_addr.currentIndex() + 1

        flow1 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow1_range')
        self.range1.setCurrentIndex(flow_index[flow1])
        flow2 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow2_range')
        self.range2.setCurrentIndex(flow_index[flow2])
        flow3 = read_config(SYS_CONF_PATH, 'HMTS48', 'flow3_range')
        self.range3.setCurrentIndex(flow_index[flow3])

        flow_addr = self.flowmeter_addr.currentIndex() + 1
        self.flowapi = C_S48(self.s48_port, flow_addr)
コード例 #3
0
ファイル: VI_main.py プロジェクト: cygnushan/measurement
 def on_VI_XY_set_clicked(self):
     """
     Slot documentation goes here.
     """
     # TODO: not implemented yet
     disp_coord()
     if qmdz_const.Auto_Range == 0:
         xmin = int(read_config(qmdz_const.SYS_CONF_PATH, 'COORD', 'x_min'))
         xmax = int(read_config(qmdz_const.SYS_CONF_PATH, 'COORD', 'x_max'))
         ymin = int(read_config(qmdz_const.SYS_CONF_PATH, 'COORD', 'y_min'))
         ymax = int(read_config(qmdz_const.SYS_CONF_PATH, 'COORD', 'y_max'))
         self.VI_MPL.change_xy(xmin, xmax, ymin, ymax)
コード例 #4
0
 def on_GAS_SET_clicked(self):
     """
     Slot documentation goes here.
     """
     # TODO: not implemented yet
     dispSC_gas()
     self.res_offset = int(read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'res_offset'))
     self.res_hold = int(read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'res_hold'))
     self.t_resp = int(read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'response')) 
     self.t_recy = int(read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'recovery')) 
     self.measure_times = int(read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'repeat'))
     print self.measure_times
コード例 #5
0
ファイル: VI_main.py プロジェクト: cygnushan/measurement
 def on_VI_2400_set_clicked(self):
     """
     Slot documentation goes here.
     """
     # TODO: not implemented yet
     dispVI_2400()
     print "VI:",qmdz_const.VI_ILIST
     print "IV:",qmdz_const.IV_VLIST
     # 通电压测电流   IV 
     self.vrange = read_config(qmdz_const.VI_CONF_PATH, 'INST', 'iv_stop')
     vi_range_index = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'iv_range'))
     self.ilimit = qmdz_const.irange_dict[vi_range_index]
     iv_unit = read_config(qmdz_const.VI_CONF_PATH, 'INST', 'iv_unit')
     if iv_unit == '0':
         self.vrange = self.vrange + "e-3"
     # 通电流测电压 VI
     self.irange = read_config(qmdz_const.VI_CONF_PATH, 'INST', 'vi_stop')
     iv_range_index = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'vi_range'))
     self.vlimit = qmdz_const.vrange_dict[iv_range_index]
     vi_unit = read_config(qmdz_const.VI_CONF_PATH, 'INST', 'vi_unit')
     if vi_unit == '0':
         self.irange = self.irange + "e-6"
     if vi_unit == '1':
         self.irange = self.irange + "e-3"
         
     if self.vimode:    
         self.loops = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'vi_loop'))
     else:
         self.loops = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'iv_loop'))
コード例 #6
0
    def get_sys_state(self):
        
        if Valve_Ctrl.get_pcb_state():
            self.pcb_sta.setPixmap(QtGui.QPixmap(":/icon/icons/dlb.png"))
        else:
            QtGui.QMessageBox.warning(self, u'警告', u"电路板未连接!")
            logger.warning("PCB isn't connected!")
            self.pcb_sta.setPixmap(QtGui.QPixmap(":/icon/icons/nodlb.png"))
        
        self.temprature = ai518p_api.get_now_temp()
        if self.temprature != "":
            self.now_T.setText(str(self.temprature))
            self.ai518_sta.setPixmap(QtGui.QPixmap(":/icon/icons/wky.png"))
        else:
            QtGui.QMessageBox.warning(self, u'警告', u"温控仪未连接!")
            logger.warning("AI518P isn't connected!")
            self.ai518_sta.setPixmap(QtGui.QPixmap(":/icon/icons/nowky.png"))
            
        instState = Keithley2400.conncet_inst()
        if instState:
            self.inst_sta.setPixmap(QtGui.QPixmap(":/icon/icons/yb.png"))     
        else:
            QtGui.QMessageBox.warning(self, u'警告', u"仪表2400未连接!")
            logger.warning("2400 isn't connected!")
            self.inst_sta.setPixmap(QtGui.QPixmap(":/icon/icons/noyb.png"))  
            
        self.flow_port = read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'port') 
        self.flow1_addr =  read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow1_addr')
        self.flow1_range =  int(read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow1_range'))
        self.flow2_addr =  read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow2_addr')
        self.flow2_range = int(read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow2_range'))
        self.flow3_addr =  read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow3_addr') 
        self.flow3_range =  int(read_config(qmdz_const.SYS_CONF_PATH, 'HMTS48', 'flow3_range')) 
 
        qmdz_const.measure_times = int(read_config(qmdz_const.SYS_CONF_PATH, 'AI518P', 'meas_times'))
コード例 #7
0
ファイル: VI_main.py プロジェクト: cygnushan/measurement
 def coord_init(self):
     if qmdz_const.Auto_Range:
         if self.vimode:
             xmin = min(map(float, qmdz_const.VI_ILIST))*2
             xmax = max(map(float, qmdz_const.VI_ILIST))*2
             ymin = xmin*float(self.resistance)
             ymax = xmax*float(self.resistance)
             print xmin,xmax,ymin,ymax
             self.VI_MPL.change_xy(xmin, xmax, ymin, ymax)
             self.loops = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'vi_loop'))
         else:
             xmin = min(map(float, qmdz_const.IV_VLIST))*2
             xmax = max(map(float, qmdz_const.IV_VLIST))*2
             ymin = xmin/float(self.resistance)
             ymax = xmax/float(self.resistance)
             self.VI_MPL.change_xy(xmin, xmax, ymin, ymax)
             self.loops = int(read_config(qmdz_const.VI_CONF_PATH, 'INST', 'iv_loop'))
コード例 #8
0
 def get_inst_conf(self):
     self.meas_type = int(read_config(qmdz_const.ST_CONF_PATH, 'INST', 'meas_mode'))
     self.vi_mode = int(read_config(qmdz_const.ST_CONF_PATH, 'INST', 'vi_mode'))
     self.src_vol = read_config(qmdz_const.ST_CONF_PATH, 'INST', 'iv_voltage')
     self.iv_unit = read_config(qmdz_const.ST_CONF_PATH, 'INST', 'iv_unit')
     self.ilimit = qmdz_const.irange_dict[int(read_config(qmdz_const.ST_CONF_PATH, 'INST', 'iv_range'))]
     
     self.src_curr = read_config(qmdz_const.ST_CONF_PATH, 'INST', 'vi_current') 
     self.vi_unit = read_config(qmdz_const.ST_CONF_PATH, 'INST', 'vi_unit')
     self.vlimit = qmdz_const.vrange_dict[int(read_config(qmdz_const.ST_CONF_PATH, 'INST', 'vi_range'))]
     
     if self.iv_unit == '0':
         self.src_vol = self.src_vol + 'e-3'
     if self.vi_unit == '0':
         self.src_curr = self.src_curr + 'e-6'
     elif self.vi_unit == '1':
         self.src_curr = self.src_curr + 'e-3'
     print self.vi_mode,self.src_vol,self.ilimit
     print "vi:",self.src_curr,self.vlimit
コード例 #9
0
 def get_gas_conf(self):
     self.res_offset = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'res_offset'))
     self.res_hold = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'res_hold'))
     
     self.t1 = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't1')) 
     self.t2 = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't2')) 
     self.t3 = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't3')) 
     self.t4 = int(read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't4')) 
     logger.info("GAS SET PARA:%d %d %d %d %d" % (qmdz_const.ST_GAS_MODE,self.t1,self.t2,self.t3,self.t4))
   
     if self.RT_test==0 and qmdz_const.t1_gas == []:
         QtGui.QMessageBox.warning(self,u'警告', u'请先设置气体参数!')
         return False
     
     return True
コード例 #10
0
ENABLE_PWD = 57

REG_DICT = {
    0: REG_CLOSE,
    1: REG_CONTROL,
    2: REG_CLEN,
    3: REG_STA,
    4: REG_AUTOZERO,
    5: REG_UNIT,
    6: REG_DISPFLOW,
    7: REG_SETFLOW,
    8: REG_FLOW_RANGE,
    9: REG_OFFSET
}

BAUD = read_config(SYS_CONF_PATH, 'HMTS48', 'baud')


class C_S48():
    def __init__(self, port, addr):

        self.port = port
        self.addr = int(addr)
        minimalmodbus.BAUDRATE = BAUD
        minimalmodbus.CLOSE_PORT_AFTER_EACH_CALL = True

    def comm_connect(self):
        try:
            self.S48 = minimalmodbus.Instrument(self.port, self.addr)
            return True
        except:
コード例 #11
0
    def xls_write(self):
        self.xls = xlwt.Workbook(encoding='utf-8')
        self.tab_conf = self.xls.add_sheet(u'配置信息',cell_overwrite_ok=True)
        self.tab_conf.write(0,0,"[试验信息]")
        self.tab_conf.write(1,0,"试验时间:")
        self.tab_conf.write(1,1,time.ctime())
        self.tab_conf.write(2,0,"样品名称:")
        self.tab_conf.write(2,1,str(self.sample_id.text()))
        self.tab_conf.write(3,0,"样品面积:")
        self.tab_conf.write(3,1,str(self.sample_area.text()))
        self.tab_conf.write(4,0,"样品厚度:")
        self.tab_conf.write(4,1,str(self.sample_height.text()))
        self.tab_conf.write(5,0,"温度测量点:")
        self.tab_conf.write(5,1,str(qmdz_const.temp_list))
        self.tab_conf.write(6,0,"[2400配置]")
        self.tab_conf.write(7,0,"测量模式:")
        if self.meas_type == 0:
            self.tab_conf.write(7,1,"二线制")
        else:
            self.tab_conf.write(7,1,"四线制")
        self.tab_conf.write(8,0,"激励电流(A)")
        if self.vi_mode==1:
            self.tab_conf.write(8,1,self.src_curr)
        self.tab_conf.write(9,0,"激励电压(V)")
        if self.vi_mode==0:
            self.tab_conf.write(9,1,self.src_vol)
        self.tab_conf.write(10,0,"[气压配置]")
        self.tab_conf.write(11,0,"工作模式:")
        if qmdz_const.ST_GAS_MODE:
            self.tab_conf.write(11,1,"手动")
        else:
            self.tab_conf.write(11,1,"自动")

        self.tab_conf.write(13,0,"时间(S)")
        self.tab_conf.write(14,0,"流量计1(mL/min)")
        self.tab_conf.write(15,0,"流量计2(mL/min)")
        self.tab_conf.write(16,0,"流量计3(mL/min)")
        self.tab_conf.write(17,0,"空气泵(L/min)")
        if qmdz_const.ST_GAS_MODE:
            self.tab_conf.write(12,1,"响应前期")
            self.tab_conf.write(12,2,"响应后期")
            self.tab_conf.write(12,3,"恢复前期")
            self.tab_conf.write(12,4,"恢复后期")
            self.tab_conf.write(13,1,str(self.t1))
            self.tab_conf.write(14, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't1_flow1_val'))
            self.tab_conf.write(15, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't1_flow2_val'))
            self.tab_conf.write(16, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't1_flow3_val'))
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't1_air')=='1':
                self.tab_conf.write(17,1,"10")
            else:
                self.tab_conf.write(17,1,"0")
            
            self.tab_conf.write(13,2,str(self.t2))
            self.tab_conf.write(14, 2,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't2_flow1_val'))
            self.tab_conf.write(15, 2,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't2_flow2_val'))
            self.tab_conf.write(16, 2,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't2_flow3_val'))
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't2_air')=='1':
                self.tab_conf.write(17,2,"10")
            else:
                self.tab_conf.write(17,2,"0")  
                      
            self.tab_conf.write(13,3,str(self.t3))
            self.tab_conf.write(14, 3,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't3_flow1_val'))
            self.tab_conf.write(15, 3,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't3_flow2_val'))
            self.tab_conf.write(16, 3,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't3_flow3_val'))
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't3_air')=='1':
                self.tab_conf.write(17,3,"10")
            else:
                self.tab_conf.write(17,3,"0")
                
            self.tab_conf.write(13,4,str(self.t4))
            self.tab_conf.write(14, 4,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't4_flow1_val'))
            self.tab_conf.write(15, 4,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't4_flow2_val'))
            self.tab_conf.write(16, 4,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't4_flow3_val'))
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 't4_air')=='1':
                self.tab_conf.write(17,4,"10")
            else:
                self.tab_conf.write(17,4,"0")
        else:
            self.tab_conf.write(12, 1, "响应时期")
            self.tab_conf.write(17, 1, '0') 
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow1')=='2':
                self.tab_conf.write(14, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow1_val'))
            else:
                self.tab_conf.write(14, 1, '0')
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow2')=='2':
                self.tab_conf.write(15, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow2_val'))
            else:
                self.tab_conf.write(15, 1, '0')
            if read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow3')=='2':
                self.tab_conf.write(16, 1,
                    read_config(qmdz_const.ST_CONF_PATH, 'GAS', 'flow3_val'))
            else:
                self.tab_conf.write(16, 1, '0')                
                
            self.tab_conf.write(12,2,"恢复时期")
            self.tab_conf.write(14, 2, '0')
            self.tab_conf.write(15, 2, '0')
            self.tab_conf.write(16, 2, '0')
            self.tab_conf.write(17, 2, '10')
            self.tab_conf.write(13, 1, str(self.resp_time))
            self.tab_conf.write(13, 2, str(self.resp_time))
      
        self.tab_Rt = self.xls.add_sheet(u'R-time曲线',cell_overwrite_ok=True)
        self.tab_RT = self.xls.add_sheet(u'R-Temp曲线',cell_overwrite_ok=True)
        self.tab_ST = self.xls.add_sheet(u'S-Temp曲线',cell_overwrite_ok=True)
        

        if len(qmdz_const.temp_list) > 0:
            self.tab_RT.write(0,0,u'温度(℃)')
            self.tab_ST.write(0,0,u'温度(℃)')
            self.tab_ST.write(0,1,u'灵敏度')
            # 未测完保存有问题
            for i in range(0, len(qmdz_const.temp_list)):
                self.tab_RT.write(0,i+1,str(qmdz_const.temp_list[i])+'℃')
                self.tab_RT.write(1,i+1,u'电阻(Ω)')
                self.tab_ST.write(i+1,0,str(qmdz_const.temp_list[i])+'℃')
                self.tab_ST.write(i+1,1,self.dataS[i])
            x_row = 1
            for data in self.dataX[0]:
                x_row += 1
                self.tab_RT.write(x_row, 0, data)

            y_row = 1
            y_colum = 1
            for data_list in self.dataY:
                for data in data_list:
                    y_row += 1
                    self.tab_RT.write(y_row, y_colum, data)
                y_row = 1
                y_colum += 1

        else:
            self.tab_Rt.write(0,0,u'温度(℃)')
            self.tab_Rt.write(1,0,u'时间(S)')
            self.tab_Rt.write(1,1,u'电阻(Ω)')
            self.tab_Rt.write(0,1,str(self.temprature) + u'℃')
            
            x_row = 1
            for data in self.dataX[0]:
                x_row += 1
                self.tab_Rt.write(x_row, 0, data)

            y_row = 1
            for data in self.dataY[0]:
                y_row += 1
                self.tab_Rt.write(y_row, 1, data)
                

        self.style = xlwt.XFStyle
        self.font = xlwt.Font
        self.font.name = 'SimSun'
        self.style.font = self.font
コード例 #12
0
ファイル: valve_ctrl.py プロジェクト: cygnushan/measurement
# -*- coding: utf-8 -*-
'''
Created on 2015

@author: Administrator
'''

import serial,time
import qmdz_const
from mylog import logger
from init_op import read_config

PORT = read_config(qmdz_const.SYS_CONF_PATH, 'PCB', 'port')
BAUD = read_config(qmdz_const.SYS_CONF_PATH, 'PCB', 'baud')

class C_Valve():
    
    def __init__(self, port, baud):
        
        self.baud = baud
        try:
            self.pcb = serial.Serial(port, baud, timeout=1)
        except:
            print "open pcb comm port %s failed!" % port
            
    def connect(self, port):
        try:
            self.pcb = serial.Serial(port, self.baud, timeout=1)
        except:
            print "open pcb comm port %s failed!" % port  
    
コード例 #13
0
    def xls_write(self):
        self.xls = xlwt.Workbook(encoding='utf-8')
        self.tab_conf = self.xls.add_sheet(u'配置信息',cell_overwrite_ok=True)
        self.tab_conf.write(0,0,"[试验信息]")
        self.tab_conf.write(1,0,"试验时间:")
        self.tab_conf.write(1,1,time.ctime())
        self.tab_conf.write(2,0,"样品名称:")
        self.tab_conf.write(2,1,str(self.sample_id.text()))
        self.tab_conf.write(3,0,"样品面积:")
        self.tab_conf.write(3,1,str(self.sample_area.text()))
        self.tab_conf.write(4,0,"样品厚度:")
        self.tab_conf.write(4,1,str(self.sample_height.text()))
        self.tab_conf.write(5,0,"温度测量点:")
        self.tab_conf.write(5,1,str(qmdz_const.temp_list))
        self.tab_conf.write(6,0,"[2400配置]")
        self.tab_conf.write(7,0,"测量模式:")
        if self.meas_type:
            self.tab_conf.write(7,1,"二线制")
        else:
            self.tab_conf.write(7,1,"四线制")
        self.tab_conf.write(8,0,"激励电流(A)")
        if self.vi_mode==1:
            self.tab_conf.write(8,1,self.src_curr)
        self.tab_conf.write(9,0,"激励电压(V)")
        if self.vi_mode==0:
            self.tab_conf.write(9,1,self.src_vol)
        self.tab_conf.write(10,0,"[气压配置]")
        self.tab_conf.write(11,0,"总流量(mL)")
        self.tab_conf.write(12,0,"流量计1(mL/min)")
        if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow1')=='0':
            self.tab_conf.write(12,1,"0")
        else:
            if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow1_change')=='0':
                self.tab_conf.write(12, 1,
                    read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow1_val'))
            elif read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow1_change')=='1':
                self.tab_conf.write(12, 1,"10%-90%")
            else:
                self.tab_conf.write(12, 1,"90%-10%")
                
        self.tab_conf.write(13,0,"流量计2(mL/min)")
        if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow2')=='0':
            self.tab_conf.write(13,1,"0")
        else:
            if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow2_change')=='0':
                self.tab_conf.write(13, 1,
                    read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow2_val'))
            elif read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow2_change')=='1':
                self.tab_conf.write(13, 1,"10%-90%")
            else:
                self.tab_conf.write(13, 1,"90%-10%")
                
        self.tab_conf.write(14,0,"流量计3(mL/min)")
        if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow3')=='0':
            self.tab_conf.write(14,1,"0")
        else:
            if read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow3_change')=='0':
                self.tab_conf.write(14, 1,
                    read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow3_val'))
            elif read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'flow3_change')=='1':
                self.tab_conf.write(14, 1,"10%-90%")
            else:
                self.tab_conf.write(14, 1,"90%-10%")
        
        self.tab_conf.write(15,0,"电阻偏差范围(Ω)")
        self.tab_conf.write(15, 1,
            read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'res_offset'))
        self.tab_conf.write(16,0,"电阻温度时间(S)")
        self.tab_conf.write(16, 1,
            read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'res_hold'))
        self.tab_conf.write(17,0,"响应时间(S)")
        self.tab_conf.write(17, 1,
            read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'response'))
        self.tab_conf.write(18,0,"恢复时间(S)")
        self.tab_conf.write(18, 1,
            read_config(qmdz_const.SC_CONF_PATH, 'GAS', 'recovery'))
      
        self.tab_Rt = self.xls.add_sheet(u'R-t曲线',cell_overwrite_ok=True)
        self.tab_SC = self.xls.add_sheet(u'S-C曲线',cell_overwrite_ok=True)
        
        self.tab_Rt.write(0,0,u'温度(℃)')
        self.tab_Rt.write(0,1,str(self.temprature) + u'℃')
        self.tab_Rt.write(1,0,u'浓度')
        self.tab_Rt.write(2,0,u'时间(S)')
        for i in xrange(1,len(self.dataY)+1):
            self.tab_Rt.write(1,i,'C'+str(i)) 
            self.tab_Rt.write(2,i,u'电阻(Ω)')
            y_row = 2
            for data in self.dataY[i-1]:
                y_row += 1
                self.tab_Rt.write(y_row, i, str(data))
        
        x_row = 2
        for data in self.dataX[0]:
            x_row += 1
            self.tab_Rt.write(x_row, 0, data)
            
        
        self.tab_SC.write(0, 0, u'浓度')
        self.tab_SC.write(0, 1, u'灵敏度')
        if len(self.dataY)==9:
            for i in xrange(0,9):
                self.tab_SC.write(i+1, 0, self.dataC[i])
                self.tab_SC.write(i+1, 1, self.dataS[i])
        else:    
            for i in xrange(0,len(self.dataY)-1):
                self.tab_SC.write(i+1, 0, self.dataC[i])
                self.tab_SC.write(i+1, 1, self.dataS[i])

        self.style = xlwt.XFStyle
        self.font = xlwt.Font
        self.font.name = 'SimSun'
        self.style.font = self.font
コード例 #14
0
ファイル: coordinate.py プロジェクト: cygnushan/measurement
def get_value(key):
    key_value = read_config(qmdz_const.SYS_CONF_PATH, 'COORD', key)
    return key_value
コード例 #15
0
ファイル: AI518P.py プロジェクト: cygnushan/measurement
# -*- coding: utf-8 -*-
'''
Created on 2015-6-1

@author: Administrator
'''
import serial 
import struct
from mylog import logger
from init_op import read_config
from qmdz_const import SYS_CONF_PATH

ADDR = read_config(SYS_CONF_PATH, 'AI518P', 'addr')
PORT = read_config(SYS_CONF_PATH, 'AI518P', 'port')
BAUD = read_config(SYS_CONF_PATH, 'AI518P', 'baud')

para_dict = {'SteP'  : 0x00,
             'HIAL': 0x01,
             'LoAL': 0x02,
             'HdAL': 0x03,
             'LdAL': 0x04,
             'AHYS': 0x05,
             'CtrL': 0x06,
             'M5': 0x07,
             'P': 0x08,
             't': 0x09,
             'CtI': 0x0A,
             'InP': 0x0B,
             'dPt': 0x0C,
             'SCL': 0x0D,
             'SCH': 0x0E,
コード例 #16
0
def get_range(key):
    key_value = read_config(SYS_CONF_PATH, 'HMTS48', key)
    return key_value
コード例 #17
0
ファイル: AI518P.py プロジェクト: cygnushan/measurement
# -*- coding: utf-8 -*-
'''
Created on 2015-6-1

@author: Administrator
'''
import serial
import struct
from mylog import logger
from init_op import read_config
from qmdz_const import SYS_CONF_PATH

ADDR = read_config(SYS_CONF_PATH, 'AI518P', 'addr')
PORT = read_config(SYS_CONF_PATH, 'AI518P', 'port')
BAUD = read_config(SYS_CONF_PATH, 'AI518P', 'baud')

para_dict = {
    'SteP': 0x00,
    'HIAL': 0x01,
    'LoAL': 0x02,
    'HdAL': 0x03,
    'LdAL': 0x04,
    'AHYS': 0x05,
    'CtrL': 0x06,
    'M5': 0x07,
    'P': 0x08,
    't': 0x09,
    'CtI': 0x0A,
    'InP': 0x0B,
    'dPt': 0x0C,
    'SCL': 0x0D,
コード例 #18
0
ファイル: valve_ctrl.py プロジェクト: cygnushan/measurement
# -*- coding: utf-8 -*-
'''
Created on 2015

@author: Administrator
'''

import serial, time
import qmdz_const
from mylog import logger
from init_op import read_config

PORT = read_config(qmdz_const.SYS_CONF_PATH, 'PCB', 'port')
BAUD = read_config(qmdz_const.SYS_CONF_PATH, 'PCB', 'baud')


class C_Valve():
    def __init__(self, port, baud):

        self.baud = baud
        try:
            self.pcb = serial.Serial(port, baud, timeout=1)
        except:
            print "open pcb comm port %s failed!" % port

    def connect(self, port):
        try:
            self.pcb = serial.Serial(port, self.baud, timeout=1)
        except:
            print "open pcb comm port %s failed!" % port
コード例 #19
0
ファイル: ST_2400.py プロジェクト: cygnushan/measurement
def get_value(key):
    key_value = read_config(qmdz_const.ST_CONF_PATH, 'INST', key)
    return key_value
コード例 #20
0
def get_value(key):
    key_value = read_config(qmdz_const.SYS_CONF_PATH, 'AI518P', key)
    return key_value
コード例 #21
0
ファイル: VI_gas_set.py プロジェクト: cygnushan/measurement
def get_value(key):
    key_value = read_config(VI_CONF_PATH, 'GAS', key)
    return key_value
コード例 #22
0
ファイル: qmdz_const.py プロジェクト: cygnushan/measurement
def get_range(key):
    key_value = read_config(SYS_CONF_PATH, 'HMTS48', key)
    return key_value
コード例 #23
0
ファイル: VI_gas_set.py プロジェクト: cygnushan/measurement
def get_value(key):
    key_value = read_config(VI_CONF_PATH, 'GAS', key)
    return key_value