I'm trying to design the new macro for a project that would allow field measurement with a somewhat more fine-tuned lab protocol (to keep separate from a photosynq 'protocol'). It seems from talking to Veronica that changes to prompts might need to be partially or entirely changed within the protocol level rather than the macro, and then the macro calls the data filled in by the protocol.
I've changed the 100% digestion solution setup to 10 mL of a 0.015 M or 15 mM solution (in the past this was 20 mL of a 20 mM solution). Then 50% and 25% calibrants would be 7.5 and 3.75 mM. So I think the calibration protocol and macro need changing, starting with the prompts within the calibration protocol (right?) And then I can make json calls to the variables set up by the protocol from those prompts? (my json cabability is recently expanding thanks veronica!). It may be that the existing math to fill in the slope and intercept values for the new concentration would work fine as well, but I can check that at the macro level.
Then for the data from unknowns, I would need to change the protocol to have (ideally for me) a pulldown for the user that says 1g of soil vs. 2g of soil, and then a blank for other values if neither of those, and then either the macro or the protocol figures out whether the blank or the pulldown should be used.
The macro (and/or project measurement page within the app) should then supply the user with the lab protocol or assumptions -- 1 or 2 g or soil in 10 mL solution, dilute 30:1 with water, measure in the cuvette.
Each protocol is associated with a single macro. So, if you want to make changes to a macro, you will need to create a new protocol. This new protocol can be the same as an old protocol (with a new name) so that you can associate this protocol with your new macro. In your case you will need to create 2 new protocols and macro's - 1 new calibration protocol/macro and 1 new sampling protocol macro.
At this point the macro's cannot pull data from the user answers (this will be changed before April). Therefore, you will need to use prompts within the protocol for inputting the soil weight. You cannot edit the prompts and messages in the protocol assembly tool in the chrome app, but can copy the original protocols to the console where you can make your edits and run the protocol to see if it works. Then you will need to create the new project and copy in the json directly into the admin page.
Hi Dan/Greg, can you check the following? I want the modify the calibration protocol, and I started by copying verbatim the protocol to console, changing the messages only, and trying to run it. But on the first message it shows nothing and I have to click the "skip wait" button to get it to move on to the measurements. This does not happen if I copy the existing calibration protocol to the console and run it, it shows all messages ("enter concentration... etc") as appropriate. I have compared the two side by side in wordpad as text files and there does not seem to be any difference. Maybe you can run the attached and see if you get the same behavior. Hope a text file works as an attachment here, seems like it should.
Ok, new frontier and new issue. I think the one remaining hurdle other than arithmetic to get the numbers to come out right, which is just a power of ten issue, is getting a prompt in the Active Carbon [new version] protocol to acquire from the user whether they want to use 1g, 2g, or other amount ____ of soil. For right now I would be happy with 1 or 2 g. But I can't see where in the new 0.5g protocol to do that, mostly I'm sure to my inexperience with JSON, but the other protocols don't seem to have a very linear progress that I can cut and paste from, e.g. could I just splice in this modified text below or similar from the calibration protocol and if so where? (I copy also below the existing 0.5g protocol) It seems to me that the JSON scripts are not read in a completely linear way?
I really want to get this to work because it would allow for a field expedition of mapping an active carbon gradient or some such, which would be cool to try (before it snows here in NY!) -- oh, and because we owe this to future FRN efforts.
"Enter if using one or two g of soil in this protocol"
//HERE WE NEED A RADIO BUTTON OR BLANK THAT WOULD TAKE INTEGER INPUT OR EVEN FLOAT, WHICH WOULD SOLVE THE "OTHER" OPTION//
THIS WOULD NEED TO BE COMBINED WITH BELOW, THE EXISTING 0.5G ACTIVE C PROTOCOL; AND THEN ALSO WHAT VARIABLE DO I CALL IN THE MACRO INSTEAD OF THE MACRO ASSUMING IT IS 0.5G, TO ACCESS THE ANSWER GIVEN BY THE USER IN THE PROTOCOL - WITH DAN'S HELPFUL POST ABOVE I THINK THIS IS WHAT NEEDS TO HAPPEN?
Steve, we can't really do a radio button. So your two options would be to have 3 yes or no prompts: 'is it 1g?' 'is it 2g?' or 'is it other?'. This option seems overly complicated. The simplest method would be to use the question from the original 'active carbon in soil' protocol. That protocol used the following:
"Enter weight of soil in grams"
Then, the macro pulls that number as:
// pull out the weight information from the user
var weight = json.message;
If you use this method, you will need just one prompt, and the user will need to type in the soil weight, and the macro will use that soil weight in the calcs.
If you want to set up a quick skype chat to get this working, let me know.
Hi Dan, see the attached. I get the protocol to work but I am having trouble linking it to a macro.
Steve, are you running the protocol from the console? You need to save the protocol first and then you attach the macro at the time that you save the protocol. To save the protocol you will need to copy the protocol into the 'new protocol' tab on the PhotosynQ admin page
Where is the photosynq admin page? sorry for dense questions....
Then select protocol from the top bar and there will be a 'new protocol' button in the upper right
Ok, all set -- I have 2 new protocols and 2 new macros, one calibration and one measurement of each.
Some renaming needed as these become less tentative and part of the standard toolkit of the project.
Also, is it possible or desireable to reintroduce the multiple technical reps with turning the cuvette in the measurement protocol? I think I see how that code works.
And, how do I associate the new macros with the project (also updates there to the photo and the description.
Forgetting to add that I tried these with the calibrant solutions and they gave reasonable values for the imagined active carbon these would represent, ~100-1500 mg/kg active carbon.
It would be best to test the variation on a couple of samples where you remove then re-insert the cuvette.
My guess is that having 3 technical replicates per sample would be the optimum solution.
Oh, good, yes I think 3 would be good too, based on doing many of them in a more offline way.
Did you see my question about how to associate a macro to a project? I want to make this new macro the main one in the Active Soil Carbon for Farmer Research Networks. I didn't see an easy way to do that in the macros or projects section of teh admin pages.
Hi Dan, Veronica straightened me out on how to add/remove macros from a project, so I am all set. do I reintroduce the script from some of the other active carbon macros in order to achieve 3 technical replicates?
If you want to do technical replicates for each sample, which you probably should, then you should copy the protocol structure from the old active C protocols that have technical reps. Though you should only need 3, not 5, technical reps. Make sure that you also make the appropriate changes to the macro to account for the technical reps as well.
Thanks Dan, your proposal is wholeheartedly accepted. If they want to just type 1 or 2 then it works just fine and is fast. Let me try to mash this together and then are you around this morning? I'll email you. Sorry for screwing up the thread order, should I have put stuff down at the bottom?
I'm around if you get stuck
I think I know the problem... don't put in any funny characters (even periods or brackets or anything) --- that messes it up.
ok, I'll try that, wow, fast response.
Yup, that does it. Not even a comma is allowed. Just letters and numbers. Is there some sort of JSON thing for special characters to get around this? Thanks, on my way now.