4

所以我是一名编码员,我会做 PHP、JavaScript 和 Objective-C。我目前几乎全职在一个网站上工作,16 岁时,除了卧室里的一张桌子外,并没有真正的“办公室”......所以我花了很长时间在我的房间里编写这个网站我有一点问题。

我的卧室在我们家的后面,窗户朝西,所以下午的阳光照在窗户上,使房间暖和起来。现在当我输入这个时,它是 28.5 摄氏度,但它确实变得高达 32 摄氏度,这对于工作来说实在是太不舒服了。

作为那种极客,我想知道是否有可能 - 或者,可行 - 获得一个与 Mac 兼容的 USB 温度计等,然后使用 AppleScript 来检测温度何时达到一定水平. 例如,如果它达到 23 度,我希望在 25 度时“打开两个大窗户”和 28 度时出现“打开所有窗户和门”的咆哮通知,例如...

我认为这会很整洁,即使我是唯一使用过它的人!那么,这种事情是否可能,我从哪里得到一个 USB 温度计(如果它们甚至存在的话......)?易趣?我也意识到,这个问题与编程没有直接关系,但是,我真的不知道在哪里可以问它......所以,一个程序问题是是否可以通过 AppleScript 从 USB 设备获取数据?- 在那里,就可以了。

干杯!

杰克

PS 对于你们所有的铁杆亚利桑那人或德克萨斯人或其他人,我住在英国,30 度左右的温度让我们昏倒;)

4

3 回答 3

4

Cheers Matee,亚马逊和 eBay 等网站上有很多 rickey 'ol USB 温度计,还有谷歌购物,价格约为 15 美元(这正好是你的 22 磅,对于你们中的那些人来说,巧合的是,这就是原 Xbox 重量的 1.2 倍)。无论如何,就代码而言,我敢打赌你有点棘手,'ol top。就眼光而言,AppleScript 不支持太多的硬件集成,它更像是一个宏观的东西,是吗?不要以为我只会说话,没有裤子,不过,如果我不是军营律师,我已经做了很多年了。母公司(上帝保佑国王)可能会在下一个版本中实现它,但我敢打赌他们会先把金丝雀扔进煤矿。谁说,我 无论哪种方式,我只是一个坐在克拉彭公共汽车上的人,起草这条评论是正确的。你们英国人在那里照顾;)

- 再见

于 2010-07-04T18:37:58.173 回答
2

您将无法使用 applescript 直接监控 USB 设备。即使您可以直接访问 USB 输出,您也不知道如何将信号转换为温度。但是,如果设备与 mac 兼容,它将附带温度计软件......您将能够使用 applescript 监控该软件。一个快速的谷歌搜索出现了这个,它说这个软件是苹果脚本的。 http://practsol.com/thummac.htm

于 2010-07-05T08:11:46.723 回答
1

A little late reply here, but right now, in Texas, I've got my nephew digging a 60in X 16in X 4ft hole just outside my home office. Into it I'll be placing a 40ft copper tubing "radiator". This with be the "core" of a geothermal loop to cool my mac. Yeah, it's wildly watercooled because the mods cause me to exceed the TDP (it's a MacPro1,1) of the case, but even before that my office got uncomfortably hot. Now it just causes my computer to shut down when I try to encode video. Not good.

In the UK you should be able to do the same (well, cool your room at least) with just a ground loop, a cheap pump, and a fan with more copper tubing coiled behind it. My project has ended up costing me quite a bit because of its complexity and mistakes make along the way, but a simple system to cool just the room should cost less than £150-200 and is definitely a DIY project you and your dad could do.

One of of the biggest reasons to do this are the electricity (cooling) costs saved for me, literally several hundred $ per year. And it's "Green" cooling. But the biggest reason is for the amount of science I've learned in the past 3 months.

Talk to your Dad about it. It's been fun, and would be a good project for a young Scottish engineer!

于 2011-02-21T19:14:12.600 回答