Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleCreate Grid
linenumberstrue
<Query>
  <Find><DeleteAll format="version,current">
    <Zone><Grid>
      <ZoneName<GridID eqne="Zone1"/>
    </Zone>Grid>
  </Find>DeleteAll>
  <Create>
    <Grid>
      <GridName>
        Grid1Intel-Grid
      </GridName>
      <GridNSPosition><GridID>
        1livegrid
      </GridNSPosition>GridID>
      <GridWEPosition><ZoneID>
        1livezone
      </GridWEPosition>ZoneID>
      <GridLength>
        3.331
      </GridLength>
      <GridWidth>
        3.331
      </GridWidth>
      <SoilMoisture><GridNSPosition>
        0N
      </SoilMoisture>GridNSPosition>
      <AmbientLight><GridWEPosition>
        0E
      </AmbientLight>GridWEPosition>
      <ZoneGrid>[:$Response.Message.Value.Find.Result.Zone.ZoneID:]</ZoneGrid><GridLocation>
     </Grid>   </Create><Vertex1>
  </Query>

Create Zone

Code Block
languagexml
titleCreate Zone
linenumberstrue
<Query>
  <DeleteAll>     <Zone> 1
     <ZoneID ne=""/>     </Zone>Vertex1>
   </DeleteAll>   <Create>  <Vertex2>
  <Zone>       <ZoneWidth> 1
       10 </Vertex2>
     </ZoneWidth>   <Vertex3>
   <ZoneLength>       1
 10       </ZoneLength>Vertex3>
      <GridOnLength>   <Vertex4>
     3     1
 </GridOnLength>       <GridOnWidth></Vertex4>
      </GridLocation>
 3     <SoilMoisture>
 </GridOnWidth>       <GridCount>53
      </SoilMoisture>
 9     <AmbientLight>
 </GridCount>       <GridLength>0
      </AmbientLight>
 3.33   </Grid>
  </Create>
</GridLength>Query>

Create Zone

Code Block
languagexml
titleCreate Zone
linenumberstrue
<Query>
  <DeleteAll format="version,current">
   <GridWidth> <Zone>
      <ZoneID 3.33ne = ""/>
    </GridWidth>Zone>
  </DeleteAll>
   <EndZone><Create>
    <Zone>
      <ZoneID>
        Nolivezone
      </EndZone>ZoneID>
      <ZoneTemperature><ZoneName>
        0Intel-Zone
      </ZoneTemperature>ZoneName>
      <ZoneHumidity><LaneID>
        0livelane
      </ZoneHumidity>LaneID>
      <CropType>Tomato</CropType><ZoneLength>
    </Zone>   </Create>
</Query>

Create Lane

Code Block
languagexml
titleCreate Lane
linenumberstrue
<Query> 1
  <Create>     <Lane></ZoneLength>
      <LaneWidth><ZoneWidth>
        1101
      </LaneWidth>ZoneWidth>
      <ZoneInLane><ZoneLocation>
        10<Vertex1>
      </ZoneInLane>    1
  <BorderLane>      </Vertex1>
  Yes      <Vertex2>
</BorderLane>       <LaneZones>   1
   </LaneZones>     </Lane>Vertex2>
  </Create> </Query>

Create Greenhouse

Code Block
languagexml
titleCreate Greenhouse
linenumberstrue
<<Query>   <DeleteAll format="version,current">
 <Vertex3>
   <Greenhouse>       <GreenhouseID ne=""/>1
     </Greenhouse>   </DeleteAll>Vertex3>
  <Create>     <Greenhouse> <Vertex4>
     <GreenhouseID>      1
  livegreenhouse       </GreenhouseID>Vertex4>
      <GreenhouseName></ZoneLocation>
      <EndZone>
 Intel-GreenHouse       </GreenhouseName>endzone
      <BoundingBox></EndZone>
      <GridOnLength>
 <Vertex1>       1
   0         </Vertex1>GridOnLength>
      <GridOnWidth>
 <Vertex2>       1
   0   </GridOnWidth>
     </Vertex2> <GridCount>
       <Vertex3> 1
      </GridCount>
  110    <GridLength>
    </Vertex3>     1
   <Vertex4>   </GridLength>
      <GridWidth>
40         </Vertex4>1
      </BoundingBox>GridWidth>
      <LaneCount><ZoneTemperature>
        326
      </LaneCount>ZoneTemperature>
      <LaneWidth><ZoneHumidity>
        11053
      </LaneWidth>ZoneHumidity>
      <ZoneLength><ZoneAvgSM>
        1020
      </ZoneLength>ZoneAvgSM>
      <ZoneInLane><ZoneAvgLight>
        52
      </ZoneInLane>ZoneAvgLight>
      <ZoneCount><CropType>
        15Apple
      </ZoneCount>CropType>
      <GHLength><SeedingDate>
        11011-04-2016
      </GHLength>SeedingDate>
      <GHWidth><LastFertilisationDate>
        4014-04-2016
      </GHWidth>LastFertilisationDate>
      <HarvestingSeason>
        <ExternalEnv>April
      </HarvestingSeason>
  <Temperature>    <NoOfPlants>
      26  5
      </Temperature>NoOfPlants>
      <VPD>
  <Humidity>      0
    53  </VPD>
      </Humidity><Location>
        <Light><latitude>
          1.11
        </Light>latitude>
        <SoilMoisture><longitude>
          201.12
        </SoilMoisture>longitude>
      </Location>
 <Wind>     <Live>
     19.5   yes
      </Wind>Live>
    </Zone>
  </Create>
</ExternalEnv>Query>

Create Lane

Code Block
languagexml
titleCreate Lane
linenumberstrue
<Query>
  <DeleteAll format="version,current">
  <InternalEnv>  <Lane>
      <Temperature><LaneID ne = ""/>
    </Lane>
  20</DeleteAll>
  <Create>
    <Lane>
</Temperature>      <LaneID>
  <Humidity>      livelane
    53  </LaneID>
      </Humidity><GreenhouseID>
        <Light>livegreenhouse
      </GreenhouseID>
   1   <LaneName>
      </Light>
  lane-1
      </LaneName>
<SoilMoisture>      <LaneLength>
    1    5
      </SoilMoisture>LaneLength>
      <LaneWidth>
 </InternalEnv>       <GHLanes>1
      </GHLanes>LaneWidth>
      <SunnyDay><ZoneInLane>
        True4
      </SunnyDay>ZoneInLane>
      <BorderLane>
<Location>        1
<latitude>      </BorderLane>
    37.3718999  <BoundingBox>
      </latitude>  <Vertex1>
      <longitude>    5
      -122.0022377  </Vertex1>
      </longitude>  <Vertex2>
    </Location>     </Greenhouse> 28
        </Create>
</Query>

Create Temperature Sensor

TempSensorInZone value is the ZoneID value of the Zone. This is dynamically assigned by querying the Zone Model.

Code Block
languagexml
titleCreate Temperature Sensor
linenumberstrue
<Query>
  <DeleteAll>Vertex2>
        <Vertex3>
      <TempSensorModel>    105
  <TempSensorId ne=""/>     </TempSensorModel>Vertex3>
   </DeleteAll>   <Find>     <Zone><Vertex4>
          38
        </Vertex4>
      </BoundingBox>
    </Lane>
  </Create>
</Query>

Create Greenhouse

Code Block
languagexml
titleCreate Greenhouse
linenumberstrue
<<Query>
  <DeleteAll format="version,current">
    <Greenhouse>
      <GreenhouseID ne=""/>
    </Greenhouse>
  </DeleteAll>
  <Create>
    <Greenhouse>
      <GreenhouseID>
        livegreenhouse
      </GreenhouseID>
      <GreenhouseName>
        Intel-GreenHouse
      </GreenhouseName>
      <BoundingBox>
        <Vertex1>
          0
        </Vertex1>
        <Vertex2>
          0
        </Vertex2>
        <Vertex3>
          110
        </Vertex3>
        <Vertex4>
          40
        </Vertex4>
      </BoundingBox>
      <LaneCount>
        3
      </LaneCount>
      <LaneWidth>
        110
      </LaneWidth>
      <ZoneLength>
        10
      </ZoneLength>
      <ZoneInLane>
        5
      </ZoneInLane>
      <ZoneCount>
        15
      </ZoneCount>
      <GHLength>
        110
      </GHLength>
      <GHWidth>
        40
      </GHWidth>
      <ExternalEnv>
        <Temperature>
          26
        </Temperature>
        <Humidity>
          53
        </Humidity>
        <Light>
          1
        </Light>
        <SoilMoisture>
          20
        </SoilMoisture>
        <Wind>
          19.5
        </Wind>
      </ExternalEnv>
      <InternalEnv>
        <Temperature>
          20
        </Temperature>
        <Humidity>
          53
        </Humidity>
        <Light>
          1
        </Light>
        <SoilMoisture>
          1
        </SoilMoisture>
      </InternalEnv>
      <GHLanes>
      </GHLanes>
      <SunnyDay>
        True
      </SunnyDay>
      <Location>
        <latitude>
          37.3718999
        </latitude>
        <longitude>
          -122.0022377
        </longitude>
      </Location>
    </Greenhouse>
  </Create>
</Query>

Initialize Temperature Sensor

TempSensorInZone value is the ZoneID value of the Zone.

Code Block
languagexml
titleCreate Temperature Sensor
linenumberstrue
<Query>
  <DeleteAll format="version,current">
    <TempSensor>
      <sensorId ne=""/>
    </TempSensor>
  </DeleteAll>
  <Save format="version,current">
    <!-- This will read -->
    <TempSensor>
      <Peripheral>
        serial
      </Peripheral>
      <Baudrate>
        115200
      </Baudrate>
      <InterfacePort>
        /dev/tty.usbserial-DA01OX0S
      </InterfacePort>
      <Interface>
        serial
      </Interface>
      <Format>
        ascii
      </Format>
      <Operation>
        receive
      </Operation>
      <ZoneName eq="Zone1"/><UniqueId>
     </Zone>   </Find>76522
  <Create>    </UniqueId>
<TempSensorModel>      <Payload>
<TempValueInC>         0$Null()
      </TempValueInC>Payload>
      <TempValueInF><TempValue>
        0$Null()
      </TempValueInF>TempValue>
      <TempSensorInZone>
        [:$Response.Message.Value.Find.Result.Zone.ZoneID:]livezone
      </TempSensorInZone>
    </TempSensorModel>TempSensor>
  </Create>Save>
</Query>

Find

...

Greenhouse

Code Block
languagexml
titleFind Temperature Greenhouse
linenumberstrue
<Query>
  <Find nested="*" format="Version">
    <TempSensorModel><Greenhouse>
      <TempSensorId<GreenhouseID ne="" />
    </TempSensorModel>Greenhouse>
  </Find>
</Query>