toji 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fd2eacf273ed8b0126f4d78775c0b0f3d152b54cdba00cf15abe221b71baeb8
4
- data.tar.gz: 5ad7bca85b2b46dd33ec59a5b0069612dd3cdf325fdd6404db2d9dab594f4edf
3
+ metadata.gz: 4bb2c0d3045f4f5106baff4e11e3e68e929fc61bd9367001e262d40176a340ae
4
+ data.tar.gz: c1749c3d61a4e71632a9856a686aa441fef7103ab8ae1d02bc69fef753261eaa
5
5
  SHA512:
6
- metadata.gz: 46c4cc2b892fc477dc7b63d01fbd75f2b5cc934d749e97b9b858820410a958d0545cf024008ad4649aa7270a0e8c2f067b667a92f2d5c3befe3643ea9da70985
7
- data.tar.gz: 572a7438670c646a0dc93bb056a3d55e19bd7bfad5004922544cd87d8c78f8d59d2c36c5de479afe00ea9e250a8f80266d6258f7f44a8216b8c1ebfaecdcecac
6
+ metadata.gz: 77c23ecf85fa60d7d37eae8dc1d937f1f5b636dc4dc28ac87d3614dbe7d94a072734463d2ab86f3d52152e6dea0de5e82921b5ba753b3ab07be9fd1ace93a7a5
7
+ data.tar.gz: c075aee25381874ff10298801a0a5b75d0b2a4801fc244ecfeb7cbe60a4ce2f0e5b28f5a344a10165adf98631f2e4f54c278099d3372128a73e6c6d005522814
@@ -0,0 +1,84 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "data": {
10
+ "text/html": [
11
+ "\n",
12
+ " <script>\n",
13
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
14
+ " </script>\n",
15
+ "\n",
16
+ "\n",
17
+ "<div id=\"fbd8af84-03f9-4489-ba76-90ddd95508fc\" style=\"height: 100%; width: 100%;\"></div>\n",
18
+ "\n",
19
+ "<script>\n",
20
+ " require(['plotly'], function(Plotly) { \n",
21
+ "Plotly.newPlot(\n",
22
+ " 'fbd8af84-03f9-4489-ba76-90ddd95508fc',\n",
23
+ " [{\"x\":[0,3600,32400,32401,75600,75601,104400,104401,126000,126001,140400,158400],\"y\":[35.0,32.0,32.0,31.0,35.0,33.0,37.0,35.0,38.0,37.0,40.0,40.0],\"text\":[\"01/01 09:00\",\"01/01 10:00\",\"01/01 18:00\",\"01/01 18:00\",\"01/02 06:00\",\"01/02 06:00\",\"01/02 14:00\",\"01/02 14:00\",\"01/02 20:00\",\"01/02 20:00\",\"01/03 00:00\",\"01/03 05:00\"],\"name\":\"temps\",\"line\":{\"shape\":\"linear\"}},{\"x\":[0,3600,32400,75600,104400,126000,140400,158400],\"y\":[28.0,28.0,28.0,28.0,28.0,28.0,28.0,28.0],\"text\":[\"01/01 09:00\",\"01/01 10:00\",\"01/01 18:00\",\"01/02 06:00\",\"01/02 14:00\",\"01/02 20:00\",\"01/03 00:00\",\"01/03 05:00\"],\"name\":\"room_temp\",\"line\":{\"shape\":\"linear\"}},{\"x\":[75600,104400,126000,140400,158400],\"y\":[4,4,5,5,5],\"text\":[\"01/02 06:00\",\"01/02 14:00\",\"01/02 20:00\",\"01/03 00:00\",\"01/03 05:00\"],\"name\":\"room_psychrometry\",\"line\":{\"shape\":\"linear\"}}],\n",
24
+ " {\"xaxis\":{\"dtick\":86400,\"tickvals\":[0,86400,172800],\"ticktext\":[1,2,3]},\"annotations\":[{\"x\":0,\"y\":35.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"hikikomi\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":3600,\"y\":32.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"tokomomi\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":32400,\"y\":32.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"kirikaeshi\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":75600,\"y\":35.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"mori\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":104400,\"y\":37.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"naka_shigoto\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":126000,\"y\":38.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"shimai_shigoto\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":140400,\"y\":40.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"tsumikae\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":158400,\"y\":40.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"dekoji\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40}]},\n",
25
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
26
+ ")\n",
27
+ "\n",
28
+ "window.addEventListener('resize', function() {\n",
29
+ " Plotly.Plots.resize(document.getElementById('fbd8af84-03f9-4489-ba76-90ddd95508fc'))\n",
30
+ "})\n",
31
+ " }) \n",
32
+ "</script>"
33
+ ],
34
+ "text/plain": [
35
+ "#<Plotly::Offline::HTML:0x00007f934f02ae88 @id=\"fbd8af84-03f9-4489-ba76-90ddd95508fc\", @data=[{:x=>[0, 3600, 32400, 32401, 75600, 75601, 104400, 104401, 126000, 126001, 140400, 158400], :y=>[35.0, 32.0, 32.0, 31.0, 35.0, 33.0, 37.0, 35.0, 38.0, 37.0, 40.0, 40.0], :text=>[\"01/01 09:00\", \"01/01 10:00\", \"01/01 18:00\", \"01/01 18:00\", \"01/02 06:00\", \"01/02 06:00\", \"01/02 14:00\", \"01/02 14:00\", \"01/02 20:00\", \"01/02 20:00\", \"01/03 00:00\", \"01/03 05:00\"], :name=>:temps, :line=>{:shape=>:linear}}, {:x=>[0, 3600, 32400, 75600, 104400, 126000, 140400, 158400], :y=>[28.0, 28.0, 28.0, 28.0, 28.0, 28.0, 28.0, 28.0], :text=>[\"01/01 09:00\", \"01/01 10:00\", \"01/01 18:00\", \"01/02 06:00\", \"01/02 14:00\", \"01/02 20:00\", \"01/03 00:00\", \"01/03 05:00\"], :name=>:room_temp, :line=>{:shape=>:linear}}, {:x=>[75600, 104400, 126000, 140400, 158400], :y=>[4, 4, 5, 5, 5], :text=>[\"01/02 06:00\", \"01/02 14:00\", \"01/02 20:00\", \"01/03 00:00\", \"01/03 05:00\"], :name=>:room_psychrometry, :line=>{:shape=>:linear}}], @layout={:xaxis=>{:dtick=>86400, :tickvals=>[0, 86400, 172800], :ticktext=>[1, 2, 3]}, :annotations=>[{:x=>0, :y=>35.0, :xref=>\"x\", :yref=>\"y\", :text=>:hikikomi, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>3600, :y=>32.0, :xref=>\"x\", :yref=>\"y\", :text=>:tokomomi, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>32400, :y=>32.0, :xref=>\"x\", :yref=>\"y\", :text=>:kirikaeshi, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>75600, :y=>35.0, :xref=>\"x\", :yref=>\"y\", :text=>:mori, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>104400, :y=>37.0, :xref=>\"x\", :yref=>\"y\", :text=>:naka_shigoto, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>126000, :y=>38.0, :xref=>\"x\", :yref=>\"y\", :text=>:shimai_shigoto, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>140400, :y=>40.0, :xref=>\"x\", :yref=>\"y\", :text=>:tsumikae, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>158400, :y=>40.0, :xref=>\"x\", :yref=>\"y\", :text=>:dekoji, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}]}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
36
+ ]
37
+ },
38
+ "metadata": {},
39
+ "output_type": "display_data"
40
+ },
41
+ {
42
+ "data": {
43
+ "text/plain": [
44
+ "#<CZTop::Socket::PUB:0x7f934dd9a3d0 last_endpoint=\"tcp://127.0.0.1:57436\">"
45
+ ]
46
+ },
47
+ "execution_count": 1,
48
+ "metadata": {},
49
+ "output_type": "execute_result"
50
+ }
51
+ ],
52
+ "source": [
53
+ "$LOAD_PATH << File.dirname(__FILE__) + \"/../lib\"\n",
54
+ "require 'toji'\n",
55
+ "require 'rbplotly'\n",
56
+ "\n",
57
+ "koji = Toji::Product::KojiMaking.template\n",
58
+ "koji.progress.plot.show"
59
+ ]
60
+ },
61
+ {
62
+ "cell_type": "code",
63
+ "execution_count": null,
64
+ "metadata": {},
65
+ "outputs": [],
66
+ "source": []
67
+ }
68
+ ],
69
+ "metadata": {
70
+ "kernelspec": {
71
+ "display_name": "Ruby 2.7.0",
72
+ "language": "ruby",
73
+ "name": "ruby"
74
+ },
75
+ "language_info": {
76
+ "file_extension": ".rb",
77
+ "mimetype": "application/x-ruby",
78
+ "name": "ruby",
79
+ "version": "2.6.3"
80
+ }
81
+ },
82
+ "nbformat": 4,
83
+ "nbformat_minor": 2
84
+ }
@@ -0,0 +1,14 @@
1
+ require 'toji'
2
+ require 'terminal-table'
3
+
4
+ koji_making = Toji::Product::KojiMaking.template
5
+
6
+ table = Terminal::Table.new do |t|
7
+ t << ["作業", "品温(度)", "操作室温", "乾湿差(度)", "経過時間", "日時"]
8
+ t << :separator
9
+ koji_making.each {|j|
10
+ temp = j.temps.map(&:to_s).join(" / ")
11
+ t << [j.id, temp, j.room_temp, j.room_psychrometry, j.elapsed_time, j.display_time]
12
+ }
13
+ end
14
+ puts table
@@ -0,0 +1,69 @@
1
+ require 'toji'
2
+ require 'terminal-table'
3
+
4
+ rice_rate = Toji::Recipe::RiceRate.cooked(0.30, 0.45, 0.40, 0.37)
5
+ koji = Toji::Ingredient::Koji.expected(200.0, rice_rate: rice_rate)
6
+ #koji = Toji::Ingredient::Koji.actual(200.0, 266.0, 24.0, 280.0, 270, 0.2, 0.0)
7
+
8
+ table = Terminal::Table.new do |t|
9
+ t << ["", "分量", "白米を基準とした歩合"]
10
+ t << :separator
11
+ t << ["麹", koji.dekoji, 1.0 + koji.dekoji_rate]
12
+ t << [" 蒸米", koji.steamed, 1.0 + koji.steamed_rate]
13
+ t << [" 白米", koji.raw, 1.0]
14
+ t << [" 汲水", koji.soaking_water, koji.soaked_rate]
15
+ t << [" 種麹", koji.tanekoji, koji.tanekoji_rate]
16
+ end
17
+ puts table
18
+ puts
19
+
20
+ table = Terminal::Table.new do |t|
21
+ t << ["工程", "原料", "分量"]
22
+ t << :separator
23
+ t << ["洗米・浸漬", "白米", koji.raw&.round(2)]
24
+ t << ["", "吸水増加量", koji.soaking_water&.round(2)]
25
+ t << :separator
26
+ t << ["水切り", "浸漬米", koji.soaked&.round(2)]
27
+ t << ["", "蒸発・炊飯前の汲水", koji.steaming_water&.round(2)]
28
+ t << :separator
29
+ t << ["蒸し", "蒸米", koji.steamed&.round(2)]
30
+ t << :separator
31
+ t << ["放冷・引込み", "蒸米", koji.cooled&.round(2)]
32
+ t << ["", "種麹", koji.tanekoji&.round(2)]
33
+ t << :separator
34
+ t << ["製麹", "麹", koji.dekoji&.round(2)]
35
+ end
36
+ puts table
37
+
38
+
39
+ koji_making = Toji::Product::KojiMaking.template
40
+
41
+ table = Terminal::Table.new do |t|
42
+ t << ["作業", "品温(度)", "操作室温", "乾湿差(度)", "経過時間", "日時"]
43
+ t << :separator
44
+ koji_making.each {|j|
45
+ temp = j.temps.map(&:to_s).join(" / ")
46
+ t << [j.id, temp, j.room_temp, j.room_psychrometry, j.elapsed_time, j.display_time]
47
+ }
48
+ end
49
+ puts table
50
+
51
+
52
+ koji_making = Toji::Product::KojiMaking.template
53
+ koji_making.add(Toji::Product::Job.new(
54
+ time: Time.mktime(2020, 1, 15, 13, 15),
55
+ id: :hikikomi,
56
+ temps: 31.2,
57
+ preset_temp: 35,
58
+ room_temp: 25,
59
+ ))
60
+
61
+ table = Terminal::Table.new do |t|
62
+ t << ["作業", "品温(度)", "操作室温", "設定温度", "経過時間", "日時"]
63
+ t << :separator
64
+ koji_making.each {|j|
65
+ temp = j.temps.map(&:to_s).join(" / ")
66
+ t << [j.id, temp, j.room_temp, j.preset_temp, j.elapsed_time, j.display_time]
67
+ }
68
+ end
69
+ puts table
@@ -0,0 +1,159 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {
7
+ "scrolled": false
8
+ },
9
+ "outputs": [
10
+ {
11
+ "data": {
12
+ "text/html": [
13
+ "\n",
14
+ " <script>\n",
15
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
16
+ " </script>\n",
17
+ "\n",
18
+ "\n",
19
+ "<div id=\"95271cc2-db63-48a2-a6db-986b18f19135\" style=\"height: 100%; width: 100%;\"></div>\n",
20
+ "\n",
21
+ "<script>\n",
22
+ " require(['plotly'], function(Plotly) { \n",
23
+ "Plotly.newPlot(\n",
24
+ " '95271cc2-db63-48a2-a6db-986b18f19135',\n",
25
+ " [{\"x\":[0.0,1.0,86400.0,172800.0,259200.0,259201.0,345600.0,345601.0,432000.0,518400.0,604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0,1209600.0,1296000.0,1382400.0,1468800.0,1555200.0,1641600.0,1728000.0,1814400.0,1900800.0,1987200.0,2073600.0],\"y\":[14.8,11.0,14.3,11.3,6.9,10.6,7.5,8.0,9.1,10.4,11.9,12.3,13.1,13.1,12.9,12.8,12.9,12.6,12.0,11.2,10.2,9.7,9.8,9.1,8.4,8.1,8.3,8.1],\"text\":[\"01/16 00:00\",\"01/16 00:00\",\"01/17 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\",\"01/30 00:00\",\"01/31 00:00\",\"02/01 00:00\",\"02/02 00:00\",\"02/03 00:00\",\"02/04 00:00\",\"02/05 00:00\",\"02/06 00:00\",\"02/07 00:00\",\"02/08 00:00\",\"02/09 00:00\"],\"name\":\"temps\",\"line\":{\"shape\":\"linear\"}},{\"x\":[0.0,86400.0,172800.0,259200.0,345600.0,432000.0,518400.0,604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0,1209600.0,1296000.0,1382400.0,1468800.0,1555200.0,1641600.0,1728000.0,1814400.0,1900800.0,1987200.0,2073600.0],\"y\":[9,9,8.5,9,6,7,7,8,8,7.5,7.5,7.5,7.0,8.0,8.0,7.0,7.0,6.5,7.0,8.0,6.0,5.0,5.0,7.0,6.0],\"text\":[\"01/16 00:00\",\"01/17 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\",\"01/30 00:00\",\"01/31 00:00\",\"02/01 00:00\",\"02/02 00:00\",\"02/03 00:00\",\"02/04 00:00\",\"02/05 00:00\",\"02/06 00:00\",\"02/07 00:00\",\"02/08 00:00\",\"02/09 00:00\"],\"name\":\"room_temp\",\"line\":{\"shape\":\"linear\"}},{\"x\":[604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0,1209600.0,1296000.0,1382400.0,1468800.0,1641600.0,1728000.0,1814400.0,1900800.0,1987200.0],\"y\":[8.6,8.0,7.2,5.8,4.8,4.0,3.4,2.7,2.1,1.7000000000000002,1.3,0.8,0.5,0.30000000000000004,0.2,-0.0],\"text\":[\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\",\"01/30 00:00\",\"01/31 00:00\",\"02/01 00:00\",\"02/02 00:00\",\"02/04 00:00\",\"02/05 00:00\",\"02/06 00:00\",\"02/07 00:00\",\"02/08 00:00\"],\"name\":\"baume\",\"line\":{\"shape\":\"linear\"}},{\"x\":[691200.0,777600.0,864000.0,1036800.0,1123200.0,1209600.0,1296000.0,1641600.0,1814400.0],\"y\":[4.8,6.75,7.992,10.7,11.6,12.7,13.7,16.0,16.3],\"text\":[\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/28 00:00\",\"01/29 00:00\",\"01/30 00:00\",\"01/31 00:00\",\"02/04 00:00\",\"02/06 00:00\"],\"name\":\"alcohol\",\"line\":{\"shape\":\"linear\"}}],\n",
26
+ " {\"xaxis\":{\"dtick\":86400,\"tickvals\":[0,86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200,1209600,1296000,1382400,1468800,1555200,1641600,1728000,1814400,1900800,1987200,2073600],\"ticktext\":[\"soe\",\"odori\",\"odori\",\"naka\",\"tome\",2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]},\"annotations\":[{\"x\":0.0,\"y\":14.8,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"soe\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":259200.0,\"y\":6.9,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"naka\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":345600.0,\"y\":7.5,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"tome\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40}]},\n",
27
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
28
+ ")\n",
29
+ "\n",
30
+ "window.addEventListener('resize', function() {\n",
31
+ " Plotly.Plots.resize(document.getElementById('95271cc2-db63-48a2-a6db-986b18f19135'))\n",
32
+ "})\n",
33
+ " }) \n",
34
+ "</script>"
35
+ ],
36
+ "text/plain": [
37
+ "#<Plotly::Offline::HTML:0x00007ff8ff12bf10 @id=\"95271cc2-db63-48a2-a6db-986b18f19135\", @data=[{:x=>[0.0, 1.0, 86400.0, 172800.0, 259200.0, 259201.0, 345600.0, 345601.0, 432000.0, 518400.0, 604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0, 1209600.0, 1296000.0, 1382400.0, 1468800.0, 1555200.0, 1641600.0, 1728000.0, 1814400.0, 1900800.0, 1987200.0, 2073600.0], :y=>[14.8, 11.0, 14.3, 11.3, 6.9, 10.6, 7.5, 8.0, 9.1, 10.4, 11.9, 12.3, 13.1, 13.1, 12.9, 12.8, 12.9, 12.6, 12.0, 11.2, 10.2, 9.7, 9.8, 9.1, 8.4, 8.1, 8.3, 8.1], :text=>[\"01/16 00:00\", \"01/16 00:00\", \"01/17 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\", \"01/30 00:00\", \"01/31 00:00\", \"02/01 00:00\", \"02/02 00:00\", \"02/03 00:00\", \"02/04 00:00\", \"02/05 00:00\", \"02/06 00:00\", \"02/07 00:00\", \"02/08 00:00\", \"02/09 00:00\"], :name=>:temps, :line=>{:shape=>:linear}}, {:x=>[0.0, 86400.0, 172800.0, 259200.0, 345600.0, 432000.0, 518400.0, 604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0, 1209600.0, 1296000.0, 1382400.0, 1468800.0, 1555200.0, 1641600.0, 1728000.0, 1814400.0, 1900800.0, 1987200.0, 2073600.0], :y=>[9, 9, 8.5, 9, 6, 7, 7, 8, 8, 7.5, 7.5, 7.5, 7.0, 8.0, 8.0, 7.0, 7.0, 6.5, 7.0, 8.0, 6.0, 5.0, 5.0, 7.0, 6.0], :text=>[\"01/16 00:00\", \"01/17 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\", \"01/30 00:00\", \"01/31 00:00\", \"02/01 00:00\", \"02/02 00:00\", \"02/03 00:00\", \"02/04 00:00\", \"02/05 00:00\", \"02/06 00:00\", \"02/07 00:00\", \"02/08 00:00\", \"02/09 00:00\"], :name=>:room_temp, :line=>{:shape=>:linear}}, {:x=>[604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0, 1209600.0, 1296000.0, 1382400.0, 1468800.0, 1641600.0, 1728000.0, 1814400.0, 1900800.0, 1987200.0], :y=>[8.6, 8.0, 7.2, 5.8, 4.8, 4.0, 3.4, 2.7, 2.1, 1.7000000000000002, 1.3, 0.8, 0.5, 0.30000000000000004, 0.2, -0.0], :text=>[\"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\", \"01/30 00:00\", \"01/31 00:00\", \"02/01 00:00\", \"02/02 00:00\", \"02/04 00:00\", \"02/05 00:00\", \"02/06 00:00\", \"02/07 00:00\", \"02/08 00:00\"], :name=>:baume, :line=>{:shape=>:linear}}, {:x=>[691200.0, 777600.0, 864000.0, 1036800.0, 1123200.0, 1209600.0, 1296000.0, 1641600.0, 1814400.0], :y=>[4.8, 6.75, 7.992, 10.7, 11.6, 12.7, 13.7, 16.0, 16.3], :text=>[\"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/28 00:00\", \"01/29 00:00\", \"01/30 00:00\", \"01/31 00:00\", \"02/04 00:00\", \"02/06 00:00\"], :name=>:alcohol, :line=>{:shape=>:linear}}], @layout={:xaxis=>{:dtick=>86400, :tickvals=>[0, 86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200, 1209600, 1296000, 1382400, 1468800, 1555200, 1641600, 1728000, 1814400, 1900800, 1987200, 2073600], :ticktext=>[:soe, :odori, :odori, :naka, :tome, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]}, :annotations=>[{:x=>0.0, :y=>14.8, :xref=>\"x\", :yref=>\"y\", :text=>:soe, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>259200.0, :y=>6.9, :xref=>\"x\", :yref=>\"y\", :text=>:naka, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>345600.0, :y=>7.5, :xref=>\"x\", :yref=>\"y\", :text=>:tome, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}]}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
38
+ ]
39
+ },
40
+ "metadata": {},
41
+ "output_type": "display_data"
42
+ },
43
+ {
44
+ "data": {
45
+ "text/html": [
46
+ "\n",
47
+ " <script>\n",
48
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
49
+ " </script>\n",
50
+ "\n",
51
+ "\n",
52
+ "<div id=\"9771971d-6961-4ef2-ab8e-b8e0e5c410a4\" style=\"height: 100%; width: 100%;\"></div>\n",
53
+ "\n",
54
+ "<script>\n",
55
+ " require(['plotly'], function(Plotly) { \n",
56
+ "Plotly.newPlot(\n",
57
+ " '9771971d-6961-4ef2-ab8e-b8e0e5c410a4',\n",
58
+ " [{\"x\":[259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200,1296000,1382400,1468800,1555200,1641600],\"y\":[34.4,40.0,43.2,40.6,38.4,36.0,34.0,29.700000000000003,25.200000000000003,22.1,18.2,12.8,8.5,5.4,3.8000000000000003,-0.0],\"text\":[\"2019-01-23 00:00:00 +0900\\u003cbr /\\u003emoromi day=4, be=8.6, bmd=34.4\",\"2019-01-24 00:00:00 +0900\\u003cbr /\\u003emoromi day=5, be=8.0, bmd=40.0\",\"2019-01-25 00:00:00 +0900\\u003cbr /\\u003emoromi day=6, be=7.2, bmd=43.2\",\"2019-01-26 00:00:00 +0900\\u003cbr /\\u003emoromi day=7, be=5.8, bmd=40.6\",\"2019-01-27 00:00:00 +0900\\u003cbr /\\u003emoromi day=8, be=4.8, bmd=38.4\",\"2019-01-28 00:00:00 +0900\\u003cbr /\\u003emoromi day=9, be=4.0, bmd=36.0\",\"2019-01-29 00:00:00 +0900\\u003cbr /\\u003emoromi day=10, be=3.4, bmd=34.0\",\"2019-01-30 00:00:00 +0900\\u003cbr /\\u003emoromi day=11, be=2.7, bmd=29.700000000000003\",\"2019-01-31 00:00:00 +0900\\u003cbr /\\u003emoromi day=12, be=2.1, bmd=25.200000000000003\",\"2019-02-01 00:00:00 +0900\\u003cbr /\\u003emoromi day=13, be=1.7000000000000002, bmd=22.1\",\"2019-02-02 00:00:00 +0900\\u003cbr /\\u003emoromi day=14, be=1.3, bmd=18.2\",\"2019-02-04 00:00:00 +0900\\u003cbr /\\u003emoromi day=16, be=0.8, bmd=12.8\",\"2019-02-05 00:00:00 +0900\\u003cbr /\\u003emoromi day=17, be=0.5, bmd=8.5\",\"2019-02-06 00:00:00 +0900\\u003cbr /\\u003emoromi day=18, be=0.30000000000000004, bmd=5.4\",\"2019-02-07 00:00:00 +0900\\u003cbr /\\u003emoromi day=19, be=0.2, bmd=3.8000000000000003\",\"2019-02-08 00:00:00 +0900\\u003cbr /\\u003emoromi day=20, be=-0.0, bmd=-0.0\"],\"name\":\"actual\"}],\n",
59
+ " {\"xaxis\":{\"title\":\"Moromi day\",\"dtick\":86400,\"range\":[86400,1728000],\"tickvals\":[0,86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200,1209600,1296000,1382400,1468800,1555200,1641600],\"ticktext\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]},\"yaxis\":{\"title\":\"BMD\"}},\n",
60
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
61
+ ")\n",
62
+ "\n",
63
+ "window.addEventListener('resize', function() {\n",
64
+ " Plotly.Plots.resize(document.getElementById('9771971d-6961-4ef2-ab8e-b8e0e5c410a4'))\n",
65
+ "})\n",
66
+ " }) \n",
67
+ "</script>"
68
+ ],
69
+ "text/plain": [
70
+ "#<Plotly::Offline::HTML:0x00007ff8fd9e4488 @id=\"9771971d-6961-4ef2-ab8e-b8e0e5c410a4\", @data=[{:x=>[259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200, 1296000, 1382400, 1468800, 1555200, 1641600], :y=>[34.4, 40.0, 43.2, 40.6, 38.4, 36.0, 34.0, 29.700000000000003, 25.200000000000003, 22.1, 18.2, 12.8, 8.5, 5.4, 3.8000000000000003, -0.0], :text=>[\"2019-01-23 00:00:00 +0900<br />moromi day=4, be=8.6, bmd=34.4\", \"2019-01-24 00:00:00 +0900<br />moromi day=5, be=8.0, bmd=40.0\", \"2019-01-25 00:00:00 +0900<br />moromi day=6, be=7.2, bmd=43.2\", \"2019-01-26 00:00:00 +0900<br />moromi day=7, be=5.8, bmd=40.6\", \"2019-01-27 00:00:00 +0900<br />moromi day=8, be=4.8, bmd=38.4\", \"2019-01-28 00:00:00 +0900<br />moromi day=9, be=4.0, bmd=36.0\", \"2019-01-29 00:00:00 +0900<br />moromi day=10, be=3.4, bmd=34.0\", \"2019-01-30 00:00:00 +0900<br />moromi day=11, be=2.7, bmd=29.700000000000003\", \"2019-01-31 00:00:00 +0900<br />moromi day=12, be=2.1, bmd=25.200000000000003\", \"2019-02-01 00:00:00 +0900<br />moromi day=13, be=1.7000000000000002, bmd=22.1\", \"2019-02-02 00:00:00 +0900<br />moromi day=14, be=1.3, bmd=18.2\", \"2019-02-04 00:00:00 +0900<br />moromi day=16, be=0.8, bmd=12.8\", \"2019-02-05 00:00:00 +0900<br />moromi day=17, be=0.5, bmd=8.5\", \"2019-02-06 00:00:00 +0900<br />moromi day=18, be=0.30000000000000004, bmd=5.4\", \"2019-02-07 00:00:00 +0900<br />moromi day=19, be=0.2, bmd=3.8000000000000003\", \"2019-02-08 00:00:00 +0900<br />moromi day=20, be=-0.0, bmd=-0.0\"], :name=>:actual}], @layout={:xaxis=>{:title=>\"Moromi day\", :dtick=>86400, :range=>[86400, 1728000], :tickvals=>[0, 86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200, 1209600, 1296000, 1382400, 1468800, 1555200, 1641600], :ticktext=>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]}, :yaxis=>{:title=>\"BMD\"}}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
71
+ ]
72
+ },
73
+ "metadata": {},
74
+ "output_type": "display_data"
75
+ },
76
+ {
77
+ "data": {
78
+ "text/html": [
79
+ "\n",
80
+ " <script>\n",
81
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
82
+ " </script>\n",
83
+ "\n",
84
+ "\n",
85
+ "<div id=\"0e4dc488-7896-4278-8904-6ad2a4e29b8c\" style=\"height: 100%; width: 100%;\"></div>\n",
86
+ "\n",
87
+ "<script>\n",
88
+ " require(['plotly'], function(Plotly) { \n",
89
+ "Plotly.newPlot(\n",
90
+ " '0e4dc488-7896-4278-8904-6ad2a4e29b8c',\n",
91
+ " [{\"x\":[4.8,6.75,7.992,10.7,11.6,12.7,13.7,16.0,16.3],\"y\":[8.0,7.2,5.8,4.0,3.4,2.7,2.1,0.8,0.30000000000000004],\"text\":[\"2019-01-24 00:00:00 +0900\\u003cbr /\\u003ealc=4.8, be=8.0\",\"2019-01-25 00:00:00 +0900\\u003cbr /\\u003ealc=6.75, be=7.2\",\"2019-01-26 00:00:00 +0900\\u003cbr /\\u003ealc=7.992, be=5.8\",\"2019-01-28 00:00:00 +0900\\u003cbr /\\u003ealc=10.7, be=4.0\",\"2019-01-29 00:00:00 +0900\\u003cbr /\\u003ealc=11.6, be=3.4\",\"2019-01-30 00:00:00 +0900\\u003cbr /\\u003ealc=12.7, be=2.7\",\"2019-01-31 00:00:00 +0900\\u003cbr /\\u003ealc=13.7, be=2.1\",\"2019-02-04 00:00:00 +0900\\u003cbr /\\u003ealc=16.0, be=0.8\",\"2019-02-06 00:00:00 +0900\\u003cbr /\\u003ealc=16.3, be=0.30000000000000004\"],\"name\":\"actual\"},{\"x\":[16.05,4.049999999999999],\"y\":[0.0,8.0],\"name\":\"+3.0 16.5\"},{\"x\":[16.55,4.549999999999999],\"y\":[0.0,8.0],\"name\":\"+3.0 17.0\"},{\"x\":[16.5,4.5],\"y\":[0.0,8.0],\"name\":\"+0.0 16.5\"}],\n",
92
+ " {\"xaxis\":{\"title\":\"Alcohol\",\"dtick\":2,\"range\":[0,20]},\"yaxis\":{\"title\":\"Baume\",\"dtick\":1,\"range\":[0,10]}},\n",
93
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
94
+ ")\n",
95
+ "\n",
96
+ "window.addEventListener('resize', function() {\n",
97
+ " Plotly.Plots.resize(document.getElementById('0e4dc488-7896-4278-8904-6ad2a4e29b8c'))\n",
98
+ "})\n",
99
+ " }) \n",
100
+ "</script>"
101
+ ],
102
+ "text/plain": [
103
+ "#<Plotly::Offline::HTML:0x00007ff8ff143908 @id=\"0e4dc488-7896-4278-8904-6ad2a4e29b8c\", @data=[{:x=>[4.8, 6.75, 7.992, 10.7, 11.6, 12.7, 13.7, 16.0, 16.3], :y=>[8.0, 7.2, 5.8, 4.0, 3.4, 2.7, 2.1, 0.8, 0.30000000000000004], :text=>[\"2019-01-24 00:00:00 +0900<br />alc=4.8, be=8.0\", \"2019-01-25 00:00:00 +0900<br />alc=6.75, be=7.2\", \"2019-01-26 00:00:00 +0900<br />alc=7.992, be=5.8\", \"2019-01-28 00:00:00 +0900<br />alc=10.7, be=4.0\", \"2019-01-29 00:00:00 +0900<br />alc=11.6, be=3.4\", \"2019-01-30 00:00:00 +0900<br />alc=12.7, be=2.7\", \"2019-01-31 00:00:00 +0900<br />alc=13.7, be=2.1\", \"2019-02-04 00:00:00 +0900<br />alc=16.0, be=0.8\", \"2019-02-06 00:00:00 +0900<br />alc=16.3, be=0.30000000000000004\"], :name=>:actual}, {:x=>[16.05, 4.049999999999999], :y=>[0.0, 8.0], :name=>\"+3.0 16.5\"}, {:x=>[16.55, 4.549999999999999], :y=>[0.0, 8.0], :name=>\"+3.0 17.0\"}, {:x=>[16.5, 4.5], :y=>[0.0, 8.0], :name=>\"+0.0 16.5\"}], @layout={:xaxis=>{:title=>\"Alcohol\", :dtick=>2, :range=>[0, 20]}, :yaxis=>{:title=>\"Baume\", :dtick=>1, :range=>[0, 10]}}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
104
+ ]
105
+ },
106
+ "metadata": {},
107
+ "output_type": "display_data"
108
+ },
109
+ {
110
+ "data": {
111
+ "text/plain": [
112
+ "#<CZTop::Socket::PUB:0x7ff9018ebce0 last_endpoint=\"tcp://127.0.0.1:62137\">"
113
+ ]
114
+ },
115
+ "execution_count": 1,
116
+ "metadata": {},
117
+ "output_type": "execute_result"
118
+ }
119
+ ],
120
+ "source": [
121
+ "$LOAD_PATH << File.dirname(__FILE__) + \"/../lib\"\n",
122
+ "require 'toji'\n",
123
+ "require 'rbplotly'\n",
124
+ "\n",
125
+ "moromi = Toji::Product::Moromi.template\n",
126
+ "moromi.progress.plot.show\n",
127
+ "moromi.bmd.plot.show\n",
128
+ "\n",
129
+ "moromi.ab(1.5)\n",
130
+ " .expect(16.5, +3)\n",
131
+ " .expect(17.0, +3)\n",
132
+ " .expect(16.5, +0)\n",
133
+ " .plot.show"
134
+ ]
135
+ },
136
+ {
137
+ "cell_type": "code",
138
+ "execution_count": null,
139
+ "metadata": {},
140
+ "outputs": [],
141
+ "source": []
142
+ }
143
+ ],
144
+ "metadata": {
145
+ "kernelspec": {
146
+ "display_name": "Ruby 2.7.0",
147
+ "language": "ruby",
148
+ "name": "ruby"
149
+ },
150
+ "language_info": {
151
+ "file_extension": ".rb",
152
+ "mimetype": "application/x-ruby",
153
+ "name": "ruby",
154
+ "version": "2.6.3"
155
+ }
156
+ },
157
+ "nbformat": 4,
158
+ "nbformat_minor": 2
159
+ }
data/example/moromi.rb ADDED
@@ -0,0 +1,15 @@
1
+ require 'toji'
2
+ require 'terminal-table'
3
+
4
+
5
+ moromi = Toji::Product::Moromi.template
6
+
7
+ table = Terminal::Table.new do |t|
8
+ t << ["作業", "品温(度)", "操作室温", "ボーメ及び日本酒度", "アルコール度数", "BMD", "AB 16.5 +3", "経過時間", "日時"]
9
+ t << :separator
10
+ moromi.each {|j|
11
+ temp = j.temps.map(&:to_s).join(" / ")
12
+ t << [j.id, temp, j.room_temp, j.display_baume, j.alcohol, j.bmd&.round(2), j.expected_alcohol(16.5, +3, 1.5)&.round(2), j.elapsed_time, j.time]
13
+ }
14
+ end
15
+ puts table
@@ -0,0 +1,84 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "data": {
10
+ "text/html": [
11
+ "\n",
12
+ " <script>\n",
13
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
14
+ " </script>\n",
15
+ "\n",
16
+ "\n",
17
+ "<div id=\"54033831-3193-4266-bac7-eabe6fa8807f\" style=\"height: 100%; width: 100%;\"></div>\n",
18
+ "\n",
19
+ "<script>\n",
20
+ " require(['plotly'], function(Plotly) { \n",
21
+ "Plotly.newPlot(\n",
22
+ " '54033831-3193-4266-bac7-eabe6fa8807f',\n",
23
+ " [{\"x\":[0,3600,86400,172800,172801,259200,259201,345600,345601,432000,518400,604800,691200,777600,864000,950400,1036800,1123200],\"y\":[12.0,20.0,14.0,8.0,11.0,10.0,13.0,12.0,15.0,14.0,20.0,20.0,20.0,20.0,15.0,12.0,10.0,9.0],\"text\":[\"01/01 09:00\",\"01/01 10:00\",\"01/02 09:00\",\"01/03 09:00\",\"01/03 09:00\",\"01/04 09:00\",\"01/04 09:00\",\"01/05 09:00\",\"01/05 09:00\",\"01/06 09:00\",\"01/07 09:00\",\"01/08 09:00\",\"01/09 09:00\",\"01/10 09:00\",\"01/11 09:00\",\"01/12 09:00\",\"01/13 09:00\",\"01/14 09:00\"],\"name\":\"temps\",\"line\":{\"shape\":\"linear\"}},{\"x\":[0,3600,86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200],\"y\":[13.0,13.0,13.0,13.0,13.5,13.5,14.0,14.5,15.5,16.0,16.0,16.5,17.0,17.5,17.5],\"text\":[\"01/01 09:00\",\"01/01 10:00\",\"01/02 09:00\",\"01/03 09:00\",\"01/04 09:00\",\"01/05 09:00\",\"01/06 09:00\",\"01/07 09:00\",\"01/08 09:00\",\"01/09 09:00\",\"01/10 09:00\",\"01/11 09:00\",\"01/12 09:00\",\"01/13 09:00\",\"01/14 09:00\"],\"name\":\"acid\",\"line\":{\"shape\":\"linear\"}},{\"x\":[86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200],\"y\":[15.0,16.0,16.5,17.0,17.0,17.0,14.0,12.0,9.0,8.0,7.0,6.0,5.0],\"text\":[\"01/02 09:00\",\"01/03 09:00\",\"01/04 09:00\",\"01/05 09:00\",\"01/06 09:00\",\"01/07 09:00\",\"01/08 09:00\",\"01/09 09:00\",\"01/10 09:00\",\"01/11 09:00\",\"01/12 09:00\",\"01/13 09:00\",\"01/14 09:00\"],\"name\":\"baume\",\"line\":{\"shape\":\"linear\"}}],\n",
24
+ " {\"xaxis\":{\"dtick\":86400,\"tickvals\":[0,86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200],\"ticktext\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14]},\"annotations\":[{\"x\":0,\"y\":12.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"mizukoji\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":3600,\"y\":20.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"shikomi\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":86400,\"y\":14.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"utase\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":777600,\"y\":20.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"wake\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40}]},\n",
25
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
26
+ ")\n",
27
+ "\n",
28
+ "window.addEventListener('resize', function() {\n",
29
+ " Plotly.Plots.resize(document.getElementById('54033831-3193-4266-bac7-eabe6fa8807f'))\n",
30
+ "})\n",
31
+ " }) \n",
32
+ "</script>"
33
+ ],
34
+ "text/plain": [
35
+ "#<Plotly::Offline::HTML:0x00007f7ff5a47848 @id=\"54033831-3193-4266-bac7-eabe6fa8807f\", @data=[{:x=>[0, 3600, 86400, 172800, 172801, 259200, 259201, 345600, 345601, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200], :y=>[12.0, 20.0, 14.0, 8.0, 11.0, 10.0, 13.0, 12.0, 15.0, 14.0, 20.0, 20.0, 20.0, 20.0, 15.0, 12.0, 10.0, 9.0], :text=>[\"01/01 09:00\", \"01/01 10:00\", \"01/02 09:00\", \"01/03 09:00\", \"01/03 09:00\", \"01/04 09:00\", \"01/04 09:00\", \"01/05 09:00\", \"01/05 09:00\", \"01/06 09:00\", \"01/07 09:00\", \"01/08 09:00\", \"01/09 09:00\", \"01/10 09:00\", \"01/11 09:00\", \"01/12 09:00\", \"01/13 09:00\", \"01/14 09:00\"], :name=>:temps, :line=>{:shape=>:linear}}, {:x=>[0, 3600, 86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200], :y=>[13.0, 13.0, 13.0, 13.0, 13.5, 13.5, 14.0, 14.5, 15.5, 16.0, 16.0, 16.5, 17.0, 17.5, 17.5], :text=>[\"01/01 09:00\", \"01/01 10:00\", \"01/02 09:00\", \"01/03 09:00\", \"01/04 09:00\", \"01/05 09:00\", \"01/06 09:00\", \"01/07 09:00\", \"01/08 09:00\", \"01/09 09:00\", \"01/10 09:00\", \"01/11 09:00\", \"01/12 09:00\", \"01/13 09:00\", \"01/14 09:00\"], :name=>:acid, :line=>{:shape=>:linear}}, {:x=>[86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200], :y=>[15.0, 16.0, 16.5, 17.0, 17.0, 17.0, 14.0, 12.0, 9.0, 8.0, 7.0, 6.0, 5.0], :text=>[\"01/02 09:00\", \"01/03 09:00\", \"01/04 09:00\", \"01/05 09:00\", \"01/06 09:00\", \"01/07 09:00\", \"01/08 09:00\", \"01/09 09:00\", \"01/10 09:00\", \"01/11 09:00\", \"01/12 09:00\", \"01/13 09:00\", \"01/14 09:00\"], :name=>:baume, :line=>{:shape=>:linear}}], @layout={:xaxis=>{:dtick=>86400, :tickvals=>[0, 86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200], :ticktext=>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]}, :annotations=>[{:x=>0, :y=>12.0, :xref=>\"x\", :yref=>\"y\", :text=>:mizukoji, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>3600, :y=>20.0, :xref=>\"x\", :yref=>\"y\", :text=>:shikomi, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>86400, :y=>14.0, :xref=>\"x\", :yref=>\"y\", :text=>:utase, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>777600, :y=>20.0, :xref=>\"x\", :yref=>\"y\", :text=>:wake, :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}]}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
36
+ ]
37
+ },
38
+ "metadata": {},
39
+ "output_type": "display_data"
40
+ },
41
+ {
42
+ "data": {
43
+ "text/plain": [
44
+ "#<CZTop::Socket::PUB:0x7f7ff6d8c2a0 last_endpoint=\"tcp://127.0.0.1:59277\">"
45
+ ]
46
+ },
47
+ "execution_count": 1,
48
+ "metadata": {},
49
+ "output_type": "execute_result"
50
+ }
51
+ ],
52
+ "source": [
53
+ "$LOAD_PATH << File.dirname(__FILE__) + \"/../lib\"\n",
54
+ "require 'toji'\n",
55
+ "require 'rbplotly'\n",
56
+ "\n",
57
+ "shubo = Toji::Product::Shubo.template\n",
58
+ "shubo.progress.plot.show"
59
+ ]
60
+ },
61
+ {
62
+ "cell_type": "code",
63
+ "execution_count": null,
64
+ "metadata": {},
65
+ "outputs": [],
66
+ "source": []
67
+ }
68
+ ],
69
+ "metadata": {
70
+ "kernelspec": {
71
+ "display_name": "Ruby 2.7.0",
72
+ "language": "ruby",
73
+ "name": "ruby"
74
+ },
75
+ "language_info": {
76
+ "file_extension": ".rb",
77
+ "mimetype": "application/x-ruby",
78
+ "name": "ruby",
79
+ "version": "2.6.3"
80
+ }
81
+ },
82
+ "nbformat": 4,
83
+ "nbformat_minor": 2
84
+ }
data/example/shubo.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'toji'
2
+ require 'terminal-table'
3
+
4
+ shubo = Toji::Product::Shubo.template
5
+
6
+ table = Terminal::Table.new do |t|
7
+ t << ["作業", "品温(度)", "ボーメ", "酸度", "経過時間", "日時"]
8
+ t << :separator
9
+ shubo.each {|j|
10
+ temp = j.temps.map(&:to_s).join(" / ")
11
+ t << [j.id, temp, j.baume, j.acid, j.elapsed_time, j.display_time]
12
+ }
13
+ end
14
+ puts table
@@ -7,23 +7,23 @@ table = Terminal::Table.new do |t|
7
7
  t << [""] + recipe.class::STEP_NAMES
