migrated to async
This commit is contained in:
parent
4c14c62c05
commit
1d92a34093
|
|
@ -29,27 +29,18 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "0.7.13"
|
version = "0.7.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
|
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ansi_term"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.32"
|
version = "1.0.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"
|
checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atk"
|
name = "atk"
|
||||||
|
|
@ -78,15 +69,10 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "autocfg"
|
||||||
version = "0.2.14"
|
version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
dependencies = [
|
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
|
|
@ -96,9 +82,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.3.4"
|
version = "1.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
|
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cairo-rs"
|
name = "cairo-rs"
|
||||||
|
|
@ -128,9 +114,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.60"
|
version = "1.0.67"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
|
checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
|
|
@ -144,28 +130,13 @@ version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "clap"
|
|
||||||
version = "2.33.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
|
|
||||||
dependencies = [
|
|
||||||
"ansi_term",
|
|
||||||
"atty",
|
|
||||||
"bitflags",
|
|
||||||
"strsim",
|
|
||||||
"textwrap",
|
|
||||||
"unicode-width",
|
|
||||||
"vec_map",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc32fast"
|
name = "crc32fast"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
|
checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 0.1.10",
|
"cfg-if 1.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -192,9 +163,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
|
checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
|
@ -207,9 +178,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-channel"
|
name = "futures-channel"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
|
checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
|
|
@ -217,15 +188,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-core"
|
name = "futures-core"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
|
checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-executor"
|
name = "futures-executor"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
|
checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
|
|
@ -234,15 +205,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-io"
|
name = "futures-io"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
|
checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-macro"
|
name = "futures-macro"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
|
checksum = "668c6733a182cd7deb4f1de7ba3bf2120823835b3bcfbeacf7d2c4a773c1bb8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -252,24 +223,21 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-sink"
|
name = "futures-sink"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
|
checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-task"
|
name = "futures-task"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
|
checksum = "ba7aa51095076f3ba6d9a1f702f74bd05ec65f555d70d2033d55ba8d69f581bc"
|
||||||
dependencies = [
|
|
||||||
"once_cell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-util"
|
name = "futures-util"
|
||||||
version = "0.3.5"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
|
checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
|
@ -278,7 +246,7 @@ dependencies = [
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
"memchr",
|
"memchr",
|
||||||
"pin-project",
|
"pin-project-lite",
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro-nested",
|
"proc-macro-nested",
|
||||||
|
|
@ -352,9 +320,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6"
|
checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"libc",
|
"libc",
|
||||||
|
|
@ -499,9 +467,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
|
checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
@ -524,17 +492,11 @@ dependencies = [
|
||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lazy_static"
|
|
||||||
version = "1.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.77"
|
version = "0.2.94"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
|
checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libmath"
|
name = "libmath"
|
||||||
|
|
@ -585,9 +547,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.3.3"
|
version = "2.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
|
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
|
|
@ -612,10 +574,20 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "num_cpus"
|
||||||
version = "1.4.1"
|
version = "1.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
|
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "once_cell"
|
||||||
|
version = "1.7.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pango"
|
name = "pango"
|
||||||
|
|
@ -645,24 +617,10 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project-lite"
|
||||||
version = "0.4.24"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f48fad7cfbff853437be7cf54d7b993af21f53be7f0988cbfe4a51535aa77205"
|
checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"
|
||||||
dependencies = [
|
|
||||||
"pin-project-internal",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pin-project-internal"
|
|
||||||
version = "0.4.24"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "24c6d293bdd3ca5a1697997854c6cf7855e43fb6a0ba1c47af57a5bcafd158ae"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-utils"
|
name = "pin-utils"
|
||||||
|
|
@ -672,9 +630,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.18"
|
version = "0.3.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
|
checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "png"
|
name = "png"
|
||||||
|
|
@ -729,30 +687,30 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-hack"
|
name = "proc-macro-hack"
|
||||||
version = "0.5.18"
|
version = "0.5.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
|
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-nested"
|
name = "proc-macro-nested"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
|
checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.23"
|
version = "1.0.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51ef7cd2518ead700af67bf9d1a658d90b6037d77110fd9c0445429d0ba1c6c9"
|
checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.7"
|
version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
|
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
@ -782,13 +740,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.8.1"
|
version = "0.8.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c24fcd450d3fa2b592732565aa4f17a27a61c65ece4726353e000939b0edee34"
|
checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"rand_chacha",
|
"rand_chacha",
|
||||||
"rand_core 0.6.1",
|
"rand_core 0.6.2",
|
||||||
"rand_hc",
|
"rand_hc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -799,7 +757,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
|
checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ppv-lite86",
|
"ppv-lite86",
|
||||||
"rand_core 0.6.1",
|
"rand_core 0.6.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -819,9 +777,9 @@ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_core"
|
name = "rand_core"
|
||||||
version = "0.6.1"
|
version = "0.6.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5"
|
checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
]
|
]
|
||||||
|
|
@ -832,7 +790,7 @@ version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
|
checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rand_core 0.6.1",
|
"rand_core 0.6.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -846,33 +804,32 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.4.2"
|
version = "1.4.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
|
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
"regex-syntax",
|
"regex-syntax",
|
||||||
"thread_local",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.21"
|
version = "0.6.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
|
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.116"
|
version = "1.0.125"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
|
checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serialport"
|
name = "serialport"
|
||||||
version = "4.0.0"
|
version = "4.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22f37409d980045734250d679750bdf11bd875fec5bb5417dd21bb75d04d31a1"
|
checksum = "5d8cd7c0f22290ee2c01457009fa6fc1cae4153d5608a924e5dc423babc2c655"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"CoreFoundation-sys",
|
"CoreFoundation-sys",
|
||||||
"IOKit-sys",
|
"IOKit-sys",
|
||||||
|
|
@ -887,15 +844,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "strsim"
|
|
||||||
version = "0.8.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strum"
|
name = "strum"
|
||||||
|
|
@ -917,9 +868,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.42"
|
version = "1.0.70"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228"
|
checksum = "b9505f307c872bab8eb46f77ae357c8eba1fdacead58ee5a850116b1d7f82883"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
@ -942,44 +893,35 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tarangam"
|
name = "tarangam_dwij"
|
||||||
version = "0.1.2"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cairo-rs",
|
"cairo-rs",
|
||||||
"clap",
|
|
||||||
"gdk",
|
"gdk",
|
||||||
"gio",
|
"gio",
|
||||||
"glib",
|
"glib",
|
||||||
"gtk",
|
"gtk",
|
||||||
"libmath",
|
"libmath",
|
||||||
"png",
|
"png",
|
||||||
"rand 0.8.1",
|
"rand 0.8.3",
|
||||||
"serialport",
|
"serialport",
|
||||||
]
|
"tokio",
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "textwrap"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
|
||||||
dependencies = [
|
|
||||||
"unicode-width",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.20"
|
version = "1.0.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
|
checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"thiserror-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "1.0.20"
|
version = "1.0.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
|
checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
@ -987,34 +929,42 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thread_local"
|
name = "tokio"
|
||||||
version = "1.0.1"
|
version = "1.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
|
checksum = "83f0c8e7c0addab50b663055baf787d0af7f413a46e6e7fb9559a4e4db7137a5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"autocfg",
|
||||||
|
"num_cpus",
|
||||||
|
"pin-project-lite",
|
||||||
|
"tokio-macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-macros"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.5.6"
|
version = "0.5.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
|
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.6.0"
|
version = "1.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
|
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unicode-width"
|
|
||||||
version = "0.1.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
|
|
@ -1022,12 +972,6 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vec_map"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version-compare"
|
name = "version-compare"
|
||||||
version = "0.0.10"
|
version = "0.0.10"
|
||||||
|
|
@ -1036,9 +980,9 @@ checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.2"
|
version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
|
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "void"
|
name = "void"
|
||||||
|
|
@ -1048,9 +992,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
version = "0.10.1+wasi-snapshot-preview1"
|
version = "0.10.2+wasi-snapshot-preview1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "93c6c3420963c5c64bca373b25e77acb562081b9bb4dd5bb864187742186cea9"
|
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
|
|
|
||||||
16
Cargo.toml
16
Cargo.toml
|
|
@ -1,16 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tarangam"
|
name = "tarangam_dwij"
|
||||||
version = "0.1.2"
|
version = "0.1.0"
|
||||||
authors = ["PiyushXCoder <piyush.raj.kit@gmail.com>"]
|
authors = ["Piyush Mishra <piyush.raj.kit@gmail.com>"]
|
||||||
license = "GPL 3.0"
|
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
documentation = "A simple serial plotter. एक सरल सीरीय्ल पलौटर।"
|
|
||||||
readme = "README.md"
|
|
||||||
repository = "https://github.com/PiyushXCoder/Tarangam"
|
|
||||||
keywords = ["plotter","serial","serialplotter","arduino","gtk"]
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
tokio = { version = "1.5.0", features = ["rt", "rt-multi-thread", "macros", "time", "sync"] }
|
||||||
gtk = "0.9.2"
|
gtk = "0.9.2"
|
||||||
gdk = "0.13.2"
|
gdk = "0.13.2"
|
||||||
gio = "0.9.1"
|
gio = "0.9.1"
|
||||||
|
|
@ -19,5 +16,4 @@ png = "0.16.8"
|
||||||
cairo-rs = { version = "0.9.1", features = ["png"] }
|
cairo-rs = { version = "0.9.1", features = ["png"] }
|
||||||
rand = "0.8.1"
|
rand = "0.8.1"
|
||||||
libmath = "0.2.1"
|
libmath = "0.2.1"
|
||||||
serialport = "4.0.0"
|
serialport = "4.0.1"
|
||||||
clap = "2.33.3"
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of Tarangam.
|
|
||||||
|
|
||||||
Tarangam is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
Tarangam is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with Tarangam. If not, see <https://www.gnu.org/licenses/>
|
|
||||||
*/
|
|
||||||
|
|
||||||
//! Feel free to see through codes. Application is not written to be used as a library for other app. :)
|
|
||||||
|
|
||||||
pub struct Config {
|
|
||||||
pub ui_file: String
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Config {
|
|
||||||
pub fn generate() -> Self {
|
|
||||||
let ui_file = std::env::var("TARANGAM_UI_FILE");
|
|
||||||
|
|
||||||
Config {
|
|
||||||
ui_file: match ui_file {
|
|
||||||
Ok(val) => val,
|
|
||||||
Err(_) => std::env::current_exe().unwrap().parent().unwrap()
|
|
||||||
.join("ui.glade").to_str().unwrap().to_owned()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
621
src/lib.rs
621
src/lib.rs
|
|
@ -17,70 +17,49 @@
|
||||||
|
|
||||||
//! Feel free to see through codes. Application is not written to be used as a library for other app. :)
|
//! Feel free to see through codes. Application is not written to be used as a library for other app. :)
|
||||||
|
|
||||||
mod graph;
|
pub mod graph;
|
||||||
|
pub mod util;
|
||||||
|
pub mod port_util;
|
||||||
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
use glib::clone;
|
||||||
|
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
use std::{collections::HashMap, sync::{Arc, Mutex}};
|
use std::collections::HashMap;
|
||||||
|
use std::sync::Arc;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::io::prelude::*;
|
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
use graph::Graph;
|
use graph::Graph;
|
||||||
|
use util::Config;
|
||||||
/// Status of Serial reading
|
use port_util as putil;
|
||||||
enum Status {
|
|
||||||
JAGRIT, // Mode of Active
|
|
||||||
SAYAN, // Mode of Sleeping
|
|
||||||
AVRODTIH, // Mode of being stopped
|
|
||||||
PARIVARTIT // Mode of being values modified
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Configuration to read from Serial Port
|
|
||||||
pub struct Config {
|
|
||||||
status: Status,
|
|
||||||
bondrate: u32,
|
|
||||||
port: String
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Config {
|
|
||||||
pub fn new() -> Config {
|
|
||||||
Config {
|
|
||||||
status: Status::AVRODTIH,
|
|
||||||
bondrate: 9600,
|
|
||||||
port: "".to_owned()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// For communication between mpsc of graph and serial port
|
|
||||||
#[derive(Debug)]
|
|
||||||
enum MessageSerialThread {
|
|
||||||
Msg(String, MessageSerialThreadMsgType),
|
|
||||||
Points(Vec<(String, f64)>),
|
|
||||||
Status(String)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
enum MessageSerialThreadMsgType {
|
|
||||||
Point,
|
|
||||||
Log
|
|
||||||
}
|
|
||||||
|
|
||||||
// Building and configuring GUI
|
// Building and configuring GUI
|
||||||
pub fn build_ui(app: >k::Application, ui_file: &str) {
|
pub fn build_ui(app: >k::Application, config: &Arc<Config>) {
|
||||||
let config = Arc::new(Mutex::new(Config::new()));
|
let builder = gtk::Builder::from_file(&config.ui_file);
|
||||||
let builder = gtk::Builder::from_file(ui_file);
|
|
||||||
|
|
||||||
let win = builder.get_object::<gtk::ApplicationWindow>("win").expect("Resource file missing!");
|
let win = builder.get_object::<gtk::ApplicationWindow>("win").expect("Resource file missing!");
|
||||||
win.set_application(Some(app));
|
win.set_application(Some(app));
|
||||||
|
|
||||||
|
// Status Bar
|
||||||
let bar = builder.get_object::<gtk::Statusbar>("status_bar").expect("Resource file missing!");
|
let bar = builder.get_object::<gtk::Statusbar>("status_bar").expect("Resource file missing!");
|
||||||
|
|
||||||
|
// Logging Area
|
||||||
let log_area = builder.get_object::<gtk::TextView>("log_area").expect("Resource file missing!");
|
let log_area = builder.get_object::<gtk::TextView>("log_area").expect("Resource file missing!");
|
||||||
|
|
||||||
|
// About Window
|
||||||
|
let about_window = builder.get_object::<gtk::AboutDialog>("about_window").expect("Resource file missing!");
|
||||||
|
|
||||||
|
// Save Window
|
||||||
|
let save_window = builder.get_object::<gtk::FileChooserDialog>("save_window").expect("Resource file missing!");
|
||||||
|
save_window.set_transient_for(Some(&win));
|
||||||
|
save_window.set_action(gtk::FileChooserAction::Save);
|
||||||
|
save_window.add_button("_Save", gtk::ResponseType::Apply);
|
||||||
|
save_window.add_button("_Cancel", gtk::ResponseType::Cancel);
|
||||||
|
|
||||||
let graph = Graph::new(
|
let graph = Graph::new(
|
||||||
builder.get_object::<gtk::DrawingArea>("draw_area").expect("Resource file missing!"),
|
builder.get_object::<gtk::DrawingArea>("draw_area").expect("Resource file missing!"),
|
||||||
0.0, 100.0,
|
0.0, 100.0,
|
||||||
|
|
@ -95,47 +74,190 @@ pub fn build_ui(app: >k::Application, ui_file: &str) {
|
||||||
|
|
||||||
win.show_all();
|
win.show_all();
|
||||||
|
|
||||||
// exit_menu
|
// required by signals
|
||||||
let exit_menu = builder.get_object::<gtk::MenuItem>("exit_menu").expect("Resource file missing!");
|
let stambh_1 = builder.get_object::<gtk::Entry>("stambh_1").expect("Resource file missing!");
|
||||||
|
let stambh_2 = builder.get_object::<gtk::Entry>("stambh_2").expect("Resource file missing!");
|
||||||
let tmp_win = win.clone();
|
let draw_baarik_box = builder.get_object::<gtk::CheckButton>("draw_baarik_box").expect("Resource file missing!");
|
||||||
exit_menu.connect_activate(move |_|{
|
let port = builder.get_object::<gtk::ComboBoxText>("port").expect("Resource file missing!");
|
||||||
unsafe {
|
let send_entry = builder.get_object::<gtk::Entry>("send_entry").expect("Resource file missing!");
|
||||||
tmp_win.destroy();
|
// Signals
|
||||||
|
builder.connect_signals(|_, handler_name| {
|
||||||
|
match handler_name {
|
||||||
|
"exit_menu_activate" => Box::new(clone!(@weak win => @default-return None, move |_| {
|
||||||
|
unsafe { win.destroy(); }
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"about_menu_activate" => Box::new(clone!(@weak about_window => @default-return None, move |_| {
|
||||||
|
about_window.show();
|
||||||
|
about_window.present();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"save_menu_activate" => Box::new(clone!(@weak save_window => @default-return None, move |_| {
|
||||||
|
save_window.show();
|
||||||
|
save_window.present();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"gtk_main_quit" => Box::new(clone!(@weak save_window => @default-return None, move |_| {
|
||||||
|
save_window.show();
|
||||||
|
save_window.present();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"pankti_value_changed" => Box::new(clone!(@weak graph => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::SpinButton>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
tmp_graph.scale_x_size = btn.get_value();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"stambh_1_changed" => Box::new(clone!(@weak graph => @default-return None, move |a| {
|
||||||
|
let entry = a[0].get::<gtk::Entry>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
let val = entry.get_text().parse::<f64>().unwrap_or(0.0);
|
||||||
|
let purana_y_start = tmp_graph.scale_y_start;
|
||||||
|
let y_size = tmp_graph.scale_y_size;
|
||||||
|
tmp_graph.scale_y_start = val;
|
||||||
|
tmp_graph.scale_y_size = y_size + (purana_y_start - val);
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"stambh_2_changed" => Box::new(clone!(@weak graph => @default-return None, move |a| {
|
||||||
|
let entry = a[0].get::<gtk::Entry>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
let val = entry.get_text().parse::<f64>().unwrap_or(0.0);
|
||||||
|
let y_start = tmp_graph.scale_y_start;
|
||||||
|
tmp_graph.scale_y_size = (val - y_start).abs();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"nimna_stambh_toggled" => Box::new(clone!(@weak graph, @weak stambh_1, @weak stambh_2 => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::CheckButton>().unwrap().unwrap();
|
||||||
|
graph.borrow_mut().auto_adjust_y = !btn.get_active();
|
||||||
|
stambh_1.set_sensitive(btn.get_active());
|
||||||
|
stambh_2.set_sensitive(btn.get_active());
|
||||||
|
if btn.get_active() {
|
||||||
|
stambh_1.emit_activate();
|
||||||
|
stambh_2.emit_activate();
|
||||||
|
}
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"draw_patches_toggled" => Box::new(clone!(@weak graph => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::CheckButton>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
tmp_graph.draw_patch = btn.get_active();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"draw_box_toggled" => Box::new(clone!(@weak graph, @weak draw_baarik_box => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::CheckButton>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
draw_baarik_box.set_sensitive(btn.get_active());
|
||||||
|
tmp_graph.draw_box = btn.get_active();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"draw_baarik_box_toggled" => Box::new(clone!(@weak graph => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::CheckButton>().unwrap().unwrap();
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
tmp_graph.draw_baarik_box = btn.get_active();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"clear_graph_clicked"=> Box::new(clone!(@weak graph => @default-return None, move |_| {
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
tmp_graph.pankti_sankya = 0.0;
|
||||||
|
tmp_graph.lines.clear();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"bondrate_changed" => Box::new(clone!(@weak config => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::ComboBoxText>().unwrap().unwrap();
|
||||||
|
config.bondrate.store(btn.get_active_text().unwrap().parse::<u32>().unwrap_or(9600u32), Ordering::SeqCst);
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"port_changed" => Box::new(clone!(@weak config, @weak bar => @default-return None, move |a| {
|
||||||
|
let btn = a[0].get::<gtk::ComboBoxText>().unwrap().unwrap();
|
||||||
|
if let Some(val) = btn.get_active_text() {
|
||||||
|
match config.port.lock() {
|
||||||
|
Ok(mut a) => { *a = val.to_string() },
|
||||||
|
Err(_) => { bar.push(1, "Can't set Port"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"refresh_port_clicked" => Box::new(clone!(@weak port, @weak bar, @weak config => @default-return None, move |_| {
|
||||||
|
port.remove_all();
|
||||||
|
match config.status.lock() {
|
||||||
|
Ok(mut a) => { *a = util::Status::AVRODTIH },
|
||||||
|
Err(_) => { bar.push(1, "Can't Avrodhit"); return None; }
|
||||||
|
}
|
||||||
|
bar.push(1, "Avrodhit");
|
||||||
|
match serialport::available_ports() {
|
||||||
|
Ok(ports) => {
|
||||||
|
if ports.len() == 0 { bar.push(1, "No port found!"); }
|
||||||
|
for p in ports {
|
||||||
|
port.append_text(p.port_name.as_str());
|
||||||
|
}
|
||||||
|
}, Err(_) => {
|
||||||
|
bar.push(1, "No port found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"jagrit_btn_clicked" => Box::new(clone!(@weak config, @weak graph, @weak bar => @default-return None, move |_| {
|
||||||
|
let mut tmp_graph = graph.borrow_mut();
|
||||||
|
tmp_graph.pankti_sankya = 0.0;
|
||||||
|
tmp_graph.lines.clear();
|
||||||
|
tmp_graph.redraw();
|
||||||
|
bar.push(1, "Jagrit");
|
||||||
|
match config.status.lock() {
|
||||||
|
Ok(mut a) => { *a = util::Status::PARIVARTIT },
|
||||||
|
Err(_) => { bar.push(1, "Can't Jagrit"); }
|
||||||
|
}
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"avrodith_btn_clicked" => Box::new(clone!(@weak config, @weak bar => @default-return None, move |_| {
|
||||||
|
bar.push(1, "Avrodhit");
|
||||||
|
match config.status.lock() {
|
||||||
|
Ok(mut a) => { *a = util::Status::AVRODTIH },
|
||||||
|
Err(_) => { bar.push(1, "Can't Avrodhit"); }
|
||||||
|
}
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"clear_log_clicked" => Box::new(clone!(@weak log_area => @default-return None, move |_| {
|
||||||
|
log_area.get_buffer().expect("Couldn't get window").set_text("");
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"send_entry_activate" => Box::new(clone!(@weak config, @weak bar => @default-return None, move |a| {
|
||||||
|
let ent = a[0].get::<gtk::Entry>().unwrap().unwrap();
|
||||||
|
putil::send_text(&config, &ent, &bar);
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"send_btn_clicked" => Box::new(clone!(@weak config, @weak bar, @weak send_entry => @default-return None, move |_| {
|
||||||
|
putil::send_text(&config, &send_entry, &bar);
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"about_window_delete" => Box::new(|a| {
|
||||||
|
let win = a[0].get::<gtk::AboutDialog>().unwrap().unwrap();
|
||||||
|
win.hide();
|
||||||
|
Some(true.to_value())
|
||||||
|
}),
|
||||||
|
"save_window_delete" => Box::new(|a| {
|
||||||
|
let win = a[0].get::<gtk::FileChooserDialog>().unwrap().unwrap();
|
||||||
|
win.hide();
|
||||||
|
Some(true.to_value())
|
||||||
|
}),
|
||||||
|
"about_window_close" => Box::new(clone!(@weak about_window => @default-return None, move |_| {
|
||||||
|
about_window.hide();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
"save_window_close" => Box::new(clone!(@weak save_window => @default-return None, move |_| {
|
||||||
|
save_window.hide();
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
_ => Box::new(|_| {None})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// about_menu
|
|
||||||
let about_menu = builder.get_object::<gtk::MenuItem>("about_menu").expect("Resource file missing!");
|
|
||||||
let about_window = builder.get_object::<gtk::AboutDialog>("about_window").expect("Resource file missing!");
|
|
||||||
about_window.set_transient_for(Some(&win));
|
|
||||||
about_window.set_version(Some(env!("CARGO_PKG_VERSION")));
|
|
||||||
about_window.connect_delete_event(|win,_| {
|
|
||||||
win.hide();
|
|
||||||
Inhibit(true)
|
|
||||||
});
|
|
||||||
|
|
||||||
let a_win = about_window.clone();
|
|
||||||
about_menu.connect_activate(move |_|{
|
|
||||||
a_win.show();
|
|
||||||
a_win.present();
|
|
||||||
});
|
|
||||||
|
|
||||||
// save_log
|
|
||||||
let save_menu = builder.get_object::<gtk::MenuItem>("save_menu").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let save_window = builder.get_object::<gtk::FileChooserDialog>("save_window").expect("Resource file missing!");
|
|
||||||
save_window.set_transient_for(Some(&win));
|
|
||||||
save_window.set_action(gtk::FileChooserAction::Save);
|
|
||||||
|
|
||||||
save_window.connect_delete_event(|win,_| {
|
|
||||||
win.hide();
|
|
||||||
Inhibit(true)
|
|
||||||
});
|
|
||||||
|
|
||||||
save_window.add_button("_Save", gtk::ResponseType::Apply);
|
|
||||||
save_window.add_button("_Cancel", gtk::ResponseType::Cancel);
|
|
||||||
|
|
||||||
let tmp_log_area = log_area.clone();
|
let tmp_log_area = log_area.clone();
|
||||||
let tmp_bar = bar.clone();
|
let tmp_bar = bar.clone();
|
||||||
save_window.connect_response(move |win, res| {
|
save_window.connect_response(move |win, res| {
|
||||||
|
|
@ -161,216 +283,6 @@ pub fn build_ui(app: >k::Application, ui_file: &str) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
save_menu.connect_activate(move |_|{
|
|
||||||
save_window.show();
|
|
||||||
});
|
|
||||||
|
|
||||||
// pankti
|
|
||||||
let pankti = builder.get_object::<gtk::SpinButton>("pankti").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
pankti.connect_value_changed(move |btn| {
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
tmp_graph.scale_x_size = btn.get_value();
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// stambh_1
|
|
||||||
let stambh_1 = builder.get_object::<gtk::Entry>("stambh_1").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
stambh_1.connect_activate(move |entry| {
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
let val = entry.get_text().parse::<f64>().unwrap_or(0.0);
|
|
||||||
let purana_y_start = tmp_graph.scale_y_start;
|
|
||||||
let y_size = tmp_graph.scale_y_size;
|
|
||||||
tmp_graph.scale_y_start = val;
|
|
||||||
tmp_graph.scale_y_size = y_size + (purana_y_start - val);
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// stambh_2
|
|
||||||
let stambh_2 = builder.get_object::<gtk::Entry>("stambh_2").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
stambh_2.connect_activate(move |entry| {
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
let val = entry.get_text().parse::<f64>().unwrap_or(0.0);
|
|
||||||
let y_start = tmp_graph.scale_y_start;
|
|
||||||
tmp_graph.scale_y_size = (val - y_start).abs();
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// nimna_stambh
|
|
||||||
let nimna_stambh = builder.get_object::<gtk::CheckButton>("nimna_stambh").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
nimna_stambh.connect_clicked(move |btn| {
|
|
||||||
tmp_graph.borrow_mut().auto_adjust_y = !btn.get_active();
|
|
||||||
stambh_1.set_sensitive(btn.get_active());
|
|
||||||
stambh_2.set_sensitive(btn.get_active());
|
|
||||||
if btn.get_active() {
|
|
||||||
stambh_1.emit_activate();
|
|
||||||
stambh_2.emit_activate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// draw_patches
|
|
||||||
let draw_patches = builder.get_object::<gtk::CheckButton>("draw_patches").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
draw_patches.connect_clicked(move |btn| {
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
tmp_graph.draw_patch = btn.get_active();
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// draw_baarik_box
|
|
||||||
let draw_baarik_box = builder.get_object::<gtk::CheckButton>("draw_baarik_box").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
draw_baarik_box.connect_clicked(move |btn| {
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
tmp_graph.draw_baarik_box = btn.get_active();
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// draw_box
|
|
||||||
let draw_box = builder.get_object::<gtk::CheckButton>("draw_box").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
draw_box.connect_clicked(move |btn| {
|
|
||||||
draw_baarik_box.set_sensitive(btn.get_active());
|
|
||||||
let mut tmp_graph = tmp_graph.borrow_mut();
|
|
||||||
tmp_graph.draw_box = btn.get_active();
|
|
||||||
tmp_graph.redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Bondrate
|
|
||||||
let bondrate = builder.get_object::<gtk::ComboBoxText>("bondrate").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
bondrate.connect_changed(move |cbx| {
|
|
||||||
match tmp_config.lock() {
|
|
||||||
Ok(mut config) => {
|
|
||||||
config.bondrate = match cbx.get_active_text() {
|
|
||||||
Some(txt) => txt.to_string().parse::<u32>().unwrap_or(9600u32),
|
|
||||||
None => 9600
|
|
||||||
};
|
|
||||||
}, Err(_) => {
|
|
||||||
tmp_bar.push(1, "Failed to change bondrate!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// port
|
|
||||||
let refresh_port = builder.get_object::<gtk::ToolButton>("refresh_port").expect("Resource file missing!");
|
|
||||||
let port = builder.get_object::<gtk::ComboBoxText>("port").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_port = port.clone();
|
|
||||||
refresh_port.connect_clicked(move |_| {
|
|
||||||
tmp_port.remove_all();
|
|
||||||
match serialport::available_ports() {
|
|
||||||
Ok(ports) => {
|
|
||||||
if ports.len() == 0 { tmp_bar.push(1, "No port found!"); }
|
|
||||||
for p in ports {
|
|
||||||
tmp_port.append_text(p.port_name.as_str());
|
|
||||||
}
|
|
||||||
}, Err(_) => {
|
|
||||||
tmp_bar.push(1, "No port found!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
port.connect_changed(move |cbx| {
|
|
||||||
match tmp_config.lock() {
|
|
||||||
Ok(mut config) => {
|
|
||||||
config.port = match cbx.get_active_text() {
|
|
||||||
Some(txt) => txt.to_string(),
|
|
||||||
None => "".to_owned()
|
|
||||||
};
|
|
||||||
}, Err(_) => {
|
|
||||||
tmp_bar.push(1, "Failed to change port!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// clear_graph
|
|
||||||
let clear_graph = builder.get_object::<gtk::ToolButton>("clear_graph").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
clear_graph.connect_clicked(move |_ | {
|
|
||||||
tmp_graph.borrow_mut().pankti_sankya = 0.0;
|
|
||||||
tmp_graph.borrow_mut().lines.clear();
|
|
||||||
tmp_graph.borrow_mut().redraw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// jagrit_btn
|
|
||||||
let jagrit_btn = builder.get_object::<gtk::ToolButton>("jagrit_btn").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
let tmp_graph = Rc::clone(&graph);
|
|
||||||
jagrit_btn.connect_clicked(move |_ | {
|
|
||||||
match tmp_config.lock() {
|
|
||||||
Ok(mut config) => {
|
|
||||||
tmp_graph.borrow_mut().pankti_sankya = 0.0;
|
|
||||||
tmp_graph.borrow_mut().lines.clear();
|
|
||||||
tmp_graph.borrow_mut().redraw();
|
|
||||||
tmp_bar.push(1, "Jagrit");
|
|
||||||
config.status = Status::PARIVARTIT;
|
|
||||||
}, Err(_) => {
|
|
||||||
tmp_bar.push(1, "Failed to change port!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// avrodith_btn
|
|
||||||
let avrodith_btn = builder.get_object::<gtk::ToolButton>("avrodith_btn").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
avrodith_btn.connect_clicked(move |_| {
|
|
||||||
match tmp_config.lock() {
|
|
||||||
Ok(mut config) => {
|
|
||||||
tmp_bar.push(1, "Avrodhit");
|
|
||||||
config.status = Status::AVRODTIH;
|
|
||||||
}, Err(_) => {
|
|
||||||
tmp_bar.push(1, "Failed to change port!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// clear_log
|
|
||||||
let clear_log = builder.get_object::<gtk::ToolButton>("clear_log").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_log_area = log_area.clone();
|
|
||||||
clear_log.connect_clicked(move |_| {
|
|
||||||
tmp_log_area.get_buffer().expect("Couldn't get window").set_text("");
|
|
||||||
});
|
|
||||||
|
|
||||||
// send_entry
|
|
||||||
let send_entry = builder.get_object::<gtk::Entry>("send_entry").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
send_entry.connect_activate(move |ent| {
|
|
||||||
send_text(&tmp_config, ent, &tmp_bar);
|
|
||||||
});
|
|
||||||
|
|
||||||
// send_btn
|
|
||||||
let send_btn = builder.get_object::<gtk::Button>("send_btn").expect("Resource file missing!");
|
|
||||||
|
|
||||||
let tmp_bar = bar.clone();
|
|
||||||
let tmp_config = Arc::clone(&config);
|
|
||||||
send_btn.connect_clicked(move |_| {
|
|
||||||
send_text(&tmp_config, &send_entry, &tmp_bar);
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Thread to manage Serial Port
|
Thread to manage Serial Port
|
||||||
|
|
||||||
|
|
@ -379,13 +291,13 @@ pub fn build_ui(app: >k::Application, ui_file: &str) {
|
||||||
or Log is added to text area or any status is displayed in bar
|
or Log is added to text area or any status is displayed in bar
|
||||||
*/
|
*/
|
||||||
let (sender, receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
|
let (sender, receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
|
||||||
|
|
||||||
let tmp_config = Arc::clone(&config);
|
let tmp_config = Arc::clone(&config);
|
||||||
std::thread::spawn(move || {
|
tokio::task::spawn(async move {
|
||||||
let mut bufread: Option<BufReader<Box<dyn serialport::SerialPort>>> = None;
|
let mut bufread: Option<BufReader<Box<dyn serialport::SerialPort>>> = None;
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
loop {
|
loop {
|
||||||
serial_thread_work(&tmp_config, &mut bufread, &sender, &mut buf);
|
putil::serial_thread_work(&tmp_config, &mut bufread, &sender, &mut buf).await;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -395,13 +307,13 @@ pub fn build_ui(app: >k::Application, ui_file: &str) {
|
||||||
let tmp_graph = Rc::clone(&graph);
|
let tmp_graph = Rc::clone(&graph);
|
||||||
receiver.attach(None, move |msg| {
|
receiver.attach(None, move |msg| {
|
||||||
match msg {
|
match msg {
|
||||||
MessageSerialThread::Msg(text, msg_type) => {
|
util::MessageSerialThread::Msg(text, msg_type) => {
|
||||||
receiver_for_msg(text, &msg_type, &full_log, &log_area);
|
receiver_for_msg(text, &msg_type, &full_log, &log_area);
|
||||||
},
|
},
|
||||||
MessageSerialThread::Points(points) => {
|
util::MessageSerialThread::Points(points) => {
|
||||||
receiver_for_points(points, &tmp_graph, &graph_data);
|
receiver_for_points(points, &tmp_graph, &graph_data);
|
||||||
}
|
}
|
||||||
MessageSerialThread::Status(text) => {
|
util::MessageSerialThread::Status(text) => {
|
||||||
bar.push(1, &text);
|
bar.push(1, &text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -409,91 +321,16 @@ pub fn build_ui(app: >k::Application, ui_file: &str) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls the thread and read from serial port
|
|
||||||
fn serial_thread_work(
|
|
||||||
config: &Arc<Mutex<Config>>,
|
|
||||||
bufread: &mut Option<BufReader<Box<dyn serialport::SerialPort>>>,
|
|
||||||
sender: &glib::Sender<MessageSerialThread>,
|
|
||||||
buf: &mut String) {
|
|
||||||
let mut do_sleep = false;
|
|
||||||
match config.lock() {
|
|
||||||
Ok(mut config) => {
|
|
||||||
match config.status {
|
|
||||||
Status::AVRODTIH => {
|
|
||||||
*bufread = None;
|
|
||||||
config.status = Status::SAYAN;
|
|
||||||
},
|
|
||||||
Status::JAGRIT => {
|
|
||||||
if let Some(read) = bufread {
|
|
||||||
if let Ok(_) = read.read_line(buf) {
|
|
||||||
for line in buf.lines() {
|
|
||||||
if line.len() == 0 {
|
|
||||||
continue;
|
|
||||||
} else if line.starts_with("#") {
|
|
||||||
let mut points: Vec<(String, f64)> = Vec::new();
|
|
||||||
for (index, line) in line[1..].split(" ").enumerate() {
|
|
||||||
let part = line.split("=");
|
|
||||||
let part = part.into_iter().collect::<Vec<&str>>();
|
|
||||||
if part.len() == 1 {
|
|
||||||
let num = match part[0].trim().parse::<f64>() {
|
|
||||||
Ok(val) => val,
|
|
||||||
Err(_) => {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
points.push((index.to_string(), num));
|
|
||||||
} else if part.len() == 2 {
|
|
||||||
points.push((part[0].trim().to_owned(), part[1].parse::<f64>().unwrap()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sender.send(MessageSerialThread::Points(points)).unwrap();
|
|
||||||
sender.send(MessageSerialThread::Msg(line.to_owned(), MessageSerialThreadMsgType::Point)).unwrap();
|
|
||||||
} else {
|
|
||||||
sender.send(MessageSerialThread::Msg(line.to_owned(), MessageSerialThreadMsgType::Log)).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buf.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Status::PARIVARTIT => {
|
|
||||||
let p = match serialport::new(&config.port, config.bondrate).open() {
|
|
||||||
Ok(p) => p,
|
|
||||||
Err(_) => {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
*bufread = Some(BufReader::new(p));
|
|
||||||
config.status = Status::JAGRIT;
|
|
||||||
},
|
|
||||||
Status::SAYAN => {
|
|
||||||
do_sleep = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, Err(_) => {
|
|
||||||
sender.send(MessageSerialThread::Status("Faild prepare for communication!".to_owned())).unwrap();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Hack for smooth performance
|
|
||||||
if do_sleep {
|
|
||||||
std::thread::sleep(std::time::Duration::from_millis(100));
|
|
||||||
} else {
|
|
||||||
std::thread::sleep(std::time::Duration::from_nanos(1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Receives MessageSerialThread from Serial Port managing thread adds message to text area
|
// Receives MessageSerialThread from Serial Port managing thread adds message to text area
|
||||||
fn receiver_for_msg(text: String, msg_type: &MessageSerialThreadMsgType, full_log: >k::CheckButton, log_area: >k::TextView) {
|
fn receiver_for_msg(text: String, msg_type: &util::MessageSerialThreadMsgType, full_log: >k::CheckButton, log_area: >k::TextView) {
|
||||||
if !full_log.get_active(){
|
if !full_log.get_active(){
|
||||||
if let MessageSerialThreadMsgType::Point = msg_type {
|
if let util::MessageSerialThreadMsgType::Point = msg_type {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if text.len() <= 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let buf = log_area.get_buffer()
|
let buf = log_area.get_buffer()
|
||||||
.expect("Couldn't get log_area");
|
.expect("Couldn't get log_area");
|
||||||
buf.insert(&mut buf.get_end_iter(), &format!("{}\n",text));
|
buf.insert(&mut buf.get_end_iter(), &format!("{}\n",text));
|
||||||
|
|
@ -539,27 +376,3 @@ fn receiver_for_points(points: Vec<(String, f64)>, graph: &Rc<RefCell<Graph>>, g
|
||||||
}
|
}
|
||||||
graph.borrow_mut().pankti_sankya += 1.0;
|
graph.borrow_mut().pankti_sankya += 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sends text through Serial Post to device
|
|
||||||
fn send_text(config: &Arc<Mutex<Config>>, entry: >k::Entry, bar: >k::Statusbar) {
|
|
||||||
match config.lock() {
|
|
||||||
Ok(config) => {
|
|
||||||
if let Status::JAGRIT = config.status {
|
|
||||||
let mut p = match serialport::new(&config.port, config.bondrate).open() {
|
|
||||||
Ok(p) => p,
|
|
||||||
Err(_) => {
|
|
||||||
bar.push(1, "Failed to change port!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
|
||||||
p.write_all(entry.get_text().to_string().as_bytes_mut()).unwrap();
|
|
||||||
}
|
|
||||||
entry.set_text("");
|
|
||||||
}
|
|
||||||
}, Err(_) => {
|
|
||||||
bar.push(1, "Failed to change port!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
32
src/main.rs
32
src/main.rs
|
|
@ -1,33 +1,23 @@
|
||||||
/*
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
mod config;
|
|
||||||
|
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use std::env::args;
|
|
||||||
|
|
||||||
fn main() {
|
use std::env::args;
|
||||||
let conf = config::Config::generate();
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use tarangam_dwij::util::Config;
|
||||||
|
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let conf = Arc::new(Config::default());
|
||||||
|
|
||||||
let app = gtk::Application::new(Some("sng.tarangm"), Default::default())
|
let app = gtk::Application::new(Some("sng.tarangm"), Default::default())
|
||||||
.expect("Failed to initiate gtk");
|
.expect("Failed to initiate gtk");
|
||||||
|
|
||||||
|
let tmp_conf = Arc::clone(&conf);
|
||||||
app.connect_activate(move |app| {
|
app.connect_activate(move |app| {
|
||||||
tarangam::build_ui(app, &conf.ui_file);
|
tarangam_dwij::build_ui(app, &tmp_conf);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.run(&args().collect::<Vec<_>>());
|
app.run(&args().collect::<Vec<_>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
|
||||||
|
use gtk::prelude::*;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
use std::io::prelude::*;
|
||||||
|
use std::io::BufReader;
|
||||||
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
|
use crate::{util::Config, util};
|
||||||
|
|
||||||
|
// Controls the thread and read from serial port
|
||||||
|
pub async fn serial_thread_work(
|
||||||
|
config: &Arc<Config>,
|
||||||
|
bufread: &mut Option<BufReader<Box<dyn serialport::SerialPort>>>,
|
||||||
|
sender: &glib::Sender<util::MessageSerialThread>,
|
||||||
|
buf: &mut String) {
|
||||||
|
|
||||||
|
let status = match config.status.try_lock() {
|
||||||
|
Ok(a) => a.to_owned(),
|
||||||
|
Err(_) => { return; }
|
||||||
|
};
|
||||||
|
|
||||||
|
match status {
|
||||||
|
util::Status::AVRODTIH => {
|
||||||
|
*bufread = None;
|
||||||
|
match config.status.lock() {
|
||||||
|
Ok(mut a) => *a = util::Status::SAYAN,
|
||||||
|
Err(_) => { return; }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
util::Status::JAGRIT => {
|
||||||
|
if let Some(read) = bufread {
|
||||||
|
if let Ok(_) = read.read_line(buf) {
|
||||||
|
for line in buf.lines() {
|
||||||
|
if line.len() == 0 {
|
||||||
|
continue;
|
||||||
|
} else if line.starts_with("#") {
|
||||||
|
let mut points: Vec<(String, f64)> = Vec::new();
|
||||||
|
for (index, line) in line[1..].split(" ").enumerate() {
|
||||||
|
let part = line.split("=");
|
||||||
|
let part = part.into_iter().collect::<Vec<&str>>();
|
||||||
|
if part.len() == 1 {
|
||||||
|
let num = match part[0].trim().parse::<f64>() {
|
||||||
|
Ok(val) => val,
|
||||||
|
Err(_) => {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
points.push((index.to_string(), num));
|
||||||
|
} else if part.len() == 2 {
|
||||||
|
points.push((part[0].trim().to_owned(), part[1].parse::<f64>().unwrap()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sender.send(util::MessageSerialThread::Points(points)).unwrap();
|
||||||
|
sender.send(util::MessageSerialThread::Msg(line.to_owned(), util::MessageSerialThreadMsgType::Point)).unwrap();
|
||||||
|
} else {
|
||||||
|
sender.send(util::MessageSerialThread::Msg(line.to_owned(), util::MessageSerialThreadMsgType::Log)).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buf.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
|
||||||
|
},
|
||||||
|
util::Status::PARIVARTIT => {
|
||||||
|
let port = match config.port.lock() {
|
||||||
|
Ok(a) => a.to_owned(),
|
||||||
|
Err(_) => { return; }
|
||||||
|
};
|
||||||
|
let p = match serialport::new(&port, config.bondrate.load(Ordering::SeqCst)).open() {
|
||||||
|
Ok(p) => p,
|
||||||
|
Err(_) => {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
*bufread = Some(BufReader::new(p));
|
||||||
|
match config.status.try_lock() {
|
||||||
|
Ok(mut a) => *a = util::Status::JAGRIT,
|
||||||
|
Err(_) => { return; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// // Sends text through Serial Post to device
|
||||||
|
pub fn send_text(config: &Arc<Config>, entry: >k::Entry, bar: >k::Statusbar) {
|
||||||
|
|
||||||
|
let status = match config.status.try_lock() {
|
||||||
|
Ok(a) => a.to_owned(),
|
||||||
|
Err(_) => { return; }
|
||||||
|
};
|
||||||
|
if let util::Status::JAGRIT = status {
|
||||||
|
let port = match config.port.lock() {
|
||||||
|
Ok(a) => a.to_owned(),
|
||||||
|
Err(_) => {
|
||||||
|
bar.push(1, "Failed to set port!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut p = match serialport::new(port, config.bondrate.load(Ordering::SeqCst)).open() {
|
||||||
|
Ok(p) => p,
|
||||||
|
Err(_) => {
|
||||||
|
bar.push(1, "Failed to change port!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
p.write_all(entry.get_text().to_string().as_bytes_mut()).unwrap();
|
||||||
|
}
|
||||||
|
entry.set_text("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
use std::sync::{atomic::*, Mutex};
|
||||||
|
|
||||||
|
/// Status of Serial reading
|
||||||
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
pub enum Status {
|
||||||
|
AVRODTIH, // Mode of being stopped
|
||||||
|
SAYAN, // Mode of Sleeping
|
||||||
|
JAGRIT, // Mode of Active
|
||||||
|
PARIVARTIT // Mode of being values modified
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Config {
|
||||||
|
pub ui_file: String,
|
||||||
|
pub bondrate: AtomicU32,
|
||||||
|
pub port: Mutex<String>,
|
||||||
|
pub status: Mutex<Status>
|
||||||
|
}
|
||||||
|
|
||||||
|
/// For communication between mpsc of graph and serial port
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum MessageSerialThread {
|
||||||
|
Msg(String, MessageSerialThreadMsgType),
|
||||||
|
Points(Vec<(String, f64)>),
|
||||||
|
Status(String)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum MessageSerialThreadMsgType {
|
||||||
|
Point,
|
||||||
|
Log
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Config {
|
||||||
|
pub fn default() -> Self {
|
||||||
|
let ui_file = std::env::var("TARANGAM_UI_FILE");
|
||||||
|
|
||||||
|
Config {
|
||||||
|
ui_file: match ui_file {
|
||||||
|
Ok(val) => val,
|
||||||
|
Err(_) => std::env::current_exe().unwrap().parent().unwrap()
|
||||||
|
.join("ui.glade").to_str().unwrap().to_owned()
|
||||||
|
},
|
||||||
|
bondrate: AtomicU32::new(9600),
|
||||||
|
port: Mutex::new(String::new()),
|
||||||
|
status: Mutex::new(Status::AVRODTIH)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
use std::io::prelude::*;
|
|
||||||
use std::io::BufReader;
|
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn start() {
|
|
||||||
let ports = serialport::available_ports();
|
|
||||||
println!("{:?}",ports);
|
|
||||||
|
|
||||||
let mut p = serialport::new("/dev/ttyUSB1", 9600).timeout(Duration::from_millis(10))
|
|
||||||
.open().expect("Failed to open port");
|
|
||||||
|
|
||||||
unsafe {
|
|
||||||
p.write_all("buf".to_owned().as_bytes_mut()).unwrap();
|
|
||||||
}
|
|
||||||
let mut read = BufReader::new(p);
|
|
||||||
let mut buf = String::new();
|
|
||||||
loop {
|
|
||||||
match read.read_line(&mut buf) {
|
|
||||||
Ok(_) =>
|
|
||||||
{
|
|
||||||
print!("{}", buf);
|
|
||||||
buf.clear();
|
|
||||||
},
|
|
||||||
Err(_) => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
48
ui.glade
48
ui.glade
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.38.2 -->
|
<!-- Generated with glade 3.38.1 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22"/>
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<object class="GtkAboutDialog" id="about_window">
|
<object class="GtkAboutDialog" id="about_window">
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
<property name="authors">Piyush Mishra(पीयूष मिश्र:)</property>
|
<property name="authors">Piyush Mishra(पीयूष मिश्र:)</property>
|
||||||
<property name="logo">chitra.png</property>
|
<property name="logo">chitra.png</property>
|
||||||
<property name="license-type">gpl-3-0</property>
|
<property name="license-type">gpl-3-0</property>
|
||||||
|
<signal name="close" handler="about_window_close" swapped="no"/>
|
||||||
|
<signal name="delete-event" handler="about_window_delete" swapped="no"/>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
|
@ -43,11 +45,6 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkImage" id="document_save">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="icon-name">document-save</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkAdjustment" id="pankti_adjustment">
|
<object class="GtkAdjustment" id="pankti_adjustment">
|
||||||
<property name="lower">5</property>
|
<property name="lower">5</property>
|
||||||
<property name="upper">500</property>
|
<property name="upper">500</property>
|
||||||
|
|
@ -60,6 +57,9 @@
|
||||||
<property name="icon">chitra.svg</property>
|
<property name="icon">chitra.svg</property>
|
||||||
<property name="type-hint">dialog</property>
|
<property name="type-hint">dialog</property>
|
||||||
<property name="action">select-folder</property>
|
<property name="action">select-folder</property>
|
||||||
|
<signal name="close" handler="save_window_close" swapped="no"/>
|
||||||
|
<signal name="delete-event" handler="save_window_delete" swapped="no"/>
|
||||||
|
<signal name="response" handler="save_window_response" swapped="no"/>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
|
@ -119,12 +119,11 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem" id="save_menu">
|
<object class="GtkMenuItem" id="save_menu">
|
||||||
<property name="label">Save Log</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="image">document_save</property>
|
<property name="label" translatable="yes">Save Log</property>
|
||||||
<property name="use-stock">False</property>
|
<signal name="activate" handler="save_menu_activate" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|
@ -134,12 +133,12 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem" id="exit_menu">
|
<object class="GtkMenuItem" id="exit_menu">
|
||||||
<property name="label">gtk-quit</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Exit</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use-stock">True</property>
|
<signal name="activate" handler="exit_menu_activate" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -157,12 +156,12 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem" id="about_menu">
|
<object class="GtkMenuItem" id="about_menu">
|
||||||
<property name="label">gtk-about</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">About</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use-stock">True</property>
|
<signal name="activate" handler="about_menu_activate" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -188,6 +187,7 @@
|
||||||
<property name="label" translatable="yes">refresh</property>
|
<property name="label" translatable="yes">refresh</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="icon-name">view-refresh</property>
|
<property name="icon-name">view-refresh</property>
|
||||||
|
<signal name="clicked" handler="refresh_port_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
@ -202,6 +202,7 @@
|
||||||
<object class="GtkComboBoxText" id="port">
|
<object class="GtkComboBoxText" id="port">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
<signal name="changed" handler="port_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -241,6 +242,7 @@
|
||||||
<item translatable="yes">460800</item>
|
<item translatable="yes">460800</item>
|
||||||
<item translatable="yes">921600</item>
|
<item translatable="yes">921600</item>
|
||||||
</items>
|
</items>
|
||||||
|
<signal name="changed" handler="bondrate_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -256,6 +258,7 @@
|
||||||
<property name="label" translatable="yes">Connect</property>
|
<property name="label" translatable="yes">Connect</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="icon-name">media-playback-start</property>
|
<property name="icon-name">media-playback-start</property>
|
||||||
|
<signal name="clicked" handler="jagrit_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
@ -269,6 +272,7 @@
|
||||||
<property name="label" translatable="yes">Stop</property>
|
<property name="label" translatable="yes">Stop</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="icon-name">media-playback-stop</property>
|
<property name="icon-name">media-playback-stop</property>
|
||||||
|
<signal name="clicked" handler="avrodith_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
@ -302,6 +306,7 @@
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">Clear</property>
|
<property name="label" translatable="yes">Clear</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
|
<signal name="clicked" handler="clear_graph_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
@ -319,6 +324,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
|
<signal name="toggled" handler="draw_patches_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -339,6 +345,7 @@
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="active">True</property>
|
<property name="active">True</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
|
<signal name="toggled" handler="draw_box_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -358,6 +365,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
|
<signal name="toggled" handler="draw_baarik_box_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -406,6 +414,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="numeric">True</property>
|
<property name="numeric">True</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
|
<signal name="value-changed" handler="pankti_value_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -475,6 +484,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
|
<signal name="toggled" handler="nimna_stambh_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -513,6 +523,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="width-chars">8</property>
|
<property name="width-chars">8</property>
|
||||||
<property name="text" translatable="yes">0</property>
|
<property name="text" translatable="yes">0</property>
|
||||||
|
<signal name="changed" handler="stambh_1_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -551,6 +562,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="width-chars">8</property>
|
<property name="width-chars">8</property>
|
||||||
<property name="text" translatable="yes">100</property>
|
<property name="text" translatable="yes">100</property>
|
||||||
|
<signal name="changed" handler="stambh_2_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -587,6 +599,7 @@
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">Clear</property>
|
<property name="label" translatable="yes">Clear</property>
|
||||||
<property name="use-underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
|
<signal name="clicked" handler="clear_log_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
@ -604,6 +617,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
|
<signal name="toggled" handler="full_log_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -649,6 +663,7 @@
|
||||||
<object class="GtkEntry" id="send_entry">
|
<object class="GtkEntry" id="send_entry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
|
<signal name="activate" handler="send_entry_activate" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
|
@ -663,6 +678,7 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="receives-default">True</property>
|
||||||
<property name="image">send_image</property>
|
<property name="image">send_image</property>
|
||||||
|
<signal name="clicked" handler="send_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue