Code review

Could someone review this code on a Mac or Windows 7 computer and tell me if you have any questions?

It is a JavaFX application written with eclipse and scene generator

The value that you enter in the PMRC field is a 1, and the small brown buttons are ToggleButton controls as is the male/female ToggleButton

Main class

the appCC package;

Import javafx.application.Application;

Import javafx.stage.Stage;

Import javafx.scene.Scene;

Import javafx.scene.layout.AnchorPane;

Import javafx.fxml.FXMLLoader;

public class CLRC extends Application {}

@Override

{} public void start (point primaryStage)

try {}

Root AnchorPane = FXMLLoader.load (getClass ().getResource("crcl.fxml")) (AnchorPane);

Scene = new Scene (root);

primaryStage.setScene (scene);

primaryStage.setTitle ("Calculator creatinine Clearance");

primaryStage.show ();

} catch (Exception e) {}

e.printStackTrace ();

}

}

Public Shared Sub main (String [] args) {}

Launch (args);

}

}

Controller class

the appCC package;

java.awt.Component import;

import java.net.URL;

import impossible;

import java.text.NumberFormat;

import java.util.ResourceBundle.

Import javax.swing.JOptionPane;

Import javafx.event.ActionEvent;

Import javafx.fxml.FXML;

Import javafx.fxml.Initializable;

Javafx.scene.control import. *;

/ public class CRCLController implements {bootable

@FXML

Private Label lblLBW;

@FXML

Private Label lblABW;

@FXML

Private Label lblTBW;

@FXML

private TextField txfAge;

@FXML

private TextField txfCI;

@FXML

private TextField txfKL;

@FXML

private TextField txfHt;

@FXML

private TextField txfWt;

@FXML

private TextField txfSC;

@FXML

tbnCI private ToggleButton;

@FXML

tbnKL private ToggleButton;

@FXML

tbnMF private ToggleButton;

@FXML

private Button btnClear;

@FXML

private Button btnCalc;

NumberFormat nf = new DecimalFormat("##.00");

private int Mals.

Private float vHtin;

Private float vHtcm;

Private float vWtlb;

Private float vWtkg;

private int vSex;

Private float vIBW;

private float TFPN; / / weight for IPN

Private float vSrCr;

Private float vCrCL; / / CLRC LBW

private float DAVL; / / weight for AdjBW

Private float vCrCA; / / CLRC ABW

Private float vCrCT; / / CLRC TBW

@FXML

Private Sub onCalc (ActionEvent ep) throws Exception {}

Test all TextFields

String regNum1 = (".") * [a - z A - Z]. * ») ;

String regNum2 = (".") * [a - z A - Z]. * ») ;

String regNum3 = (".") * [a - z A - Z]. * ») ;

String regNum4 = (".") * [a - z A - Z]. * ») ;

String W1 = String.valueOf (txfAge.getText () .trim ());

String W2 = String.valueOf (txfHt.getText () .trim ());

W3 string = String.valueOf (txfWt.getText () .trim ());

W4 channel = String.valueOf (txfSC.getText () .trim ());

NOTE the use of the. trim() < -.

If (W1.length () > 3

|| W1 is nothing

|| W1. IsEmpty()

|| W1. Matches (regNum1)

|| (W2.length () > 3 |) W2 == null | W2. IsEmpty() | W2

. Matches (regNum2))

|| (W3.length () > 3 |) W3 == null | W3. IsEmpty() | W3

. Matches (regNum3))

|| (W4.length (> 4) |) W4 == null | W4. IsEmpty() | W4

{.matches (regnum4)))}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2, "Entered Value Invalid",

'Information', JOptionPane.WARNING_MESSAGE);

If (W1.length () > 3 |) W1 == null | W1. IsEmpty()

|| {W1. Matches (regNum1))}

txfAge.setText("");

txfAge.requestFocus ();

return;

}

If (W2.length () > 3 |) W2 == null | W2. IsEmpty()

|| {W2. Matches (regNum2))}

txfHt.setText("");

txfHt.requestFocus ();

return;

}

If (W3.length () > 3 |) W3 == null | W3. IsEmpty()

|| {W3. Matches (regNum3))}

txfWt.setText("");

txfWt.requestFocus ();

return;

}

If (W4.length (> 4) |) W4 == null | W4. IsEmpty()

|| {W4. Matches (regNum4))}

txfSC.setText("");

txfSC.requestFocus ();

return;

}

}

Test range values of the data incorporated in TextFields

// ================================================

int Age = Integer.parseInt (txfAge.getText () .trim ());

If (age < = 11 |) Age > 110) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

"Age group 12 to 110 year', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfAge.setText("");

txfAge.requestFocus ();

return;

}

If (! tbnCI.isSelected ()) {/ /!} Selected NOT Ht in cm rated

float Ht = Float.parseFloat (txfHt.getText () .trim ());

If (Ht 130 < |) HT > 213) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

'Beach 130 cm to 213 cm in height', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfHt.setText("");

txfHt.requestFocus ();

return;

}

}

If (tbnCI.isSelected ()) {}

float Ht = Float.parseFloat (txfHt.getText () .trim ());

If (Ht < 51 |) HT > 83) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

"Adjustable height 51 to 83 in ', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfHt.setText("");

txfHt.requestFocus ();

return;

}

}

If (! tbnKL.isSelected ()) {/ /!} Selected NOT Wt in kg rated

float Wt = Float.parseFloat (txfWt.getText () .trim ());

If (Wt < 30 |) WT > 136) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

"Weight range 30 kg, 136 kg', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfWt.setText("");

txfWt.requestFocus ();

return;

}

}

If (tbnKL.isSelected ()) {}

float Wt = Float.parseFloat (txfWt.getText () .trim ());