8
8
  t << :separator
9
9
  t << ["[原料]"]
10
- t << ["酵母(g)", recipe.yeast.yeast]
11
- t << ["酵母吸水", recipe.yeast.water]
10
+ t << ["酵母(g)", recipe.yeast.yeast&.round(2)]
11
+ t << ["酵母吸水", recipe.yeast.water&.round(2)]
12
12
  t << ["乳酸(ml)"]
13
- t << ["掛米(g)"] + recipe.steps.map(&:rice).map(&:raw)
14
- t << ["麹米(g)"] + recipe.steps.map(&:koji).map(&:raw)
15
- t << ["汲水(ml)"] + recipe.steps.map(&:water)
13
+ t << ["掛米(g)"] + recipe.steps.map(&:rice).map(&:raw).map{|v| v&.round(2)}
14
+ t << ["麹米(g)"] + recipe.steps.map(&:koji).map(&:raw).map{|v| v&.round(2)}
15
+ t << ["汲水(ml)"] + recipe.steps.map(&:water).map{|v| v&.round(2)}
16
16
  t << :separator
17
17
  t << ["[合計]"]
18
- t << ["総米(g)"] + recipe.steps.map(&:rice_total)
19
- t << ["麹歩合(%)"] + recipe.steps.map{|s| s.koji_rate * 100}
20
- t << ["汲水歩合(%)"] + recipe.steps.map{|s| s.water_rate * 100}
18
+ t << ["総米(g)"] + recipe.steps.map(&:rice_total).map{|v| v&.round(2)}
19
+ t << ["麹歩合(%)"] + recipe.steps.map{|s| s.koji_rate * 100}.map{|v| v&.round(2)}
20
+ t << ["汲水歩合(%)"] + recipe.steps.map{|s| s.water_rate * 100}.map{|v| v&.round(2)}
21
21
  t << :separator
