//
// time: Fri Oct 10 10:23:47 1997
//
// version: 3.1.2 (format), 4.1.1 (DX Beta)
//
//
// MODULE main
//
// comment: This example visual program uses SuperviseWindow  to extract a picked pixel location in an image. The color of that pixel is then determined using Map, and a small test window is colored with that color.
// workspace: width = 665, height = 1054
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
    // 
    // node Construct[1]: x = 336, y = 911, inputs = 4, label = Construct
    // input[1]: defaulting = 0, visible = 1, type = 16777224, value = {[0 0]}
    // input[2]: defaulting = 0, visible = 1, type = 16777224, value = {[1 1]}
    // input[3]: defaulting = 0, visible = 1, type = 8, value = [80 80]
    //
main_Construct_1_out_1 = 
    Construct(
    main_Construct_1_in_1,
    main_Construct_1_in_2,
    main_Construct_1_in_3,
    main_Construct_1_in_4
    ) [instance: 1, cache: 1];
    // 
    // node ReadImage[1]: x = 74, y = 111, inputs = 9, label = ReadImage
    // input[1]: defaulting = 0, visible = 1, type = 32, value = "dx_logo.tiff"
    // input[8]: defaulting = 0, visible = 0, type = 3, value = 0
    // input[9]: defaulting = 0, visible = 0, type = 32, value = "float"
    //
main_ReadImage_1_out_1 = 
    ReadImage(
    main_ReadImage_1_in_1,
    main_ReadImage_1_in_2,
    main_ReadImage_1_in_3,
    main_ReadImage_1_in_4,
    main_ReadImage_1_in_5,
    main_ReadImage_1_in_6,
    main_ReadImage_1_in_7,
    main_ReadImage_1_in_8,
    main_ReadImage_1_in_9
    ) [instance: 1, cache: 1];
    // 
    // node Inquire[1]: x = 146, y = 203, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "connection gridcounts"
    //
