~ubuntu-branches/ubuntu/natty/electric/natty

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/simulation/test/T2500.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.sun.electric.tool.simulation.test;
 
2
 
 
3
/**
 
4
 * Created by IntelliJ IDEA.
 
5
 * User: hf198446
 
6
 * Date: Feb 22, 2008
 
7
 * Time: 1:18:00 PM
 
8
 * To change this template use File | Settings | File Templates.
 
9
 */
 
10
public class T2500 extends Equipment {
 
11
    
 
12
    /** Creates a new instance of T2500 */
 
13
    public T2500 (String name) {
 
14
        super(name);
 
15
        logInit("Initialized T2500 Temperature Forcer named " + name);
 
16
    }
 
17
 
 
18
    /**
 
19
     * Queries the T2500 device to obtain the air flow temperature.
 
20
     * @return Returns the current temperature of the air inside the thermal mixture, in Degrees Celsius
 
21
     */
 
22
    public float getAirTemp() {
 
23
        write("AIRTEMP?");
 
24
        String [] s = read(40).split(" ");
 
25
        return Float.parseFloat(s[0]);
 
26
    }
 
27
 
 
28
    /**
 
29
     * Queries the T2500 device to obtain the device under test temperature.
 
30
     * @return Returns the current temperatur of the device under test, in Degrees Celsius
 
31
     */
 
32
    public float getDeviceTemp() {
 
33
        write("DUTTEMP?");
 
34
        String [] s = read(40).split(" ");
 
35
        return Float.parseFloat(s[0]);
 
36
    }
 
37
 
 
38
    /**
 
39
     * Queries the T2500 device to obtain the soak time.
 
40
     * @return Returns the soak time (values from 0-9999 seconds)
 
41
     */
 
42
    public float getSoakTime() {
 
43
        write("SOAKTIME?");
 
44
        String [] s = read(40).split(" ");
 
45
        return Float.parseFloat(s[0]);
 
46
    }
 
47
 
 
48
    /**
 
49
     * Queries the T2500 device to obtain the current setpoint.
 
50
     * @return Returns the current setpoint (values from -99.9C to 230C)
 
51
     */
 
52
    public float getSetpoint() {
 
53
        write("SETPOINT?");
 
54
        String [] s = read(40).split(" ");
 
55
        return Float.parseFloat(s[0]);
 
56
    }
 
57
 
 
58
    /**
 
59
     * Queiries the T2500 for its current status.
 
60
     * @return Returns the current state of the T2500 (values from 0 - 255)
 
61
     */
 
62
    public float getStatus() {
 
63
        write("TESR?");
 
64
        String [] s = read(40).split(" ");
 
65
        return Float.parseFloat(s[0]);
 
66
    }
 
67
 
 
68
    /**
 
69
     * Queiries the T2500 for its current head position.
 
70
     * @return Returns false if head is down, true if head is up.
 
71
     */
 
72
    public boolean getHeadState() {
 
73
        write("HEAD?");
 
74
        String [] s = read(40).split(" ");
 
75
        return Boolean.valueOf(s[0]).booleanValue();
 
76
        //return read(40);
 
77
    }
 
78
 
 
79
    /**
 
80
     * Brings the head of the T2500 down.
 
81
     * @param state If true, head goes down, otherwise head comes up.
 
82
     */
 
83
    public void headDown(boolean state) {
 
84
        if (state) {write("HEAD 0");}
 
85
        else { write("HEAD 1"); }
 
86
    }
 
87
 
 
88
    /**
 
89
     * Queiries the T2500 for its current compressor state.
 
90
     * @return Returns false if compressor off, true if compressor on.
 
91
     */
 
92
    public boolean getCompressorState() {
 
93
        write("COMP?");
 
94
        String [] s = read(40).split(" ");
 
95
        return Boolean.valueOf(s[0]).booleanValue();
 
96
    }
 
97
 
 
98
    /**
 
99
     * Turn the compressor of the T2500 on or off.
 
100
     * @param state If state is true, compressor will turn on, else compressor will turn off
 
101
     */
 
102
    public void setCompressorState(boolean state) {
 
103
        if (state){ write("COMP 1"); }
 
104
        else { write("COMP 0"); }
 
105
    }
 
106
 
 
107
    /**
 
108
     * Sets one of five available temperature presets for manual control.
 
109
     * @param presetNum Preset Number, 1-5
 
110
     * @param value Temperature, -99.9C to 230C
 
111
     */
 
112
    public void setTemp (int presetNum, float value){
 
113
        write("TEMP" + presetNum + " " + value);
 
114
    }
 
115
 
 
116
    /**
 
117
     * Gets the specified temperature preset
 
118
     * @param presetNum Preset Number, 1-5
 
119
     * @return Returns the set temperature of the specified preset
 
120
     */
 
121
    public float getTemp (int presetNum){
 
122
        write ("TEMP"+presetNum+"?");
 
123
        String [] s = read(40).split(" ");
 
124
        return Float.parseFloat(s[0]);
 
125
    }
 
126
 
 
127
    /**
 
128
     * Activates one of the temperature presets that has been already set up on the manual control screen or through GPIB.
 
129
     * @param presetNum preset temperature number, 1-5
 
130
     */
 
131
    public void goTemp (int presetNum){
 
132
        write("GOTEMP" + presetNum);
 
133
    }
 
134
 
 
135
    /**
 
136
     * Sets the soak time for one of the temperature presets
 
137
     * @param presetNum Preset Number, 1-5
 
138
     * @param soakTime Amount of time to soak device in set temperature, 0-9999 seconds
 
139
     */
 
140
    public void setSoakTime (int presetNum, float soakTime){
 
141
        write("SOAK" + presetNum + " " + soakTime);
 
142
    }
 
143
 
 
144
    /**
 
145
     * Queries the T2500 for the soak time of supplied preset number
 
146
     * @param presetNum Preset number, 1-5
 
147
     * @return Returns soak time for supplied preset number
 
148
     */
 
149
    public float getSoakTime (int presetNum){
 
150
        write ("SOAK"+presetNum+"?");
 
151
        String [] s = read(40).split(" ");
 
152
        return Float.parseFloat(s[0]);
 
153
    }
 
154
 
 
155
    /**
 
156
     * Turns the air and the heaters in the thermal mixutre off.
 
157
     */
 
158
    public void airOff (){
 
159
        write("AIROFF");
 
160
    }
 
161
 
 
162
    /**
 
163
     * Sets the type of cold air functioning of the cold-boost feaure
 
164
     * @param level 0 = no boost, normal air functioning; 1 = Air, causing the cold air regulator to be bypassed,
 
165
     * allowing un-regulated cold air to flow; 2 = LN2, activates use of liquid nitrogen if the option is installed
 
166
     */
 
167
    public void setBoost (int level){
 
168
            write("BOOST "+level);
 
169
    }
 
170
 
 
171
    /**
 
172
     * This method returns the boost level
 
173
     * @return 0 = no boost, normal air functioning; 1 = Air, causing the cold air regulator to be bypassed,
 
174
     * allowing un-regulated cold air to flow; 2 = LN2, activates use of liquid nitrogen if the option is installed
 
175
     */
 
176
    public float getBoostLevel (){
 
177
        write ("BOOST?");
 
178
        String [] s = read(40).split(" ");
 
179
        return Float.parseFloat(s[0]);
 
180
    }
 
181
 
 
182
    /**
 
183
     * Sets the flow rate of the cold air.
 
184
     * @param value Valid values range from 100 - 999 SCFH (Cubic Feet per Hour at Standard Conditions)
 
185
     */
 
186
    public void setColdFlow (int value){
 
187
            write("COLDFLOW "+value);
 
188
    }
 
189
 
 
190
    /**
 
191
     * Gets the flow rate of the cold air.
 
192
     * @return Valid values range from 100 - 999 SCFH (Cubic Feet per Hour at Standard Conditions)
 
193
     */
 
194
    public float getColdFlow (){
 
195
        write ("COLDFLOW?");
 
196
        String [] s = read(40).split(" ");
 
197
        return Float.parseFloat(s[0]);
 
198
    }
 
199
 
 
200
    /**
 
201
     * Sets the flow rate of the hot air.
 
202
     * @param value Valid values range from 100 - 999 SCFH (Cubic Feet per Hour at Standard Conditions)
 
203
     */
 
204
    public void setHotFlow (int value){
 
205
            write("HOTFLOW "+value);
 
206
    }
 
207
 
 
208
    /**
 
209
     * Gets the flow rate of the hot air.
 
210
     * @return Valid values range from 100 - 999 SCFH (Cubic Feet per Hour at Standard Conditions)
 
211
     */
 
212
    public float getHotFlow (){
 
213
        write ("HOTFLOW?");
 
214
        String [] s = read(40).split(" ");
 
215
        return Float.parseFloat(s[0]);
 
216
    }
 
217
 
 
218
    /**
 
219
     * Turns temperature ramping on or off. Must be on for value set by RAMPRATE to function.
 
220
     * @param state if true, ramp = on, else ramp = off
 
221
     */
 
222
    public void setRampState (boolean state){
 
223
        if (state) {write("RAMP 1");}
 
224
        else { write("RAMP 0"); }
 
225
    }
 
226
 
 
227
    /**
 
228
     * @return Returns true if RAMP is enabled, false if RAMP is disabled
 
229
     */
 
230
    public boolean getRampState() {
 
231
            write("RAMP?");
 
232
            String [] s = read(40).split(" ");
 
233
            return Boolean.valueOf(s[0]).booleanValue();
 
234
        }
 
235
 
 
236
 
 
237
    /**
 
238
     * Determines ramprate, which is the number of degrees/minute the temperature setpoint will change when the ramp
 
239
     * feature has been activated. 
 
240
     * @param value Value of ramp rate, from 0 - 999 degrees/minute
 
241
     */
 
242
    public void setRampRate (int value){
 
243
        write("RAMPRATE "+value);
 
244
    }
 
245
 
 
246
    /**
 
247
     *
 
248
     * @return Returns the currently set up ramp rate value.
 
249
     */
 
250
    public float getRampRate (){
 
251
        write ("RAMPRATE?");
 
252
        String [] s = read(40).split(" ");
 
253
        return Float.parseFloat(s[0]);
 
254
    }
 
255
 
 
256
    /**
 
257
     * Determines the type (mode) of termperature sensing
 
258
     * @param value 0 = Fixture/air sense control; 1 = DUT sense control, K-type thermocouple; 2 = DUT sense control,
 
259
     * T-type thermocouple; 3 = RTD sensor control
 
260
     */
 
261
    public void setTempSensing (int value){
 
262
        write("TCONTROL "+value);
 
263
    }
 
264
 
 
265
    /**
 
266
     * Returns the type (mode) of temperature sensing
 
267
     * @return value 0 = Fixture/air sense control; 1 = DUT sense control, K-type thermocouple; 2 = DUT sense control,
 
268
     * T-type thermocouple; 3 = RTD sensor control
 
269
     */
 
270
    public float getTempSensingMode (){
 
271
        write ("TCONTROL?");
 
272
        String [] s = read(40).split(" ");
 
273
        return Float.parseFloat(s[0]);
 
274
    }
 
275
 
 
276
    /**
 
277
     * Sets the temperature resolution window around the setpoint at which the system is considered to be at temperature.
 
278
     * @param value temperature tolerance, 0.1 - 15.0 degrees
 
279
     */
 
280
    public void setTempTolerance (float value){
 
281
        write("TEMPTOL "+value);
 
282
    }
 
283
 
 
284
    /**
 
285
     * Returns the current temperature resolution window
 
286
     * @return Resolution, 0.1 - 15.0 degrees
 
287
     */
 
288
    public float getTempTol (){
 
289
        write ("TEMPTOL?");
 
290
        String [] s = read(40).split(" ");
 
291
        return Float.parseFloat(s[0]);
 
292
    }
 
293
 
 
294
    /**
 
295
     * Sets the minimum temperature of the cold air that the DUT is exposed to in DUT-sense
 
296
     * @param value Valid values range from -99 - 30.9
 
297
     */
 
298
    public void setMinTemp (float value){
 
299
            write("MINTEMP "+value);
 
300
    }
 
301
 
 
302
    /**
 
303
     * Returns the min temp of the cold air that the DUT is exposed to in DUT-sense
 
304
     * @return Min temp, -99 to 30.9
 
305
     */
 
306
    public float getMinTemp (){
 
307
        write ("MINTEMP?");
 
308
        String [] s = read(40).split(" ");
 
309
        return Float.parseFloat(s[0]);
 
310
    }
 
311
 
 
312
    /**
 
313
     * Sets the minimum temperature of the  of the hot air that the DUT is exposed to in DUT-sense
 
314
     * @param value Valid values range from 31.0 - 230.0
 
315
     */
 
316
    public void setMaxTemp (float value){
 
317
            write("MAXTEMP "+value);
 
318
    }
 
319
 
 
320
    /**
 
321
     * Returns the max temp of the hot air that the DUT is exposed to in DUT-sense
 
322
     * @return Max temp, 31.0 to 230.0
 
323
     */
 
324
    public float getMaxTemp (){
 
325
        write ("MAXTEMP?");
 
326
        String [] s = read(40).split(" ");
 
327
        return Float.parseFloat(s[0]);
 
328
    }
 
329
 
 
330
    public String test() {
 
331
           write("FLOW?");
 
332
           return read(40);
 
333
    }
 
334
 
 
335
        public float getFlow() {
 
336
                write("FLOW?");
 
337
                String [] s = read(40).split(" ");
 
338
        return Float.parseFloat(s[0]);
 
339
        }
 
340
 
 
341
    public static void main(String[] args) {
 
342
        int [] gpibController = new int[] {0};
 
343
        Infrastructure.gpibControllers = gpibController;
 
344
 
 
345
        T2500 DUT = new T2500("T2500");
 
346
        DUT.airOff();
 
347
 
 
348
 
 
349
 
 
350
 
 
351
 
 
352
        /*DUT.setTemp(2, 23);
 
353
 
 
354
        System.out.println("Air Temp: " + DUT.getAirTemp());
 
355
        System.out.println("Device Temp: " + DUT.getDeviceTemp());
 
356
        System.out.println("Soak Time: " + DUT.getSoakTime());
 
357
        System.out.println("Set Point: " + DUT.getSetpoint());
 
358
        System.out.println("Status: " + DUT.getStatus());
 
359
        System.out.println("Head State " + DUT.getHeadState());
 
360
        //DUT.headDown(false);
 
361
        //System.out.println("Head State " + DUT.getHeadState());
 
362
        //DUT.headDown(true);
 
363
        //System.out.println("Head State " + DUT.getHeadState());        
 
364
        //DUT.setCompressorState(true); //works
 
365
        System.out.println("Compressor State " + DUT.getCompressorState());   //check to make sure this is not backwards, doesnt seem to work
 
366
        System.out.println("Preset 2 temp: " + DUT.getTemp(2));
 
367
        //DUT.goTemp(2);
 
368
        DUT.setSoakTime (2, 120);
 
369
        System.out.println("Preset 2 soak time: " + DUT.getSoakTime (2));
 
370
        //DUT.airOff();
 
371
        DUT.setBoost(0);
 
372
        System.out.println("Boost level: " + DUT.getBoostLevel());
 
373
        DUT.setColdFlow(300);
 
374
        System.out.println("Cold flow level: " + DUT.getColdFlow());
 
375
        DUT.setHotFlow(300);
 
376
        System.out.println("Hot flow level: " + DUT.getHotFlow());
 
377
        DUT.setRampState(true);  //not working
 
378
        DUT.setRampRate(10);
 
379
        System.out.println("Ramp State: " + DUT.getRampState()); //may not be working b/c setRampState giving bad result
 
380
        System.out.println("Ramp Rate: " + DUT.getRampRate());
 
381
        DUT.setTempSensing(1);
 
382
        System.out.println("Temp Sensing Mode: " + DUT.getTempSensingMode());
 
383
        DUT.setTempTolerance(0.5f);
 
384
        System.out.println("Temp Tol: " + DUT.getTempTol());
 
385
 
 
386
        */
 
387
        DUT.setMaxTemp(150f);
 
388
        DUT.setMinTemp(-60f);
 
389
 
 
390
        System.out.println("Min Temp: " + DUT.getMinTemp());
 
391
        System.out.println("Max Temp: " + DUT.getMaxTemp());
 
392
        //TO DO: test
 
393
 
 
394
    }
 
395
}