22
22
  t << ["[累計]"]
23
- t << ["総米(g)"] + recipe.cumulative_rice_totals
24
- t << ["白米比率"] + recipe.rice_rates
25
- t << ["酒母歩合(%)"] + recipe.cumulative_shubo_rates.map{|s| s * 100}
26
- t << ["タンク内容量(ml)"] + recipe.cumulative_weight_totals
23
+ t << ["総米(g)"] + recipe.cumulative_rice_totals.map{|v| v&.round(2)}
24
+ t << ["白米比率"] + recipe.rice_rates.map{|v| v&.round(2)}
25
+ t << ["酒母歩合(%)"] + recipe.cumulative_shubo_rates.map{|s| s * 100}.map{|v| v&.round(2)}
26
+ t << ["タンク内容量(ml)"] + recipe.cumulative_weight_totals.map{|v| v&.round(2)}
27
27
  end
28
28
  puts table
29
29
  puts
@@ -33,13 +33,13 @@ puts "掛米"
33
33
  table = Terminal::Table.new do |t|
34
34
  t << ["工程", "原料"] + recipe.class::STEP_NAMES
35
35
  t << :separator
36
- t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:rice).map(&:raw)
37
- t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:rice).map(&:soaking_water)
36
+ t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:rice).map(&:raw).map{|v| v&.round(2)}
37
+ t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:rice).map(&:soaking_water).map{|v| v&.round(2)}
38
38
  t << :separator
