Updating Progress Bar Value While Uploading the Image - objective-c

I want to update both the label and progress bar like
Progress Label :if i uploading 5 image means 0/5 ->after one image uploaded the label should be updated as 1/5 like this ans so on at lst 5/5
i did this correctly using this code
self.progressLabel.text = [NSString stringWithFormat:#"%d/%lu",self.currentIndex,(unsigned long)self.arrayWithImages.count];
this will be used after successfully uploaded the image one by one .
Now i want to update the progress bar it is not updating correctly
i have did like this
int count = self.currentIndex++;
self.progressView.progress =count/self.arrayWithImages.count;
i am updating the current index value after successfull image uploads one by one .
Please help me to do this .

What type of object is progressView?
NSProgressIndicator does not have a progress property, it has doubleValue, which takes a value from 0-100
So you could try:
self.progressView.progress = (count/self.arrayWithImages.count)*100;
Just make sure that count is always less than or equal to self.arrayWithImages.count

Related

How to display more than one image dynamically with python (pyqt5)?

I'm using python to build an application by PyQt5, the main idea is to display images from a directory and for each image some masks show up next to it to select one of them (i.e. for each image there are different number of masks). So, I want to display these masks in a "container" that can handle this dynamically.
I tried QlistWidget in a scroll area and the masks are displayed as icons in it, but I want to use something else to handle them easier and retrieve any mask as Qpixmap or QImage to use it in another operations without convert it multiple times (which slows down the program)
this is the part that displays the masks (this is the only way that worked with me)
for ann in annotations:
mask = self.coco.annToMask(ann)
mask_img = Image.fromarray((mask*255).astype(np.uint8))
qt_img = ImageQt.ImageQt(mask_img) # convert Image to ImageQt
icon = QtGui.QIcon(QtGui.QPixmap.fromImage(qt_img))
item = QtWidgets.QListWidgetItem(icon, f"{annIndex}")
self.listWidget.addItem(item)
annIndex += 1

Work Queue - Updating Narrative(Status - Text) in Work Queue Item

Working on sample process work queue in Blue Prism. I am successfully able to process work queue items. However, I am not able to update queue items.
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test", after this calling Set Data action (Passing RetrievedData collection and Item ID). When retrieving an item as Get-Item I am not able to see the updated value "Test" in Status column.
Can anybody please help.
Please see the attached screenshot]1
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test"
No, you are currently testing whether [RetrievedData.Status] is equal to "Test" (and storing True/False to the data item Result). To set [RetrievedData.Status] to "Test", you need to use it like this:
are you using that specific item id for which you have updated data in 2nd get item? if not then 2nd get item will pick a new item from queue not the same item. Instead of using get item 2nd time you can use get item data action to verify the updated data

How to get or save the pitch listing in praat using scripting

I am trying to use scripting in praat to either save or write to a file with the values given from using "Pitch Listing" under "Pitch". This is my code for the script so far:
selectObject: 1
View & Edit
editor: 1
Select: 0.0, 10000
Pitch listing
p$ = Get pitch
fileappend pitch123.txt 'p$'
This code only returns the mean for the sound file and I am wondering if there is a way to avoid getting small chunks of the file and getting the average pitch and instead being able to get the data given the way praat does it like so :
Time_s F0_Hz
0.254558 125.982312
0.264558 127.975510
0.274558 123.010164
0.284558 120.761760
0.294558 119.652539
0.304558 118.916850
Even just being able to save the file that pops up from "Pitch Listing" would work. Any help is appreciated. Thanks!
Using the new syntax (Praat >= 5.3.63), you can create a Pitch object and loop through the frames to get the Pitch value for that frame (by default, one frame every 10 msec).
writeFileLine: "./pitch_list.txt", "time,pitch"
selectObject: 1
To Pitch: 0, 75, 600
no_of_frames = Get number of frames
for frame from 1 to no_of_frames
time = Get time from frame number: frame
pitch = Get value in frame: frame, "Hertz"
appendFileLine: "pitch_list.txt", "'time','pitch'"
endfor

Is It Possible To Use Embedded Resource Images For ObjectListView SubItems

I can't seem to find any information on this, but does anyone know if it is possible to use an embedded image from my.resources within an ObjectListView SubItem?
I am currently using images stored in an ImageList control, but I find for some reason, those images get corrupted and start displaying imperfections. I don't have the problem if I pull them from the embedded resources as I previously have with the normal listview control.
I am using the ImageGetter routine to return a key reference the ImageList, however, ultimately I would like to pull these from embedded resources. I would like to also do this for animated GIF references as well.
If anyone knows a way, could you please assist. Sample code would be appreciated.
Thanks
You can return three different types from the ImageGetter
int - the int value will be used as an index into the image list
String - the string value will be used as a key into the image list
Image - the Image will be drawn directly (only in OwnerDrawn mode)
So option number 3 could be what you want. Note that you have to set objectListView1.OwnerDraw = true.
If that does not work, an alternative could be to load the images into the ImageList at runtime. There is an example here.
this.mainColumn.ImageGetter = delegate(object row) {
String key = this.GetImageKey(row);
if (!this.listView.LargeImageList.Images.ContainsKey(key)) {
Image smallImage = this.GetSmallImageFromStorage(key);
Image largeImage = this.GetLargeImageFromStorage(key);
this.listView.SmallImageList.Images.Add(key, smallImage);
this.listView.LargeImageList.Images.Add(key, largeImage);
}
return key;
};
This dynamically fetches the images if they haven’t been already fetched. You will need to write the GetImageKey(), GetSmallImageFromStorage() and GetLargeImageFromStorage() methods. Their names will probably be different, depending on exactly how you are deciding which image is shown against which model object.

Save a string with a photo and return them

I have a label on top of the image view.
Every time some one pushes the button the label is filled with a string that comes from a server.
I have a button that calls the picker to select a photo from the picker but the label obviously keeps empty..
How can i make sure the string will be saved with the photo and when i call it back with the picker it fills the label again...
I need some tips/help...
i am using ASIHTTPREQUEST asynchronical call to fill the label...so it does not hang up...thats best practice right ? or should i use nsurl and nsstring with format ?
you may use imageview's tag and store each string with tag of image view.
Somethings are not clear here :-
1>from the client sid eyou can send a request to server with the image that has been changed and get the corresponding string(in a table probably you have have to store string for each image).
2>You might use a dictionary to store key(string) for every corresponding imageName and store it in a dictionary and if you want persistent storage you may use coredata or sqlite.
To ensure that both the image and string are shown at same time you can show an activityIndicator.