Compare commits
2 Commits
add_weathe
...
graph_fixi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98983ea50d | ||
|
|
c947980844 |
@@ -10,4 +10,3 @@ 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,6 +12,7 @@ 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
|
||||||
|
|
||||||
@@ -26,5 +27,3 @@ 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.3.1
|
METEOR@1.2.1
|
||||||
|
|||||||
@@ -1,95 +1,92 @@
|
|||||||
accounts-base@1.2.5
|
accounts-base@1.2.2
|
||||||
accounts-password@1.1.7
|
accounts-password@1.1.4
|
||||||
allow-deny@1.0.3
|
|
||||||
amplify@1.0.0
|
amplify@1.0.0
|
||||||
autoupdate@1.2.7
|
autoupdate@1.2.4
|
||||||
babel-compiler@6.6.1
|
babel-compiler@5.8.24_1
|
||||||
babel-runtime@0.1.7
|
babel-runtime@0.1.4
|
||||||
base64@1.0.7
|
base64@1.0.4
|
||||||
binary-heap@1.0.7
|
binary-heap@1.0.4
|
||||||
blaze@2.1.6
|
blaze@2.1.3
|
||||||
blaze-html-templates@1.0.3
|
blaze-html-templates@1.0.1
|
||||||
blaze-tools@1.0.7
|
blaze-tools@1.0.4
|
||||||
boilerplate-generator@1.0.7
|
boilerplate-generator@1.0.4
|
||||||
caching-compiler@1.0.3
|
caching-compiler@1.0.0
|
||||||
caching-html-compiler@1.0.5
|
caching-html-compiler@1.0.2
|
||||||
callback-hook@1.0.7
|
callback-hook@1.0.4
|
||||||
check@1.1.3
|
check@1.1.0
|
||||||
coffeescript@1.0.16
|
coffeescript@1.0.11
|
||||||
ddp@1.2.4
|
ddp@1.2.2
|
||||||
ddp-client@1.2.4
|
ddp-client@1.2.1
|
||||||
ddp-common@1.2.4
|
ddp-common@1.2.2
|
||||||
ddp-rate-limiter@1.0.3
|
ddp-rate-limiter@1.0.0
|
||||||
ddp-server@1.2.5
|
ddp-server@1.2.2
|
||||||
deps@1.0.11
|
deps@1.0.9
|
||||||
diff-sequence@1.0.4
|
diff-sequence@1.0.1
|
||||||
ecmascript@0.4.2
|
ecmascript@0.1.6
|
||||||
ecmascript-runtime@0.2.9
|
ecmascript-runtime@0.2.6
|
||||||
ejson@1.0.10
|
ejson@1.0.7
|
||||||
email@1.0.11
|
email@1.0.8
|
||||||
es5-shim@4.5.9
|
es5-shim@4.1.14
|
||||||
fastclick@1.0.10
|
fastclick@1.0.7
|
||||||
fortawesome:fontawesome@4.5.0
|
fortawesome:fontawesome@4.5.0
|
||||||
fourseven:scss@3.4.1
|
fourseven:scss@3.4.1
|
||||||
geojson-utils@1.0.7
|
geojson-utils@1.0.4
|
||||||
hot-code-push@1.0.3
|
handlebars@1.0.4
|
||||||
html-tools@1.0.8
|
hot-code-push@1.0.0
|
||||||
htmljs@1.0.8
|
html-tools@1.0.5
|
||||||
http@1.1.4
|
htmljs@1.0.5
|
||||||
huttonr:bootstrap3@3.3.6_10
|
http@1.1.1
|
||||||
huttonr:bootstrap3-assets@3.3.6_3
|
huttonr:bootstrap3@3.3.6_6
|
||||||
id-map@1.0.6
|
huttonr:bootstrap3-assets@3.3.6_2
|
||||||
jquery@1.11.7
|
id-map@1.0.4
|
||||||
launch-screen@1.0.10
|
jquery@1.11.4
|
||||||
less@2.5.7
|
json@1.0.3
|
||||||
livedata@1.0.17
|
launch-screen@1.0.4
|
||||||
localstorage@1.0.8
|
less@2.5.1
|
||||||
logging@1.0.11
|
livedata@1.0.15
|
||||||
meteor@1.1.13
|
localstorage@1.0.5
|
||||||
meteor-base@1.0.3
|
logging@1.0.8
|
||||||
|
meteor@1.1.10
|
||||||
|
meteor-base@1.0.1
|
||||||
mfpierre:chartist-js@1.6.1
|
mfpierre:chartist-js@1.6.1
|
||||||
minifier-css@1.1.10
|
minifiers@1.1.7
|
||||||
minifier-js@1.1.10
|
minimongo@1.0.10
|
||||||
minimongo@1.0.13
|
mobile-experience@1.0.1
|
||||||
mobile-experience@1.0.3
|
mobile-status-bar@1.0.6
|
||||||
mobile-status-bar@1.0.11
|
momentjs:moment@2.11.2
|
||||||
modules@0.5.2
|
mongo@1.1.3
|
||||||
modules-runtime@0.6.2
|
mongo-id@1.0.1
|
||||||
momentjs:moment@2.12.0
|
nimble:restivus@0.8.7
|
||||||
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.42
|
npm-mongo@1.4.39_1
|
||||||
observe-sequence@1.0.10
|
observe-sequence@1.0.7
|
||||||
ordered-dict@1.0.6
|
ordered-dict@1.0.4
|
||||||
peppelg:bootstrap-3-modal@1.0.4
|
peppelg:bootstrap-3-modal@1.0.4
|
||||||
percolate:synced-cron@1.3.2
|
percolate:synced-cron@1.3.0
|
||||||
promise@0.6.6
|
promise@0.5.1
|
||||||
random@1.0.8
|
random@1.0.5
|
||||||
rate-limit@1.0.3
|
rate-limit@1.0.0
|
||||||
reactive-dict@1.1.6
|
reactive-dict@1.1.3
|
||||||
reactive-var@1.0.8
|
reactive-var@1.0.6
|
||||||
reload@1.1.7
|
reload@1.1.4
|
||||||
retry@1.0.6
|
retry@1.0.4
|
||||||
routepolicy@1.0.9
|
routepolicy@1.0.6
|
||||||
rzymek:moment-locale-bs@2.9.0
|
rzymek:moment-locale-bs@2.9.0
|
||||||
selaias:meteor-simpleweather@0.7.0
|
selaias:meteor-simpleweather@0.6.8
|
||||||
service-configuration@1.0.8
|
service-configuration@1.0.5
|
||||||
session@1.1.4
|
session@1.1.1
|
||||||
sha@1.0.6
|
sha@1.0.4
|
||||||
simple:json-routes@2.1.0
|
simple:json-routes@2.0.1
|
||||||
spacebars@1.0.10
|
spacebars@1.0.7
|
||||||
spacebars-compiler@1.0.10
|
spacebars-compiler@1.0.7
|
||||||
srp@1.0.7
|
srp@1.0.4
|
||||||
standard-minifier-css@1.0.5
|
standard-minifiers@1.0.2
|
||||||
standard-minifier-js@1.0.5
|
templating@1.1.5
|
||||||
templating@1.1.8
|
templating-tools@1.0.0
|
||||||
templating-tools@1.0.3
|
tracker@1.0.9
|
||||||
tracker@1.0.12
|
|
||||||
u2622:persistent-session@0.4.4
|
u2622:persistent-session@0.4.4
|
||||||
ui@1.0.10
|
ui@1.0.8
|
||||||
underscore@1.0.7
|
underscore@1.0.4
|
||||||
url@1.0.8
|
url@1.0.5
|
||||||
webapp@1.2.7
|
webapp@1.2.3
|
||||||
webapp-hashing@1.0.8
|
webapp-hashing@1.0.5
|
||||||
|
|||||||
BIN
app/app.tar.gz
Normal file
BIN
app/app.tar.gz
Normal file
Binary file not shown.
@@ -0,0 +1,17 @@
|
|||||||
|
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,5 +1,4 @@
|
|||||||
<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,8 +100,6 @@ 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');
|
||||||
|
|||||||
@@ -22,16 +22,13 @@ Template.state_details.rendered = function() {
|
|||||||
.range([0, $(self.timelineWrapper).width()])
|
.range([0, $(self.timelineWrapper).width()])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sensor_data_collection() {
|
function sensor_data_collection() {
|
||||||
var controllerId = Session.get('controller_id');
|
var controllerId = Session.get('controller_id');
|
||||||
return SensorData.find({
|
return SensorData.find({
|
||||||
controllerId: controllerId
|
controllerId: controllerId
|
||||||
}, {
|
}, {
|
||||||
sort: {
|
sort: {
|
||||||
created_at: -1
|
created_at: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -60,9 +57,13 @@ Template.state_details.rendered = function() {
|
|||||||
*/
|
*/
|
||||||
function buildTemperatureGraph() {
|
function buildTemperatureGraph() {
|
||||||
|
|
||||||
var sensorReadings = sensor_data_collection();
|
var unfilteredReadings = sensor_data_collection();
|
||||||
|
|
||||||
|
// we want to show only 11 points from all data
|
||||||
|
var breakingPoint = Math.floor(countValues(unfilteredReadings) / 10);
|
||||||
|
|
||||||
|
var sensorReadings = filterDataPoints(unfilteredReadings, breakingPoint);
|
||||||
|
|
||||||
console.log("Added: ", sensorReadings.count());
|
|
||||||
var times = sensorReadings.map(function(reading) {
|
var times = sensorReadings.map(function(reading) {
|
||||||
return moment(reading.created_at).format("HH:mm:ss");
|
return moment(reading.created_at).format("HH:mm:ss");
|
||||||
});
|
});
|
||||||
@@ -70,6 +71,8 @@ function buildTemperatureGraph() {
|
|||||||
return reading.temperatureValue;
|
return reading.temperatureValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var breakingPoint = Math.floor(times.length / 11);
|
||||||
|
|
||||||
return new Chartist.Line('#temperature_graph', {
|
return new Chartist.Line('#temperature_graph', {
|
||||||
labels: times,
|
labels: times,
|
||||||
series: [values]
|
series: [values]
|
||||||
@@ -85,10 +88,13 @@ function buildTemperatureGraph() {
|
|||||||
* Function to draw the graph
|
* Function to draw the graph
|
||||||
*/
|
*/
|
||||||
function buildHumidityGraph() {
|
function buildHumidityGraph() {
|
||||||
|
var unfilteredReadings = sensor_data_collection();
|
||||||
|
// we want to show only 11 points from all data - filtering will add
|
||||||
|
// the last one so 10 + 1 = 11
|
||||||
|
var breakingPoint = Math.floor(countValues(unfilteredReadings) / 10);
|
||||||
|
|
||||||
var sensorReadings = sensor_data_collection();
|
var sensorReadings = filterDataPoints(unfilteredReadings, breakingPoint);
|
||||||
|
|
||||||
console.log("Added: ", sensorReadings.count());
|
|
||||||
var times = sensorReadings.map(function(reading) {
|
var times = sensorReadings.map(function(reading) {
|
||||||
return moment(reading.created_at).format("HH:mm:ss");
|
return moment(reading.created_at).format("HH:mm:ss");
|
||||||
});
|
});
|
||||||
@@ -96,6 +102,8 @@ function buildHumidityGraph() {
|
|||||||
return reading.humidityValue;
|
return reading.humidityValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new Chartist.Line('#humidity_graph', {
|
return new Chartist.Line('#humidity_graph', {
|
||||||
labels: times,
|
labels: times,
|
||||||
series: [values]
|
series: [values]
|
||||||
@@ -106,3 +114,40 @@ function buildHumidityGraph() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterDataPoints(data, breakingPoint) {
|
||||||
|
|
||||||
|
if (breakingPoint === 0) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var result = [];
|
||||||
|
var index = 0;
|
||||||
|
var lastUnpushedRow = null;
|
||||||
|
data.forEach(function(row) {
|
||||||
|
if (index % breakingPoint === 0) {
|
||||||
|
result.push(row);
|
||||||
|
lastUnpushedRow = null;
|
||||||
|
} else {
|
||||||
|
lastUnpushedRow = row;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
|
||||||
|
// in order to always have the latest value
|
||||||
|
if(lastUnpushedRow) {
|
||||||
|
|
||||||
|
result.push(lastUnpushedRow);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// dirty hack for the complicated way of getting
|
||||||
|
// acual number of values
|
||||||
|
function countValues(data) {
|
||||||
|
var count = 0;
|
||||||
|
data.forEach(function(row) {
|
||||||
|
count++;
|
||||||
|
});
|
||||||
|
return count;
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
<template name="weather">
|
|
||||||
|
|
||||||
<div> </div>
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="text-center">
|
|
||||||
{{>simpleWeather}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
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'>" + 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
|
|
||||||
@@ -4,29 +4,10 @@ if (Meteor.isServer) {
|
|||||||
SyncedCron.start();
|
SyncedCron.start();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Global API configuration
|
// Global API configuration
|
||||||
var Api = new Restivus({
|
var Api = new Restivus({
|
||||||
useDefaultAuth: true,
|
useDefaultAuth: true,
|
||||||
prettyJson: true
|
prettyJson: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// Api.addRoute('sensorData', {
|
|
||||||
// authRequired: false
|
|
||||||
// }, {
|
|
||||||
// post: function() {
|
|
||||||
// SensorData.insert({
|
|
||||||
// temperatureValue: parseFloat(this.bodyParams.temperatureValue),
|
|
||||||
// humidityValue: parseFloat(this.bodyParams.humidityValue),
|
|
||||||
// tankFull: this.bodyParams.tankFull,
|
|
||||||
// owner: this.bodyParams.owner,
|
|
||||||
// created_at: new Date()
|
|
||||||
// });
|
|
||||||
// return [];
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import RPi.GPIO as GPIO
|
|||||||
# Try to read the state of GPIO_PIN_TANKFULL
|
# Try to read the state of GPIO_PIN_TANKFULL
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(config.GPIO_PIN_TANKFULL, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
GPIO.setup(config.GPIO_PIN_TANKFULL, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||||
tankFull = GPIO.input(config.GPIO_PIN_TANKFULL)
|
|
||||||
|
# tank sensor has inverse logic - 0 when it is full 1 when it is not
|
||||||
|
# so we are inverting its value here
|
||||||
|
tankFull = (not GPIO.input(config.GPIO_PIN_TANKFULL))
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
print 'Bacva puna: {}'.format(tankFull)
|
print 'Bacva puna: {}'.format(tankFull)
|
||||||
|
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<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">
|
|
||||||
<img src="http://zoblak.com/wp-content/uploads/2016/02/zoblak-1.png" /> <br />
|
|
||||||
Zoblak Agrar Plus se isplati za 2 mjeseci. U periodu od 3 godine ostvaruje uštedu u novcu od 3000.00 KM, te uštedu u vremenu od 800 sati za ovaj konkretan slučaj.
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<p>Na troškove goriva mjesečno trošite 600 KM. Na rad potreban za zalijevanje trošite mjesečno 45 sati što uz zadanu satnicu iznosi 3000 KM. Zajedno to je 3600 KM troška na zalijevanje. </p>
|
|
||||||
|
|
||||||
<p>Okvirna cijena Zoblak Agrar Plus za navedeni broj ventila i pumpi iznosi 2500 KM</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="udaljenost" 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="potrosnja" type="number" min="2" max="5" 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="frekvencija_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="vrijeme" 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="satnica" type="number" min="5" max="100" value="20" step="5" />
|
|
||||||
</div>
|
|
||||||
<div class="form-group ">
|
|
||||||
<label class="control-label " for="number3">
|
|
||||||
Trajanje sezone u mjesecima
|
|
||||||
</label>
|
|
||||||
<input class="form-control ulazni-parametar" id="sezona" type="number" min="1" max="12" value="4" step="1" />
|
|
||||||
</div>
|
|
||||||
<div class="form-group ">
|
|
||||||
<label class="control-label " for="number3">
|
|
||||||
Broj ventila i pumpi koje Zoblak kontroliše
|
|
||||||
</label>
|
|
||||||
<input class="form-control ulazni-parametar" id="broj_ventila" type="number" min="2" max="50" value="2" step="1"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group ">
|
|
||||||
<label class="control-label " for="number3">
|
|
||||||
Na koliko godina/sezona se projekcija vrši
|
|
||||||
</label>
|
|
||||||
<input class="form-control ulazni-parametar" id="broj_sezona" type="number" min="1" max="10" value="1" step="1"/>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
function iskalkulisi() {
|
|
||||||
// ulazi
|
|
||||||
var udaljenost = parseFloat($('#udaljenost').val());
|
|
||||||
var potrosnja = parseFloat($('#potrosnja').val());
|
|
||||||
var frekvencija = parseInt($'#frekvencija_zalijevanja').val());
|
|
||||||
var vrijeme = parseFloat($('#vrijeme').val());
|
|
||||||
var satnica = parseFloat($('#satnica').val());
|
|
||||||
var sezona = parseInt($'#sezona').val());
|
|
||||||
var ventili = parseInt($'#broj_ventila').val());
|
|
||||||
var brojSezona = parseInt($'#broj_sezona').val());
|
|
||||||
var bazaCijeneZoblaka = 1400;
|
|
||||||
var bazaCijeneVentila = 150;
|
|
||||||
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) * (udaljenost * 2) * zalijevanjaMjesecno);
|
|
||||||
var ukupnoTroskovaMjesecno = iznosGoriva + plata;
|
|
||||||
var trosakZoblaka = bazaCijeneZoblaka + ((ventili - 2) * bazaCijeneVentila);
|
|
||||||
var satiUProjekciji = satiMjesecno * sezona * brojSezona;
|
|
||||||
var novcaUProjekciji = ukupnoTroskovaMjesecno * sezona * brojSezona;
|
|
||||||
var iznosUstede =
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user