If (Wt < 66 |) WT > 300) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

'Range 66 lb to 300 lb of weight', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfWt.setText("");

txfWt.requestFocus ();

return;

}

}

float SC = Float.parseFloat (txfSC.getText () .trim ());

If (SC < 0.4 |) SC > 24) {}

Component Reflection2 = null;

JOptionPane.showMessageDialog (Reflection2,

'"PMRC range of 0.4 mg/dl to 24 mg/dl', 'Information ',.

JOptionPane.WARNING_MESSAGE);

txfSC.setText("");

txfSC.requestFocus ();

return;

}

If (tbnCI.isSelected ()) {/ / Selected is inches and cm}

vHtcm = (float) (Float.parseFloat (txfHt.getText (.trim (())) * 2.54);

vHtcm = Float.parseFloat (nf.format (vHtcm));

calculated inches it is necessary to other calculations

vHtin = (float) (Float.parseFloat (txfHt.getText (.trim (())));

vHtin = Float.parseFloat (nf.format (vHtin));

} else {}

vHtin = (float) (Float.parseFloat (txfHt.getText (.trim (())) * 0,3938);

vHtin = Float.parseFloat (nf.format (vHtin));

}

If (tbnKL.isSelected ()) {/ / Selected is kg}

vWtkg = (float) (Float.parseFloat (txfWt.getText (.trim (())) * 0.4546);

vWtkg = Float.parseFloat (nf.format (vWtkg));

} else {}

vWtlb = (float) (Float.parseFloat (txfWt.getText ()) * 2.2 .trim ());

vWtlb = Float.parseFloat (nf.format (vWtlb));

calculated kg it is necessary to other calculations

vWtkg = (float) (Float.parseFloat (txfWt.getText (.trim (())));

vWtkg = Float.parseFloat (nf.format (vWtkg));

}

If (tbnMF.isSelected ()) {}

vSex = 1; / / woman

} else {}

vSex = 0; / / man

}

calculation for IBW

If (tbnMF.isSelected ()) {/ / Selected is FEMALE}

vIBW = (float) (45.5 + (2.3 * (vHtin - 60)));

vIBW = Float.parseFloat (nf.format (vIBW));

} else {}

vIBW = (float) (50 + (2.3 * (vHtin - 60)));

vIBW = Float.parseFloat (nf.format (vIBW));

}

Hypotrophy of the IBW

If (vWtkg < vIBW) {}

TFPN = vWtkg;

} else {}

TFPN = vIBW;

}

convert mathematical variables age & SrCr

vSrCr = (float) (Float.parseFloat (txfSC.getText (.trim (())));

Mals = (int) (Integer.parseInt (txfAge.getText (.trim (())));

CLRC LBW

vCrCL = ((140-vAge) * TFPN) / (vSrCr * 72);

vCrCL = Float.parseFloat (nf.format (vCrCL));

lblLBW.setVisible (true);

lblLBW.setText (String.valueOf (vCrCL) + ' mL/min');

If (vSex == 1) {/ / if female}

vCrCL = (float) (vCrCL * 0.85).

vCrCL = Float.parseFloat (nf.format (vCrCL));

lblLBW.setVisible (true);

lblLBW.setText (String.valueOf (vCrCL) + ' mL/min');

}

Calculate the weight adjusted to CLRC ABW

If (vWtkg > TFPN) {}

DAVL = (float) (TFPN + (0.4 * (vWtkg - TFPN)));

} else {}

DAVL = vWtkg;

}

CLRC ABW

vCrCA = ((140-vAge) * DAVL) / (vSrCr * 72);

vCrCA = Float.parseFloat (nf.format (vCrCA));

lblABW.setVisible (true);

lblABW.setText (String.valueOf (vCrCA) + ' mL/min');

If (vSex == 1) {/ / if female}

vCrCA = (float) (vCrCA * 0.85).

vCrCA = Float.parseFloat (nf.format (vCrCA));

lblABW.setVisible (true);

lblABW.setText (String.valueOf (vCrCA) + ' mL/min');

}

CLRC TBW

vCrCT = ((140-vAge) * vWtkg) / (vSrCr * 72);

vCrCT = Float.parseFloat (nf.format (vCrCT));

lblTBW.setVisible (true);

lblTBW.setText (String.valueOf (vCrCT) + ' mL/min');

If (vSex == 1) {/ / if female}

vCrCT = (float) (vCrCT * 0.85).

vCrCT = Float.parseFloat (nf.format (vCrCT));

lblTBW.setVisible (true);

lblTBW.setText (String.valueOf (vCrCT) + ' mL/min');

}

}

@FXML

Private Sub labels (ActionEvent ep) throws Exception {}

lblLBW.setText (null);

lblABW.setText (null);

lblTBW.setText (null);

txfAge.setText (null);

txfHt.setText (null);

txfWt.setText (null);

txfSC.setText (null);

tbnCI.setSelected (false);

tbnCI.setText ("cm");

tbnCI.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

tbnKL.setSelected (false);

tbnKL.setText ("kg");

tbnKL.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

tbnMF.setSelected (false);

tbnMF.setText ("Male");

tbnMF.setStyle ("background - fx - color: Blue;") ("- fx - police-weight:" BOLD "");

txfAge.requestFocus ();

}

Toggle the setting button code

@FXML

Private Sub onPCI (ActionEvent ep) throws Exception {}

If (tbnCI.isSelected ()) {}

tbnCI.setText ("in");

tbnCI.setStyle ("- fx - do - weight:bold");

} else {}

tbnCI.setText ("cm");

tbnCI.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

}

}

@FXML

Private Sub onPKL (ActionEvent ep) throws Exception {}

