Compare commits
13 Commits
graph_fixi
...
last_fill_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2db89ffc0 | ||
|
|
ac76654e2a | ||
| 2772baafbc | |||
|
|
3e0733bf3d | ||
|
|
d9fa0bf2f5 | ||
|
|
abff71ac06 | ||
|
|
5a4fdbbd00 | ||
|
|
96c67a6d00 | ||
|
|
3b8fb3dce4 | ||
| 0b4a886de6 | |||
|
|
79df9d05b4 | ||
| 4df30c3523 | |||
|
|
f886530f5f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -58,3 +58,6 @@ docs/_build/
|
|||||||
|
|
||||||
# PyBuilder
|
# PyBuilder
|
||||||
target/
|
target/
|
||||||
|
|
||||||
|
# meteor
|
||||||
|
app.tar.gz
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
|
|||||||
1.2.0-meteor-platform-split
|
1.2.0-meteor-platform-split
|
||||||
1.2.0-cordova-changes
|
1.2.0-cordova-changes
|
||||||
1.2.0-breaking-changes
|
1.2.0-breaking-changes
|
||||||
|
1.3.0-split-minifiers-package
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ session # Client-side reactive dictionary for your app
|
|||||||
jquery # Helpful client-side library
|
jquery # Helpful client-side library
|
||||||
tracker # Meteor's client-side reactive programming library
|
tracker # Meteor's client-side reactive programming library
|
||||||
|
|
||||||
standard-minifiers # JS/CSS minifiers run for production mode
|
|
||||||
es5-shim # ECMAScript 5 compatibility for older browsers.
|
es5-shim # ECMAScript 5 compatibility for older browsers.
|
||||||
ecmascript # Enable ECMAScript2015+ syntax in app code
|
ecmascript # Enable ECMAScript2015+ syntax in app code
|
||||||
|
|
||||||
@@ -27,3 +26,5 @@ rzymek:moment-locale-bs
|
|||||||
peppelg:bootstrap-3-modal
|
peppelg:bootstrap-3-modal
|
||||||
fortawesome:fontawesome
|
fortawesome:fontawesome
|
||||||
mfpierre:chartist-js
|
mfpierre:chartist-js
|
||||||
|
standard-minifier-css
|
||||||
|
standard-minifier-js
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
METEOR@1.2.1
|
METEOR@1.3.1
|
||||||
|
|||||||
@@ -1,92 +1,95 @@
|
|||||||
accounts-base@1.2.2
|
accounts-base@1.2.5
|
||||||
accounts-password@1.1.4
|
accounts-password@1.1.7
|
||||||
|
allow-deny@1.0.3
|
||||||
amplify@1.0.0
|
amplify@1.0.0
|
||||||
autoupdate@1.2.4
|
autoupdate@1.2.7
|
||||||
babel-compiler@5.8.24_1
|
babel-compiler@6.6.1
|
||||||
babel-runtime@0.1.4
|
babel-runtime@0.1.7
|
||||||
base64@1.0.4
|
base64@1.0.7
|
||||||
binary-heap@1.0.4
|
binary-heap@1.0.7
|
||||||
blaze@2.1.3
|
blaze@2.1.6
|
||||||
blaze-html-templates@1.0.1
|
blaze-html-templates@1.0.3
|
||||||
blaze-tools@1.0.4
|
blaze-tools@1.0.7
|
||||||
boilerplate-generator@1.0.4
|
boilerplate-generator@1.0.7
|
||||||
caching-compiler@1.0.0
|
caching-compiler@1.0.3
|
||||||
caching-html-compiler@1.0.2
|
caching-html-compiler@1.0.5
|
||||||
callback-hook@1.0.4
|
callback-hook@1.0.7
|
||||||
check@1.1.0
|
check@1.1.3
|
||||||
coffeescript@1.0.11
|
coffeescript@1.0.16
|
||||||
ddp@1.2.2
|
ddp@1.2.4
|
||||||
ddp-client@1.2.1
|
ddp-client@1.2.4
|
||||||
ddp-common@1.2.2
|
ddp-common@1.2.4
|
||||||
ddp-rate-limiter@1.0.0
|
ddp-rate-limiter@1.0.3
|
||||||
ddp-server@1.2.2
|
ddp-server@1.2.5
|
||||||
deps@1.0.9
|
deps@1.0.11
|
||||||
diff-sequence@1.0.1
|
diff-sequence@1.0.4
|
||||||
ecmascript@0.1.6
|
ecmascript@0.4.2
|
||||||
ecmascript-runtime@0.2.6
|
ecmascript-runtime@0.2.9
|
||||||
ejson@1.0.7
|
ejson@1.0.10
|
||||||
email@1.0.8
|
email@1.0.11
|
||||||
es5-shim@4.1.14
|
es5-shim@4.5.9
|
||||||
fastclick@1.0.7
|
fastclick@1.0.10
|
||||||
fortawesome:fontawesome@4.5.0
|
fortawesome:fontawesome@4.5.0
|
||||||
fourseven:scss@3.4.1
|
fourseven:scss@3.4.1
|
||||||
geojson-utils@1.0.4
|
geojson-utils@1.0.7
|
||||||
handlebars@1.0.4
|
hot-code-push@1.0.3
|
||||||
hot-code-push@1.0.0
|
html-tools@1.0.8
|
||||||
html-tools@1.0.5
|
htmljs@1.0.8
|
||||||
htmljs@1.0.5
|
http@1.1.4
|
||||||
http@1.1.1
|
huttonr:bootstrap3@3.3.6_10
|
||||||
huttonr:bootstrap3@3.3.6_6
|
huttonr:bootstrap3-assets@3.3.6_3
|
||||||
huttonr:bootstrap3-assets@3.3.6_2
|
id-map@1.0.6
|
||||||
id-map@1.0.4
|
jquery@1.11.7
|
||||||
jquery@1.11.4
|
launch-screen@1.0.10
|
||||||
json@1.0.3
|
less@2.5.7
|
||||||
launch-screen@1.0.4
|
livedata@1.0.17
|
||||||
less@2.5.1
|
localstorage@1.0.8
|
||||||
livedata@1.0.15
|
logging@1.0.11
|
||||||
localstorage@1.0.5
|
meteor@1.1.13
|
||||||
logging@1.0.8
|
meteor-base@1.0.3
|
||||||
meteor@1.1.10
|
|
||||||
meteor-base@1.0.1
|
|
||||||
mfpierre:chartist-js@1.6.1
|
mfpierre:chartist-js@1.6.1
|
||||||
minifiers@1.1.7
|
minifier-css@1.1.10
|
||||||
minimongo@1.0.10
|
minifier-js@1.1.10
|
||||||
mobile-experience@1.0.1
|
minimongo@1.0.13
|
||||||
mobile-status-bar@1.0.6
|
mobile-experience@1.0.3
|
||||||
momentjs:moment@2.11.2
|
mobile-status-bar@1.0.11
|
||||||
mongo@1.1.3
|
modules@0.5.2
|
||||||
mongo-id@1.0.1
|
modules-runtime@0.6.2
|
||||||
nimble:restivus@0.8.7
|
momentjs:moment@2.12.0
|
||||||
|
mongo@1.1.6
|
||||||
|
mongo-id@1.0.3
|
||||||
|
nimble:restivus@0.8.10
|
||||||
npm-bcrypt@0.7.8_2
|
npm-bcrypt@0.7.8_2
|
||||||
npm-mongo@1.4.39_1
|
npm-mongo@1.4.42
|
||||||
observe-sequence@1.0.7
|
observe-sequence@1.0.10
|
||||||
ordered-dict@1.0.4
|
ordered-dict@1.0.6
|
||||||
peppelg:bootstrap-3-modal@1.0.4
|
peppelg:bootstrap-3-modal@1.0.4
|
||||||
percolate:synced-cron@1.3.0
|
percolate:synced-cron@1.3.2
|
||||||
promise@0.5.1
|
promise@0.6.6
|
||||||
random@1.0.5
|
random@1.0.8
|
||||||
rate-limit@1.0.0
|
rate-limit@1.0.3
|
||||||
reactive-dict@1.1.3
|
reactive-dict@1.1.6
|
||||||
reactive-var@1.0.6
|
reactive-var@1.0.8
|
||||||
reload@1.1.4
|
reload@1.1.7
|
||||||
retry@1.0.4
|
retry@1.0.6
|
||||||
routepolicy@1.0.6
|
routepolicy@1.0.9
|
||||||
rzymek:moment-locale-bs@2.9.0
|
rzymek:moment-locale-bs@2.9.0
|
||||||
selaias:meteor-simpleweather@0.6.8
|
selaias:meteor-simpleweather@0.7.0
|
||||||
service-configuration@1.0.5
|
service-configuration@1.0.8
|
||||||
session@1.1.1
|
session@1.1.4
|
||||||
sha@1.0.4
|
sha@1.0.6
|
||||||
simple:json-routes@2.0.1
|
simple:json-routes@2.1.0
|
||||||
spacebars@1.0.7
|
spacebars@1.0.10
|
||||||
spacebars-compiler@1.0.7
|
spacebars-compiler@1.0.10
|
||||||
srp@1.0.4
|
srp@1.0.7
|
||||||
standard-minifiers@1.0.2
|
standard-minifier-css@1.0.5
|
||||||
templating@1.1.5
|
standard-minifier-js@1.0.5
|
||||||
templating-tools@1.0.0
|
templating@1.1.8
|
||||||
tracker@1.0.9
|
templating-tools@1.0.3
|
||||||
|
tracker@1.0.12
|
||||||
u2622:persistent-session@0.4.4
|
u2622:persistent-session@0.4.4
|
||||||
ui@1.0.8
|
ui@1.0.10
|
||||||
underscore@1.0.4
|
underscore@1.0.7
|
||||||
url@1.0.5
|
url@1.0.8
|
||||||
webapp@1.2.3
|
webapp@1.2.7
|
||||||
webapp-hashing@1.0.5
|
webapp-hashing@1.0.8
|
||||||
|
|||||||
BIN
app/app.tar.gz
BIN
app/app.tar.gz
Binary file not shown.
@@ -1,17 +0,0 @@
|
|||||||
var options = {
|
|
||||||
location: 40.7127+','+ 74.0059, // New York
|
|
||||||
unit: 'c',
|
|
||||||
success: function(weather) {
|
|
||||||
html = '<h2><i class="sw icon-'+weather.code+'"></i> '
|
|
||||||
html += weather.temp+'°'+weather.units.temp+'</h2>';
|
|
||||||
html += '<ul><li>'+weather.city+', '+weather.region +'</li>';
|
|
||||||
html += '<li class="currently">'+weather.currently+'</li>';
|
|
||||||
|
|
||||||
$("#weather").html(html);
|
|
||||||
},
|
|
||||||
error: function(error) {
|
|
||||||
$("#weather").html('<p>'+error+'</p>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Weather.options = options
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template name="state">
|
<template name="state">
|
||||||
|
<div> </div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{{#with controller_state}}
|
{{#with controller_state}}
|
||||||
<img src="{{ bucket_image }}" class="img-responsive center-block" id="bucket_image" />
|
<img src="{{ bucket_image }}" class="img-responsive center-block" id="bucket_image" />
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ Template.state.helpers({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Template.state.events({
|
Template.state.events({
|
||||||
'click #water_now': function() {
|
'click #water_now': function() {
|
||||||
var controller_id = Session.get('controller_id');
|
var controller_id = Session.get('controller_id');
|
||||||
|
|||||||
@@ -14,9 +14,13 @@
|
|||||||
<div><strong>Ulazni ventil/pumpa:</strong> {{pretty_valve state.in_valve }}</div>
|
<div><strong>Ulazni ventil/pumpa:</strong> {{pretty_valve state.in_valve }}</div>
|
||||||
<div><strong>Zadnja komunikacija: {{ last_communication_time }}</strong>
|
<div><strong>Zadnja komunikacija: {{ last_communication_time }}</strong>
|
||||||
</div>
|
</div>
|
||||||
|
<div><strong>Zadnje zaljevanje: {{ last_out_valve_open }}</strong>
|
||||||
|
</div>
|
||||||
|
<div><strong>Zadnje punjenje: {{ last_in_valve_open }}</strong>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row hidden">
|
||||||
<div class="col-md-12 chart">
|
<div class="col-md-12 chart">
|
||||||
<h3>Temperatura:</h3>
|
<h3>Temperatura:</h3>
|
||||||
<div id="temperature_graph">
|
<div id="temperature_graph">
|
||||||
@@ -24,7 +28,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row hidden">
|
||||||
<div class="col-md-12 chart">
|
<div class="col-md-12 chart">
|
||||||
<h3>Vlažnost:</h3>
|
<h3>Vlažnost:</h3>
|
||||||
<div id="humidity_graph">
|
<div id="humidity_graph">
|
||||||
|
|||||||
@@ -7,6 +7,12 @@ Template.state_details.helpers({
|
|||||||
},
|
},
|
||||||
last_communication_time: function() {
|
last_communication_time: function() {
|
||||||
return moment(this.time).fromNow();
|
return moment(this.time).fromNow();
|
||||||
|
},
|
||||||
|
last_out_valve_open: function() {
|
||||||
|
return moment(this.significantEvents.lastOutValveOpen).fromNow();
|
||||||
|
},
|
||||||
|
last_in_valve_open: function() {
|
||||||
|
return moment(this.significantEvents.lastInValveOpen).fromNow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -44,8 +50,8 @@ Template.state_details.rendered = function() {
|
|||||||
self.autorun(function() {
|
self.autorun(function() {
|
||||||
sensor_data_collection().observe({
|
sensor_data_collection().observe({
|
||||||
added: function(reading) {
|
added: function(reading) {
|
||||||
buildTemperatureGraph();
|
// buildTemperatureGraph();
|
||||||
buildHumidityGraph()
|
// buildHumidityGraph()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -90,7 +96,7 @@ function buildTemperatureGraph() {
|
|||||||
function buildHumidityGraph() {
|
function buildHumidityGraph() {
|
||||||
var unfilteredReadings = sensor_data_collection();
|
var unfilteredReadings = sensor_data_collection();
|
||||||
// we want to show only 11 points from all data - filtering will add
|
// we want to show only 11 points from all data - filtering will add
|
||||||
// the last one so 10 + 1 = 11
|
// the last one so 10 + 1 = 11
|
||||||
var breakingPoint = Math.floor(countValues(unfilteredReadings) / 10);
|
var breakingPoint = Math.floor(countValues(unfilteredReadings) / 10);
|
||||||
|
|
||||||
var sensorReadings = filterDataPoints(unfilteredReadings, breakingPoint);
|
var sensorReadings = filterDataPoints(unfilteredReadings, breakingPoint);
|
||||||
|
|||||||
9
app/client/weather.html
Normal file
9
app/client/weather.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template name="weather">
|
||||||
|
|
||||||
|
<div> </div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="text-center">
|
||||||
|
{{>simpleWeather}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
38
app/client/weather.js
Normal file
38
app/client/weather.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
var options = {
|
||||||
|
|
||||||
|
location: 44.0123 + ',' + 18.19455, // New Visoko
|
||||||
|
unit: 'c',
|
||||||
|
success: function(weather) {
|
||||||
|
html = "<h2><i class='sw icon-" + weather.code + "'></i>";
|
||||||
|
html += weather.temp + '°' + weather.units.temp + '</h2>';
|
||||||
|
html += '<ul><li>' + weather.city + ', ' + weather.region + '</li>';
|
||||||
|
html += "<li class='currently'>" + weather.currently + '</li>';
|
||||||
|
html += '<hr />';
|
||||||
|
|
||||||
|
for (var i = 0; i < 5; i++) {
|
||||||
|
var forecast = weather.forecast[i];
|
||||||
|
html += '<div>';
|
||||||
|
html += "<h2><i class='sw icon-" + forecast.code + "'></i>";
|
||||||
|
html += forecast.high + '°' + weather.units.temp + '</h2>';
|
||||||
|
html += "<li class='currently'> Najniža dnevna: "+ forecast.low + ' ° ' + weather.units.temp + "<br />" + daysInBosnian[forecast.day] + ': ' + forecast.text + '</li>';
|
||||||
|
html += "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#weather').html(html);
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$('#weather').html('<p>' + error + '</p>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var daysInBosnian = {
|
||||||
|
'Sun': 'Nedjelja',
|
||||||
|
'Mon': 'Ponedjeljak',
|
||||||
|
'Tue': 'Utorak',
|
||||||
|
'Wed': 'Srijeda',
|
||||||
|
'Thu': 'Četvrtak',
|
||||||
|
'Fri': 'Petak',
|
||||||
|
'Sat': 'Subota'
|
||||||
|
};
|
||||||
|
|
||||||
|
Weather.options = options
|
||||||
@@ -37,6 +37,7 @@ function reactToSensorData(nextSensorReading) {
|
|||||||
}, {
|
}, {
|
||||||
'$set': {
|
'$set': {
|
||||||
'state.in_valve': 'opening',
|
'state.in_valve': 'opening',
|
||||||
|
'significantEvents.lastInValveOpen': new Date(),
|
||||||
'time': new Date(),
|
'time': new Date(),
|
||||||
'set_by': 'server'
|
'set_by': 'server'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ function setOutValveTo(controller_id, nextState) {
|
|||||||
'set_by': 'server'
|
'set_by': 'server'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(nextState === "open") {
|
||||||
|
ControllerState.update(state._id, {
|
||||||
|
'$set': {
|
||||||
|
'significantEvents.lastOutValveOpen': new Date(),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openOutValve(controller_id) {
|
function openOutValve(controller_id) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ GPIO.setup(config.GPIO_PIN_TANKFULL, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
|||||||
|
|
||||||
# tank sensor has inverse logic - 0 when it is full 1 when it is not
|
# tank sensor has inverse logic - 0 when it is full 1 when it is not
|
||||||
# so we are inverting its value here
|
# so we are inverting its value here
|
||||||
tankFull = (not GPIO.input(config.GPIO_PIN_TANKFULL))
|
tankFull = (GPIO.input(config.GPIO_PIN_TANKFULL) == GPIO.LOW)
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
print 'Bacva puna: {}'.format(tankFull)
|
print 'Bacva puna: {}'.format(tankFull)
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ humidity, temperature = Adafruit_DHT.read_retry(SENSOR_TYPE, config.GPIO_PIN_DHT
|
|||||||
# guarantee the timing of calls to read the sensor).
|
# guarantee the timing of calls to read the sensor).
|
||||||
# If this happens try again!
|
# If this happens try again!
|
||||||
if temperature is not None and humidity is not None:
|
if temperature is not None and humidity is not None:
|
||||||
response = requests.post(config.SENSORDATA_URL, json={"owner": owner, "temperatureValue": temperature, "humidityValue":humidity, "tankFull":tankFull,
|
response = requests.post(config.SENSORDATA_URL, json={"owner": owner, "temperatureValue": temperature, "humidityValue":humidity, "tankFull": "1" if tankFull else "0",
|
||||||
"controllerId": controller_id
|
"controllerId": controller_id
|
||||||
})
|
})
|
||||||
print 'Temp={0:0.1f}*C'.format(temperature)
|
print 'Temp={0:0.1f}*C'.format(temperature)
|
||||||
|
|||||||
136
misc/calculator.html
Normal file
136
misc/calculator.html
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
|
||||||
|
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
|
||||||
|
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="jumbotron">
|
||||||
|
<div class="lead text-center">
|
||||||
|
<img src="./zoblak.png" width="30%" />
|
||||||
|
<br /> Zoblak Agrar Plus se isplati za <span id="vrijemeZaBreakEven" class="bg-success"></span> mjeseci. U periodu od <span id="brojSezona"></span> godine ostvaruje uštedu u novcu od <span id="iznosUstede" class="bg-success"></span> KM, te uštedu u vremenu od <span id="satiUProjekciji" class="bg-success"></span> sati za podešeni slučaj.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<p>Na troškove goriva mjesečno trošite <span id="iznosGoriva"></span> KM. Na rad potreban za zalijevanje trošite mjesečno <span id="satiMjesecno"></span> sati što uz zadanu satnicu iznosi <span id="plata"></span> KM. Zajedno to je <span id="ukupnoTroskovaMjesecno"></span> KM troška na zalijevanje. </p>
|
||||||
|
|
||||||
|
<p>Okvirna cijena Zoblak Agrar Plus iznosi <span id="bazaCijeneZoblaka"></span> KM + sistem navodnjavanja</p>
|
||||||
|
|
||||||
|
<p class="bg-primary">NAPOMENA: finalna cijena može biti niža ili viša i poznata je nakon izrade projekta).</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-sm-6">
|
||||||
|
<form method="post">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number">
|
||||||
|
Vaša udaljenost od polja u km
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="pudaljenost" type="number" min="1" max="200" step="0.1" value="5" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number1">
|
||||||
|
Prosjecna potrošnja automobila na 100 km
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="ppotrosnja" type="number" min="2" max="15" value="7" step="0.1" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="select">
|
||||||
|
Koliko često treba zaljevati kulturu?
|
||||||
|
</label>
|
||||||
|
<select class="select form-control" id="pfrekvencija_zalijevanja">
|
||||||
|
<option value="1">
|
||||||
|
Svaki dan
|
||||||
|
</option>
|
||||||
|
<option value="2">
|
||||||
|
Jednom u dva dana
|
||||||
|
</option>
|
||||||
|
<option value="3">
|
||||||
|
Jednom u tri dana
|
||||||
|
</option>
|
||||||
|
<option value="4">
|
||||||
|
Jednom u četiri dana
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number2">
|
||||||
|
Koliko vremena traje put prema polju (u oba smijera) i jedan ciklus zalijevanja? U satima.
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="pvrijeme" type="number" min="2" max="10" value="1.5" step="0.5" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number3">
|
||||||
|
Satnica osobe koja zalijeva u KM
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="psatnica" type="number" min="1" max="100" value="20" step="1" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number3">
|
||||||
|
Trajanje sezone u mjesecima
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="psezona" type="number" min="1" max="12" value="4" step="1" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label " for="number3">
|
||||||
|
Na koliko godina/sezona se kalkulacija vrši
|
||||||
|
</label>
|
||||||
|
<input class="form-control ulazni-parametar" id="pbroj_sezona" type="number" min="1" max="10" value="3" step="1" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function iskalkulisi() {
|
||||||
|
var udaljenost = parseFloat($('#pudaljenost').val()) || 10;
|
||||||
|
var potrosnja = parseFloat($('#ppotrosnja').val()) || 7;
|
||||||
|
var frekvencija = parseInt($('#pfrekvencija_zalijevanja').val()) || 2;
|
||||||
|
var vrijeme = parseFloat($('#pvrijeme').val()) || 1.5;
|
||||||
|
var satnica = parseFloat($('#psatnica').val()) || 20;
|
||||||
|
var sezona = parseInt($('#psezona').val()) || 4;
|
||||||
|
var brojSezona = parseInt($('#pbroj_sezona').val()) || 3;
|
||||||
|
|
||||||
|
var bazaCijeneZoblaka = 1000;
|
||||||
|
var bazaCijeneVentila = 0;
|
||||||
|
var bazaCijeneGoriva = 1.70;
|
||||||
|
var godisnjeOdrzavanjeZoblaka = 200;
|
||||||
|
|
||||||
|
// rezultati
|
||||||
|
var zalijevanjaMjesecno = Math.ceil(30 / frekvencija);
|
||||||
|
var satiMjesecno = Math.ceil(vrijeme) * zalijevanjaMjesecno;
|
||||||
|
var plata = satiMjesecno * satnica;
|
||||||
|
var iznosGoriva = Math.ceil((potrosnja / 100) * bazaCijeneGoriva * (udaljenost * 2) * zalijevanjaMjesecno);
|
||||||
|
var ukupnoTroskovaMjesecno = iznosGoriva + plata;
|
||||||
|
var trosakZoblaka = bazaCijeneZoblaka + godisnjeOdrzavanjeZoblaka * (brojSezona - 1);
|
||||||
|
var satiUProjekciji = satiMjesecno * sezona * brojSezona;
|
||||||
|
var novcaUProjekciji = ukupnoTroskovaMjesecno * sezona * brojSezona;
|
||||||
|
var iznosUstede = novcaUProjekciji - trosakZoblaka
|
||||||
|
var vrijemeZaBreakEven = Math.ceil(bazaCijeneZoblaka / ukupnoTroskovaMjesecno);
|
||||||
|
|
||||||
|
$('#vrijemeZaBreakEven').html(vrijemeZaBreakEven);
|
||||||
|
$('#brojSezona').html(brojSezona);
|
||||||
|
$('#iznosUstede').html(iznosUstede);
|
||||||
|
$('#satiUProjekciji').html(satiUProjekciji);
|
||||||
|
$('#iznosGoriva').html(iznosGoriva);
|
||||||
|
$('#satiMjesecno').html(satiMjesecno);
|
||||||
|
$('#plata').html(plata);
|
||||||
|
$('#ukupnoTroskovaMjesecno').html(ukupnoTroskovaMjesecno);
|
||||||
|
$('#bazaCijeneZoblaka').html(bazaCijeneZoblaka);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
iskalkulisi();
|
||||||
|
$(".ulazni-parametar").keyup(iskalkulisi);
|
||||||
|
$(".ulazni-parametar").change(iskalkulisi);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
BIN
misc/zoblak.png
Normal file
BIN
misc/zoblak.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user