39
- t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:rice).map(&:soaked)
40
- t << ["", "汲水(ml)"] + recipe.steps.map(&:rice).map(&:steaming_water)
39
+ t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:rice).map(&:soaked).map{|v| v&.round(2)}
40
+ t << ["", "汲水(ml)"] + recipe.steps.map(&:rice).map(&:steaming_water).map{|v| v&.round(2)}
41
41
  t << :separator
42
- t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:rice).map(&:steamed)
42
+ t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:rice).map(&:steamed).map{|v| v&.round(2)}
43
43
  end
44
44
  puts table
45
45
  puts
@@ -48,18 +48,18 @@ puts "麹"
48
48
  table = Terminal::Table.new do |t|
49
49
  t << ["工程", "原料"] + recipe.class::STEP_NAMES
50
50
  t << :separator
51
- t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:koji).map(&:raw)
52
- t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:koji).map(&:soaking_water)
51
+ t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:koji).map(&:raw).map{|v| v&.round(2)}
52
+ t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:koji).map(&:soaking_water).map{|v| v&.round(2)}
53
53
  t << :separator
54
- t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:koji).map(&:soaked)
55
- t << ["", "汲水(ml)"] + recipe.steps.map(&:koji).map(&:steaming_water)
54
+ t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:koji).map(&:soaked).map{|v| v&.round(2)}
55
+ t << ["", "汲水(ml)"] + recipe.steps.map(&:koji).map(&:steaming_water).map{|v| v&.round(2)}
56
56
  t << :separator
57
- t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:steamed)
57
+ t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:steamed).map{|v| v&.round(2)}
58
58
  t << :separator
59
- t << ["放冷・引込み", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:cooled)
60
- t << ["", "種麹(g)"] + recipe.steps.map(&:koji).map(&:tanekoji)
59
+ t << ["放冷・引込み", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:cooled).map{|v| v&.round(2)}
60
+ t << ["", "種麹(g)"] + recipe.steps.map(&:koji).map(&:tanekoji).map{|v| v&.round(2)}
61
61
  t << :separator
62
- t << ["製麹", "麹(g)"] + recipe.steps.map(&:koji).map(&:dekoji)
62
+ t << ["製麹", "麹(g)"] + recipe.steps.map(&:koji).map(&:dekoji).map{|v| v&.round(2)}
63
63
  end
64
64
  puts table
65
65
  puts