If (tbnKL.isSelected ()) {}

tbnKL.setText ("lb");

tbnKL.setStyle ("police - fx - weight:" BOLD "");

} else {}

tbnKL.setText ("kg");

tbnKL.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

}

}

@FXML

Private Sub onPMF (ActionEvent ep) throws Exception {}

If (tbnMF.isSelected ()) {}

tbnMF.setText ("Female");

tbnMF.setStyle ("background - fx - color: pink;") ("police - fx - weight:" BOLD "");

NOTE css inline code construction use; After the first construction

} else {}

tbnMF.setText ("Male");

tbnMF.setStyle ("background - fx - color: Blue;") ("- fx - police-weight:" BOLD "");

}

}

@Override

Public Sub initialize (URL arg0, arg1 ResourceBundle) {}

}

}

File FXML

<? XML version = "1.0" encoding = "UTF-8"? >

<? import javafx.scene.shape. *? >

<? import javafx.scene.text. *? >

<? import javafx.geometry. *? >

<? import javafx.scene.control. *? >

<? import java.lang. *? >

<? import javafx.scene.layout. *? >

<? import javafx.scene.layout.AnchorPane? >

< AnchorPane prefHeight = "420,0" prefWidth = "1060,0".

style = "" background - fx - color: gray; "xmlns =" " http://JavaFX.com/JavaFX/8 "

' xmlns:fx = ' http://JavaFX.com/fxml/1 "fx:controller ="appCC.CRCLController">

< children >

< prefHeight pane = "420,0" prefWidth = "1060,0".

"AnchorPane.bottomAnchor ="0.0"AnchorPane.leftAnchor =" 0.0 ".

AnchorPane.rightAnchor = "0.0" AnchorPane.topAnchor ="0.0" > "

< children >

< rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

height = "250.0" layoutX "60.0" = on = "70.0" opacity = race '0.99' = 'blue '.

strokeType = "INSIDE" strokeWidth = "2.0" width = "280.0" / >

< button fx:id = "btnCalc" focusTraversable = 'false' layoutX = "230,0.

On = "340,0" mnemonicParsing = "false" onAction = "#onCalc".

prefHeight = "28.0" prefWidth = "100.0" style = "" fonts - fx - weight: bold; ' "

Text = 'Calculate' / >

< button fx:id = "btnClear" focusTraversable = 'false' layoutX = "80.0.

On = "340,0" mnemonicParsing = "false" onAction = "#onClear".

prefHeight = "28.0" prefWidth = "100.0" style = "" fonts - fx - weight: bold; ' "

Text = "Clear form" / >

< rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

height = "260.0" layoutX '400.0' = on = race "65.0" = 'blue '.

strokeType = "INSIDE" strokeWidth = "2.0" width = "600,0" / >

< rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

height = "250.0" layoutX '405.0' = on = race '70.0' = 'blue '.

strokeType = "INSIDE" strokeWidth = "2.0" width = "590,0" / >

< layoutX label = "450.0" on = "100.0" text = "Formula" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "450.0" on = '140.0' text 'Formula of Cockcroft and Gault LBW' = >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "450.0" on = "180.0.

Text = "Cockcroft and Gault formula adjusted BW" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label '450.0' = on = text '220.0' = 'Formula of Cockcroft and Gault BW True' >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "780.0" on = "100.0" text = "Clearance of creatinine" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< label fx:id = "lblLBW" = "800,0" layoutX on = "140.0.

prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< label fx:id = "lblABW" = "800,0" layoutX on = "180.0.

prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< label fx:id = "lblTBW" = "800,0" layoutX on = "220,0.

prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "100.0" on = "28.0" text = 'Patient demographics' >

< font >

< do size = "20.0" / >

< / make >

< / label >

< / children >

< / component >

< rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

height = "260.0" layoutX '55.0' = on = "65.0" opacity = race '0.99' = 'blue '.

strokeType = "INSIDE" strokeWidth = "2.0" width = "290,0" / >

< layoutX label '105,0' = on = "100.0" text = 'Âge' >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "90.0" on = '140.0' text 'Height' = >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label '90.0' = on = "180.0" text = 'Weight' >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label '90.0' = on = "220.0" text = "Gender" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "105.0" on = "260.0" text = "PMRC" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "240.0" on = "100.0" text = 'years' >

< font >

< do size = "18.0" / >

< / make >

< / label >

< layoutX label = "240.0" on = text "260.0" = "mg/dl" >

< font >

< do size = "18.0" / >

< / make >

< / label >

< fx:id = "txfAge" = "155.0" layoutX TextField on = "100.0".

prefHeight = '28.0' prefWidth = "75.0" / >

< fx:id = "txfHt" = "155.0" layoutX TextField on = "135,0.

prefHeight = '28.0' prefWidth = "75.0" / >

< fx:id = "tbnCI" = "240.0" layoutX ToggleButton on = "135,0.

mnemonicParsing = "false" onAction = "#onPCI" prefHeight = "28.0.

prefWidth = "45.0" style = "background - fx - color: tan;" fonts - fx - weight: bold; »

text = "cm" / >

< fx:id = "txfWt" = "155.0" layoutX TextField on = "175,0.

prefHeight = '28.0' prefWidth = "75.0" / >

< fx:id = "tbnKL" = "240.0" layoutX ToggleButton on = "175,0.

mnemonicParsing = "false" onAction = "#onPKL" prefHeight = "28.0.

prefWidth = "45.0" style = "background - fx - color: tan;" fonts - fx - weight: bold; »

Text = "kg" / >

< fx:id = "tbnMF" = "155.0" layoutX ToggleButton on = "220,0.

mnemonicParsing = "false" onAction = "#onPMF" prefHeight = "28.0.