main_Inquire_1_out_1 = 
    Inquire(
    main_ReadImage_1_out_1,
    main_Inquire_1_in_2,
    main_Inquire_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node Compute[1]: x = 245, y = 237, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "[$0.1, $0.0]"
    // expression: value = [a.1, a.0]
    // name[2]: value = a
    // name[3]: value = b
    //
main_Compute_1_out_1 = 
    Compute(
    main_Compute_1_in_1,
    main_Inquire_1_out_1,
    main_Compute_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node SuperviseWindow[1]: x = 206, y = 335, inputs = 10, label = SuperviseWindow
    //
main_SuperviseWindow_1_out_1,
main_SuperviseWindow_1_out_2,
main_SuperviseWindow_1_out_3 = 
    SuperviseWindow(
    main_SuperviseWindow_1_in_1,
    main_SuperviseWindow_1_in_2,
    main_Compute_1_out_1,
    main_SuperviseWindow_1_in_4,
    main_SuperviseWindow_1_in_5,
    main_SuperviseWindow_1_in_6,
    main_SuperviseWindow_1_in_7,
    main_SuperviseWindow_1_in_8,
    main_SuperviseWindow_1_in_9,
    main_SuperviseWindow_1_in_10
    ) [instance: 1, cache: 1];
    // 
    // node Inquire[2]: x = 266, y = 486, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "is not null"
    //
main_Inquire_2_out_1 = 
    Inquire(
    main_SuperviseWindow_1_out_3,
    main_Inquire_2_in_2,
    main_Inquire_2_in_3
    ) [instance: 2, cache: 1];
    // 
    // node Route[1]: x = 348, y = 517, inputs = 2, outputs = 2, label = Route
    //
main_Route_1_out_1,
main_Route_1_out_2 = 
    Route(
    main_Inquire_2_out_1,
    main_SuperviseWindow_1_out_3
    ) [instance: 1, cache: 1];
    // 
    // node Compute[5]: x = 202, y = 572, inputs = 2, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0.3 == 1 ? 1 : 0"
    // expression: value = a.3 == 1 ? 1 : 0
    // name[2]: value = a
    //
main_Compute_5_out_1 = 
    Compute(
    main_Compute_5_in_1,
    main_Route_1_out_1
    ) [instance: 5, cache: 1];
    // 
    // node Route[2]: x = 342, y = 610, inputs = 2, outputs = 2, label = Route
    //
main_Route_2_out_1,
main_Route_2_out_2 = 
    Route(
    main_Compute_5_out_1,
    main_Route_1_out_1
    ) [instance: 2, cache: 1];
    // 
    // node Select[2]: x = 131, y = 688, inputs = 3, label = Select
    //
main_Select_2_out_1 = 
    Select(
    main_Route_2_out_1,
    main_Select_2_in_2,
    main_Select_2_in_3
    ) [instance: 2, cache: 1];
    // 
    // node Compute[2]: x = 395, y = 732, inputs = 2, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "[$0.1, $0.2]"
    // expression: value = [a.1, a.2]
    // name[2]: value = a
    //
main_Compute_2_out_1 = 
    Compute(
    main_Compute_2_in_1,
    main_Select_2_out_1
    ) [instance: 2, cache: 1];
    // 
    // node Compute[4]: x = 465, y = 819, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "[$0.0, $1.1-$0.1]"
    // expression: value = [a.0, b.1-a.1]
    // name[2]: value = a
    // name[3]: value = b
    //
main_Compute_4_out_1 = 
    Compute(
    main_Compute_4_in_1,
    main_Compute_2_out_1,
    main_Compute_1_out_1
    ) [instance: 4, cache: 1];
    // 
    // node Mark[1]: x = 617, y = 438, inputs = 2, label = Mark
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "colors"
    //
main_Mark_1_out_1 = 
    Mark(
    main_ReadImage_1_out_1,
    main_Mark_1_in_2
    ) [instance: 1, cache: 1];
    // 
    // node Map[1]: x = 552, y = 835, inputs = 4, label = Map
    //
main_Map_1_out_1 = 
    Map(
    main_Compute_4_out_1,
    main_Mark_1_out_1,
    main_Map_1_in_3,
    main_Map_1_in_4
    ) [instance: 1, cache: 1];
    // 
    // node Color[1]: x = 403, y = 985, inputs = 5, label = Color
    //
main_Color_1_out_1 = 
    Color(
    main_Construct_1_out_1,
    main_Map_1_out_1,
    main_Color_1_in_3,
    main_Color_1_in_4,
    main_Color_1_in_5
    ) [instance: 1, cache: 1];
    // 
    // node Display[2]: x = 96, y = 525, inputs = 8, label = Display
    // input[3]: visible = 1
    // depth: value = 24
    //
main_Display_2_out_1[cache: 2] = 
    Display(
    main_ReadImage_1_out_1,
    main_Display_2_in_2,
    main_SuperviseWindow_1_out_1,
    main_Display_2_in_4,
    main_Display_2_in_5,
    main_Display_2_in_6,
    main_Display_2_in_7,
    main_Display_2_in_8
    ) [instance: 2, cache: 1];
    // 
    // node Display[3]: x = 500, y = 992, inputs = 8, label = Display
    // depth: value = 8
    // window: position = (0.8797,0.1436), size = 0.0734x0.2480
    //
main_Display_3_out_1[cache: 2] = 
    Display(
    main_Color_1_out_1,
    main_Display_3_in_2,
    main_Display_3_in_3,
    main_Display_3_in_4,
    main_Display_3_in_5,
    main_Display_3_in_6,
    main_Display_3_in_7,
    main_Display_3_in_8
    ) [instance: 3, cache: 1];
    //
    // decorator Annotate	pos=(21,22) size=603x60 style(Label), value = <NULL>
    // annotation user_begin: 201
    // annotation user: Use any button to pick. Button-down events are extracted and used to determine the 
    // annotation user: pixel location of the pick. The color is then determined using Map, and a small test
    // annotation user: window is created of that color.
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(232,169) size=297x44 style(Label), value = <NULL>
    // annotation user_begin: 59
    // annotation user: get the right size for SuperviseWindow to
    // annotation user: create the window
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(403,519) size=193x44 style(Label), value = <NULL>
    // annotation user_begin: 45
    // annotation user: route off modules below if 
    // annotation user: nothing is picked
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(135,823) size=328x60 style(Label), value = <NULL>
    // annotation user_begin: 130
    // annotation user: pixel locations are measured from top left, but
    // annotation user: image goes from bottom left, so munge the
    // annotation user: pixel location for Map to work correctly
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(329,256) size=127x28 style(Label), value = <NULL>
    // annotation user_begin: 19
    // annotation user: x varies fastest...
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(400,616) size=190x60 style(Label), value = <NULL>
    // annotation user_begin: 65
    // annotation user: route off modules below if
    // annotation user: it's not a button down 
    // annotation user: event (a pick)
    // annotation user_end: <NULL>
    //
    // decorator Annotate	pos=(263,743) size=122x44 style(Label), value = <NULL>
    // annotation user_begin: 27
    // annotation user: Pull off the pixel
    // annotation user: location
    // annotation user_end: <NULL>
// network: end of macro body
}
main_Construct_1_in_1 = {[0 0]};
main_Construct_1_in_2 = {[1 1]};
main_Construct_1_in_3 = [80 80];
main_Construct_1_in_4 = NULL;
main_Construct_1_out_1 = NULL;
main_ReadImage_1_in_1 = "dx_logo.tiff";
main_ReadImage_1_in_2 = NULL;
main_ReadImage_1_in_3 = NULL;
main_ReadImage_1_in_4 = NULL;
main_ReadImage_1_in_5 = NULL;
main_ReadImage_1_in_6 = NULL;
main_ReadImage_1_in_7 = NULL;
main_ReadImage_1_in_8 = 0;
main_ReadImage_1_in_9 = "float";
main_ReadImage_1_out_1 = NULL;
main_Inquire_1_in_2 = "connection gridcounts";
main_Inquire_1_in_3 = NULL;
main_Inquire_1_out_1 = NULL;
main_Compute_1_in_1 = "[$0.1, $0.0]";
main_Compute_1_in_3 = NULL;
main_Compute_1_out_1 = NULL;
main_SuperviseWindow_1_in_1 = NULL;
main_SuperviseWindow_1_in_2 = NULL;
main_SuperviseWindow_1_in_4 = NULL;
main_SuperviseWindow_1_in_5 = NULL;
main_SuperviseWindow_1_in_6 = NULL;
main_SuperviseWindow_1_in_7 = NULL;
main_SuperviseWindow_1_in_8 = NULL;
main_SuperviseWindow_1_in_9 = NULL;
main_SuperviseWindow_1_in_10 = NULL;
main_SuperviseWindow_1_out_1 = NULL;
main_SuperviseWindow_1_out_3 = NULL;
main_Inquire_2_in_2 = "is not null";
main_Inquire_2_in_3 = NULL;
main_Inquire_2_out_1 = NULL;
main_Route_1_out_1 = NULL;
main_Compute_5_in_1 = "$0.3 == 1 ? 1 : 0";
main_Compute_5_out_1 = NULL;
main_Route_2_out_1 = NULL;
main_Select_2_in_2 = NULL;
main_Select_2_in_3 = NULL;
main_Select_2_out_1 = NULL;
main_Compute_2_in_1 = "[$0.1, $0.2]";
main_Compute_2_out_1 = NULL;
main_Compute_4_in_1 = "[$0.0, $1.1-$0.1]";
main_Compute_4_out_1 = NULL;
main_Mark_1_in_2 = "colors";
main_Mark_1_out_1 = NULL;
main_Map_1_in_3 = NULL;
main_Map_1_in_4 = NULL;
main_Map_1_out_1 = NULL;
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_Display_2_in_2 = NULL;
main_Display_2_in_4 = NULL;
main_Display_2_in_5 = NULL;
main_Display_2_in_6 = NULL;
main_Display_2_in_7 = NULL;
main_Display_2_in_8 = NULL;
main_Display_3_in_2 = NULL;
main_Display_3_in_3 = "X8,,";
main_Display_3_in_4 = NULL;
main_Display_3_in_5 = NULL;
main_Display_3_in_6 = NULL;
main_Display_3_in_7 = NULL;
main_Display_3_in_8 = NULL;
Executive("product version 4 1 1");
$sync
main();