prefWidth = "75.0" style = "background - fx - color: Blue;" fonts - fx - weight: bold; »

Text = "Male" / >

< fx:id = "txfSC" = "155.0" layoutX TextField on = "258,0."

prefHeight = '28.0' prefWidth = "75.0" / >

< / children >

< / AnchorPane >

This is not a complete code review, just a report on my results when I tried to run your code.

I ran your code on OS X 10.9, Java8u40.

The application has started in the end.

If you enter an invalid value, the application crashes.

It is because you are trying to create Swing components in a JavaFX application on the thread of JavaFX application, rather than on the Swing thread.

If you want to call code swing, then you must encapsulate this code in a call from SwingUtilities.invokeLater :

SwingUtilities.invokeLater (new Runnable() {}

@Override
public void run() {}

JOptionPane.showMessageDialog (Reflection2, "Entered Value Invalid",
'Information', JOptionPane.WARNING_MESSAGE);
}

});

I suggest simply ditch completely Swing code and use alerts 8u40 which originate in JavaFX Java (it will work only in Java8u40 +):

Alert alert alert = new (Alert.AlertType.ERROR, "Invalid input");
alert.showAndWait ();

Even better perhaps is to not create windows separated for validation errors.

Third party frameworks can help provide the user interface for online validation ( FXForm2, JideFX with the Developer's guide, ControlsFX, etc.).

Tags: Java

Similar Questions

  • Code review for Oracle 11 g Administration Dataguard

    Can all give the code to review for exams for Oracle 11 g Dataguard Administration code.

    Thanks in advance.

    There is no review of Data Guard 11g.  The review of Data Guard Administration 12 c is 1Z0-066:

    Exam1Z0-066

  • Code / review of logic

    Hi all

    Please review the code and logic used to download data by converting the value column separated by commas following multi-line.

    Used tables.
    --------------------
    create the table temp_stg
    (number (16) id,)
    equip_name varchar2 (200),
    PCB1 varchar2 (50).
    pcb2 varchar2 (50));



    create the table temp_org
    (equip_name, varchar2 (200),)
    PCB varchar2 (50));

    insert into temp_stg
    values (1, 'Equip1', 'PCB1 & PCB2', 'PCB3 & PCB4');

    Commit
    /

    I want the output of following records inserted in temp_org

    Equip_name PCB
    ------------------- --------------------------
    Equip1 PCB1
    Equip1 PCB2
    Equip1 PCB3
    Equip1 PCB4

    Here is the PL/SQL code to do the same.

    DECLARE
    CURSOR cur_stg IS
    Select equip_name, pcb1 | '&' | pcb2 as PCB
    from temp_stg where id = 1;

    rec_stg cur_stg % ROWTYPE;
    PROCEDURE process_pcbs
    IS
    l_pcb_str VARCHAR2 (500);
    l_single_pcb VARCHAR2 (50);
    l_cnt PLS_INTEGER: = 0;
    BEGIN
    l_pcb_str: = rec_stg.pcbs;
    While (length (trim (l_pcb_str)) > 0)
    LOOP
    IF instr (l_pcb_str, '&', 1, 1) > 0 THEN
    l_single_pcb: = substr (l_pcb_str, 1, instr (l_pcb_str, '&', 1, 1));
    l_pcb_str: = substr (l_pcb_str, instr (l_pcb_str, '&', 1, 1));
    ON THE OTHER
    l_single_pcb: = l_pcb_str;
    l_pcb_str: = NULL;
    END IF;
    INSERT INTO temp_org
    VALUES (rec_stg.equip_name, l_single_pcb);
    END LOOP;
    COMMIT;
    END process_pcbs;

    BEGIN
    OPEN cur_stg.
    LOOP
    SEEK cur_stg INTO rec_stg;
    EXIT WHEN cur_stg % NOTFOUND;
    IF rec_stg.pcbs IS NOT NULL THEN
    process_pcbs;
    END IF;
    END LOOP;
    CLOSE Cur_stg;
    EXCEPTION
    WHILE OTHERS THEN
    IF cur_stg % ISOPEN THEN CLOSE cur_stg; END IF;
    LIFT;
    END;
    /

    Thank you
    Srini

    I'm close by using the type clause (just cause the type clause is fun to use)
    but I'm not strong with all the susbstr analysis of functions, instr etc.

    in any case if someone wants to end it up,
    Oh and I added a line to the temp_stg original table just so I could see it working for several lines.

    Select * from)
    with one also (select 1 rn, "Nixon #2, PCB1 and PCB2, PCB3 & PCB4" double text)
    Union
    Select the rn 2, 'Nixon #3, PCB2 and PCB3, PCB4 & PCB5' double text
    )
    Select col1, col2
    a
    model update return lines
    partition by (rn)
    dimension (0d)
    measures (col1 text,
    col2 text)
    iterate rules (10)
    (
    col1 [iteration_number + 1] = substr (col1 [0], 1, instr(col1[0],',',1) - 1).
    col2 [iteration_number + 1] = substr (col1 [0], (length(col1[1]) + 2) * (iteration_number + 1), 5)

    )

    order by col1
    )
    When col2 is not null

  • Oracle Database 11 g: Introduction to SQL - what his Code review?

    I have read from Oracle Database 11 g: SQL Fundamentals I and book II. Should what test I take?

    user11164565 wrote:
    I have read from Oracle Database 11 g: SQL Fundamentals I and book II. Should what test I take?

    Hmmm, I know, that there is no such book text... which is its ISBN number?

    Also reading is not enough, you must be practiced.

    Please read confirm you have read the announcements forum especially the road you choose [http://forums.oracle.com/forums/ann.jspa?annID=1122]

    Are also studying the certification website, [www.oracle.com/education/certification]... reviews-list all reviews... and drill on those which appear to be relevant.

  • The create a System Image will save the FPGA code and the RT code?

    I have some cRIO systems which were broadcast in our manufacturing plant for some time. A slight problem has been discovered in the programming and created a workaround solution, but a fix should be implemented. Currently, I have no way to test my new code without loading on the cRIO and it works on the tool while the product is running. If there is a problem and I need to do some debugging, the tool cannot be down for an extended period. I would write a vi that will save an image of the cRIO so I can reload the software that is currently running and prevent a situation of prolonged downtime.

    My question is, when I did in the past with a product that has different tests, calibration and the final client software RT, it seems that the code FPGA not be saved (not a big deal at the time since the new FPGA code was compatible with different deployments RT). The new FPGA code won't be compatible with the old RT software, so now I'm worried. I would like to just check on it until I have all the boss breathing down my neck. If the service will not save the bitfile FPGA, is there anything else I can do for the tool to return to the previous running state while I solved problems that may exist with the new code review? The original code was lost by my predecessor. Otherwise, I would use just that.

    Hi Jeremy,.

    You are right, because the create a System Image does not record the bitfile with the image of the RT. Using the configuration system API, you will need to deploy the RT image and then the bitfile FPGA compiled later. To ensure that you can return to the previous version of the software running on your RIOs, you could simply save the current image and bitfile before deploying the new image and bitfile.

    However, the best way to proceed is to use replication Deployment Utility (RAD of OR). I have provided the link to the tutorial on the wheel, where you can download the utility. This exe will make images of the any of your RT targets and will also include the bitfiles with them. You can also deploy these images to several targets at once. In particular, you can read about the Bitfile (s) configure for FPGA Deployment Flash; the bitfile will be deployed at the start when stored in flash memory.

    Replication and deployment (RAD) utility-

    http://www.NI.com/example/30986/en/

  • I don't see any review of Vmware Vsphere CIM 5.1. they renamed to this review?

    I don't see any review of Vmware Vsphere CIM 5.1. they renamed to this review?

    Certification for vSphere 5.1 is VCP5-VTC (she was previously VCP5), the code review remains VCP510

    More details here: Virtualization VCP-Datacenter (VCP5-VTC)

  • Examples of pl/sql code that can be used in training for new developers

    Hello

    I'm working on a training ride on the pl/sql to some developers who are totally new to PL/SQL. Although they are experienced in another language. I have power point on pl/sql presentations, but they especially the theory oriented with just a few examples. I'm looking for more help to have a few example pl/sql that can be given to interns as the code for example and also to practice. It should be a bit detailed and like to print the odd numbers or print "hellp world." Can anyone help to suggest if there is an example of code that is a bit detailed with a kind of complex problem which will give students a hands good example? I see a nice example at this link: http://tucano.tucanowebdesign.com/oracle/tutorial5.html - on an inventory system. It gives the feeling of being one on the issue of real-world work. So that if anyone knows of some other example say about 150 t0 300 lines or so of the code, I'll be grateful if it is shared.

    Thank you

    OrauserN

    That said, I feel again (my perception) that more code a person writing/comments the better he gets. So, I want students to examine several code examples. I guess I need to see some books to bring out some really long piece of PL/SQL - like case studies.

    . . .
    But these guys are too busy and so I try to find the net / books some really detailed examples.

    But you seem to be overlooking that PL/SQL is supposed to be used for: PL means "procedural language.

    So, PL/SQL must be used to 'procedure' treatment; This is typically several process steps. For example, when you want to run three applications as a "TRANSACTION". If all three completed successfully you COMMIT and if any of the three you don't ROLLBACK.

    You can do this by using SQL only. And a developer doesn't have to write the code until they have a technical requirements doc that explains what problem the code is supposed to solve and the constraints and requirements that the code must implement.

    So, my suggestion is the following:

    1. identify and teach the types of issues that PL/SQL is used to help solve. Multi-step transactions, I mentioned above is an example

    2. use the documentation and the code of your own organization in the form of samples. These 'guy' is perhaps too busy, but they should be able to provide to you all the documents for the code they wrote and that you use which would be good to use as examples. If they have no documents technical requirements so you just identify a MAJOR gap in the operations of your org that you must bring to the attention of management.

    3. you can provide value added a lot more if you use code from your own org as a basis for what you are doing. A very useful training exercise is to ask students to perform 'code review' of a code (a procedure or function) and write simple comments, one line that explain, in plain English, what makes each piece of code.

    4 comments, students create to step #3 can actually be incorporated into your code then existing so that future developers can use these comments to understand what the code actually does.

    5 part of your 'education' should be on the way to 'test' correctly a piece of code PL/SQL to make sure it is doing what it is supposed to do. Again, if your students actually your own org code allows to create tests, these tests can then be added as a result of 'test' for this application and that adds value. A lot of times those developers 'busy' will not create the actual test cases and that your students can help remedy that. In addition, it does no good to know how to write PL/SQL code if you don't know how to test properly.

  • Reg: Validation of the PL/SQL codes-

    Hi Experts,

    Need some ideas/advice about a tool " check/validation of the code syntax .

    Is it possible - to create a PL/SQL procedure (for example, ' X') where the i / p will be any creation of the Table or procedure script. X will check the syntax and any other coding loophole postings.
    In fact, we have a lot of overhead of manual checking the code for some best practices of coding. Just so desirable to automate their in a proc X.
    Can be written Regexs or any other way... a few checks as -.
    + 1] + CREATE or REPLACE PROCEDURE < schema_name >. < proc_name >
    Usually developers here avoid the schema name.

    + [2] + good Exception blocks with no. SO that OTHER THEN NULL;

    Is it really feasible or I'm just too think?

    (I have access to 10g and 11g databases).

    Please suggest some ideas. (from now on, I've tried for a windows batch script that will check for the validation of the scripts stored in a folder that + .txt)
    Help much appreciated.

    Vanessa B.

    nordine B wrote:
    The words were really wonderful, Etbin. Thank you!

    But, naming conventions g_ , v_ and . can never (mostly) right change..?
    So just try to find something like that.

    Start a simple tool and gradually increase the complexity.

    Or, do you have any other tool in mind which can reduce the daily effort?
    No matter what tool you find really useful and interesting development - to facilitate the daily efforts

    FYI - we have one tool, input a proc/table gives all other objects related to IT... same indexes, triggers, etc. Something new as this ;)

    When I was a 'Developer' (we called the postion "Programmer/Analyst"), we spent a lot of effort on the naming of standards. And given that the standards have been published and known by all programmers in the shop, catch violations has been easy to do during code reviews, even if it wasn't the purpose of focus or the destination of the revision of the code.

    So, if you are doing critical business logic code and you have a manual of standards published to cover the naming conventions, etc., then standards will be a trivial addition to a revision of the code "business logic". I think that you are pursuing a solution in search of a problem. I know it's hard for the younger generation to accept, but sometimes automation is simply not the solution. Or at least not the optimal solution.

    In fact, there is a little human psychology comes into play. If you have published standards, you don't even have to do "compliance" of the order of the day on a revision of the code "business logic". Developers will be quick to them yelling, and the fear of this will help the grip in the car in the first place. This is a factor that is not understood by computers or human beings who believe that computers are the solution to everything.

    That said, he has there the tools that will help identify some problems. SQL Navigator is one that comes to mind.

    Published by: EdStevens on February 17, 2013 18:19

    Published by: EdStevens on February 17, 2013 18:22

  • In the bar of windows svn revision number

    Hello

    I think about the possibility of putting on the application toolbar (exe) SVN revision number. I would be characteristic of the usueful to quickly assess, what source application, code review is to build in.

    What I need is therefore a kind of trigger/interface that I could use to launch scrap one code that modify the bar of the application window when the application is being built. I thought to prepare the chain using the Exec.vi system (to run the command - st svn.exe to get the information I need). But how is it I can impose on LV to trigger this code only when the build operation starts?

    Or maybe I'll use different approach?

    Hello

    in the build specification, you can run a VI prior to construction.

    So if you know how to find the svn revision number, you can call a vi that change the name of your VI main when you build the exe...

    I think it is the right way! :-)

    Best regards

  • Projects and project libraries

    I have luckily been using projects since their introduction in LabVIEW 8 - something.

    I have a project whose job is to look at the trees of directories containing the other screws in some cases, screw my code reviews have the same name as a screws used in the code (I am slot in development, not of an executable Mode).  To avoid "name conflicts", I did a search on and learned namespaces on the project libraries.

    So I have brought successfully on all the files in my project in a project the same library name.  The code works fine.

    Today, I opened my project to watch one of my screws, and to my horror, the project had No files showing.  He also did not show the library project (where I "knew" all the files are located).  A little worried, I looked on my drive and found the project library file (.lvlib) - if I double-click on it, there are my files!

    What I do have trouble (maybe because it's impossible!) becomes an 'inside' view of my library of Project Explorer project.  In view of the close relationship between the projects and the project libraries (the second is created from the beginning, for example), I expected to see such a link.  Are there?  Or are you expected to open both a project (which, in my case, has files that are not in the project library) and the corresponding project library?

    Note that I did a search in the Documentation OR on the project libraries, and what I've read has pointed out the close relationship between a project and an associated project library, including giving them the same (or similar) name and now the files in the same folders.  [Hmm - I just realized I did not name my project and the library identically - I called the project "Project XYZ" and the "Library XYZ" library project...].

    Experience "on the ground" would be welcome!

    Bob Schor

    The library project is just an xml file containing links to all of the objects that make up the project. A .lvlib is also an XML file that contains links to the objects he owns. Screws are marked as belonging to a library. They do not belong to the project. If the .lvlib is included in the project, you will be able to expand to see the items it contains. You don't need to have a project to create a .lvlib. You can create a file/new in the getting started window. You can drag any .lvlib in a project as you can a VI. You shouldn't screw that contains a .lvlib existing in the Project Explorer. Also remember that the .lvlib contains no screws or other objects. If you open it in Notepad, you will see a list of objects.

    What probably happened, is that you did not save the .lvproj after creating and adding the .lvlib. All you would have to do is find the .lvlib in Windows Explorer and drag it to your project.

  • under condition of read/write terminals on the side of the connector (basic training 3)

    Hello

    During my practice towards the review of the CLD, I examine the Core 3 online training material too. I just read a few tips of 'best practices' on the forum, for example this post:

    http://forums.NI.com/T5/LabVIEW/Community-Nugget-wired-terminals-in-subdiagrams-clearing-up-the/m-p/...

    It should be noted, that we should not use terminals (which are on the connector pane) to the inside of while loop or condition of the structure. Neither control, nor indicators (read/write terminals): "terminals conditionally read or written on the side of the connector are BAD!"

    I can find many examples in the online training materials, when the indicators and controls are placed inside while loop and the case of structures in a Subvi.

    I guess I should not do this during my review of the CLD, as they will run benchmark on my project? Should not be the core training materials updated some time? Or it's just not too important to have terminals on the outside? I would lose points during the CLD Exam my project as in the Core 3 screws?

    example 1: Core 3, exercise 4-6 design of an error-handling strategy:

    EDIT:

    What's even more ugly in this project, is that, in the case of 'Get empty Cue', the Cue output indicator is updated via a local variable, because the indicator is not accessible via 'outside ': wire

    Nice catch on the training material.  that the application would take an if subject to a review of the CLD test graders.

    As noted in the nugget: sentencing of perfomance for conditionally reached terminals is a function of the size of the data.  So, it is sometimes acceptable for simple data.  The larger point being to learn about compromise and make the right choice for your code.

    Preping for the CLD on other means of hand knowing that VI Analyzer will run on your project.  Like any other code review you walk in - know the guidelines for the review and code to ' review ' as well as 'reply spec.'

    I've not seen an instance where an example of shipping (2013 and later versions) would fail this test VIA (there are a few screws deep inside the vi.lib which can date back to before the adoption of this recommendation from style)

  • VI Analyzer - how you re there for this use case?

    My group has different people working on different LVPROJs for every software we have available. Each LVPROJ uses our user.libs and instr.libs, as well as a 'framework' in General, it is the same for most LVPROJs.

    I really think that the VI Analyzer toolkit would be powerful for code reviews, but only if I can configure it in a way where what tests I run and what are the criteria can be saved and used on any project. I can't get this to work for me. I want to save all these configurations and easily use it on new LVPROJs - the easier I can do this process, the more likely others will be to be used for the revision of the code. How would you do it? (if it's even feasible)

    I suggest the creation of a .cfg file without a link with the project, but with all the tests selected and configured as you wish... so a .cfg file with no 'elements to analyze' specified. Then, when you work on an individual project, open the CFG file, add the folder to the root of the project to the analysis, then save this CFG file with this project. This means that you can not have the project in your CFG file link, but assuming that your project is everything in a folder of level higher, which should not really be a problem, because the CFG file will be "linked" to the moment there in the top-level folder that contains your project.

  • Operating system applies to the machine, but the necessary recovery from another disk machine. Feasible?

    Is it possible to use another recovery disc (not the one that came with my machine) to install a copy of XP and then connect to servers internet for code review and entry of correct product key for my device?
    My repairman installed XP OS validated without problem out of the box, and I continued to date for about 2 years without problem.  This product key on my machine exactly matches my hardware profile and unique machine identifier.
    Unfortunately, I encountered a corrupted file NTKRNL and the complete refusal of all the way to windows, and THEN only do I condone my repairman for a recovery disk is defective.  They ignore my requests all sending me a disc of functional recovery.  I cannot use drive recovery from a friend to get a XP upwards and running, provided reacondicionador is totally unnecessary.
    Is it possible to use a different recovery disk, my friends for his XP machine and then have the MS servers recognize it as my old machine even that I registered at the origin of XP to and get the correct downloads by changing product key what is the cert of Authenticity on the machine?   I find that I use an incorrect product key (for my machine) to get the XP operating system to install, of course.  Have a headache MASSIVE because the material recovery turns out to not work properly now and restful can't be bothered to answer my questions either.
    My machine is not currently connected to the internet to try this, (was constantly in the past, but it has been faulty several months now so I killed the internet subscription).  The MS servers know my machine and I have an XP license valid, and I would go to the trouble to subscribe to internet contact again if I knew it would work.  Without a working computer, don't have much reason to keep my internet connection.

    There is a difference between Recovery Disk from a PC manufacturer and a Windows XP Installation CD.

    Assuming you mean the latter, it is possible - as long as the CD corresponds to the license. In other words, if your license (indicated on your COA) is, say, for Windows XP Home Edition, OEM version and if you are using an OEM Windows XP Home Edition installation CD version, then your COA product key should work. But that's the trap. Everything must match! In addition, there could be complications with some versions of the BRAND. For best results, use a generic OEM version of the CD (aka integrators).
    Here again, the System Builders CDs are not easy to find for most people. In this case, you have two other options:
    1. contact the manufacturer. Of course, Windows XP is an old OS, and I imagine that many OEMS no longer support it. :-(
    2. this site:
    Finally, many manufacturers offer a recovery partition which is actually a restore hidden on the hard disk partition:
  • Update CPU dv7

    I have an equipped with a p7350 processor DV7 1020us and upgrade to the t9600. It is listed in the reference of parts for this machine under no. 481377-001. Of all the research I've done I have no doubt it will work properly in this machine as both models Penryn processors and use the same chipsets and front end bus speeds. After consulting the site Intels Iam at a slight loss of what code review and spec to use. Two types are available, the SLG9F and the SLB47. This is the socket PGA478 as indicated by CPU - Z on my machine. I was not able to cross reference the part number of HP for detailed processor specifications to determine which one to use.  The original specifications of processors are not helpful except that the p7350 is a SLB53 which would lead me to think that I need the SLB47 specification for the t9600.  If anyone knows I can use, I would be very grateful. It would be a great upgrade for this machine and I look forward to the answers.

    IAM assuming my BIOS, (F.2c), is compatible, as indicated on the HP site for this machine only.

    Please note that I can not respond immediately because of limited access to internet.

    I almost forgot I posted until a reply E-mail. I have since discovered a lot on this machine. He can go to a T-9900 CPU. Technical code of the SLGEE. Priced at 3.06 GHZ, it is a fantastic upgrade. I did not yet because of the price of these old CPUS are still around $ 300.00. Regarding the other updates, T-9600, T-9800 and 9900 T are all usable. A 9600-T can be found for about a hundred bucks on E bay. I can go with the T-9600 due to the difference in price for the gain. His appreciation to 2.8 GHZ and I can't justify another two hundred two-tenths of GHZ speed increased when all other specs are the same. In any case, all these would be an upgrade for your slightly older DV7 in competition or beat most of the new machines of the day. If you do it yourself, this upgrade, I recommend to go to the HP site and download the Maint. and service guide for your machine. The mine has diss-Assembly very detailed instructions. It will be a long work and tedious so prepare accordingly with a space dedicated work, where you can keep the parts and the screws identified for reassembly. Good luck.

  • editable text field and button is not editable when added to the Manager of the Horizontal

    I find layout, when I added the button and EditField horizontally, Manager, I'm not able to write something in the EditField and not able to click on the button

    public class MyStorySearch extends MainScreen
    {
    
        private VerticalFieldManager mainManager;
        private VerticalFieldManager subManager;
        private Bitmap _backgroundBitmap = Bitmap.getBitmapResource("a.png");
        private int deviceWidth = Display.getWidth();
        private int deviceHeight = Display.getHeight();
        LabelField lbl;
        ButtonField gobtn= new ButtonField("Go");
        HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.FOCUSABLE|Manager.EDITABLE);
        private Field editfild;
        Bitmap bitmapImage = Bitmap.getBitmapResource("storysearch.png");
        BitmapField fieldDemo;
    
        public MyStorySearch()
        {
            super(NO_VERTICAL_SCROLL);
            //this manager is used for the static background image
            mainManager = new VerticalFieldManager(
                              Manager.NO_VERTICAL_SCROLL |
                              Manager.NO_VERTICAL_SCROLLBAR )
            {
                public void paint(Graphics graphics)
                {
                    graphics.clear();
                    graphics.drawBitmap(0, 0, deviceWidth,
                             deviceHeight, _backgroundBitmap, 0, 0);
                    super.paint(graphics);
                }
            };
    
            //this manger is used for adding the componentes
            subManager = new VerticalFieldManager(
                             Manager.VERTICAL_SCROLL |
                             Manager.VERTICAL_SCROLLBAR )
            {
                protected void sublayout(int maxWidth, int maxHeight)
                {
                    int displayWidth = deviceWidth;
                    int displayHeight = deviceHeight;
    
                    super.sublayout( displayWidth, displayHeight);
                    setExtent( displayWidth, displayHeight);
                }
            };
    
            //add your component to this subManager
            lbl = new LabelField("SUNRAYS SEARCH", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font myFont = Font.getDefault().derive(Font.PLAIN, 10, Ui.UNITS_pt);
            lbl.setFont(myFont);
            subManager.add(lbl);
            subManager.add(new SeparatorField());
    
            editfild = new EditField(){
                protected void layout(int width, int height) {
                    setExtent(width*85/100, 30);
    
                };
            };
            editfild.setBorder( BorderFactory.createSimpleBorder( new XYEdges(2, 2, 2, 2),
                    new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), Border.STYLE_SOLID));
            editfild.setBackground(BackgroundFactory.createSolidBackground(Color.WHITE));
    
            hfm.add(editfild);
            hfm.add(gobtn);
    
            subManager.add(hfm);
    
            //add subManager over the mainManager
            mainManager.add(subManager);
    
            //finally add the mainManager over the screen
            this.add(mainManager);
        }
    }
    

    The following code shows an EditField and a button, and I can type in the EditField and click the button.  It is not perfect, but at least it works.

    I don't know what the problem is with your code.  I suggest review you my code, review your code and investigate things that are different.

    Two areas I would focus on your layout and the sublayout.  As stated in a previous post, if you must code a setExtent in a layout, then you should really think about creating your own Manager - I gave you links to do this several times.  And if you plan to use a standard field and to make it work properly, you must use the sublayout.  Here is a link to help you create custom fields:

    http://supportforums.BlackBerry.com/T5/Java-development/create-custom-fields/Ta-p/444962

    Edit:

    Thanks for the update of these discussions.

    And I'm sorry.   I forgot to paste the code...  Here, it is now...

            EditField editfild = new EditField(){
                protected void layout(int width, int height) {
                    super.layout(width*85/100, height);
                };
            };
            editfild.setBorder( BorderFactory.createSimpleBorder( new XYEdges(2, 2, 2, 2),
                    new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), Border.STYLE_SOLID));
            editfild.setBackground(BackgroundFactory.createSolidBackground(Color.WHITE));
            ButtonField gobtn= new ButtonField("Go") {
                protected boolean navigationClick(int status, int time){
                    Status.show("button clicked");
                    return true;
                }
            };
            HorizontalFieldManager hfm = new HorizontalFieldManager();
            hfm.add(editfild);
            hfm.add(gobtn);
            this.add(hfm);
    

Maybe you are looking for

  • Error launching Sequence Editor

    Hi Ppl, I installed NI TestStand 4.1, after activation when open sequence editor I got the following error. When I tried the same error. I found this link in OR. He suggested to open the Version TestStand selector and make the active version. But whe

  • Tracing with Visual Studio 2008 works only the 1st time

    Hello I use Visual Studio 2008 and TestStand 4.1.1. I have a c# dll and I'll call a function of TestStand. In VS, I "join to deal with...". "and choose to attach it to TestStand. I start my sequence and VS to get to the point break that I set myself

  • Add the delay between periods of a waveform

    Hey all,. I have used Labview to implement a generator of signals using the 'base FuncGen' VI, (WF-Gen.png) and I'm looking to make a change to the waveform.  Currently I have my VI, set up to generate a square signal to a specified frequency and num

  • In Predator 710-G3 SSD drive

    Can Helle when and where I find the disc SSD 237 GB preinstalled in my G3-710 Predator. Newly installed another 237 GB SSD drive and could not find it. Where is the devil. Of course, the additional SSD drive would not be good without accurate right h

  • How to close 6840 after finishing work

    HP deskjet 8640 I can set it to off after the print job completed.  The light stays on for hours after I used the printer for a job.